You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When running insert-annotations-to-source, if a class file corresponding to a
.java file cannot be found, the following warning is issued:
Warning: IndexFileSpecification did not find classfile for: mypackage.MyClass
This warning is harmless if you are only inserting annotations on signatures.
The tool should only issue the warning when it is really a problem, not every
time that a class cannot be found.
Original issue reported on code.google.com by [email protected] on 16 Apr 2013 at 6:06
The text was updated successfully, but these errors were encountered:
Failing to find class files can currently cause incorrect insertions. This
example has a class on one java file reference a static nested class from
another java file.
TestStatic.java:
class TestStatic {
void test() {
Other.MyClass myLocal = new Other.MyClass();
}
}
TestOther.java:
class Other {
static class MyClass { }
}
insert-annotations-to-source -v -d ./output ./output/inference.jaif
/Users/mcarthur/dev/dff_2/verigames/java/dist/scripts/TestStatic.java
/Users/mcarthur/dev/dff_2/verigames/java/dist/scripts/TestOther.java
Using classpath: /Users/mcarthur/dev/dff_2/verigames/java/dist
Warning: IndexFileSpecification did not find classfile for: Other
Warning: IndexFileSpecification did not find classfile for: TestStatic
Warning: IndexFileSpecification did not find classfile for: Other$MyClass
Read 9 annotations from ./output/inference.jaif
Processing /Users/mcarthur/dev/dff_2/verigames/java/dist/scripts/TestStatic.java
Parsed /Users/mcarthur/dev/dff_2/verigames/java/dist/scripts/TestStatic.java
Found class TestStatic, but unable to insert @ostrusted.quals.OsUntrusted:
@ostrusted.quals.OsUntrusted (nl=true) @ [GenericArrayLocationCriterion at outermost type, ExtImplsLocationCriterion: class TestStatic at type index: -1, In class 'TestStatic' (exactly), In class 'TestStatic' (exactly)]
getPositions returned 3 positions in tree for
/Users/mcarthur/dev/dff_2/verigames/java/dist/scripts/TestStatic.java
...
Writing ./output/TestStatic.java
Processing /Users/mcarthur/dev/dff_2/verigames/java/dist/scripts/TestOther.java
Parsed /Users/mcarthur/dev/dff_2/verigames/java/dist/scripts/TestOther.java
Found class Other, but unable to insert @ostrusted.quals.OsUntrusted:
@ostrusted.quals.OsUntrusted (nl=true) @ [GenericArrayLocationCriterion at outermost type, ExtImplsLocationCriterion: class Other at type index: -1, In class 'Other' (exactly), In class 'Other' (exactly)]
getPositions returned 0 positions in tree for
/Users/mcarthur/dev/dff_2/verigames/java/dist/scripts/TestOther.java
Writing ./output/TestOther.java
output/TestStatic.java:
import ostrusted.quals.OsUntrusted;
class TestStatic {
void test(@OsUntrusted TestStatic this) {
@OsUntrusted
Other.MyClass myLocal = new @OsUntrusted Other.MyClass();
}
}
We could make the warning's more prominent and also state that this might cause
incorrect insertions, or warn only when we encounter an insertion that can't be
performed correctly without the class files. (Or change insertions on static
nested classes to not need the class files, but I don't know if that is
possible or that it is the only case that requires class files).
-David
Original issue reported on code.google.com by
[email protected]
on 16 Apr 2013 at 6:06The text was updated successfully, but these errors were encountered: