diff --git a/pmd-apex/src/main/java/net/sourceforge/pmd/lang/apex/ast/ASTLiteralExpression.java b/pmd-apex/src/main/java/net/sourceforge/pmd/lang/apex/ast/ASTLiteralExpression.java index 029bf39821..a2622cfd72 100644 --- a/pmd-apex/src/main/java/net/sourceforge/pmd/lang/apex/ast/ASTLiteralExpression.java +++ b/pmd-apex/src/main/java/net/sourceforge/pmd/lang/apex/ast/ASTLiteralExpression.java @@ -83,6 +83,17 @@ public class ASTLiteralExpression extends AbstractApexNode.Single + * For example, in the Apex code + *
{@code
+     * new X(a = 1, b = 2)
+     * }
+ * , the {@link ASTLiteralExpression} corresponding to {@code 2} will have the {@code name} + * "{@code b}". + */ public String getName() { if (getParent() instanceof ASTAssignmentExpression && getParent().getParent() instanceof ASTNewKeyValueObjectExpression) { ASTAssignmentExpression parent = (ASTAssignmentExpression) getParent();