-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[apex] Update summit-ast and apex-parser
Fixes pmd#4922
- Loading branch information
Showing
9 changed files
with
55 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
26 changes: 26 additions & 0 deletions
26
pmd-apex/src/test/resources/net/sourceforge/pmd/lang/apex/ast/TypeofTest.cls
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
public class TypeofTest { | ||
static void test() { | ||
Case c = [ | ||
SELECT | ||
Id, | ||
Subject, | ||
Description, | ||
TYPEOF Owner | ||
WHEN Group THEN Name | ||
WHEN User THEN Name | ||
END, | ||
( | ||
SELECT | ||
Id, | ||
Subject, | ||
Description, | ||
TYPEOF Owner | ||
WHEN Group THEN Name | ||
WHEN User THEN Name | ||
END | ||
FROM Cases | ||
) | ||
FROM Case | ||
]; | ||
} | ||
} |
12 changes: 12 additions & 0 deletions
12
pmd-apex/src/test/resources/net/sourceforge/pmd/lang/apex/ast/TypeofTest.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
+- ApexFile[@DefiningType = "TypeofTest", @RealLoc = true] | ||
+- UserClass[@DefiningType = "TypeofTest", @Image = "TypeofTest", @RealLoc = true, @SimpleName = "TypeofTest", @SuperClassName = ""] | ||
+- ModifierNode[@Abstract = false, @DefiningType = "TypeofTest", @DeprecatedTestMethod = false, @Final = false, @Global = false, @InheritedSharing = false, @Modifiers = 1, @Override = false, @Private = false, @Protected = false, @Public = true, @RealLoc = true, @Static = false, @Test = false, @TestOrTestSetup = false, @Transient = false, @Virtual = false, @WebService = false, @WithSharing = false, @WithoutSharing = false] | ||
+- Method[@Arity = 0, @CanonicalName = "test", @Constructor = false, @DefiningType = "TypeofTest", @Image = "test", @RealLoc = true, @ReturnType = "void", @StaticInitializer = false] | ||
+- ModifierNode[@Abstract = false, @DefiningType = "TypeofTest", @DeprecatedTestMethod = false, @Final = false, @Global = false, @InheritedSharing = false, @Modifiers = 8, @Override = false, @Private = false, @Protected = false, @Public = false, @RealLoc = true, @Static = true, @Test = false, @TestOrTestSetup = false, @Transient = false, @Virtual = false, @WebService = false, @WithSharing = false, @WithoutSharing = false] | ||
+- BlockStatement[@CurlyBrace = true, @DefiningType = "TypeofTest", @RealLoc = true] | ||
+- VariableDeclarationStatements[@DefiningType = "TypeofTest", @RealLoc = true] | ||
+- ModifierNode[@Abstract = false, @DefiningType = "TypeofTest", @DeprecatedTestMethod = false, @Final = false, @Global = false, @InheritedSharing = false, @Modifiers = 0, @Override = false, @Private = false, @Protected = false, @Public = false, @RealLoc = false, @Static = false, @Test = false, @TestOrTestSetup = false, @Transient = false, @Virtual = false, @WebService = false, @WithSharing = false, @WithoutSharing = false] | ||
+- VariableDeclaration[@DefiningType = "TypeofTest", @Image = "c", @RealLoc = true, @Type = "Case"] | ||
+- SoqlExpression[@CanonicalQuery = "SELECT\n\t\t\t\tId,\n\t\t\t\tSubject,\n\t\t\t\tDescription,\n\t\t\t\tTYPEOF Owner\n\t\t\t\t\tWHEN Group THEN Name\n\t\t\t\t\tWHEN User THEN Name\n\t\t\t\tEND,\n\t\t\t\t(\n\t\t\t\t\tSELECT\n\t\t\t\t\t\tId,\n\t\t\t\t\t\tSubject,\n\t\t\t\t\t\tDescription,\n\t\t\t\t\t\tTYPEOF Owner\n\t\t\t\t\t\t\tWHEN Group THEN Name\n\t\t\t\t\t\t\tWHEN User THEN Name\n\t\t\t\t\t\tEND\n\t\t\t\t\tFROM Cases\n\t\t\t\t)\n\t\t\tFROM Case", @DefiningType = "TypeofTest", @Query = "SELECT\n\t\t\t\tId,\n\t\t\t\tSubject,\n\t\t\t\tDescription,\n\t\t\t\tTYPEOF Owner\n\t\t\t\t\tWHEN Group THEN Name\n\t\t\t\t\tWHEN User THEN Name\n\t\t\t\tEND,\n\t\t\t\t(\n\t\t\t\t\tSELECT\n\t\t\t\t\t\tId,\n\t\t\t\t\t\tSubject,\n\t\t\t\t\t\tDescription,\n\t\t\t\t\t\tTYPEOF Owner\n\t\t\t\t\t\t\tWHEN Group THEN Name\n\t\t\t\t\t\t\tWHEN User THEN Name\n\t\t\t\t\t\tEND\n\t\t\t\t\tFROM Cases\n\t\t\t\t)\n\t\t\tFROM Case", @RealLoc = true] | ||
+- VariableExpression[@DefiningType = "TypeofTest", @Image = "c", @RealLoc = true] | ||
+- EmptyReferenceExpression[@DefiningType = null, @RealLoc = false] |