Program: 124511
Project: 124511
Buggy source:
private static Map<String,ExchangeRate> requestExchangeRates(final URL url,final String... fields){
  final long start=System.currentTimeMillis();
  HttpURLConnection connection=null;
  Reader reader=null;
  try {
    Double btcRate=0.0;
    boolean cryptsyValue=true;
    Object result=getCoinValueBTC();
    if (result == null) {
      result=getCoinValueBTC_BTER();
      cryptsyValue=false;
      if (result == null)       return null;
    }
    btcRate=(Double)result;
    connection=(HttpURLConnection)url.openConnection();
    connection.setConnectTimeout(Constants.HTTP_TIMEOUT_MS);
    connection.setReadTimeout(Constants.HTTP_TIMEOUT_MS);
    connection.connect();
    final int responseCode=connection.getResponseCode();
    if (responseCode == HttpURLConnection.HTTP_OK) {
      reader=new InputStreamReader(new BufferedInputStream(connection.getInputStream(),1024),Constants.UTF_8);
      final StringBuilder content=new StringBuilder();
      Io.copy(reader,content);
      final Map<String,ExchangeRate> rates=new TreeMap<String,ExchangeRate>();
      final JSONObject head=new JSONObject(content.toString());
      for (final Iterator<String> i=head.keys(); i.hasNext(); ) {
        final String currencyCode=i.next();
        if (!"String_Node_Str".equals(currencyCode)) {
          final JSONObject o=head.getJSONObject(currencyCode);
          for (          final String field : fields) {
            String rateStr=o.optString(field,null);
            if (rateStr != null) {
              try {
                double rateForBTC=Double.parseDouble(rateStr);
                rateStr=String.format("String_Node_Str",rateForBTC * btcRate);
                final BigInteger rate=GenericUtils.toNanoCoins(rateStr,0);
                if (rate.signum() > 0) {
                  rates.put(currencyCode,new ExchangeRate(currencyCode,rate,url.getHost()));
                  break;
                }
              }
 catch (              final ArithmeticException x) {
                log.warn("String_Node_Str",new Object[]{currencyCode,url,x.getMessage()});
              }
            }
          }
        }
      }
      log.info("String_Node_Str",url,(System.currentTimeMillis() - start));
      if (rates.size() == 0) {
        int i=0;
        i++;
      }
 else {
        rates.put(CoinDefinition.cryptsyMarketCurrency,new ExchangeRate(CoinDefinition.cryptsyMarketCurrency,GenericUtils.toNanoCoins(String.format("String_Node_Str",btcRate).replace("String_Node_Str","String_Node_Str"),0),cryptsyValue ? "String_Node_Str" : "String_Node_Str"));
        rates.put("String_Node_Str" + CoinDefinition.cryptsyMarketCurrency,new ExchangeRate("String_Node_Str" + CoinDefinition.cryptsyMarketCurrency,GenericUtils.toNanoCoins(String.format("String_Node_Str",btcRate * 1000).replace("String_Node_Str","String_Node_Str"),0),cryptsyValue ? "String_Node_Str" : "String_Node_Str"));
      }
      return rates;
    }
 else {
      log.warn("String_Node_Str",responseCode,url);
    }
  }
 catch (  final Exception x) {
    log.warn("String_Node_Str" + url,x);
  }
 finally {
    if (reader != null) {
      try {
        reader.close();
      }
 catch (      final IOException x) {
      }
    }
    if (connection != null)     connection.disconnect();
  }
  return null;
}

Fixed version (ground truth):
private static Map<String,ExchangeRate> requestExchangeRates(final URL url,final String... fields){
  final long start=System.currentTimeMillis();
  HttpURLConnection connection=null;
  Reader reader=null;
  try {
    Double btcRate=0.0;
    boolean cryptsyValue=true;
    Object result=getCoinValueBTC();
    if (result == null) {
      result=getCoinValueBTC_BTER();
      cryptsyValue=false;
      if (result == null)       return null;
    }
    btcRate=(Double)result;
    connection=(HttpURLConnection)url.openConnection();
    connection.setConnectTimeout(Constants.HTTP_TIMEOUT_MS);
    connection.setReadTimeout(Constants.HTTP_TIMEOUT_MS);
    connection.connect();
    final int responseCode=connection.getResponseCode();
    if (responseCode == HttpURLConnection.HTTP_OK) {
      reader=new InputStreamReader(new BufferedInputStream(connection.getInputStream(),1024),Constants.UTF_8);
      final StringBuilder content=new StringBuilder();
      Io.copy(reader,content);
      final Map<String,ExchangeRate> rates=new TreeMap<String,ExchangeRate>();
      final JSONObject head=new JSONObject(content.toString());
      for (final Iterator<String> i=head.keys(); i.hasNext(); ) {
        final String currencyCode=i.next();
        if (!"String_Node_Str".equals(currencyCode)) {
          final JSONObject o=head.getJSONObject(currencyCode);
          for (          final String field : fields) {
            String rateStr=o.optString(field,null);
            if (rateStr != null) {
              try {
                double rateForBTC=Double.parseDouble(rateStr);
                rateStr=String.format("String_Node_Str",rateForBTC * btcRate).replace("String_Node_Str","String_Node_Str");
                final BigInteger rate=GenericUtils.toNanoCoins(rateStr,0);
                if (rate.signum() > 0) {
                  rates.put(currencyCode,new ExchangeRate(currencyCode,rate,url.getHost()));
                  break;
                }
              }
 catch (              final ArithmeticException x) {
                log.warn("String_Node_Str",new Object[]{currencyCode,url,x.getMessage()});
              }
            }
          }
        }
      }
      log.info("String_Node_Str",url,(System.currentTimeMillis() - start));
      if (rates.size() == 0) {
        int i=0;
        i++;
      }
 else {
        rates.put(CoinDefinition.cryptsyMarketCurrency,new ExchangeRate(CoinDefinition.cryptsyMarketCurrency,GenericUtils.toNanoCoins(String.format("String_Node_Str",btcRate).replace("String_Node_Str","String_Node_Str"),0),cryptsyValue ? "String_Node_Str" : "String_Node_Str"));
        rates.put("String_Node_Str" + CoinDefinition.cryptsyMarketCurrency,new ExchangeRate("String_Node_Str" + CoinDefinition.cryptsyMarketCurrency,GenericUtils.toNanoCoins(String.format("String_Node_Str",btcRate * 1000).replace("String_Node_Str","String_Node_Str"),0),cryptsyValue ? "String_Node_Str" : "String_Node_Str"));
      }
      return rates;
    }
 else {
      log.warn("String_Node_Str",responseCode,url);
    }
  }
 catch (  final Exception x) {
    log.warn("String_Node_Str" + url,x);
  }
 finally {
    if (reader != null) {
      try {
        reader.close();
      }
 catch (      final IOException x) {
      }
    }
    if (connection != null)     connection.disconnect();
  }
  return null;
}