IDEA-195531 - do not run toString for an object being initialized

This commit is contained in:
Egor Ushakov
2018-10-23 19:03:13 +03:00
parent 9b476ba7d7
commit 8b8ec9f07c
2 changed files with 5 additions and 2 deletions
@@ -69,7 +69,10 @@ public class ToStringRenderer extends NodeRendererImpl implements OnDemandRender
return "";
}
final Value value = valueDescriptor.getValue();
Value value = valueDescriptor.getValue();
if (value instanceof ObjectReference) {
DebuggerUtils.ensureNotInsideObjectConstructor((ObjectReference)value, evaluationContext);
}
BatchEvaluator.getBatchEvaluator(evaluationContext.getDebugProcess()).invoke(new ToStringCommand(evaluationContext, value) {
@Override
public void evaluationResult(String message) {
@@ -1,7 +1,7 @@
evaluation.error.empty.code.fragment=Code fragment expected
evaluation.error.cannot.evaluate.tostring=Cannot evaluate {0}.toString()
evaluation.error.unsupported.expression.type=Unsupported expression type
evaluation.error.object.is.being.initialized=Object is still being initialized
evaluation.error.object.is.being.initialized=Object is being initialized
internal.error.locations.of.line=Internal error loading debug information from ''{0}''. Breakpoints will be unavailable in this class.
evaluation.error.inconsistent.debug.info=Debug information is inconsistent
evaluation.error.boolean.value.expected.in.condition='boolean' value expected in condition