本文整理匯總了Java中edu.umd.cs.findbugs.classfile.analysis.EnumValue類的典型用法代碼示例。如果您正苦於以下問題:Java EnumValue類的具體用法?Java EnumValue怎麽用?Java EnumValue使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
EnumValue類屬於edu.umd.cs.findbugs.classfile.analysis包,在下文中一共展示了EnumValue類的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: check
import edu.umd.cs.findbugs.classfile.analysis.EnumValue; //導入依賴的package包/類
private void check(AnnotationValue expect, FieldOrMethodDescriptor descriptor,
Collection<BugInstance> warnings, boolean expectWarnings, int priority) {
if (expect != null) {
String expectedBugCodes = (String) expect.getValue("value");
EnumValue wantedConfidence = (EnumValue) expect.getValue("confidence");
EnumValue wantedPriority = (EnumValue) expect.getValue("priority");
Integer num = (Integer) expect.getValue("num");
if (num == null)
num = (expectWarnings ? 1 : 0);
Integer rank = (Integer) expect.getValue("rank");
if (rank == null)
rank = BugRanker.VISIBLE_RANK_MAX;
int minPriority = Confidence.LOW.getConfidenceValue();
if (wantedConfidence != null)
minPriority = Confidence.valueOf(wantedConfidence.value).getConfidenceValue();
else if (wantedPriority != null)
minPriority = Priority.valueOf(wantedPriority.value).getPriorityValue();
if (DEBUG) {
if (warnings == null)
System.out.println("Checking " + expectedBugCodes + " against no bugs");
else {
System.out.println("Checking " + expectedBugCodes + " against " + warnings.size() + " bugs");
for (BugInstance b : warnings) {
System.out.println(" " + b.getType());
}
}
}
if (expectedBugCodes == null || expectedBugCodes.trim().length() == 0) {
checkAnnotation(null, warnings, expectWarnings, priority, rank, num, descriptor, minPriority);
} else {
StringTokenizer tok = new StringTokenizer(expectedBugCodes, ",");
while (tok.hasMoreTokens()) {
String bugCode = tok.nextToken().trim();
if (!possibleBugCodes.contains(bugCode))
continue;
checkAnnotation(bugCode, warnings, expectWarnings, priority, rank, num, descriptor, minPriority);
}
}
}
}
示例2: check
import edu.umd.cs.findbugs.classfile.analysis.EnumValue; //導入依賴的package包/類
private void check(AnnotationValue expect, Object descriptor,
Collection<BugInstance> warnings, boolean expectWarnings, int priority, ClassDescriptor cd) {
if (expect != null) {
String expectedBugCodes = (String) expect.getValue("value");
EnumValue wantedConfidence = (EnumValue) expect.getValue("confidence");
EnumValue wantedPriority = (EnumValue) expect.getValue("priority");
Integer num = (Integer) expect.getValue("num");
if (num == null)
num = (expectWarnings ? 1 : 0);
Integer rank = (Integer) expect.getValue("rank");
if (rank == null)
rank = BugRanker.VISIBLE_RANK_MAX;
int minPriority = Confidence.LOW.getConfidenceValue();
if (wantedConfidence != null)
minPriority = Confidence.valueOf(wantedConfidence.value).getConfidenceValue();
else if (wantedPriority != null)
minPriority = Priority.valueOf(wantedPriority.value).getPriorityValue();
if (DEBUG) {
if (warnings == null)
System.out.println("Checking " + expectedBugCodes + " against no bugs");
else {
System.out.println("Checking " + expectedBugCodes + " against " + warnings.size() + " bugs");
for (BugInstance b : warnings) {
System.out.println(" " + b.getType());
}
}
}
if (expectedBugCodes == null || expectedBugCodes.trim().length() == 0) {
checkAnnotation(null, warnings, expectWarnings, priority, rank, num, descriptor, minPriority, cd);
} else {
StringTokenizer tok = new StringTokenizer(expectedBugCodes, ",");
while (tok.hasMoreTokens()) {
String bugCode = tok.nextToken().trim();
if (!possibleBugCodes.contains(bugCode))
continue;
checkAnnotation(bugCode, warnings, expectWarnings, priority, rank, num, descriptor, minPriority, cd);
}
}
}
}