Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Display warning and outputs Failures #262

Open
wants to merge 12 commits into
base: master
Choose a base branch
from
6 changes: 5 additions & 1 deletion src/checkers/inference/InferenceMain.java
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,8 @@ private void startCheckerFramework() {
"-Xmaxwarns", "1000",
"-Xmaxerrs", "1000",
"-XDignore.symbol.file",
"-Awarns"));
"-source", "8",
"-target", "8"));

if (SystemUtil.jreVersion == 8) {
checkerFrameworkArgs.addAll(Arrays.asList("-source", "8", "-target", "8"));
Expand Down Expand Up @@ -484,6 +485,9 @@ public void handleCompilerResult(boolean success, String javacOutStr) {
logger.severe("Error return code from javac! Quitting.");
logger.info(javacOutStr);
System.exit(1);
} else if (!javacOutStr.isEmpty()) {
logger.severe("Warning output from javac.");
logger.info(javacOutStr);
}
}
}
Expand Down
6 changes: 4 additions & 2 deletions src/checkers/inference/VariableAnnotator.java
Original file line number Diff line number Diff line change
Expand Up @@ -504,6 +504,10 @@ private Slot addPrimaryVariable(AnnotatedTypeMirror atm, final Tree tree) {
if ((variable instanceof VariableSlot) && ((VariableSlot) variable).getLocation() == null) {
((VariableSlot) variable).setLocation(treeToLocation(tree));
}
if (variable instanceof ConstantSlot) {
atm.removeAnnotation(((ConstantSlot) variable).getValue());
}
atm.replaceAnnotation(slotManager.getAnnotation(variable));
} else {
AnnotationLocation location = treeToLocation(tree);
variable = replaceOrCreateEquivalentVarAnno(atm, tree, location);
Expand All @@ -521,10 +525,8 @@ private Slot addPrimaryVariable(AnnotatedTypeMirror atm, final Tree tree) {

treeToVarAnnoPair.put(tree, varATMPair);
}

atm.removeAnnotationInHierarchy(realTop);
atm.replaceAnnotation(slotManager.getAnnotation(variable));

return variable;
}

Expand Down
Loading