public FindBugsReportParser()

in agent/src/jetbrains/buildServer/xmlReportPlugin/parsers/findBugs/FindBugsReportParser.java [62:113]


  public FindBugsReportParser(@NotNull final InspectionReporter inspectionReporter,
                              @Nullable final String findBugsHome,
                              @NotNull final File baseFolder,
                              boolean lookForFiles) {
    myInspectionReporter = inspectionReporter;
    myBaseFolder = baseFolder;
    myFindBugsHome = findBugsHome == null ? null : new File(findBugsHome);

    myPatternXmlParser = new PatternXmlParser(new PatternXmlParser.Callback() {
      public void patternFound(@NotNull final String type) {
        if (!myPatterns.containsKey(type)) myPatterns.put(type, new NameAndDescritionInfo());
      }

      public void patternShortDescriptionFound(@NotNull final String type, @NotNull final String description) {
        myPatterns.get(type).setName(description);
      }

      public void patternDetailsFound(@NotNull final String type, @NotNull final String details) {
        myPatterns.get(type).setDescription(formatText(details));
      }
    });

    myCategoryXmlParser = new CategoryXmlParser(new CategoryXmlParser.Callback() {
      public void categoryFound(@NotNull final String category) {
        if (!myCategories.containsKey(category)) myCategories.put(category, new NameAndDescritionInfo());
      }

      public void categoryDescriptionFound(@NotNull final String category, @NotNull final String description) {
        myCategories.get(category).setName(description);
      }

      public void categoryDetailsFound(@NotNull final String category, @NotNull final String details) {
        final String text = formatText(details);
        myCategories.get(category).setDescription(text.substring(0, 1).toUpperCase() + text.substring(1));
      }
    });

    myFileFinder = lookForFiles ? new FileFinder() : new FileFinder() {
      @Override
      public void addJar(@NotNull final String jar) {}
      @Override
      public String getVeryFullFilePath(@Nullable final String filePath) {return null;}
      @Override
      public void close() {}
    };

    try {
      myDetailsParser = new DetailsParser(DTD.getDTD(""));
    } catch (IOException e) {
      LOG.warn("Failed to create empty DTD");
    }
  }