Patches const for jdk bug 6822627

This commit is contained in:
Egor.Ushakov
2016-11-01 12:33:12 +03:00
parent 0b4990f75e
commit ebbdb2fa49
2 changed files with 16 additions and 4 deletions
@@ -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();
}
}