本文整理汇总了Java中edu.umd.cs.findbugs.ba.NullnessAnnotationDatabase类的典型用法代码示例。如果您正苦于以下问题:Java NullnessAnnotationDatabase类的具体用法?Java NullnessAnnotationDatabase怎么用?Java NullnessAnnotationDatabase使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
NullnessAnnotationDatabase类属于edu.umd.cs.findbugs.ba包,在下文中一共展示了NullnessAnnotationDatabase类的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: parameterMustBeNonNull
import edu.umd.cs.findbugs.ba.NullnessAnnotationDatabase; //导入依赖的package包/类
public boolean parameterMustBeNonNull(XMethod m, int param) {
if (DEBUG) {
System.out.print("Checking " + m + " param " + param + " for @Nonnull...");
}
TypeQualifierAnnotation tqa = TypeQualifierApplications.getEffectiveTypeQualifierAnnotation(m, param,
nonnullTypeQualifierValue);
if (tqa == null && param == 0) {
String name = m.getName();
String signature = m.getSignature();
if (name.equals("main") && signature.equals("([Ljava/lang/String;)V") && m.isStatic() && m.isPublic())
return true;
else if (NullnessAnnotationDatabase.assertsFirstParameterIsNonnull(m))
return true;
else if (name.equals("compareTo") && signature.substring(signature.indexOf(";") + 1).equals(")Z") && !m.isStatic())
return true;
}
boolean answer = (tqa != null) && tqa.when == When.ALWAYS;
if (DEBUG) {
System.out.println(answer ? "yes" : "no");
}
return answer;
}
示例2: TrainNonNullAnnotations
import edu.umd.cs.findbugs.ba.NullnessAnnotationDatabase; //导入依赖的package包/类
public TrainNonNullAnnotations(BugReporter bugReporter) {
super(
AnalysisContext.currentAnalysisContext().getNullnessAnnotationDatabase() instanceof NullnessAnnotationDatabase ? (NullnessAnnotationDatabase) AnalysisContext
.currentAnalysisContext().getNullnessAnnotationDatabase() : null);
}
示例3: NoteNonNullAnnotations
import edu.umd.cs.findbugs.ba.NullnessAnnotationDatabase; //导入依赖的package包/类
public NoteNonNullAnnotations(BugReporter bugReporter) {
super(
AnalysisContext.currentAnalysisContext().getNullnessAnnotationDatabase() instanceof NullnessAnnotationDatabase ? (NullnessAnnotationDatabase) AnalysisContext
.currentAnalysisContext().getNullnessAnnotationDatabase() : null);
}
示例4: BuildNonNullAnnotationDatabase
import edu.umd.cs.findbugs.ba.NullnessAnnotationDatabase; //导入依赖的package包/类
public BuildNonNullAnnotationDatabase(@CheckForNull NullnessAnnotationDatabase database) {
this.database = database;
}
示例5: getDatabase
import edu.umd.cs.findbugs.ba.NullnessAnnotationDatabase; //导入依赖的package包/类
/**
* @return
*/
private static NullnessAnnotationDatabase getDatabase() {
return null;
}