mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
Patches const for jdk bug 6822627
This commit is contained in:
@@ -15,6 +15,7 @@
|
||||
*/
|
||||
package com.intellij.debugger.jdi;
|
||||
|
||||
import com.intellij.Patches;
|
||||
import com.intellij.debugger.impl.DebuggerUtilsEx;
|
||||
import com.intellij.openapi.util.Ref;
|
||||
import com.intellij.util.ReflectionUtil;
|
||||
@@ -56,11 +57,16 @@ public class MethodBytecodeUtil {
|
||||
}
|
||||
|
||||
public static byte[] getConstantPool(ReferenceType type) {
|
||||
try {
|
||||
return type.constantPool();
|
||||
if (Patches.JDK_BUG_ID_6822627) {
|
||||
try {
|
||||
return type.constantPool();
|
||||
}
|
||||
catch (NullPointerException e) { // workaround for JDK bug 6822627
|
||||
ReflectionUtil.resetField(type, "constantPoolInfoGotten");
|
||||
return type.constantPool();
|
||||
}
|
||||
}
|
||||
catch (NullPointerException e) { // workaround for JDK bug 6822627
|
||||
ReflectionUtil.resetField(type, "constantPoolInfoGotten");
|
||||
else {
|
||||
return type.constantPool();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -82,6 +82,12 @@ public class Patches {
|
||||
*/
|
||||
public static final boolean JDK_BUG_EVENT_CONTROLLER_LEAK = true;
|
||||
|
||||
/**
|
||||
* NPE from com.sun.jdi.ReferenceType#constantPool()
|
||||
* See <a href="https://bugs.openjdk.java.net/browse/JDK-6822627">JDK-6822627</a>
|
||||
*/
|
||||
public static final boolean JDK_BUG_ID_6822627 = true;
|
||||
|
||||
/**
|
||||
* JDK on Mac detects font style for system fonts based only on their name (PostScript name).
|
||||
* This doesn't work for some fonts which don't use recognizable style suffixes in their names.
|
||||
|
||||
Reference in New Issue
Block a user