diff --git a/java/debugger/impl/src/com/intellij/debugger/ui/impl/watch/CompilingEvaluator.java b/java/debugger/impl/src/com/intellij/debugger/ui/impl/watch/CompilingEvaluator.java index cbb9d12dc163..1c57767665e8 100644 --- a/java/debugger/impl/src/com/intellij/debugger/ui/impl/watch/CompilingEvaluator.java +++ b/java/debugger/impl/src/com/intellij/debugger/ui/impl/watch/CompilingEvaluator.java @@ -16,6 +16,7 @@ import com.intellij.openapi.application.ReadAction; import com.intellij.openapi.compiler.ClassObject; import com.intellij.openapi.project.Project; import com.intellij.openapi.projectRoots.JavaSdkVersion; +import com.intellij.openapi.util.registry.Registry; import com.intellij.psi.PsiElement; import com.intellij.refactoring.extractMethodObject.ExtractLightMethodObjectHandler; import com.sun.jdi.ClassLoaderReference; @@ -91,7 +92,8 @@ public abstract class CompilingEvaluator implements ExpressionEvaluator { EvaluationContext context, DebugProcess process, ClassLoaderReference classLoader) throws EvaluateException { - boolean useMagicAccessorImpl = version != null && !version.isAtLeast(JavaSdkVersion.JDK_1_9); + boolean useMagicAccessorImpl = version != null && !version.isAtLeast(JavaSdkVersion.JDK_1_9) && + Registry.is("debugger.compiling.evaluator.magic.accessor"); for (ClassObject cls : classes) { if (cls.getPath().contains(GEN_CLASS_NAME)) { diff --git a/java/debugger/impl/src/com/intellij/debugger/ui/impl/watch/CompilingEvaluatorImpl.java b/java/debugger/impl/src/com/intellij/debugger/ui/impl/watch/CompilingEvaluatorImpl.java index 6096aed7f6aa..8bfdc849f224 100644 --- a/java/debugger/impl/src/com/intellij/debugger/ui/impl/watch/CompilingEvaluatorImpl.java +++ b/java/debugger/impl/src/com/intellij/debugger/ui/impl/watch/CompilingEvaluatorImpl.java @@ -144,7 +144,7 @@ public class CompilingEvaluatorImpl extends CompilingEvaluator { if (Registry.is("debugger.compiling.evaluator") && psiContext != null) { return ApplicationManager.getApplication().runReadAction((ThrowableComputable)() -> { try { - boolean useReflection = !Registry.is("debugger.compiling.evaluator.magic.accessor", true); + boolean useReflection = Registry.is("debugger.compiling.evaluator.reflection.access.with.java8"); XDebugSession currentSession = XDebuggerManager.getInstance(project).getCurrentSession(); if (!useReflection && currentSession != null) { XSuspendContext suspendContext = currentSession.getSuspendContext(); diff --git a/java/java-impl/src/com/intellij/refactoring/extractMethodObject/ExtractLightMethodObjectHandler.java b/java/java-impl/src/com/intellij/refactoring/extractMethodObject/ExtractLightMethodObjectHandler.java index 1ba69a12ea7e..ee04860d3900 100644 --- a/java/java-impl/src/com/intellij/refactoring/extractMethodObject/ExtractLightMethodObjectHandler.java +++ b/java/java-impl/src/com/intellij/refactoring/extractMethodObject/ExtractLightMethodObjectHandler.java @@ -19,6 +19,7 @@ import com.intellij.codeInsight.CodeInsightUtil; import com.intellij.openapi.diagnostic.Logger; import com.intellij.openapi.project.Project; import com.intellij.openapi.util.TextRange; +import com.intellij.openapi.util.registry.Registry; import com.intellij.openapi.util.text.StringUtil; import com.intellij.psi.*; import com.intellij.psi.codeStyle.CodeStyleManager; @@ -198,7 +199,7 @@ public class ExtractLightMethodObjectHandler { PsiStatement outStatement = elementFactory.createStatementFromText("System.out.println(" + outputVariables + ");", anchor); outStatement = (PsiStatement)container.addAfter(outStatement, elementsCopy[elementsCopy.length - 1]); - if (!useReflection) { + if (Registry.is("debugger.compiling.evaluator.magic.accessor") && !useReflection) { copy.accept(new JavaRecursiveElementWalkingVisitor() { private void makePublic(PsiMember method) { if (method.hasModifierProperty(PsiModifier.PRIVATE)) { diff --git a/platform/util/resources/misc/registry.properties b/platform/util/resources/misc/registry.properties index b7a00a0308bb..8638ab34751e 100644 --- a/platform/util/resources/misc/registry.properties +++ b/platform/util/resources/misc/registry.properties @@ -361,6 +361,7 @@ debugger.mayBringFrameToFrontOnBreakpoint=true debugger.batch.evaluation=false debugger.compiling.evaluator=true debugger.compiling.evaluator.magic.accessor=false +debugger.compiling.evaluator.reflection.access.with.java8=true debugger.watches.in.variables=true debugger.auto.fetch.icons=true debugger.close.dialog.on.navigate=true