CPD Results

The following document contains the results of PMD's CPD 5.0.2.

Duplications

FileLine
uk/ac/ebi/intenz/tools/sib/translator/SIBEnzymeLogger.java198
uk/ac/ebi/intenz/tools/sib/translator/SIBEnzymeLogger.java241
          out.write(after.substring(diffStartIndex + afterEnd));
          out.write(".\nTO:\n");
          out.write(before.substring(0, diffStartIndex));
          out.write(before.substring(diffStartIndex, diffStartIndex + beforeEnd));
          out.write(before.substring(diffStartIndex + beforeEnd));
          out.write(".\n//");
        } else {
          out.write("<tr><td valign=\"top\"><font color=\"blue\"><a href=\"http://www.ebi.ac.uk/~mdarsow/cgi-bin/development/test/intenz_curator/handler?cmd=SearchAllEC&ec=" + ec + "\">" + ec + "</a></font></td><td>" + before.substring(0, diffStartIndex) +
                  "<font color=\"red\">" + before.substring(diffStartIndex, diffStartIndex + beforeEnd) + "</font>" + before.substring(diffStartIndex + beforeEnd) +
                  "<br/>" + after.substring(0, diffStartIndex) +
                  "<font color=\"red\">" + after.substring(diffStartIndex, diffStartIndex + afterEnd) + "</font>" + after.substring(diffStartIndex + afterEnd) + "</td></tr>\n");
FileLine
uk/ac/ebi/intenz/tools/sib/translator/rules/DescriptionLineRules.java85
uk/ac/ebi/intenz/tools/sib/translator/rules/ReactionRules.java92
     if (text == null) throw new NullPointerException("Parameter 'text' must not be null.");
    return text;
  }

  /**
   * Applies the reverse rules.
   *
   * @param text The text to be translated.
   * @return the translated text.
   * @throws NullPointerException if <code>text</code> is <code>null</code>.
   */
  public String reverseRules(String text) {
    if (text == null) throw new NullPointerException("Parameter 'text' must not be null.");
    text = translate(text, reverseRules);
    return text;
  }

  /**
   * This method performs the actual application of the rules.
   *
   * @param text The text to be translated.
   * @param rules Map of rules to be applied.
   * @return the translated text.
   */
  private String translate(String text, Map rules) {
    Set rulePatterns = rules.keySet();
    for (Iterator it = rulePatterns.iterator(); it.hasNext();) {
      String pattern = (String) it.next();
      String replacement = (String) rules.get(pattern);
      text = text.replaceAll(pattern, replacement);
    }
    return text;
  }
}
FileLine
uk/ac/ebi/intenz/tools/sib/translator/SIBEnzymeLogger.java191
uk/ac/ebi/intenz/tools/sib/translator/SIBEnzymeLogger.java214
        if (after.charAt(diffStartIndex) == '&') afterEnd = 4;
        if (enzymeLogFormat) {
          out.write("\nAC:\n");
          out.write(ec);
          out.write("\nFROM:\n");
          out.write(after.substring(0, diffStartIndex));
          out.write(after.substring(diffStartIndex, diffStartIndex + afterEnd));
          out.write(after.substring(diffStartIndex + afterEnd));
          out.write(".\nTO:\n");
          out.write(before.substring(0, diffStartIndex));
          out.write(before.substring(diffStartIndex, diffStartIndex + beforeEnd));