fix: Illegal reflective access operation on mac

This commit is contained in:
Bill Culp
2020-02-10 18:17:20 -08:00
parent 5796057a75
commit c72ee30a25

View File

@@ -191,16 +191,10 @@ public abstract class FlatLaf
private BasicLookAndFeel getBase() { private BasicLookAndFeel getBase() {
if( base == null ) { if( base == null ) {
if( SystemInfo.IS_MAC ) { if( SystemInfo.IS_MAC ) {
// use Mac Aqua LaF as base base = (BasicLookAndFeel) UIManager.getLookAndFeel();
String aquaLafClassName = "com.apple.laf.AquaLookAndFeel"; } else {
try {
base = (BasicLookAndFeel) Class.forName( aquaLafClassName ).newInstance();
} catch( Exception ex ) {
LOG.log( Level.SEVERE, "FlatLaf: Failed to initialize base look and feel '" + aquaLafClassName + "'.", ex );
throw new IllegalStateException();
}
} else
base = new MetalLookAndFeel(); base = new MetalLookAndFeel();
}
} }
return base; return base;
} }