mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
IDEA-163730 Incorrect value of logic operation stringVar == "value"
This commit is contained in:
+12
-1
@@ -26,6 +26,11 @@ import com.intellij.debugger.engine.evaluation.EvaluateExceptionUtil;
|
||||
import com.intellij.debugger.engine.evaluation.EvaluationContextImpl;
|
||||
import com.intellij.debugger.impl.DebuggerUtilsEx;
|
||||
import com.intellij.debugger.jdi.VirtualMachineProxyImpl;
|
||||
import com.intellij.util.containers.ContainerUtil;
|
||||
import com.sun.jdi.Method;
|
||||
import com.sun.jdi.StringReference;
|
||||
|
||||
import java.util.Collections;
|
||||
|
||||
class LiteralEvaluator implements Evaluator {
|
||||
private final Object myValue;
|
||||
@@ -57,7 +62,13 @@ class LiteralEvaluator implements Evaluator {
|
||||
return DebuggerUtilsEx.createValue(vm, myExpectedType, ((Number)myValue).longValue());
|
||||
}
|
||||
if (myValue instanceof String) {
|
||||
return vm.mirrorOf((String)myValue);
|
||||
StringReference str = vm.mirrorOf((String)myValue);
|
||||
// intern
|
||||
Method internMethod = ContainerUtil.getFirstItem(str.referenceType().methodsByName("intern", "()Ljava/lang/String;"));
|
||||
if (internMethod != null) {
|
||||
return context.getDebugProcess().invokeMethod(context, str, internMethod, Collections.emptyList());
|
||||
}
|
||||
return str;
|
||||
}
|
||||
throw EvaluateExceptionUtil
|
||||
.createEvaluateException(DebuggerBundle.message("evaluation.error.unknown.expression.type", myExpectedType));
|
||||
|
||||
Reference in New Issue
Block a user