Skip to content

Commit 30b44dd

Browse files
committed
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 Backport-of: 02ea4b548ea1d5e96b9e59e2aa916d7728844116
1 parent 86e827b commit 30b44dd

File tree

2 files changed

+5
-10
lines changed

2 files changed

+5
-10
lines changed

test/jdk/javax/imageio/plugins/wbmp/WBMPStreamTruncateTest.java

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2021, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2021, 2024, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -46,9 +46,6 @@ public class WBMPStreamTruncateTest
4646
static final int height = 100;
4747
public static void main(String[] args) throws IOException
4848
{
49-
String sep = System.getProperty("file.separator");
50-
String dir = System.getProperty("test.src", ".");
51-
String filePath = dir+sep;
5249
BufferedImage srcImage = new
5350
BufferedImage(width, height, BufferedImage.TYPE_BYTE_BINARY);
5451
Graphics2D g = (Graphics2D) srcImage.getGraphics();
@@ -57,7 +54,7 @@ public static void main(String[] args) throws IOException
5754
g.dispose();
5855
// create WBMP image
5956
File imageFile = File.
60-
createTempFile("test", ".wbmp", new File(filePath));
57+
createTempFile("test", ".wbmp", new File("./"));
6158
imageFile.deleteOnExit();
6259
ImageIO.write(srcImage, "wbmp", imageFile);
6360
BufferedImage testImg =

test/jdk/javax/swing/JFileChooser/FileSystemView/WindowsDefaultIconSizeTest.java

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2022, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2022, 2024, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -44,18 +44,16 @@ public static void main(String[] args) {
4444
}
4545

4646
public void test() {
47-
String sep = System.getProperty("file.separator");
48-
String dir = System.getProperty("test.src", ".");
4947
String filename = "test.not";
5048

51-
File testFile = new File(dir + sep + filename);
49+
File testFile = new File(filename);
5250
try {
5351
if (!testFile.exists()) {
5452
testFile.createNewFile();
5553
testFile.deleteOnExit();
5654
}
5755
FileSystemView fsv = FileSystemView.getFileSystemView();
58-
Icon icon = fsv.getSystemIcon(new File(dir + sep + filename));
56+
Icon icon = fsv.getSystemIcon(new File(filename));
5957
if (icon instanceof ImageIcon) {
6058
Image image = ((ImageIcon) icon).getImage();
6159
if (image instanceof MultiResolutionImage) {

0 commit comments

Comments
 (0)