framework.src.org.checkerframework.framework.test.CompilationResult Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of checker Show documentation
Show all versions of checker Show documentation
The Checker Framework enhances Java’s type system to
make it more powerful and useful. This lets software developers
detect and prevent errors in their Java programs.
The Checker Framework includes compiler plug-ins ("checkers")
that find bugs or verify their absence. It also permits you to
write your own compiler plug-ins.
package org.checkerframework.framework.test;
import java.util.Collections;
import java.util.List;
import javax.tools.Diagnostic;
import javax.tools.JavaFileObject;
/**
* CompilationResult represents the output of the compiler after it is run.
*/
public class CompilationResult {
private final boolean compiledWithoutError;
private final String javacOutput;
private final Iterable javaFileObjects;
private final List> diagnostics;
CompilationResult(boolean compiledWithoutError, String javacOutput,
Iterable javaFileObjects,
List> diagnostics) {
this.compiledWithoutError = compiledWithoutError;
this.javacOutput = javacOutput;
this.javaFileObjects = javaFileObjects;
this.diagnostics = Collections.unmodifiableList(diagnostics);
}
/**
* @return whether or not compilation succeeded without errors or exceptions
*/
public boolean compiledWithoutError() {
return compiledWithoutError;
}
/**
* @return all of the output from the compiler
*/
public String getJavacOutput() {
return javacOutput;
}
/**
* @return the list of Java files passed to the compiler
*/
public Iterable getJavaFileObjects() {
return javaFileObjects;
}
/**
* @return the diagnostics reported by the compiler
*/
public List> getDiagnostics() {
return diagnostics;
}
}