Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
1.0-JSR-1
-
None
-
None
Description
Interfaces and abstract classes definitions require semi-colons at the end of each method signatures.
I think the grammar could dinstinguish that we're inside an interface definition, or that the current method is an abstract methods. Thus, the body of the method is not to be expected.
Let's see that with an example with an interface:
interface A {
void methodOne(String s); // here, the semi is required
Object transform(Object o)
}
And with a class with an asbtract method:
class B {
abstract void methodTwo(String s); // here, the semi is also required
String hello()
}
If we're in an an interface, Antlr shouldn't expect method bodies. And in a class, it shouldn't expect a method body if the method is declared abstract.