mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 06:05:01 +07:00
IDEA-163730 Incorrect value of logic operation stringVar == "value" - inter only from jdk 7
This commit is contained in:
+6
-4
@@ -63,10 +63,12 @@ class LiteralEvaluator implements Evaluator {
|
||||
}
|
||||
if (myValue instanceof String) {
|
||||
StringReference str = vm.mirrorOf((String)myValue);
|
||||
// intern
|
||||
Method internMethod = ((ClassType)str.referenceType()).concreteMethodByName("intern", "()Ljava/lang/String;");
|
||||
if (internMethod != null) {
|
||||
return context.getDebugProcess().invokeMethod(context, str, internMethod, Collections.emptyList());
|
||||
// intern starting from jdk 7
|
||||
if (vm.versionHigher("1.7")) {
|
||||
Method internMethod = ((ClassType)str.referenceType()).concreteMethodByName("intern", "()Ljava/lang/String;");
|
||||
if (internMethod != null) {
|
||||
return context.getDebugProcess().invokeMethod(context, str, internMethod, Collections.emptyList());
|
||||
}
|
||||
}
|
||||
return str;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user