[apex] Consider VariableDeclarationGroup in ApexTreeBuilder (#5099)
Merge pull request #5099 from adangel:apex-issue-5094
This commit is contained in:
commit
669f883a99
@ -7681,6 +7681,15 @@
|
||||
"contributions": [
|
||||
"bug"
|
||||
]
|
||||
},
|
||||
{
|
||||
"login": "ethan-sargent",
|
||||
"name": "Ethan Sargent",
|
||||
"avatar_url": "https://avatars.githubusercontent.com/u/17370760?v=4",
|
||||
"profile": "https://github.com/ethan-sargent",
|
||||
"contributions": [
|
||||
"bug"
|
||||
]
|
||||
}
|
||||
],
|
||||
"contributorsPerLine": 7,
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -26,6 +26,8 @@ This is a {{ site.pmd.release_type }} release.
|
||||
for inner classes and interfaces: `innerClassPattern` and `innerInterfacePattern`.
|
||||
|
||||
### 🐛 Fixed Issues
|
||||
* apex
|
||||
* [#5094](https://github.com/pmd/pmd/issues/5094): \[apex] "No adapter exists for type" error message printed to stdout instead of stderr
|
||||
* apex-bestpractices
|
||||
* [#5095](https://github.com/pmd/pmd/issues/5095): \[apex] ApexUnitTestShouldNotUseSeeAllDataTrue false negative due to casing (regression in PMD 7)
|
||||
* apex-codestyle
|
||||
|
@ -163,6 +163,7 @@ class ApexTreeBuilder(private val task: ParserTask, private val proc: ApexLangua
|
||||
is DmlStatement -> buildDmlStatement(node)
|
||||
is IfStatement -> buildIfStatement(node)
|
||||
is VariableDeclarationStatement -> buildVariableDeclarationGroup(node.group)
|
||||
is VariableDeclarationGroup -> buildVariableDeclarationGroup(node)
|
||||
is VariableDeclaration -> buildVariableDeclaration(node)
|
||||
is EnhancedForLoopStatement -> buildEnhancedForLoopStatement(node)
|
||||
is DoWhileLoopStatement -> buildDoWhileLoopStatement(node)
|
||||
@ -187,9 +188,7 @@ class ApexTreeBuilder(private val task: ParserTask, private val proc: ApexLangua
|
||||
is KeywordModifier,
|
||||
is TypeRef -> null
|
||||
else -> {
|
||||
println("No adapter exists for type ${node::class.qualifiedName}")
|
||||
// TODO(b/239648780): temporary print
|
||||
null
|
||||
throw ParseException("No adapter exists for type ${node::class.qualifiedName}")
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1,46 +0,0 @@
|
||||
/*
|
||||
* BSD-style license; for more info see http://pmd.sourceforge.net/license.html
|
||||
*/
|
||||
|
||||
package net.sourceforge.pmd.lang.apex.ast;
|
||||
|
||||
import static org.junit.jupiter.api.Assertions.assertEquals;
|
||||
import static org.junit.jupiter.api.Assertions.assertTrue;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
class ASTSwitchStatementTest extends ApexParserTestBase {
|
||||
|
||||
@Test
|
||||
void testExamples() {
|
||||
ApexNode<?> node = apex.parseResource("SwitchStatements.cls").getMainNode();
|
||||
List<ASTSwitchStatement> switchStatements = node.descendants(ASTSwitchStatement.class).toList();
|
||||
assertEquals(4, switchStatements.size());
|
||||
|
||||
assertTrue(switchStatements.get(0).getChild(0) instanceof ASTVariableExpression);
|
||||
assertEquals(5, switchStatements.get(0).children(ASTValueWhenBlock.class).count());
|
||||
assertEquals(3, switchStatements.get(0).children(ASTValueWhenBlock.class)
|
||||
.get(1).children(ASTLiteralCase.class).count());
|
||||
assertEquals(1, switchStatements.get(0).children(ASTElseWhenBlock.class).count());
|
||||
|
||||
assertTrue(switchStatements.get(1).getChild(0) instanceof ASTMethodCallExpression);
|
||||
assertEquals(2, switchStatements.get(1).children(ASTValueWhenBlock.class).count());
|
||||
assertEquals(1, switchStatements.get(1).children(ASTElseWhenBlock.class).count());
|
||||
|
||||
assertTrue(switchStatements.get(2).getChild(0) instanceof ASTVariableExpression);
|
||||
assertEquals(2, switchStatements.get(2).children(ASTTypeWhenBlock.class).count());
|
||||
assertEquals("Account", switchStatements.get(2).children(ASTTypeWhenBlock.class)
|
||||
.get(0).getType());
|
||||
assertEquals("a", switchStatements.get(2).children(ASTTypeWhenBlock.class)
|
||||
.get(0).getName());
|
||||
assertEquals(1, switchStatements.get(2).children(ASTValueWhenBlock.class).count());
|
||||
assertEquals(1, switchStatements.get(2).children(ASTElseWhenBlock.class).count());
|
||||
|
||||
assertTrue(switchStatements.get(3).getChild(0) instanceof ASTVariableExpression);
|
||||
assertEquals(2, switchStatements.get(3).children(ASTValueWhenBlock.class).count());
|
||||
assertEquals(1, switchStatements.get(3).children(ASTElseWhenBlock.class).count());
|
||||
}
|
||||
|
||||
}
|
@ -57,4 +57,12 @@ class ApexTreeDumpTest extends BaseTreeDumpTest {
|
||||
void soslWithUsermode() {
|
||||
doTest("SoslWithUsermode");
|
||||
}
|
||||
|
||||
/**
|
||||
* @see <a href="https://github.com/pmd/pmd/issues/5094">[apex] "No adapter exists for type" error message printed to stdout instead of stderr</a>
|
||||
*/
|
||||
@Test
|
||||
void switchStatements() {
|
||||
doTest("SwitchStatements");
|
||||
}
|
||||
}
|
||||
|
@ -0,0 +1,197 @@
|
||||
+- ApexFile[@DefiningType = "ApexSwitchStatements", @RealLoc = true]
|
||||
+- UserClass[@DefiningType = "ApexSwitchStatements", @Image = "ApexSwitchStatements", @InterfaceNames = (), @RealLoc = true, @SimpleName = "ApexSwitchStatements", @SuperClassName = ""]
|
||||
+- ModifierNode[@Abstract = false, @DefiningType = "ApexSwitchStatements", @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 = "example1", @Constructor = false, @DefiningType = "ApexSwitchStatements", @Image = "example1", @RealLoc = true, @ReturnType = "void", @StaticInitializer = false]
|
||||
| +- ModifierNode[@Abstract = false, @DefiningType = "ApexSwitchStatements", @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]
|
||||
| +- BlockStatement[@CurlyBrace = true, @DefiningType = "ApexSwitchStatements", @RealLoc = true]
|
||||
| +- VariableDeclarationStatements[@DefiningType = "ApexSwitchStatements", @RealLoc = true]
|
||||
| | +- ModifierNode[@Abstract = false, @DefiningType = "ApexSwitchStatements", @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 = "ApexSwitchStatements", @Image = "i", @RealLoc = true, @Type = "int"]
|
||||
| | +- LiteralExpression[@Boolean = false, @Decimal = false, @DefiningType = "ApexSwitchStatements", @Double = false, @Image = "3", @Integer = true, @LiteralType = LiteralType.INTEGER, @Long = false, @Name = null, @Null = false, @RealLoc = true, @String = false]
|
||||
| | +- VariableExpression[@DefiningType = "ApexSwitchStatements", @Image = "i", @RealLoc = true]
|
||||
| | +- EmptyReferenceExpression[@DefiningType = null, @RealLoc = false]
|
||||
| +- SwitchStatement[@DefiningType = "ApexSwitchStatements", @RealLoc = true]
|
||||
| +- VariableExpression[@DefiningType = "ApexSwitchStatements", @Image = "i", @RealLoc = true]
|
||||
| | +- EmptyReferenceExpression[@DefiningType = null, @RealLoc = false]
|
||||
| +- ValueWhenBlock[@DefiningType = "ApexSwitchStatements", @RealLoc = false]
|
||||
| | +- LiteralCase[@DefiningType = "ApexSwitchStatements", @RealLoc = true]
|
||||
| | | +- PrefixExpression[@DefiningType = "ApexSwitchStatements", @Op = PrefixOperator.NEGATIVE, @RealLoc = true]
|
||||
| | | +- LiteralExpression[@Boolean = false, @Decimal = false, @DefiningType = "ApexSwitchStatements", @Double = false, @Image = "2", @Integer = true, @LiteralType = LiteralType.INTEGER, @Long = false, @Name = null, @Null = false, @RealLoc = true, @String = false]
|
||||
| | +- BlockStatement[@CurlyBrace = true, @DefiningType = "ApexSwitchStatements", @RealLoc = true]
|
||||
| | +- ExpressionStatement[@DefiningType = "ApexSwitchStatements", @RealLoc = true]
|
||||
| | +- MethodCallExpression[@DefiningType = "ApexSwitchStatements", @FullMethodName = "System.debug", @InputParametersSize = 1, @MethodName = "debug", @RealLoc = true]
|
||||
| | +- ReferenceExpression[@DefiningType = "ApexSwitchStatements", @Image = "System", @RealLoc = true, @ReferenceType = ReferenceType.METHOD, @SObjectType = false, @SafeNav = false]
|
||||
| | +- LiteralExpression[@Boolean = false, @Decimal = false, @DefiningType = "ApexSwitchStatements", @Double = false, @Image = "when block 2", @Integer = false, @LiteralType = LiteralType.STRING, @Long = false, @Name = null, @Null = false, @RealLoc = true, @String = true]
|
||||
| +- ValueWhenBlock[@DefiningType = "ApexSwitchStatements", @RealLoc = false]
|
||||
| | +- LiteralCase[@DefiningType = "ApexSwitchStatements", @RealLoc = true]
|
||||
| | | +- PrefixExpression[@DefiningType = "ApexSwitchStatements", @Op = PrefixOperator.NEGATIVE, @RealLoc = true]
|
||||
| | | +- LiteralExpression[@Boolean = false, @Decimal = false, @DefiningType = "ApexSwitchStatements", @Double = false, @Image = "3", @Integer = true, @LiteralType = LiteralType.INTEGER, @Long = false, @Name = null, @Null = false, @RealLoc = true, @String = false]
|
||||
| | +- LiteralCase[@DefiningType = "ApexSwitchStatements", @RealLoc = true]
|
||||
| | | +- PrefixExpression[@DefiningType = "ApexSwitchStatements", @Op = PrefixOperator.NEGATIVE, @RealLoc = true]
|
||||
| | | +- LiteralExpression[@Boolean = false, @Decimal = false, @DefiningType = "ApexSwitchStatements", @Double = false, @Image = "4", @Integer = true, @LiteralType = LiteralType.INTEGER, @Long = false, @Name = null, @Null = false, @RealLoc = true, @String = false]
|
||||
| | +- LiteralCase[@DefiningType = "ApexSwitchStatements", @RealLoc = true]
|
||||
| | | +- PrefixExpression[@DefiningType = "ApexSwitchStatements", @Op = PrefixOperator.NEGATIVE, @RealLoc = true]
|
||||
| | | +- LiteralExpression[@Boolean = false, @Decimal = false, @DefiningType = "ApexSwitchStatements", @Double = false, @Image = "5", @Integer = true, @LiteralType = LiteralType.INTEGER, @Long = false, @Name = null, @Null = false, @RealLoc = true, @String = false]
|
||||
| | +- BlockStatement[@CurlyBrace = true, @DefiningType = "ApexSwitchStatements", @RealLoc = true]
|
||||
| | +- ExpressionStatement[@DefiningType = "ApexSwitchStatements", @RealLoc = true]
|
||||
| | +- MethodCallExpression[@DefiningType = "ApexSwitchStatements", @FullMethodName = "System.debug", @InputParametersSize = 1, @MethodName = "debug", @RealLoc = true]
|
||||
| | +- ReferenceExpression[@DefiningType = "ApexSwitchStatements", @Image = "System", @RealLoc = true, @ReferenceType = ReferenceType.METHOD, @SObjectType = false, @SafeNav = false]
|
||||
| | +- LiteralExpression[@Boolean = false, @Decimal = false, @DefiningType = "ApexSwitchStatements", @Double = false, @Image = "when block 3 and 4 and 5", @Integer = false, @LiteralType = LiteralType.STRING, @Long = false, @Name = null, @Null = false, @RealLoc = true, @String = true]
|
||||
| +- ValueWhenBlock[@DefiningType = "ApexSwitchStatements", @RealLoc = false]
|
||||
| | +- LiteralCase[@DefiningType = "ApexSwitchStatements", @RealLoc = true]
|
||||
| | | +- PrefixExpression[@DefiningType = "ApexSwitchStatements", @Op = PrefixOperator.NEGATIVE, @RealLoc = true]
|
||||
| | | +- LiteralExpression[@Boolean = false, @Decimal = false, @DefiningType = "ApexSwitchStatements", @Double = false, @Image = "6", @Integer = true, @LiteralType = LiteralType.INTEGER, @Long = false, @Name = null, @Null = false, @RealLoc = true, @String = false]
|
||||
| | +- LiteralCase[@DefiningType = "ApexSwitchStatements", @RealLoc = true]
|
||||
| | | +- PrefixExpression[@DefiningType = "ApexSwitchStatements", @Op = PrefixOperator.NEGATIVE, @RealLoc = true]
|
||||
| | | +- LiteralExpression[@Boolean = false, @Decimal = false, @DefiningType = "ApexSwitchStatements", @Double = false, @Image = "7", @Integer = true, @LiteralType = LiteralType.INTEGER, @Long = false, @Name = null, @Null = false, @RealLoc = true, @String = false]
|
||||
| | +- BlockStatement[@CurlyBrace = true, @DefiningType = "ApexSwitchStatements", @RealLoc = true]
|
||||
| | +- ExpressionStatement[@DefiningType = "ApexSwitchStatements", @RealLoc = true]
|
||||
| | +- MethodCallExpression[@DefiningType = "ApexSwitchStatements", @FullMethodName = "System.debug", @InputParametersSize = 1, @MethodName = "debug", @RealLoc = true]
|
||||
| | +- ReferenceExpression[@DefiningType = "ApexSwitchStatements", @Image = "System", @RealLoc = true, @ReferenceType = ReferenceType.METHOD, @SObjectType = false, @SafeNav = false]
|
||||
| | +- LiteralExpression[@Boolean = false, @Decimal = false, @DefiningType = "ApexSwitchStatements", @Double = false, @Image = "when block 6 and 7", @Integer = false, @LiteralType = LiteralType.STRING, @Long = false, @Name = null, @Null = false, @RealLoc = true, @String = true]
|
||||
| +- ValueWhenBlock[@DefiningType = "ApexSwitchStatements", @RealLoc = false]
|
||||
| | +- LiteralCase[@DefiningType = "ApexSwitchStatements", @RealLoc = true]
|
||||
| | | +- PrefixExpression[@DefiningType = "ApexSwitchStatements", @Op = PrefixOperator.NEGATIVE, @RealLoc = true]
|
||||
| | | +- LiteralExpression[@Boolean = false, @Decimal = false, @DefiningType = "ApexSwitchStatements", @Double = false, @Image = "3", @Integer = true, @LiteralType = LiteralType.INTEGER, @Long = false, @Name = null, @Null = false, @RealLoc = true, @String = false]
|
||||
| | +- BlockStatement[@CurlyBrace = true, @DefiningType = "ApexSwitchStatements", @RealLoc = true]
|
||||
| | +- ExpressionStatement[@DefiningType = "ApexSwitchStatements", @RealLoc = true]
|
||||
| | +- MethodCallExpression[@DefiningType = "ApexSwitchStatements", @FullMethodName = "System.debug", @InputParametersSize = 1, @MethodName = "debug", @RealLoc = true]
|
||||
| | +- ReferenceExpression[@DefiningType = "ApexSwitchStatements", @Image = "System", @RealLoc = true, @ReferenceType = ReferenceType.METHOD, @SObjectType = false, @SafeNav = false]
|
||||
| | +- LiteralExpression[@Boolean = false, @Decimal = false, @DefiningType = "ApexSwitchStatements", @Double = false, @Image = "when block -3", @Integer = false, @LiteralType = LiteralType.STRING, @Long = false, @Name = null, @Null = false, @RealLoc = true, @String = true]
|
||||
| +- ValueWhenBlock[@DefiningType = "ApexSwitchStatements", @RealLoc = false]
|
||||
| | +- LiteralCase[@DefiningType = "ApexSwitchStatements", @RealLoc = true]
|
||||
| | | +- LiteralExpression[@Boolean = false, @Decimal = false, @DefiningType = "ApexSwitchStatements", @Double = false, @Image = "", @Integer = false, @LiteralType = LiteralType.NULL, @Long = false, @Name = null, @Null = true, @RealLoc = true, @String = false]
|
||||
| | +- BlockStatement[@CurlyBrace = true, @DefiningType = "ApexSwitchStatements", @RealLoc = true]
|
||||
| | +- ExpressionStatement[@DefiningType = "ApexSwitchStatements", @RealLoc = true]
|
||||
| | +- MethodCallExpression[@DefiningType = "ApexSwitchStatements", @FullMethodName = "System.debug", @InputParametersSize = 1, @MethodName = "debug", @RealLoc = true]
|
||||
| | +- ReferenceExpression[@DefiningType = "ApexSwitchStatements", @Image = "System", @RealLoc = true, @ReferenceType = ReferenceType.METHOD, @SObjectType = false, @SafeNav = false]
|
||||
| | +- LiteralExpression[@Boolean = false, @Decimal = false, @DefiningType = "ApexSwitchStatements", @Double = false, @Image = "bad integer", @Integer = false, @LiteralType = LiteralType.STRING, @Long = false, @Name = null, @Null = false, @RealLoc = true, @String = true]
|
||||
| +- ElseWhenBlock[@DefiningType = "ApexSwitchStatements", @RealLoc = false]
|
||||
| +- BlockStatement[@CurlyBrace = true, @DefiningType = "ApexSwitchStatements", @RealLoc = true]
|
||||
| +- ExpressionStatement[@DefiningType = "ApexSwitchStatements", @RealLoc = true]
|
||||
| +- MethodCallExpression[@DefiningType = "ApexSwitchStatements", @FullMethodName = "System.debug", @InputParametersSize = 1, @MethodName = "debug", @RealLoc = true]
|
||||
| +- ReferenceExpression[@DefiningType = "ApexSwitchStatements", @Image = "System", @RealLoc = true, @ReferenceType = ReferenceType.METHOD, @SObjectType = false, @SafeNav = false]
|
||||
| +- LiteralExpression[@Boolean = false, @Decimal = false, @DefiningType = "ApexSwitchStatements", @Double = false, @Image = "default", @Integer = false, @LiteralType = LiteralType.STRING, @Long = false, @Name = null, @Null = false, @RealLoc = true, @String = true]
|
||||
+- Method[@Arity = 0, @CanonicalName = "example2", @Constructor = false, @DefiningType = "ApexSwitchStatements", @Image = "example2", @RealLoc = true, @ReturnType = "void", @StaticInitializer = false]
|
||||
| +- ModifierNode[@Abstract = false, @DefiningType = "ApexSwitchStatements", @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]
|
||||
| +- BlockStatement[@CurlyBrace = true, @DefiningType = "ApexSwitchStatements", @RealLoc = true]
|
||||
| +- VariableDeclarationStatements[@DefiningType = "ApexSwitchStatements", @RealLoc = true]
|
||||
| | +- ModifierNode[@Abstract = false, @DefiningType = "ApexSwitchStatements", @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 = "ApexSwitchStatements", @Image = "i", @RealLoc = true, @Type = "int"]
|
||||
| | +- LiteralExpression[@Boolean = false, @Decimal = false, @DefiningType = "ApexSwitchStatements", @Double = false, @Image = "1", @Integer = true, @LiteralType = LiteralType.INTEGER, @Long = false, @Name = null, @Null = false, @RealLoc = true, @String = false]
|
||||
| | +- VariableExpression[@DefiningType = "ApexSwitchStatements", @Image = "i", @RealLoc = true]
|
||||
| | +- EmptyReferenceExpression[@DefiningType = null, @RealLoc = false]
|
||||
| +- SwitchStatement[@DefiningType = "ApexSwitchStatements", @RealLoc = true]
|
||||
| +- MethodCallExpression[@DefiningType = "ApexSwitchStatements", @FullMethodName = "someInteger", @InputParametersSize = 1, @MethodName = "someInteger", @RealLoc = true]
|
||||
| | +- EmptyReferenceExpression[@DefiningType = null, @RealLoc = false]
|
||||
| | +- VariableExpression[@DefiningType = "ApexSwitchStatements", @Image = "i", @RealLoc = true]
|
||||
| | +- EmptyReferenceExpression[@DefiningType = null, @RealLoc = false]
|
||||
| +- ValueWhenBlock[@DefiningType = "ApexSwitchStatements", @RealLoc = false]
|
||||
| | +- LiteralCase[@DefiningType = "ApexSwitchStatements", @RealLoc = true]
|
||||
| | | +- PrefixExpression[@DefiningType = "ApexSwitchStatements", @Op = PrefixOperator.NEGATIVE, @RealLoc = true]
|
||||
| | | +- LiteralExpression[@Boolean = false, @Decimal = false, @DefiningType = "ApexSwitchStatements", @Double = false, @Image = "2", @Integer = true, @LiteralType = LiteralType.INTEGER, @Long = false, @Name = null, @Null = false, @RealLoc = true, @String = false]
|
||||
| | +- BlockStatement[@CurlyBrace = true, @DefiningType = "ApexSwitchStatements", @RealLoc = true]
|
||||
| | +- ExpressionStatement[@DefiningType = "ApexSwitchStatements", @RealLoc = true]
|
||||
| | +- MethodCallExpression[@DefiningType = "ApexSwitchStatements", @FullMethodName = "System.debug", @InputParametersSize = 1, @MethodName = "debug", @RealLoc = true]
|
||||
| | +- ReferenceExpression[@DefiningType = "ApexSwitchStatements", @Image = "System", @RealLoc = true, @ReferenceType = ReferenceType.METHOD, @SObjectType = false, @SafeNav = false]
|
||||
| | +- LiteralExpression[@Boolean = false, @Decimal = false, @DefiningType = "ApexSwitchStatements", @Double = false, @Image = "when block 2", @Integer = false, @LiteralType = LiteralType.STRING, @Long = false, @Name = null, @Null = false, @RealLoc = true, @String = true]
|
||||
| +- ValueWhenBlock[@DefiningType = "ApexSwitchStatements", @RealLoc = false]
|
||||
| | +- LiteralCase[@DefiningType = "ApexSwitchStatements", @RealLoc = true]
|
||||
| | | +- PrefixExpression[@DefiningType = "ApexSwitchStatements", @Op = PrefixOperator.NEGATIVE, @RealLoc = true]
|
||||
| | | +- LiteralExpression[@Boolean = false, @Decimal = false, @DefiningType = "ApexSwitchStatements", @Double = false, @Image = "3", @Integer = true, @LiteralType = LiteralType.INTEGER, @Long = false, @Name = null, @Null = false, @RealLoc = true, @String = false]
|
||||
| | +- BlockStatement[@CurlyBrace = true, @DefiningType = "ApexSwitchStatements", @RealLoc = true]
|
||||
| | +- ExpressionStatement[@DefiningType = "ApexSwitchStatements", @RealLoc = true]
|
||||
| | +- MethodCallExpression[@DefiningType = "ApexSwitchStatements", @FullMethodName = "System.debug", @InputParametersSize = 1, @MethodName = "debug", @RealLoc = true]
|
||||
| | +- ReferenceExpression[@DefiningType = "ApexSwitchStatements", @Image = "System", @RealLoc = true, @ReferenceType = ReferenceType.METHOD, @SObjectType = false, @SafeNav = false]
|
||||
| | +- LiteralExpression[@Boolean = false, @Decimal = false, @DefiningType = "ApexSwitchStatements", @Double = false, @Image = "when block 3", @Integer = false, @LiteralType = LiteralType.STRING, @Long = false, @Name = null, @Null = false, @RealLoc = true, @String = true]
|
||||
| +- ElseWhenBlock[@DefiningType = "ApexSwitchStatements", @RealLoc = false]
|
||||
| +- BlockStatement[@CurlyBrace = true, @DefiningType = "ApexSwitchStatements", @RealLoc = true]
|
||||
| +- ExpressionStatement[@DefiningType = "ApexSwitchStatements", @RealLoc = true]
|
||||
| +- MethodCallExpression[@DefiningType = "ApexSwitchStatements", @FullMethodName = "System.debug", @InputParametersSize = 1, @MethodName = "debug", @RealLoc = true]
|
||||
| +- ReferenceExpression[@DefiningType = "ApexSwitchStatements", @Image = "System", @RealLoc = true, @ReferenceType = ReferenceType.METHOD, @SObjectType = false, @SafeNav = false]
|
||||
| +- LiteralExpression[@Boolean = false, @Decimal = false, @DefiningType = "ApexSwitchStatements", @Double = false, @Image = "default", @Integer = false, @LiteralType = LiteralType.STRING, @Long = false, @Name = null, @Null = false, @RealLoc = true, @String = true]
|
||||
+- Method[@Arity = 1, @CanonicalName = "someInteger", @Constructor = false, @DefiningType = "ApexSwitchStatements", @Image = "someInteger", @RealLoc = true, @ReturnType = "int", @StaticInitializer = false]
|
||||
| +- ModifierNode[@Abstract = false, @DefiningType = "ApexSwitchStatements", @DeprecatedTestMethod = false, @Final = false, @Global = false, @InheritedSharing = false, @Modifiers = 2, @Override = false, @Private = true, @Protected = false, @Public = false, @RealLoc = true, @Static = false, @Test = false, @TestOrTestSetup = false, @Transient = false, @Virtual = false, @WebService = false, @WithSharing = false, @WithoutSharing = false]
|
||||
| +- Parameter[@DefiningType = "ApexSwitchStatements", @Image = "i", @RealLoc = true, @Type = "int"]
|
||||
| | +- ModifierNode[@Abstract = false, @DefiningType = "ApexSwitchStatements", @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]
|
||||
| +- BlockStatement[@CurlyBrace = true, @DefiningType = "ApexSwitchStatements", @RealLoc = true]
|
||||
| +- ReturnStatement[@DefiningType = "ApexSwitchStatements", @RealLoc = true]
|
||||
| +- BinaryExpression[@DefiningType = "ApexSwitchStatements", @Op = BinaryOperator.ADDITION, @RealLoc = true]
|
||||
| +- VariableExpression[@DefiningType = "ApexSwitchStatements", @Image = "i", @RealLoc = true]
|
||||
| | +- EmptyReferenceExpression[@DefiningType = null, @RealLoc = false]
|
||||
| +- LiteralExpression[@Boolean = false, @Decimal = false, @DefiningType = "ApexSwitchStatements", @Double = false, @Image = "1", @Integer = true, @LiteralType = LiteralType.INTEGER, @Long = false, @Name = null, @Null = false, @RealLoc = true, @String = false]
|
||||
+- Method[@Arity = 0, @CanonicalName = "example3", @Constructor = false, @DefiningType = "ApexSwitchStatements", @Image = "example3", @RealLoc = true, @ReturnType = "void", @StaticInitializer = false]
|
||||
| +- ModifierNode[@Abstract = false, @DefiningType = "ApexSwitchStatements", @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]
|
||||
| +- BlockStatement[@CurlyBrace = true, @DefiningType = "ApexSwitchStatements", @RealLoc = true]
|
||||
| +- SwitchStatement[@DefiningType = "ApexSwitchStatements", @RealLoc = true]
|
||||
| +- VariableExpression[@DefiningType = "ApexSwitchStatements", @Image = "sobject", @RealLoc = true]
|
||||
| | +- EmptyReferenceExpression[@DefiningType = null, @RealLoc = false]
|
||||
| +- TypeWhenBlock[@DefiningType = "ApexSwitchStatements", @Name = "a", @RealLoc = false, @Type = "Account"]
|
||||
| | +- VariableDeclarationStatements[@DefiningType = "ApexSwitchStatements", @RealLoc = true]
|
||||
| | | +- ModifierNode[@Abstract = false, @DefiningType = "ApexSwitchStatements", @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 = "ApexSwitchStatements", @Image = "a", @RealLoc = true, @Type = "Account"]
|
||||
| | | +- VariableExpression[@DefiningType = "ApexSwitchStatements", @Image = "a", @RealLoc = true]
|
||||
| | | +- EmptyReferenceExpression[@DefiningType = null, @RealLoc = false]
|
||||
| | +- BlockStatement[@CurlyBrace = true, @DefiningType = "ApexSwitchStatements", @RealLoc = true]
|
||||
| | +- ExpressionStatement[@DefiningType = "ApexSwitchStatements", @RealLoc = true]
|
||||
| | +- MethodCallExpression[@DefiningType = "ApexSwitchStatements", @FullMethodName = "System.debug", @InputParametersSize = 1, @MethodName = "debug", @RealLoc = true]
|
||||
| | +- ReferenceExpression[@DefiningType = "ApexSwitchStatements", @Image = "System", @RealLoc = true, @ReferenceType = ReferenceType.METHOD, @SObjectType = false, @SafeNav = false]
|
||||
| | +- BinaryExpression[@DefiningType = "ApexSwitchStatements", @Op = BinaryOperator.ADDITION, @RealLoc = true]
|
||||
| | +- LiteralExpression[@Boolean = false, @Decimal = false, @DefiningType = "ApexSwitchStatements", @Double = false, @Image = "account ", @Integer = false, @LiteralType = LiteralType.STRING, @Long = false, @Name = null, @Null = false, @RealLoc = true, @String = true]
|
||||
| | +- VariableExpression[@DefiningType = "ApexSwitchStatements", @Image = "a", @RealLoc = true]
|
||||
| | +- EmptyReferenceExpression[@DefiningType = null, @RealLoc = false]
|
||||
| +- TypeWhenBlock[@DefiningType = "ApexSwitchStatements", @Name = "c", @RealLoc = false, @Type = "Contact"]
|
||||
| | +- VariableDeclarationStatements[@DefiningType = "ApexSwitchStatements", @RealLoc = true]
|
||||
| | | +- ModifierNode[@Abstract = false, @DefiningType = "ApexSwitchStatements", @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 = "ApexSwitchStatements", @Image = "c", @RealLoc = true, @Type = "Contact"]
|
||||
| | | +- VariableExpression[@DefiningType = "ApexSwitchStatements", @Image = "c", @RealLoc = true]
|
||||
| | | +- EmptyReferenceExpression[@DefiningType = null, @RealLoc = false]
|
||||
| | +- BlockStatement[@CurlyBrace = true, @DefiningType = "ApexSwitchStatements", @RealLoc = true]
|
||||
| | +- ExpressionStatement[@DefiningType = "ApexSwitchStatements", @RealLoc = true]
|
||||
| | +- MethodCallExpression[@DefiningType = "ApexSwitchStatements", @FullMethodName = "System.debug", @InputParametersSize = 1, @MethodName = "debug", @RealLoc = true]
|
||||
| | +- ReferenceExpression[@DefiningType = "ApexSwitchStatements", @Image = "System", @RealLoc = true, @ReferenceType = ReferenceType.METHOD, @SObjectType = false, @SafeNav = false]
|
||||
| | +- BinaryExpression[@DefiningType = "ApexSwitchStatements", @Op = BinaryOperator.ADDITION, @RealLoc = true]
|
||||
| | +- LiteralExpression[@Boolean = false, @Decimal = false, @DefiningType = "ApexSwitchStatements", @Double = false, @Image = "contact ", @Integer = false, @LiteralType = LiteralType.STRING, @Long = false, @Name = null, @Null = false, @RealLoc = true, @String = true]
|
||||
| | +- VariableExpression[@DefiningType = "ApexSwitchStatements", @Image = "c", @RealLoc = true]
|
||||
| | +- EmptyReferenceExpression[@DefiningType = null, @RealLoc = false]
|
||||
| +- ValueWhenBlock[@DefiningType = "ApexSwitchStatements", @RealLoc = false]
|
||||
| | +- LiteralCase[@DefiningType = "ApexSwitchStatements", @RealLoc = true]
|
||||
| | | +- LiteralExpression[@Boolean = false, @Decimal = false, @DefiningType = "ApexSwitchStatements", @Double = false, @Image = "", @Integer = false, @LiteralType = LiteralType.NULL, @Long = false, @Name = null, @Null = true, @RealLoc = true, @String = false]
|
||||
| | +- BlockStatement[@CurlyBrace = true, @DefiningType = "ApexSwitchStatements", @RealLoc = true]
|
||||
| | +- ExpressionStatement[@DefiningType = "ApexSwitchStatements", @RealLoc = true]
|
||||
| | +- MethodCallExpression[@DefiningType = "ApexSwitchStatements", @FullMethodName = "System.debug", @InputParametersSize = 1, @MethodName = "debug", @RealLoc = true]
|
||||
| | +- ReferenceExpression[@DefiningType = "ApexSwitchStatements", @Image = "System", @RealLoc = true, @ReferenceType = ReferenceType.METHOD, @SObjectType = false, @SafeNav = false]
|
||||
| | +- LiteralExpression[@Boolean = false, @Decimal = false, @DefiningType = "ApexSwitchStatements", @Double = false, @Image = "null", @Integer = false, @LiteralType = LiteralType.STRING, @Long = false, @Name = null, @Null = false, @RealLoc = true, @String = true]
|
||||
| +- ElseWhenBlock[@DefiningType = "ApexSwitchStatements", @RealLoc = false]
|
||||
| +- BlockStatement[@CurlyBrace = true, @DefiningType = "ApexSwitchStatements", @RealLoc = true]
|
||||
| +- ExpressionStatement[@DefiningType = "ApexSwitchStatements", @RealLoc = true]
|
||||
| +- MethodCallExpression[@DefiningType = "ApexSwitchStatements", @FullMethodName = "System.debug", @InputParametersSize = 1, @MethodName = "debug", @RealLoc = true]
|
||||
| +- ReferenceExpression[@DefiningType = "ApexSwitchStatements", @Image = "System", @RealLoc = true, @ReferenceType = ReferenceType.METHOD, @SObjectType = false, @SafeNav = false]
|
||||
| +- LiteralExpression[@Boolean = false, @Decimal = false, @DefiningType = "ApexSwitchStatements", @Double = false, @Image = "default", @Integer = false, @LiteralType = LiteralType.STRING, @Long = false, @Name = null, @Null = false, @RealLoc = true, @String = true]
|
||||
+- Method[@Arity = 0, @CanonicalName = "example4", @Constructor = false, @DefiningType = "ApexSwitchStatements", @Image = "example4", @RealLoc = true, @ReturnType = "void", @StaticInitializer = false]
|
||||
+- ModifierNode[@Abstract = false, @DefiningType = "ApexSwitchStatements", @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]
|
||||
+- BlockStatement[@CurlyBrace = true, @DefiningType = "ApexSwitchStatements", @RealLoc = true]
|
||||
+- SwitchStatement[@DefiningType = "ApexSwitchStatements", @RealLoc = true]
|
||||
+- VariableExpression[@DefiningType = "ApexSwitchStatements", @Image = "season", @RealLoc = true]
|
||||
| +- EmptyReferenceExpression[@DefiningType = null, @RealLoc = false]
|
||||
+- ValueWhenBlock[@DefiningType = "ApexSwitchStatements", @RealLoc = false]
|
||||
| +- IdentifierCase[@DefiningType = "ApexSwitchStatements", @RealLoc = true]
|
||||
| +- BlockStatement[@CurlyBrace = true, @DefiningType = "ApexSwitchStatements", @RealLoc = true]
|
||||
| +- ExpressionStatement[@DefiningType = "ApexSwitchStatements", @RealLoc = true]
|
||||
| +- MethodCallExpression[@DefiningType = "ApexSwitchStatements", @FullMethodName = "System.debug", @InputParametersSize = 1, @MethodName = "debug", @RealLoc = true]
|
||||
| +- ReferenceExpression[@DefiningType = "ApexSwitchStatements", @Image = "System", @RealLoc = true, @ReferenceType = ReferenceType.METHOD, @SObjectType = false, @SafeNav = false]
|
||||
| +- LiteralExpression[@Boolean = false, @Decimal = false, @DefiningType = "ApexSwitchStatements", @Double = false, @Image = "boots", @Integer = false, @LiteralType = LiteralType.STRING, @Long = false, @Name = null, @Null = false, @RealLoc = true, @String = true]
|
||||
+- ValueWhenBlock[@DefiningType = "ApexSwitchStatements", @RealLoc = false]
|
||||
| +- IdentifierCase[@DefiningType = "ApexSwitchStatements", @RealLoc = true]
|
||||
| +- IdentifierCase[@DefiningType = "ApexSwitchStatements", @RealLoc = true]
|
||||
| +- BlockStatement[@CurlyBrace = true, @DefiningType = "ApexSwitchStatements", @RealLoc = true]
|
||||
| +- ExpressionStatement[@DefiningType = "ApexSwitchStatements", @RealLoc = true]
|
||||
| +- MethodCallExpression[@DefiningType = "ApexSwitchStatements", @FullMethodName = "System.debug", @InputParametersSize = 1, @MethodName = "debug", @RealLoc = true]
|
||||
| +- ReferenceExpression[@DefiningType = "ApexSwitchStatements", @Image = "System", @RealLoc = true, @ReferenceType = ReferenceType.METHOD, @SObjectType = false, @SafeNav = false]
|
||||
| +- LiteralExpression[@Boolean = false, @Decimal = false, @DefiningType = "ApexSwitchStatements", @Double = false, @Image = "sandals", @Integer = false, @LiteralType = LiteralType.STRING, @Long = false, @Name = null, @Null = false, @RealLoc = true, @String = true]
|
||||
+- ElseWhenBlock[@DefiningType = "ApexSwitchStatements", @RealLoc = false]
|
||||
+- BlockStatement[@CurlyBrace = true, @DefiningType = "ApexSwitchStatements", @RealLoc = true]
|
||||
+- ExpressionStatement[@DefiningType = "ApexSwitchStatements", @RealLoc = true]
|
||||
+- MethodCallExpression[@DefiningType = "ApexSwitchStatements", @FullMethodName = "System.debug", @InputParametersSize = 1, @MethodName = "debug", @RealLoc = true]
|
||||
+- ReferenceExpression[@DefiningType = "ApexSwitchStatements", @Image = "System", @RealLoc = true, @ReferenceType = ReferenceType.METHOD, @SObjectType = false, @SafeNav = false]
|
||||
+- LiteralExpression[@Boolean = false, @Decimal = false, @DefiningType = "ApexSwitchStatements", @Double = false, @Image = "none of the above", @Integer = false, @LiteralType = LiteralType.STRING, @Long = false, @Name = null, @Null = false, @RealLoc = true, @String = true]
|
Loading…
x
Reference in New Issue
Block a user