typetools / checker-framework-inference

Inference of pluggable types for Java
10 stars 33 forks source link

Fix inference script and add a sanity check. #72

Closed smillst closed 6 years ago

smillst commented 6 years ago

Without these changes,

 ./scripts/inference --mode TYPECHECK --checker ostrusted.OsTrustedChecker --solver checkers.inference.solver.PropagationSolver testdata/ostrusted/VarArgs.java

Issued the following errors:

Exception in thread "main" java.lang.RuntimeException: The following files could not be located: /Users/smillst/jsr308/checker-framework-inference/dist/checker-qual.jar
    at org.checkerframework.framework.util.CheckerMain.assertFilesExist(CheckerMain.java:615)
    at org.checkerframework.framework.util.CheckerMain.assertValidState(CheckerMain.java:124)
    at org.checkerframework.framework.util.CheckerMain.<init>(CheckerMain.java:120)
    at checkers.inference.InferenceLauncher.typecheck(InferenceLauncher.java:129)
    at checkers.inference.InferenceLauncher.launch(InferenceLauncher.java:67)
    at checkers.inference.InferenceLauncher.main(InferenceLauncher.java:105)

Then after coping checker-qual.jar to the correct location:

testdata/ostrusted/VarArgs.java:6: error: package ostrusted.qual does not exist
import ostrusted.qual.*;
^
testdata/ostrusted/VarArgs.java:40: error: cannot find symbol
    void test5(List<@OsTrusted String>... args) {
                     ^
  symbol:   class OsTrusted
  location: class TestVarArgs<E>
  where E is a type-variable:
    E extends Object declared in class TestVarArgs
testdata/ostrusted/VarArgs.java:18: error: cannot find symbol
    void test0(@OsTrusted String[]... args) {
                ^
  symbol:   class OsTrusted
  location: class TestVarArgs<E>
  where E is a type-variable:
    E extends Object declared in class TestVarArgs
3 errors
wmdietl commented 6 years ago

Sorry for not getting to this sooner. After #71 this has some merge issues.

wmdietl commented 6 years ago

Thanks for the fixes!