Internal-only. Has no effect if applied to a Description within a BugChecker.
189872
@CheckReturnValue
  public Description applySeverityOverride(SeverityLevel severity) {
    return new Description(position, checkName, rawMessage, linkUrl, fixes, severity);
  }
738591
private void checkForEmptyCellComments(XSSFSheetXMLHandlerPlus.EmptyCellCommentsCheckType type) {
        if (commentCellRefs != null && !commentCellRefs.isEmpty()) {
            // If we've reached the end of the sheet data, output any
            //  comments we haven't yet already handled
            if (type == XSSFSheetXMLHandlerPlus.EmptyCellCommentsCheckType.END_OF_SHEET_DATA) {
                while (!commentCellRefs.isEmpty()) {
                    outputEmptyCellComment(commentCellRefs.remove());
                }
                return;
            }

            // At the end of a row, handle any comments for "missing" rows before us
            if (this.cellRef == null) {
                if (type == XSSFSheetXMLHandlerPlus.EmptyCellCommentsCheckType.END_OF_ROW) {
                    while (!commentCellRefs.isEmpty()) {
                        if (commentCellRefs.peek().getRow() == rowNum) {
                            outputEmptyCellComment(commentCellRefs.remove());
                        } else {
                            return;
                        }
                    }
                    return;
                } else {
                    throw new IllegalStateException(
                        "Cell ref should be null only if there are only empty cells in the row; rowNum: " + rowNum);
                }
            }

            CellAddress nextCommentCellRef;
            do {
                CellAddress cellRef = new CellAddress(this.cellRef);
                CellAddress peekCellRef = commentCellRefs.peek();
                if (type == XSSFSheetXMLHandlerPlus.EmptyCellCommentsCheckType.CELL && cellRef.equals(peekCellRef)) {
                    // remove the comment cell ref from the list if we're about to handle it alongside the cell content
                    commentCellRefs.remove();
                    return;
                } else {
                    // fill in any gaps if there are empty cells with comment mixed in with non-empty cells
                    int comparison = peekCellRef.compareTo(cellRef);
                    if (comparison > 0 && type == XSSFSheetXMLHandlerPlus.EmptyCellCommentsCheckType.END_OF_ROW &&
                        peekCellRef.getRow() <= rowNum) {
                        nextCommentCellRef = commentCellRefs.remove();
                        outputEmptyCellComment(nextCommentCellRef);
                    } else if (comparison < 0 && type == XSSFSheetXMLHandlerPlus.EmptyCellCommentsCheckType.CELL &&
                        peekCellRef.getRow() <= rowNum) {
                        nextCommentCellRef = commentCellRefs.remove();
                        outputEmptyCellComment(nextCommentCellRef);
                    } else {
                        nextCommentCellRef = null;
                    }
                }
            } while (nextCommentCellRef != null && !commentCellRefs.isEmpty());
        }
    }
1289721
private void matchBugs(BugCollection origCollection, BugCollection newCollection) {
        matchBugs(SortedBugCollection.BugInstanceComparator.instance, origCollection, newCollection);

        mapFromNewToOldBug.clear();
        matchedOldBugs.clear();

        matchBugs(versionInsensitiveBugComparator, origCollection, newCollection);
        matchBugs(versionInsensitiveBugComparator, origCollection, newCollection, MatchOldBugs.IF_CLASS_NOT_SEEN_UNTIL_NOW);
        if (doMatchFixedBugs) {
            matchBugs(versionInsensitiveBugComparator, origCollection, newCollection, MatchOldBugs.ALWAYS);
        }

        if (!preciseMatch) {
            matchBugs(fuzzyBugPatternMatcher, origCollection, newCollection);
        }

        if (!noPackageMoves) {
            VersionInsensitiveBugComparator movedBugComparator = new VersionInsensitiveBugComparator();
            MovedClassMap movedClassMap = new MovedClassMap(origCollection, newCollection).execute();
            if (!movedClassMap.isEmpty()) {
                movedBugComparator.setClassNameRewriter(movedClassMap);
                movedBugComparator.setComparePriorities(precisePriorityMatch);
                matchBugs(movedBugComparator, origCollection, newCollection);
                if (!preciseMatch) {
                    movedBugComparator.setExactBugPatternMatch(false);
                    matchBugs(movedBugComparator, origCollection, newCollection);
                }
            }
            /*
            if (false) {
                System.out.println("Matched old bugs: " + matchedOldBugs.size());
            }
             */

        }
    }
322065
private function isDummyDescription(string $description, string $typeUselessPattern, string $type): bool
    {
        if (Strings::match($description, $typeUselessPattern)) {
            return true;
        }

        return (strlen($description) < (strlen($type) + 10)) && levenshtein($type, $description) < 3;
    }
240978
@Override
    public void removeProperty(Object description) {
        if (properties != null) {
            properties.remove(description);
            if (properties.isEmpty())
                properties = null;
        }
    }
936044
@Override
	public void typeCheck()
	{
		boolean nothing = true;
		boolean hasSystem = false;

		for (SClassDefinition c1 : classes)
		{
			c1.setType(assistantFactory.createSClassDefinitionAssistant().getType(c1));
			for (SClassDefinition c2 : classes)
			{
				if (c1 != c2 && c1.getName().equals(c2.getName()))
				{
					TypeChecker.report(3426, "Class " + c1.getName()
							+ " duplicates " + c2.getName(), c1.getName().getLocation());
				}
			}

			if (!c1.getTypeChecked())
			{
				nothing = false;
			}

			if (c1 instanceof ASystemClassDefinition)
			{
				if (hasSystem)
				{
					TypeChecker.report(3294, "Only one system class permitted", c1.getLocation());
				} else
				{
					hasSystem = true;
				}
			}
		}

		if (nothing)
		{
			return;
		}

		Environment allClasses = getAllClassesEnvronment();

		for (SClassDefinition c : classes)
		{
			if (!c.getTypeChecked())
			{
				assistantFactory.createSClassDefinitionAssistant().implicitDefinitions(c, allClasses);
			}
		}

		for (SClassDefinition c : classes)
		{
			if (!c.getTypeChecked())
			{
				try
				{
					Environment self = new PrivateClassEnvironment(assistantFactory, c, allClasses);
					assistantFactory.createSClassDefinitionAssistant().typeResolve(c, null, new TypeCheckInfo(assistantFactory, self));
				} catch (TypeCheckException te)
				{
					report(3427, te.getMessage(), te.location);
					
    				if (te.extras != null)
    				{
    					for (TypeCheckException e: te.extras)
    					{
    						report(3427, e.getMessage(), e.location);
    					}
    				}
				} catch (AnalysisException te)
				{
					report(3431, te.getMessage(), null);// FIXME: internal error
				}
			}
		}

		for (SClassDefinition c : classes)
		{
			if (!c.getTypeChecked())
			{
				assistantFactory.createSClassDefinitionAssistant().checkOver(c);
			}
		}

		QuestionAnswerAdaptor<TypeCheckInfo, PType> tc = getTypeCheckVisitor();
		for (Pass pass : Pass.values())
		{
			for (SClassDefinition c : classes)
			{
				if (!c.getTypeChecked())
				{
					try
					{
						Environment self = new PrivateClassEnvironment(assistantFactory, c, allClasses);
						assistantFactory.createSClassDefinitionAssistant().typeCheckPass(c, pass, self, tc);
					} catch (TypeCheckException te)
					{
						report(3428, te.getMessage(), te.location);
						
	    				if (te.extras != null)
	    				{
	    					for (TypeCheckException e: te.extras)
	    					{
	    						report(3428, e.getMessage(), e.location);
	    					}
	    				}
					} catch (AnalysisException te)
					{
						report(3431, te.getMessage(), null);// FIXME: internal error
					}
				}
			}
		}

		List<PDefinition> allDefs = new Vector<PDefinition>();

		for (SClassDefinition c : classes)
		{
			if (!c.getTypeChecked())
			{
				assistantFactory.createSClassDefinitionAssistant().initializedCheck(c);
				assistantFactory.createPDefinitionAssistant().unusedCheck(c);
				allDefs.addAll(c.getDefinitions());
			}
		}
    	
    	cyclicDependencyCheck(allDefs);
	}
450823
private void checkAnonymous(FieldDescriptorDef fieldDef, String checkLevel) throws ConstraintException
    {
        if (CHECKLEVEL_NONE.equals(checkLevel))
        {
            return;
        }

        String access = fieldDef.getProperty(PropertyHelper.OJB_PROPERTY_ACCESS);

        if (!"anonymous".equals(access))
        {
            throw new ConstraintException("The access property of the field "+fieldDef.getName()+" defined in class "+fieldDef.getOwner().getName()+" cannot be changed");
        }

        if ((fieldDef.getName() == null) || (fieldDef.getName().length() == 0))
        {
            throw new ConstraintException("An anonymous field defined in class "+fieldDef.getOwner().getName()+" has no name");
        }
    }
1027361
public boolean preValidateBugLinks(final ContentSpec contentSpec) {
        // If Bug Links are turned off then there isn't any need to validate them.
        if (!contentSpec.isInjectBugLinks()) {
            return true;
        }

        final BugLinkOptions bugOptions;
        final BugLinkType type;
        if (contentSpec.getBugLinks().equals(BugLinkType.JIRA)) {
            type = BugLinkType.JIRA;
            bugOptions = contentSpec.getJIRABugLinkOptions();
        } else {
            type = BugLinkType.BUGZILLA;
            bugOptions = contentSpec.getBugzillaBugLinkOptions();
        }
        final BaseBugLinkStrategy bugLinkStrategy = BugLinkStrategyFactory.getInstance().create(type, bugOptions.getBaseUrl());

        // Validate the content in the bug options using the appropriate bug link strategy
        try {
            bugLinkStrategy.checkValidValues(bugOptions);
        } catch (ValidationException e) {
            final Throwable cause = ExceptionUtilities.getRootCause(e);
            log.error(cause.getMessage());
            return false;
        }

        return true;
    }
595536
private boolean exclude(String identifier) {
    String excludeMatch = null;
    for (String rule = identifier; rule != null; rule = enclosing(rule)) {
      if (excludes.contains(rule)) {
        excludeMatch = rule;
      }
    }
    if (excludeMatch != null) {
      usedExcludes.add(excludeMatch);
      return true;
    }
    return false;
  }
354433
private void addBugCodes(Set<String> bugCodeSet) {
        Element root = document.getRootElement();
        for (String bugCode : bugCodeSet) {
            Element element = root.addElement("BugCode");
            element.addAttribute("abbrev", bugCode);
            Element description = element.addElement("Description");
            description.setText(I18N.instance().getBugTypeDescription(bugCode));
        }
    }
556755
public Boolean getStatelessChecker() {
        if(getDevelopment()) {
            return statelessChecker != null ? statelessChecker : true;
        } else {
            return statelessChecker != null ? statelessChecker : false;
        }
    }
1017536
private final void internalInfo(Object source,
                                    Class sourceClass,
                                    String methodName,
                                    String messageIdentifier,
                                    Object object) {
        if (usePrintWriterForTrace) {
            java.io.PrintWriter printWriter = traceFactory.getPrintWriter();
            if (printWriter != null) {
                StringBuffer stringBuffer = new StringBuffer(new java.util.Date().toString());

                stringBuffer.append(" I ");
                stringBuffer.append(sourceClass.getName());
                stringBuffer.append(".");
                stringBuffer.append(methodName);

                printWriter.println(stringBuffer.toString());
                printWriter.println("\t\t" + traceFactory.nls.format(messageIdentifier,
                                                                     object));
                printWriter.flush();
            }
        }

        if (object != null) {
            SibTr.info(traceComponent,
                       messageIdentifier,
                       object);
        } else {
            SibTr.info(traceComponent,
                       messageIdentifier);
        }
    }
626451
@Override
    public void visitCode(Code obj) {
        Method m = getMethod();

        if (m.isSynthetic()) {
            return;
        }

        String signature = m.getSignature();
        if (!signature.endsWith(")Ljava/lang/Object;")) {
            return;
        }
        stack.resetForMethodEntry(this);
        returnTypes.clear();
        super.visitCode(obj);
        if (returnTypes.size() <= 1) {
            return;
        }
        String methodName = m.getName();
        try {
            boolean isInherited = SignatureUtils.isInheritedMethod(currentClass, methodName, signature);

            int priority = NORMAL_PRIORITY;
            for (JavaClass cls : returnTypes.keySet()) {
                if ((cls != null) && Values.DOTTED_JAVA_LANG_OBJECT.equals(cls.getClassName())) {
                    priority = LOW_PRIORITY;
                    break;
                }
            }

            JavaClass cls = findCommonType(returnTypes.keySet());
            BugInstance bug;
            if (isInherited) {
                bug = new BugInstance(this, BugType.URV_INHERITED_METHOD_WITH_RELATED_TYPES.name(), priority).addClass(this).addMethod(this);
                if (cls != null) {
                    bug.addString(cls.getClassName());
                }
            } else if (cls == null) {
                bug = new BugInstance(this, BugType.URV_UNRELATED_RETURN_VALUES.name(), priority).addClass(this).addMethod(this);
            } else {
                bug = new BugInstance(this, BugType.URV_CHANGE_RETURN_TYPE.name(), priority).addClass(this).addMethod(this);
                bug.addString(cls.getClassName());
            }
            for (Integer pc : returnTypes.values()) {
                bug.addSourceLine(this, pc.intValue());
            }
            bugReporter.reportBug(bug);
        } catch (ClassNotFoundException cnfe) {
            bugReporter.reportMissingClass(cnfe);
        }
    }
386075
def post_bug(self, bug):
        ''''''
        assert type(bug) is DotDict
        assert 'product' in bug
        assert 'component' in bug
        assert 'summary' in bug
        if (not 'version' in bug): bug.version = 'other'
        if (not 'op_sys' in bug): bug.op_sys = 'All'
        if (not 'platform' in bug): bug.platform = 'All'

        return self._post('bug', json.dumps(bug))
303396
private static void printNonAffectedClasses(Set<String> allClasses, Set<String> affectedClasses,
            List<String> nonAffectedClasses, String mode) {
        if (mode != null && mode.equals(ANT_MODE)) {
            StringBuilder sb = new StringBuilder();
            for (String className : nonAffectedClasses) {
                className = className.replaceAll("\\.", "/");
                sb.append("<exclude name=\"" + className + ".java\"/>");
            }
            System.out.println(sb);
        } else if (mode != null && mode.equals(MAVEN_SIMPLE_MODE)) {
            StringBuilder sb = new StringBuilder();
            for (String className : nonAffectedClasses) {
                className = className.replaceAll("\\.", "/");
                sb.append("<exclude>");
                sb.append(className).append(".java");
                sb.append("</exclude>");
            }
            System.out.println(sb);
        } else if (mode != null && mode.equals(MAVEN_MODE)) {
            StringBuilder sb = new StringBuilder();
            sb.append("<excludes>");
            for (String className : nonAffectedClasses) {
                className = className.replaceAll("\\.", "/");
                sb.append("<exclude>");
                sb.append(className).append(".java");
                sb.append("</exclude>");
            }
            sb.append("</excludes>");
            System.out.println(sb);
        } else if (mode != null && mode.equals(DEBUG_MODE)) {
            System.out.println("AFFECTED: " + affectedClasses);
            System.out.println("NONAFFECTED: " + nonAffectedClasses);
        } else {
            for (String className : nonAffectedClasses) {
                System.out.println(className);
            }
        }
    }
212381
@Nonnull
    public BugInstance describe(String description) {
        annotationList.get(annotationList.size() - 1).setDescription(description);
        return this;
    }
960051
public void checkMessages(XMLFile messagesDoc) throws DocumentException {
        // Detector elements must all have a class attribute
        // and details child element.
        for (Iterator<Node> i = messagesDoc.xpathIterator("/MessageCollection/Detector"); i.hasNext();) {
            Node node = i.next();
            messagesDoc.checkAttribute(node, "class");
            messagesDoc.checkElement(node, "Details");
        }

        // BugPattern elements must all have type attribute
        // and ShortDescription, LongDescription, and Details
        // child elements.
        for (Iterator<Node> i = messagesDoc.xpathIterator("/MessageCollection/BugPattern"); i.hasNext();) {
            Node node = i.next();
            messagesDoc.checkAttribute(node, "type");
            messagesDoc.checkElement(node, "ShortDescription");
            messagesDoc.checkElement(node, "LongDescription");
            messagesDoc.checkElement(node, "Details");
        }

        // BugCode elements must contain abbrev attribute
        // and have non-empty text
        for (Iterator<Node> i = messagesDoc.xpathIterator("/MessageCollection/BugCode"); i.hasNext();) {
            Node node = i.next();
            messagesDoc.checkAttribute(node, "abbrev");
            messagesDoc.checkNonEmptyText(node);
        }

        // Check that all Detectors are described
        Set<String> describedDetectorsSet = messagesDoc.collectAttributes("/MessageCollection/Detector", "class");
        checkDescribed("Bug detectors not described by Detector elements", messagesDoc, declaredDetectorsSet,
                describedDetectorsSet);

        // Check that all BugCodes are described
        Set<String> describedAbbrevsSet = messagesDoc.collectAttributes("/MessageCollection/BugCode", "abbrev");
        checkDescribed("Abbreviations not described by BugCode elements", messagesDoc, declaredAbbrevsSet, describedAbbrevsSet);
    }