mirror of
https://github.com/NationalSecurityAgency/ghidra.git
synced 2025-10-06 03:50:02 +02:00
GP-0: Remove unnecessary call to java.lang.Compiler.disable(). It's
currently a no-op, and it's removed in JDK 21.
This commit is contained in:
parent
a5ea18bd55
commit
65dbaeaf57
1 changed files with 21 additions and 28 deletions
|
@ -162,34 +162,27 @@ public class MyHeadlessToolkit extends Toolkit {
|
||||||
}
|
}
|
||||||
|
|
||||||
private void getRealToolkit() {
|
private void getRealToolkit() {
|
||||||
|
|
||||||
|
Class<?> cls = null;
|
||||||
try {
|
try {
|
||||||
// We disable the JIT during toolkit initialization. This
|
try {
|
||||||
// tends to touch lots of classes that aren't needed again
|
cls = Class.forName(preferredToolkit);
|
||||||
// later and therefore JITing is counter-productiive.
|
}
|
||||||
java.lang.Compiler.disable();
|
catch (ClassNotFoundException ee) {
|
||||||
|
throw new AWTError("Toolkit not found: " + preferredToolkit);
|
||||||
Class<?> cls = null;
|
}
|
||||||
try {
|
if (cls != null) {
|
||||||
try {
|
localToolKit = (Toolkit) cls.newInstance();
|
||||||
cls = Class.forName(preferredToolkit);
|
if (GraphicsEnvironment.isHeadless()) {
|
||||||
} catch (ClassNotFoundException ee) {
|
localToolKit = new HeadlessToolkit(localToolKit);
|
||||||
throw new AWTError("Toolkit not found: " + preferredToolkit);
|
}
|
||||||
}
|
}
|
||||||
if (cls != null) {
|
}
|
||||||
localToolKit = (Toolkit)cls.newInstance();
|
catch (InstantiationException e) {
|
||||||
if (GraphicsEnvironment.isHeadless()) {
|
throw new AWTError("Could not instantiate Toolkit: " + preferredToolkit);
|
||||||
localToolKit = new HeadlessToolkit(localToolKit);
|
}
|
||||||
}
|
catch (IllegalAccessException e) {
|
||||||
}
|
throw new AWTError("Could not access Toolkit: " + preferredToolkit);
|
||||||
} catch (InstantiationException e) {
|
}
|
||||||
throw new AWTError("Could not instantiate Toolkit: " + preferredToolkit);
|
|
||||||
} catch (IllegalAccessException e) {
|
|
||||||
throw new AWTError("Could not access Toolkit: " + preferredToolkit);
|
|
||||||
}
|
|
||||||
|
|
||||||
} finally {
|
|
||||||
// Make sure to always re-enable the JIT.
|
|
||||||
java.lang.Compiler.enable();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue