IDEA-163730 string literal interning turned off by default
authorEgor.Ushakov <egor.ushakov@jetbrains.com>
Fri, 11 Nov 2016 12:24:24 +0000 (15:24 +0300)
committerEgor.Ushakov <egor.ushakov@jetbrains.com>
Fri, 11 Nov 2016 12:26:58 +0000 (15:26 +0300)
java/debugger/impl/src/com/intellij/debugger/engine/evaluation/expression/LiteralEvaluator.java
platform/util/resources/misc/registry.properties

index f33cb466cb7c46ec8e9eaba2fe5c181a79028ff4..29f5a46f1e5a7000c3326ac22aa4bdf7be44757f 100644 (file)
@@ -26,6 +26,7 @@ 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.openapi.util.registry.Registry;
 import com.sun.jdi.ClassType;
 import com.sun.jdi.Method;
 import com.sun.jdi.StringReference;
@@ -65,7 +66,7 @@ class LiteralEvaluator implements Evaluator {
       return vm.mirrorOfStringLiteral(((String)myValue), () -> {
         StringReference str = vm.mirrorOf((String)myValue);
         // intern starting from jdk 7
-        if (vm.versionHigher("1.7")) {
+        if (Registry.is("debugger.intern.string.literals") && vm.versionHigher("1.7")) {
           Method internMethod = ((ClassType)str.referenceType()).concreteMethodByName("intern", "()Ljava/lang/String;");
           if (internMethod != null) {
             return (StringReference)context.getDebugProcess().invokeMethod(context, str, internMethod, Collections.emptyList());
index 2cfa497c41777b3280089119b55ad8d35c599ff8..97597bbcd48a9b555d45aad289e7ec614c1e5f1f 100644 (file)
@@ -243,6 +243,8 @@ debugger.single.smart.step.force=true
 debugger.single.smart.step.force.description=Do force step into on single variant smart step into
 debugger.emulate.method.breakpoints=false
 debugger.emulate.method.breakpoints.description=Emulate method breakpoints with line breakpoints
+debugger.intern.string.literals=false
+debugger.intern.string.literals.description=Make string literal refer to the same instance of class String
 
 analyze.exceptions.on.the.fly=false
 analyze.exceptions.on.the.fly.description=Automatically analyze clipboard on frame activation,\