当前位置: 首页>>代码示例>>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;未经允许,请勿转载。