Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commita834b58

Browse files
committed
8269269: [macos11] SystemIconTest fails with ClassCastException
Backport-of: eab959cbfa9e781adac3bc4bc3e74af8b18a1fd5
1 parent23326d5 commita834b58

File tree

1 file changed

+17
-8
lines changed

1 file changed

+17
-8
lines changed

‎test/jdk/javax/swing/JFileChooser/FileSystemView/SystemIconTest.java‎

Lines changed: 17 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -73,30 +73,39 @@ static void negativeTests() {
7373
staticvoidtestSystemIcon(Filefile,booleanimplComplete) {
7474
int[]sizes =newint[] {16,32,48,64,128};
7575
for (intsize :sizes) {
76-
ImageIconicon = (ImageIcon)fsv.getSystemIcon(file,size,size);
76+
Iconi =fsv.getSystemIcon(file,size,size);
7777

78+
if (i ==null) {
79+
thrownewRuntimeException(file.getAbsolutePath() +" icon is null");
80+
}
81+
82+
if (!(iinstanceofImageIcon)) {
83+
// Default UI resource icon returned - it is not covered
84+
// by new implementation so we can not test it
85+
continue;
86+
}
87+
88+
ImageIconicon = (ImageIcon)i;
7889
//Enable below to see the icon
7990
//JLabel label = new JLabel(icon);
8091
//JOptionPane.showMessageDialog(null, label);
8192

82-
if (icon ==null) {
83-
thrownewRuntimeException("icon is null!!!");
84-
}
85-
8693
if (implComplete &&icon.getIconWidth() !=size) {
8794
thrownewRuntimeException("Wrong icon size " +
88-
icon.getIconWidth() +" when requested " +size);
95+
icon.getIconWidth() +" when requested " +size +
96+
" for file " +file.getAbsolutePath());
8997
}
9098

9199
if (icon.getImage()instanceofMultiResolutionImage) {
92100
MultiResolutionImagemri = (MultiResolutionImage)icon.getImage();
93101
if (mri.getResolutionVariant(size,size) ==null) {
94102
thrownewRuntimeException("There is no suitable variant for the size "
95-
+size +" in the multi resolution icon");
103+
+size +" in the multi resolution icon " +file.getAbsolutePath());
96104
}
97105
}else {
98106
if (implComplete) {
99-
thrownewRuntimeException("icon is supposed to be multi-resolution but it is not");
107+
thrownewRuntimeException("icon is supposed to be" +
108+
" multi-resolution but it is not for " +file.getAbsolutePath());
100109
}
101110
}
102111
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp