If a source file contains a class with type parameters, e.g.
package de.codemanyak;
public class Tuple<X, Y> {
public final X variable;
public final Y position;
public Tuple(X x, Y y) {
this.variable = x;
this.position = y;
}
@Override
public String toString() {
return "Tuple{" +
"variable=" + variable +
", position=" + position +
'}';
}
}
then the parser fails after the first type parameter (if this doesn't bear an extends clause):
error.syntax in file "D:\Structorizer\tests\Issue1150_Java_import\Tuple.java"
Preceding source context:
1: package de.codemanyak;
2:
3: public class Tuple<X» , Y> {
Found token ','
Expected: extends
The reason is a missing (empty) grammar rule for the linguistic variable <TypeBoundOpt>.
If a source file contains a class with type parameters, e.g.
then the parser fails after the first type parameter (if this doesn't bear an
extends
clause):The reason is a missing (empty) grammar rule for the linguistic variable
<TypeBoundOpt>
.