checker.src.org.checkerframework.checker.formatter.FormatterAnalysis 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.checker.formatter;
import java.util.List;
import javax.lang.model.element.VariableElement;
import org.checkerframework.common.basetype.BaseTypeChecker;
import org.checkerframework.framework.flow.CFAbstractAnalysis;
import org.checkerframework.framework.flow.CFStore;
import org.checkerframework.framework.flow.CFValue;
import org.checkerframework.framework.type.AnnotatedTypeMirror;
import org.checkerframework.javacutil.Pair;
/**
* Needed for flow analysis, to implement the {@link FormatUtil#asFormat} method.
*
* @author Konstantin Weitz
*/
public class FormatterAnalysis extends
CFAbstractAnalysis {
public FormatterAnalysis(BaseTypeChecker checker,
FormatterAnnotatedTypeFactory factory,
List> fieldValues) {
super(checker, factory, fieldValues);
}
@Override
public FormatterTransfer createTransferFunction() {
return new FormatterTransfer(this,(FormatterChecker)checker);
}
@Override
public CFStore createEmptyStore(boolean sequentialSemantics) {
return new CFStore(this, sequentialSemantics);
}
@Override
public CFStore createCopiedStore(CFStore s) {
return new CFStore(this, s);
}
@Override
public CFValue createAbstractValue(AnnotatedTypeMirror type) {
return defaultCreateAbstractValue(this, type);
}
}