本文整理匯總了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;
}