The proper style for a type annotation is to write it immediately before the type that it annotates. For example, this is wrong:
@Interned
String m1() {
return "foo bar";
}
and this is correct:
@Interned String m1() {
return "foo bar";
}
However, the insert-annotations-to-source program produces the former rather than the latter.
The same thing goes for fields: the annotation should be on the same line as the type, not above the type and indented.
I have attached files that reproduce the problem and that show the desired output. Run the following commands:
javac MethodReturnTest3.java
insert-annotations-to-source MethodReturnTest3.jaif MethodReturnTest3.java
type-annotation-formatting.zip