Do not throw exception when unable to get constant pool #1097

Bug: https://issuetracker.google.com/issues/123863053
It is becuase ART(Android) JVM doesn't support the 'getConstantPool' capability.
This commit is contained in:
kunshen
2019-03-25 14:27:12 +03:00
committed by Egor Ushakov
parent 93d7795bd9
commit 0dd5034a1d
@@ -292,6 +292,11 @@ public class MethodBytecodeUtil {
return locations;
}
// Android Studio: 'getConstantPool' is not supported on android. (b/123863053)
if (!method.declaringType().virtualMachine().canGetConstantPool()) {
return locations;
}
int lineNumber = locations.get(0).lineNumber();
List<Boolean> mask = new ArrayList<>(locationsSize);
visit(method, new MethodVisitor(Opcodes.API_VERSION) {