forked from phoedos/pmd
This commit is contained in:
@@ -30,6 +30,9 @@ public class GuardedAndParenthesizedPatterns {
|
||||
System.out.println(when);
|
||||
}
|
||||
|
||||
// verify that "when" can still be used as a type name
|
||||
private static class when {}
|
||||
|
||||
static void testWithNull(Object o) {
|
||||
switch (o) {
|
||||
case String s when (s.length() == 1) -> System.out.println("single char string");
|
||||
|
@@ -210,6 +210,9 @@
|
||||
| +- PrimaryExpression[]
|
||||
| +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false]
|
||||
| +- Name[@Image = "when"]
|
||||
+- ClassOrInterfaceBodyDeclaration[@AnonymousInnerClass = false, @EnumChild = false, @Kind = DeclarationKind.CLASS]
|
||||
| +- ClassOrInterfaceDeclaration[@Abstract = false, @BinaryName = "GuardedAndParenthesizedPatterns$when", @Default = false, @Final = false, @Image = "when", @Interface = false, @Local = false, @Modifiers = 20, @Native = false, @Nested = true, @NonSealed = false, @PackagePrivate = false, @Private = true, @Protected = false, @Public = false, @Sealed = false, @SimpleName = "when", @Static = true, @Strictfp = false, @Synchronized = false, @Transient = false, @TypeKind = TypeKind.CLASS, @Volatile = false]
|
||||
| +- ClassOrInterfaceBody[@AnonymousInnerClass = false, @EnumChild = false]
|
||||
+- ClassOrInterfaceBodyDeclaration[@AnonymousInnerClass = false, @EnumChild = false, @Kind = DeclarationKind.METHOD]
|
||||
| +- MethodDeclaration[@Abstract = false, @Arity = 1, @Default = false, @Final = false, @InterfaceMember = false, @Kind = MethodLikeKind.METHOD, @MethodName = "testWithNull", @Modifiers = 16, @Name = "testWithNull", @Native = false, @PackagePrivate = true, @Private = false, @Protected = false, @Public = false, @Static = true, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyPublic = false, @Transient = false, @Void = true, @Volatile = false]
|
||||
| +- ResultType[@Void = true, @returnsArray = false]
|
||||
|
Reference in New Issue
Block a user