當前位置: 首頁>>代碼示例>>Java>>正文


Java EnumValue類代碼示例

本文整理匯總了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);
            }
        }
    }
}
 
開發者ID:ytus,項目名稱:findbugs-all-the-bugs,代碼行數:45,代碼來源:CheckExpectedWarnings.java

示例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);
            }
        }
    }
}
 
開發者ID:OpenNTF,項目名稱:FindBug-for-Domino-Designer,代碼行數:45,代碼來源:CheckExpectedWarnings.java


注:本文中的edu.umd.cs.findbugs.classfile.analysis.EnumValue類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。