GeezerVisonThe World Wide Web, restored to 800 pixels of glory. |
| Home|About|Gaming cabinet|Archives|How it works|Starter sites |
GeezerVison is showing github.com — [apex] Expose the referenced type name on ClassRefExpression for XPath rules · Issue #7182 · pmd/pmd Closed Labels an:enhancementAn improvement on existing features / rules Milestone DescriptionIs your feature request related to a problem? Please describe. In Apex, XPath rules can identify a Reproduced with PMD 7.28.0. For Describe the solution you'd like Expose the referenced type name on For the reproduction below, a query such as this should be possible (the attribute name is illustrative): The requested value is the type name written in the class literal; full symbol/type resolution is not required. It should remain available when the expression is used without a cast or typed variable declaration. Qualified/nested type names should also be retained. Describe alternatives you've considered
Additional context Fresh, self-contained minimal reproduction ( public class ClassLiteralExample { public class TargetClass {} public static void example() { consume(TargetClass.class); } private static void consume(Type referencedType) {} } Command: pmd ast-dump --language apex --file ClassLiteralExample.cls --format xml Actual <MethodCallExpression DefiningType="ClassLiteralExample" FullMethodName="consume" Image="" InputParametersSize="1" MethodName="consume" RealLoc="true"> <EmptyReferenceExpression DefiningType="" Image="" RealLoc="false" /> <ClassRefExpression DefiningType="ClassLiteralExample" Image="" RealLoc="true" /> </MethodCallExpression> The practical use case is enforcing a shared test helper instead of manually mocking a particular implementation class. Matching the method call itself is possible; matching which class literal was passed is the missing piece. Current implementation for reference: https://github.com/pmd/pmd/blob/main/pmd-apex/src/main/java/net/sourceforge/pmd/lang/apex/ast/ASTClassRefExpression.java Activity
MetadataMetadataAssigneesLabelsan:enhancementAn improvement on existing features / rules TypeProjectsMilestoneRelationshipsDevelopmentIssue actions |
| You are visitor 01402775 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |