CPD Results

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

Duplications

FileLine
uk/ac/ebi/intenz/mapper/EnzymeEntryMapper.java1373
uk/ac/ebi/intenz/mapper/EnzymeEntryMapper.java1425
    String subSubclassName = "";

    if (rs.getInt(1) > 0) enzymeId = new Long(rs.getLong(1));
    if (rs.getInt(2) > 0) ec1 = rs.getInt(2);
    if (rs.getInt(3) > 0) ec2 = rs.getInt(3);
    if (rs.getInt(4) > 0) ec3 = rs.getInt(4);
    if (rs.getInt(5) > 0) ec4 = rs.getInt(5);
    if (rs.getString(6) != null) history = rs.getString(6);
    if (rs.getString(7) != null) note = rs.getString(7);
    if (rs.getString(8) != null) status = rs.getString(8);
    if (rs.getString(9) != null) source = rs.getString(9);
    if (rs.getString(10) != null) active = rs.getString(10);
FileLine
uk/ac/ebi/intenz/mapper/EnzymeFutureMapper.java106
uk/ac/ebi/intenz/mapper/EnzymeHistoryMapper.java78
  private List findFutureEvents(HistoryNode currentNode, Connection con)
  throws SQLException, DomainException {
    PreparedStatement findStatement = null;
    ResultSet rs = null;
    Vector result = new Vector();

    try {
      findStatement = con.prepareStatement(findStatement());
      findStatement.setLong(1, currentNode.getEnzymeEntry().getId().longValue());
      findStatement.setLong(2, currentNode.getEnzymeEntry().getId().longValue());
      rs = findStatement.executeQuery();
      while (rs.next()) {
        result.addElement(doLoad(rs, currentNode, con));
      }
    } finally {
    	if (rs != null) rs.close();
    	if (findStatement != null) findStatement.close();
    }

    return result;
  }

  /**
   * Creates the <code>EnzymeLink</code> object from the given result set.
   *
   * @param rs The result set object.
   * @return an <code>EnzymeLink</code> instance.
   * @throws SQLException
   */
  private FutureEvent doLoad(ResultSet rs, HistoryNode currentNode,
FileLine
uk/ac/ebi/intenz/mapper/EnzymeFutureMapper.java162
uk/ac/ebi/intenz/mapper/EnzymeHistoryMapper.java130
    if (rs.getDate(12) != null) dueDate = rs.getDate(12);

    // Check for relative. Either beforeNode or afterNode is different from current node or one of them is null.
    EnzymeEntryMapper enzymeEntryMapper = new EnzymeEntryMapper();
    HistoryNode beforeNode = null, afterNode = null;
    if (beforeId > 0) {
      if (beforeId != currentNode.getEnzymeEntry().getId().longValue()) {
        EnzymeEntry ghostEntry = enzymeEntryMapper.findGhostById(beforeId, con);
        beforeNode = findNode(ghostEntry, false, con);
        afterNode = currentNode;
      } else {
        beforeNode = currentNode;
      }
    }
    if (afterId > 0) {
      if (afterId != currentNode.getEnzymeEntry().getId().longValue()) {
        EnzymeEntry ghostEntry = enzymeEntryMapper.findGhostById(afterId, con);
        beforeNode = currentNode;
        afterNode = findNode(ghostEntry, false, con);
      } else {
        afterNode = currentNode;
      }
    }