Allow nested private methods
This commit is contained in:
@ -1359,11 +1359,11 @@ void TypeDeclaration():
|
||||
|
||||
void ClassOrInterfaceDeclaration(int modifiers):
|
||||
{
|
||||
Token t = null;
|
||||
jjtThis.setModifiers(modifiers);
|
||||
Token t = null;
|
||||
jjtThis.setModifiers(modifiers);
|
||||
inInterface = false;
|
||||
}
|
||||
{
|
||||
|
||||
( /* See note about this optional final modifier in BlockStatement */
|
||||
["final"|"abstract"] "class" | "interface" { jjtThis.setInterface(); inInterface = true; } )
|
||||
t=<IDENTIFIER> { jjtThis.setImage(t.image); }
|
||||
|
@ -218,6 +218,11 @@ public class JDKVersionTest {
|
||||
parseJava18("public class Foo { private void bar() { } }");
|
||||
}
|
||||
|
||||
@Test
|
||||
public final void testNestedPrivateMethods() {
|
||||
parseJava18("public interface Baz { public static class Foo { private void bar() { } } }");
|
||||
}
|
||||
|
||||
@Test
|
||||
public final void jdk9PrivateInterfaceMethods() {
|
||||
parseJava9(loadSource("jdk9_private_interface_methods.java"));
|
||||
|
Reference in New Issue
Block a user