/** * Constructor. * * @param type * the bug type * @param priority * the bug priority */ public BugInstance(String type, int priority) { this.type = type.intern(); this.priority = priority; lastVersion = -1; annotationList = new ArrayList<>(4); cachedHashCode = INVALID_HASH_CODE; BugPattern p = DetectorFactoryCollection.instance().lookupBugPattern(type); if (p == null) { if ( missingBugTypes.add(type)) { String msg = "Can't find definition of bug type " + type; AnalysisContext.logError(msg, new NoSuchBugPattern(type)); } } else { this.priority += p.getPriorityAdjustment(); } if (adjustExperimental && isExperimental()) { this.priority = Priorities.EXP_PRIORITY; } boundPriority(); }
/** * Constructor. * * @param type * the bug type * @param priority * the bug priority */ public BugInstance(String type, int priority) { this.type = type.intern(); this.priority = priority; lastVersion = -1; xmlProps = new AtomicReference<XmlProps>(); annotationList = new ArrayList<BugAnnotation>(4); cachedHashCode = INVALID_HASH_CODE; BugPattern p = DetectorFactoryCollection.instance().lookupBugPattern(type); if (p == null) { if ( missingBugTypes.add(type)) { String msg = "Can't find definition of bug type " + type; AnalysisContext.logError(msg, new NoSuchBugPattern(type)); } } else { this.priority += p.getPriorityAdjustment(); } if (adjustExperimental && isExperimental()) { this.priority = Priorities.EXP_PRIORITY; } boundPriority(); }