{"record":{"id":"7e5ced31446d124d","repo":"JetBrains/intellij-community","slug":"invalid-field-name-0-7e5ced","errorCode":null,"errorMessage":"Invalid field name '{0}'","messagePattern":"Invalid field name '(.+?)'","errorType":"exception","errorClass":"EvaluateException","httpStatus":null,"severity":"warning","filePath":"java/debugger/impl/src/com/intellij/debugger/ui/tree/render/ClassRenderer.java","lineNumber":345,"sourceCode":"\n  @Override\n  public void writeExternal(Element element) throws WriteExternalException {\n    super.writeExternal(element);\n    DefaultJDOMExternalizer.write(this, element, new DifferenceFilter<>(this, new ClassRenderer()));\n  }\n\n  @Override\n  public PsiElement getChildValueExpression(DebuggerTreeNode node, DebuggerContext context) throws EvaluateException {\n    DescriptorWithParentObject descriptor = (DescriptorWithParentObject)node.getDescriptor();\n\n    PsiElementFactory elementFactory = JavaPsiFacade.getElementFactory(node.getProject());\n    try {\n      return elementFactory.createExpressionFromText(\"this.\" + descriptor.getName(), DebuggerUtils.findClass(\n        descriptor.getObject().referenceType().name(), context.getProject(), context.getDebugProcess().getSearchScope())\n      );\n    }\n    catch (IncorrectOperationException e) {\n      throw new EvaluateException(JavaDebuggerBundle.message(\"error.invalid.field.name\", descriptor.getName()), null);\n    }\n  }\n\n  @Override\n  public CompletableFuture<Boolean> isExpandableAsync(Value value, EvaluationContext evaluationContext, NodeDescriptor parentDescriptor) {\n    DebuggerManagerThreadImpl.assertIsManagerThread();\n    if (value instanceof ArrayReference) {\n      return DebuggerUtilsAsync.length((ArrayReference)value).thenApply(r -> r > 0).exceptionally(throwable -> true);\n    }\n    else if (value instanceof ObjectReference) {\n      return CompletableFuture.completedFuture(true); // if object has no fields, it contains a child-message about that\n      //return ((ObjectReference)value).referenceType().allFields().size() > 0;\n    }\n\n    return CompletableFuture.completedFuture(false);\n  }\n\n  @Override","sourceCodeStart":327,"sourceCodeEnd":363,"githubUrl":"https://github.com/JetBrains/intellij-community/blob/be881553f2a76ac8b4ea53950d93f0de78295c19/java/debugger/impl/src/com/intellij/debugger/ui/tree/render/ClassRenderer.java#L327-L363","documentation":"ClassRenderer.getChildValueExpression builds the expression 'this.<fieldName>' for a child node of an object in the Variables view and parses it with PsiElementFactory.createExpressionFromText scoped to the object's class. If parsing fails with IncorrectOperationException (field name is not a valid Java identifier or the containing class cannot be resolved), it becomes this EvaluateException.","triggerScenarios":"Expanding an object in the debugger tree where a field name comes back empty or illegal as an identifier (obfuscated bytecode, synthetic fields), or where DebuggerUtils.findClass cannot locate the object's class in the IDE index, so 'this.<name>' cannot be parsed against that class.","commonSituations":"Debugging obfuscated/minified code (R8/ProGuard produce field names like 'a' that are valid, but sometimes empty or keyword-clashing names in non-Java bytecode); class not on the IDE's indexed classpath (remote process with different jars); debugging Kotlin/Scala synthetic fields.","solutions":["Ensure the classpath configured in the run configuration matches the jars actually loaded by the debugged process so findClass succeeds","Rebuild/re-deobfuscate the target so field names are legal identifiers, or disable obfuscation for debug builds","Attach sources or decompiled sources for the library containing the class so the IDE can resolve it","As a workaround, evaluate the field through a manually typed Watch expression instead of expanding the tree node"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"// ensure the object's class is resolvable in the IDE before expanding children\nPsiClass cls = DebuggerUtils.findClass(refType.name(), project, scope);\nif (cls == null) return; // 'this.<field>' will not parse without the class scope","typeGuard":null,"tryCatchPattern":"try {\n  renderer.getChildValueExpression(node, context);\n} catch (EvaluateException e) {\n  // field name not parseable / class unresolvable: display raw JDI value instead\n}","preventionTips":["Make sure every library on the debugged process's classpath is also known to the IDE (attached or indexed)","Debug non-obfuscated builds whenever possible","Prefer Watches with hand-written expressions over expanding nodes for odd bytecode"],"tags":["intellij-debugger","evaluation","psi","fields","obfuscation"],"backgroundTag":null,"analyzedSha":"be881553f2a76ac8b4ea53950d93f0de78295c19","analyzedAt":"2026-08-14T14:13:06.425Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}