-
Notifications
You must be signed in to change notification settings - Fork 5
Open
Description
Annotation-tools cannot insert annotation to array variable with initializer, when the enclosing class is not the first in the file.
Java source:
class MyA {
}
class List{
List() {
Object[] t = new Object[10];
}
}
Minimized JAIF:
package qual:
annotation @Immutable:
package :
class List:
method <init>()V:
insert-annotation Method.body, Block.statement 0, Variable.type, ArrayType.type: @qual.Immutable
insert-annotation Method.body, Block.statement 0, Variable.initializer, NewArray.type 0: @qual.Immutable
insert-annotation Method.body, Block.statement 0, Variable.type: @qual.Immutable
The output does not contain any annotation after running insert-annotations-to-source, with a warning:
Warning: IndexFileSpecification did not find classfile for: List
Expected output:
class MyA {
}
class List{
List() {
@Immutable Object @Immutable [] t = new @Immutable Object[10];
}
}
Metadata
Metadata
Assignees
Labels
No labels