From 02ea4b548ea1d5e96b9e59e2aa916d7728844116 Mon Sep 17 00:00:00 2001 From: Harshitha Onkar Date: Wed, 30 Oct 2024 21:53:12 +0000 Subject: [PATCH] 8342635: javax/swing/JFileChooser/FileSystemView/WindowsDefaultIconSizeTest.java creates tmp file in src dir 8342634: javax/imageio/plugins/wbmp/WBMPStreamTruncateTest.java creates temp file in src dir Reviewed-by: erikj, serb --- .../imageio/plugins/wbmp/WBMPStreamTruncateTest.java | 7 ++----- .../FileSystemView/WindowsDefaultIconSizeTest.java | 8 +++----- 2 files changed, 5 insertions(+), 10 deletions(-) diff --git a/test/jdk/javax/imageio/plugins/wbmp/WBMPStreamTruncateTest.java b/test/jdk/javax/imageio/plugins/wbmp/WBMPStreamTruncateTest.java index 36b8d4a72e0..0d38869634e 100644 --- a/test/jdk/javax/imageio/plugins/wbmp/WBMPStreamTruncateTest.java +++ b/test/jdk/javax/imageio/plugins/wbmp/WBMPStreamTruncateTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2021, 2024, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -46,9 +46,6 @@ public class WBMPStreamTruncateTest static final int height = 100; public static void main(String[] args) throws IOException { - String sep = System.getProperty("file.separator"); - String dir = System.getProperty("test.src", "."); - String filePath = dir+sep; BufferedImage srcImage = new BufferedImage(width, height, BufferedImage.TYPE_BYTE_BINARY); Graphics2D g = (Graphics2D) srcImage.getGraphics(); @@ -57,7 +54,7 @@ public class WBMPStreamTruncateTest g.dispose(); // create WBMP image File imageFile = File. - createTempFile("test", ".wbmp", new File(filePath)); + createTempFile("test", ".wbmp", new File("./")); imageFile.deleteOnExit(); ImageIO.write(srcImage, "wbmp", imageFile); BufferedImage testImg = diff --git a/test/jdk/javax/swing/JFileChooser/FileSystemView/WindowsDefaultIconSizeTest.java b/test/jdk/javax/swing/JFileChooser/FileSystemView/WindowsDefaultIconSizeTest.java index 081277ca2d4..dcdc7ca7b96 100644 --- a/test/jdk/javax/swing/JFileChooser/FileSystemView/WindowsDefaultIconSizeTest.java +++ b/test/jdk/javax/swing/JFileChooser/FileSystemView/WindowsDefaultIconSizeTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2022, 2024, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -44,18 +44,16 @@ public class WindowsDefaultIconSizeTest { } public void test() { - String sep = System.getProperty("file.separator"); - String dir = System.getProperty("test.src", "."); String filename = "test.not"; - File testFile = new File(dir + sep + filename); + File testFile = new File(filename); try { if (!testFile.exists()) { testFile.createNewFile(); testFile.deleteOnExit(); } FileSystemView fsv = FileSystemView.getFileSystemView(); - Icon icon = fsv.getSystemIcon(new File(dir + sep + filename)); + Icon icon = fsv.getSystemIcon(new File(filename)); if (icon instanceof ImageIcon) { Image image = ((ImageIcon) icon).getImage(); if (image instanceof MultiResolutionImage) {