本文整理汇总了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);
}
}
}
}