Program: 85656
Project: 85656
Buggy source:
/** 
 * Get the map of the   {@link org.bitcoinj.core.TransactionOutput}'s keyed on their height for a given address and a specified height.
 * @param address The address.
 * @param maxHeight The minimum block height of this tx output (inclusive).
 * @return The map of transaction outputs (list) keyed by height
 * @throws BlockStoreException If there is an error getting the list out outputs.
 */
public Map<Integer,List<TransactionOutput>> getOpenTransactionOutputsHeightMap(Address address,@Nullable Integer maxHeight) throws BlockStoreException {
  maybeConnect();
  PreparedStatement s=null;
  HashMap<Integer,List<TransactionOutput>> outputsMap=new HashMap<Integer,List<TransactionOutput>>();
  try {
    if (maxHeight != null) {
      s=conn.get().prepareStatement(getTrasactionOutputWithHeightSelectSQL());
      s.setInt(2,maxHeight);
    }
 else {
      s=conn.get().prepareStatement(getTrasactionOutputSelectSQL());
    }
    s.setString(1,address.toString());
    ResultSet rs=s.executeQuery();
    while (rs.next()) {
      Coin amount=Coin.valueOf((new BigInteger(rs.getBytes(1)).longValue()));
      byte[] scriptBytes=rs.getBytes(2);
      int height=rs.getInt(3);
      TransactionOutput output=new TransactionOutput(params,null,amount,scriptBytes);
      if (outputsMap.containsKey(height)) {
        outputsMap.get(height).add(output);
      }
 else {
        List outputs=new ArrayList<TransactionOutput>();
        outputs.add(output);
        outputsMap.put(height,outputs);
      }
    }
    return outputsMap;
  }
 catch (  SQLException ex) {
    throw new BlockStoreException(ex);
  }
 finally {
    if (s != null)     try {
      s.close();
    }
 catch (    SQLException e) {
      throw new BlockStoreException("String_Node_Str");
    }
  }
}

Fixed version (ground truth):
/** 
 * Get the map of the   {@link org.bitcoinj.core.TransactionOutput}'s keyed on their height for a given address and a specified height.
 * @param address The address.
 * @param maxHeight The minimum block height of this tx output (inclusive).
 * @return The map of transaction outputs (list) keyed by height
 * @throws BlockStoreException If there is an error getting the list out outputs.
 */
public Map<Integer,List<TransactionOutput>> getOpenTransactionOutputsHeightMap(Address address,@Nullable Integer maxHeight) throws BlockStoreException {
  maybeConnect();
  PreparedStatement s=null;
  HashMap<Integer,List<TransactionOutput>> outputsMap=new HashMap<Integer,List<TransactionOutput>>();
  try {
    if (maxHeight != null) {
      s=conn.get().prepareStatement(getTrasactionOutputWithHeightSelectSQL());
      s.setInt(2,maxHeight);
    }
 else {
      s=conn.get().prepareStatement(getTrasactionOutputSelectSQL());
    }
    s.setString(1,address.toString());
    ResultSet rs=s.executeQuery();
    while (rs.next()) {
      Coin amount=Coin.valueOf(rs.getLong(1));
      byte[] scriptBytes=rs.getBytes(2);
      int height=rs.getInt(3);
      TransactionOutput output=new TransactionOutput(params,null,amount,scriptBytes);
      if (outputsMap.containsKey(height)) {
        outputsMap.get(height).add(output);
      }
 else {
        List outputs=new ArrayList<TransactionOutput>();
        outputs.add(output);
        outputsMap.put(height,outputs);
      }
    }
    return outputsMap;
  }
 catch (  SQLException ex) {
    throw new BlockStoreException(ex);
  }
 finally {
    if (s != null)     try {
      s.close();
    }
 catch (    SQLException e) {
      throw new BlockStoreException("String_Node_Str");
    }
  }
}