From e96a30b72b01a3b358278d794490e35cf3e0deb8 Mon Sep 17 00:00:00 2001 From: "Egor.Ushakov" Date: Fri, 11 Nov 2016 15:24:24 +0300 Subject: [PATCH] IDEA-163730 string literal interning turned off by default --- .../engine/evaluation/expression/LiteralEvaluator.java | 3 ++- platform/util/resources/misc/registry.properties | 2 ++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/java/debugger/impl/src/com/intellij/debugger/engine/evaluation/expression/LiteralEvaluator.java b/java/debugger/impl/src/com/intellij/debugger/engine/evaluation/expression/LiteralEvaluator.java index f33cb466cb7c..29f5a46f1e5a 100644 --- a/java/debugger/impl/src/com/intellij/debugger/engine/evaluation/expression/LiteralEvaluator.java +++ b/java/debugger/impl/src/com/intellij/debugger/engine/evaluation/expression/LiteralEvaluator.java @@ -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()); diff --git a/platform/util/resources/misc/registry.properties b/platform/util/resources/misc/registry.properties index 2cfa497c4177..97597bbcd48a 100644 --- a/platform/util/resources/misc/registry.properties +++ b/platform/util/resources/misc/registry.properties @@ -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,\