Program: 70568
Project: 70568
Buggy source:
@Override protected Integer doInBackground(Game... params){
  mGame=params[0];
  if (mGame.getGameCode() == null) {
    return TYPE_FAILED;
  }
  HashMap<String,Double> ratesMap=mGameLab.mRatesMap;
  List<SupportedCountry> supportedCountryList=mSupportedCountryLab.getSupportedCountries();
  List<SupportedCountry> usCountryList=new ArrayList<>();
  List<SupportedCountry> euCountryList=new ArrayList<>();
  List<SupportedCountry> jpCountryList=new ArrayList<>();
  for (  SupportedCountry supportedCountry : supportedCountryList) {
switch (supportedCountry.getBelong()) {
case "String_Node_Str":
      usCountryList.add(supportedCountry);
    break;
case "String_Node_Str":
  euCountryList.add(supportedCountry);
break;
default :
jpCountryList.add(supportedCountry);
break;
}
}
String usNsuid=mGame.getUsNsUid();
String euNsuid=mGame.getEuNsUid();
String jpNsuid=mGame.getJpNsUid();
List<HttpUrl> httpUrls=new ArrayList<>();
if (usNsuid != null) {
for (SupportedCountry country : usCountryList) {
HttpUrl url=buildHttpUrl(country.getCode(),usNsuid);
httpUrls.add(url);
}
}
if (euNsuid != null) {
for (SupportedCountry country : euCountryList) {
HttpUrl url=buildHttpUrl(country.getCode(),euNsuid);
httpUrls.add(url);
}
}
if (jpNsuid != null) {
for (SupportedCountry country : jpCountryList) {
HttpUrl url=buildHttpUrl(country.getCode(),jpNsuid);
httpUrls.add(url);
}
}
List<Price> priceList=queryPrice(httpUrls);
if (priceList == null || priceList.size() == 0) {
return TYPE_FAILED;
}
for (Price price : priceList) {
String currency=price.getCurrency();
double rates=ratesMap.get(currency);
if (price.getDiscountPrice() != null) {
price.setDiscount(String.valueOf(String.format("String_Node_Str",(1 - Double.parseDouble(price.getDiscountPrice()) / Double.parseDouble(price.getPrice())) * 100)) + "String_Node_Str");
price.setDiscountPriceByCurrency(String.valueOf(String.format("String_Node_Str",Double.parseDouble(price.getDiscountPrice()) / rates)));
}
price.setPriceByCurrency(String.valueOf(String.format("String_Node_Str",Double.parseDouble(price.getPrice()) / rates)));
}
Collections.sort(priceList,new Comparator<Price>(){
public int compare(Price arg0,Price arg1){
if (arg0.getDiscountPriceByCurrency() != null) {
if (arg1.getDiscountPriceByCurrency() != null) {
return arg0.getDiscountPriceByCurrency().compareTo(arg1.getDiscountPriceByCurrency());
}
 else {
return arg0.getDiscountPriceByCurrency().compareTo(arg1.getPriceByCurrency());
}
}
 else {
if (arg1.getDiscountPriceByCurrency() != null) {
return arg0.getPriceByCurrency().compareTo(arg1.getDiscountPriceByCurrency());
}
 else {
return arg0.getPriceByCurrency().compareTo(arg1.getPriceByCurrency());
}
}
}
}
);
Price price=priceList.get(0);
price.setCountryName(mSupportedCountryLab.getSupportedCountry(price.getCountryCode()).getName());
mGame.setPrice(price);
return TYPE_SUCCESS;
}

Fixed version (ground truth):
@Override protected Integer doInBackground(Game... params){
  mGame=params[0];
  if (mGame.getGameCode() == null) {
    return TYPE_FAILED;
  }
  HashMap<String,Double> ratesMap=mGameLab.mRatesMap;
  List<SupportedCountry> supportedCountryList=mSupportedCountryLab.getSupportedCountries();
  List<SupportedCountry> usCountryList=new ArrayList<>();
  List<SupportedCountry> euCountryList=new ArrayList<>();
  List<SupportedCountry> jpCountryList=new ArrayList<>();
  for (  SupportedCountry supportedCountry : supportedCountryList) {
switch (supportedCountry.getBelong()) {
case "String_Node_Str":
      usCountryList.add(supportedCountry);
    break;
case "String_Node_Str":
  euCountryList.add(supportedCountry);
break;
default :
jpCountryList.add(supportedCountry);
break;
}
}
mCountries.addAll(usCountryList);
mCountries.addAll(euCountryList);
mCountries.addAll(jpCountryList);
String usNsuid=mGame.getUsNsUid();
String euNsuid=mGame.getEuNsUid();
String jpNsuid=mGame.getJpNsUid();
List<HttpUrl> httpUrls=new ArrayList<>();
if (usNsuid != null) {
for (SupportedCountry country : usCountryList) {
HttpUrl url=buildHttpUrl(country.getCode(),usNsuid);
httpUrls.add(url);
}
}
if (euNsuid != null) {
for (SupportedCountry country : euCountryList) {
HttpUrl url=buildHttpUrl(country.getCode(),euNsuid);
httpUrls.add(url);
}
}
if (jpNsuid != null) {
for (SupportedCountry country : jpCountryList) {
HttpUrl url=buildHttpUrl(country.getCode(),jpNsuid);
httpUrls.add(url);
}
}
List<Price> priceList=queryPrice(httpUrls);
if (priceList == null || priceList.size() == 0) {
return TYPE_FAILED;
}
Iterator<Price> iterator=priceList.iterator();
while (iterator.hasNext()) {
Price price=iterator.next();
String currency=price.getCurrency();
if (currency == null) {
iterator.remove();
}
 else {
double rates=ratesMap.get(currency);
if (price.getDiscountPrice() != null) {
price.setDiscount(String.valueOf(String.format("String_Node_Str",(1 - Double.parseDouble(price.getDiscountPrice()) / Double.parseDouble(price.getPrice())) * 100)) + "String_Node_Str");
price.setDiscountPriceByCurrency(String.valueOf(String.format("String_Node_Str",Double.parseDouble(price.getDiscountPrice()) / rates)));
}
price.setPriceByCurrency(String.valueOf(String.format("String_Node_Str",Double.parseDouble(price.getPrice()) / rates)));
}
}
Collections.sort(priceList,new Comparator<Price>(){
public int compare(Price arg0,Price arg1){
if (arg0.getDiscountPriceByCurrency() != null) {
if (arg1.getDiscountPriceByCurrency() != null) {
return arg0.getDiscountPriceByCurrency().compareTo(arg1.getDiscountPriceByCurrency());
}
 else {
return arg0.getDiscountPriceByCurrency().compareTo(arg1.getPriceByCurrency());
}
}
 else {
if (arg1.getDiscountPriceByCurrency() != null) {
return arg0.getPriceByCurrency().compareTo(arg1.getDiscountPriceByCurrency());
}
 else {
return arg0.getPriceByCurrency().compareTo(arg1.getPriceByCurrency());
}
}
}
}
);
Price price=priceList.get(0);
price.setCountryName(mSupportedCountryLab.getSupportedCountry(price.getCountryCode()).getName());
mGame.setPrice(price);
return TYPE_SUCCESS;
}