- edited description
SafeVarargs annotation on private methods in java 8
ExtendJ 8.0.1-189-g6a0d36d JavaSE 8
The SafeVarargs annotation should not be allowed on non-final, non-static methods in java 8.
The following code will compile in ExtendJ but not in javac:
@SafeVarargs
private void m(String... strings) {
}
Comments (3)
-
reporter -
The attributes for checking the SafeVarargs annotation were okay, but the
isFinal
attribute did not behave as expected/intended. See issue#210.Fixing the isFinal issue also fixes this issue.
-
- changed status to resolved
MethodDecl.isFinal() only tests for final modifier
The isFinal attribute on MethodDecl was too smart. It was used in situations where only the final modifier should have effect, allowing private methods (and non-final methods in final classes) to act as if declared with the final keyword.
This change affects generated bytecode: the ACC_FINAL flag is now only generated if a method is declared with the final modifier.
→ <<cset 38bf0d5aabc6>>
- Log in to comment