Skip to content

Commit

Permalink
FileChooser: avoid unnecessary logging of `InaccessibleObjectExceptio…
Browse files Browse the repository at this point in the history
…n` when running in Java 16 (issue #741)
  • Loading branch information
DevCharly committed Oct 15, 2023
1 parent 635a620 commit 0494c21
Showing 1 changed file with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -555,10 +555,12 @@ protected Icon getIcon( FileSystemView fsv, File file ) {
return new ImageIcon( image );
}
}
} catch( IllegalAccessException ex ) {
// do not log because access may be denied via VM option '--illegal-access=deny'
} catch( Exception ex ) {
LoggingFacade.INSTANCE.logSevere( null, ex );
// do not log InaccessibleObjectException because access
// may be denied via VM option '--illegal-access=deny' (default in Java 16)
// (not catching InaccessibleObjectException here because it is new in Java 9, but FlatLaf also runs on Java 8)
if( !"java.lang.reflect.InaccessibleObjectException".equals( ex.getClass().getName() ) )
LoggingFacade.INSTANCE.logSevere( null, ex );
}

// get system icon in default size 16x16
Expand Down

0 comments on commit 0494c21

Please sign in to comment.