Skip to content

Commit a680f6f

Browse files
committed
Analyze All Packages In Directory
1 parent 9c87c4b commit a680f6f

File tree

2 files changed

+13
-9
lines changed

2 files changed

+13
-9
lines changed

liquidjava-verifier/src/main/java/liquidjava/api/CommandLineLauncher.java

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -53,12 +53,10 @@ public static ErrorEmitter launch(String file) {
5353
processingManager.addProcessor(processor);
5454

5555
try {
56-
// To only search the last package - less time spent
57-
CtPackage v = factory.Package().getAll().stream().reduce((first, second) -> second).orElse(null);
58-
if (v != null)
59-
processingManager.process(v);
60-
// To search all previous packages
61-
// processingManager.process(factory.Package().getRootPackage());
56+
// analyze all packages
57+
CtPackage root = factory.Package().getRootPackage();
58+
if (root != null)
59+
processingManager.process(root);
6260
} catch (Exception e) {
6361
e.printStackTrace();
6462
throw e;

liquidjava-verifier/src/main/java/liquidjava/processor/refinement_checker/object_checkers/AuxStateHandler.java

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -528,9 +528,15 @@ private static String addInstanceWithState(TypeChecker tc, String superName, Str
528528
prevInstance.getRefinement(), invocation);
529529
// vi2.setState(transitionedState);
530530
vi2.setRefinement(transitionedState);
531-
RefinedVariable rv = tc.getContext().getVariableByName(superName);
532-
for (CtTypeReference<?> t : rv.getSuperTypes()) {
533-
vi2.addSuperType(t);
531+
RefinedVariable rv = superName != null ? tc.getContext().getVariableByName(superName) : null;
532+
if (rv != null) {
533+
// propagate supertypes from the refined variable
534+
for (CtTypeReference<?> t : rv.getSuperTypes())
535+
vi2.addSuperType(t);
536+
} else {
537+
// propagate supertypes from the previous instance
538+
for (CtTypeReference<?> t : prevInstance.getSuperTypes())
539+
vi2.addSuperType(t);
534540
}
535541

536542
// if the variable is a parent (not a VariableInstance) we need to check that

0 commit comments

Comments
 (0)