diff --git a/java/debugger/impl/src/com/intellij/debugger/ui/tree/render/CachedEvaluator.java b/java/debugger/impl/src/com/intellij/debugger/ui/tree/render/CachedEvaluator.java index a8f6765d23af..cf79d9514e7e 100644 --- a/java/debugger/impl/src/com/intellij/debugger/ui/tree/render/CachedEvaluator.java +++ b/java/debugger/impl/src/com/intellij/debugger/ui/tree/render/CachedEvaluator.java @@ -1,20 +1,7 @@ -/* - * Copyright 2000-2017 JetBrains s.r.o. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ +// Copyright 2000-2017 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. package com.intellij.debugger.ui.tree.render; +import com.intellij.debugger.DebuggerBundle; import com.intellij.debugger.engine.DebuggerUtils; import com.intellij.debugger.engine.evaluation.CodeFragmentFactory; import com.intellij.debugger.engine.evaluation.EvaluateException; @@ -59,10 +46,11 @@ public abstract class CachedEvaluator { protected Cache initEvaluatorAndChildrenExpression(final Project project) { final Cache cache = new Cache(); try { - Pair psiClassAndType = DebuggerUtilsImpl.getPsiClassAndType(getClassName(), project); + String className = getClassName(); + Pair psiClassAndType = DebuggerUtilsImpl.getPsiClassAndType(className, project); PsiElement context = psiClassAndType.first; if (context == null) { - throw EvaluateExceptionUtil.CANNOT_FIND_SOURCE_CLASS; + throw EvaluateExceptionUtil.createEvaluateException(DebuggerBundle.message("evaluation.error.cannot.find.source", className)); } CodeFragmentFactory factory = DebuggerUtilsEx.findAppropriateCodeFragmentFactory(myReferenceExpression, context); JavaCodeFragment codeFragment = factory.createCodeFragment(myReferenceExpression, overrideContext(context), project); diff --git a/resources-en/src/messages/DebuggerBundle.properties b/resources-en/src/messages/DebuggerBundle.properties index 5fedb92836a2..eba84d5b17b0 100644 --- a/resources-en/src/messages/DebuggerBundle.properties +++ b/resources-en/src/messages/DebuggerBundle.properties @@ -10,6 +10,7 @@ evaluation.error.stack.frame.unavailable=Stack frame unavailable evaluation.error.nested.evaluation=Evaluation is not supported during another method''s evaluation evaluation.error.sources.out.of.sync=Sources do not correspond to code being executed evaluation.error.cannot.find.stackframe.source=Cannot find source class for current stack frame +evaluation.error.cannot.find.source=Cannot find source class for {0} evaluation.error.object.collected=Object has been collected evaluation.error.thread.collected=Thread has been collected evaluation.error.array.collected=Array has been collected