Program: 171278
Project: 171278
Buggy source:
private void applyEquipClothingEffects(AbstractClothing newClothing){
  incrementBonusAttribute(Attribute.RESISTANCE_PHYSICAL,newClothing.getClothingType().getPhysicalResistance());
  for (  Entry<Attribute,Integer> e : newClothing.getAttributeModifiers().entrySet()) {
    incrementBonusAttribute(e.getKey(),e.getValue());
  }
  for (  ItemEffect ie : newClothing.getEffects()) {
    if (ie.getSecondaryModifier() != null && ie.getSecondaryModifier().getFetish() != null) {
      Fetish associatedFetish=ie.getSecondaryModifier().getFetish();
switch (ie.getPotency()) {
case MINOR_BOOST:
        clothingFetishDesireModifiersMap.putIfAbsent(ie.getSecondaryModifier().getFetish(),0);
      clothingFetishDesireModifiersMap.put(associatedFetish,clothingFetishDesireModifiersMap.get(associatedFetish) + 1);
    break;
case BOOST:
  clothingFetishDesireModifiersMap.putIfAbsent(associatedFetish,0);
clothingFetishDesireModifiersMap.put(associatedFetish,clothingFetishDesireModifiersMap.get(associatedFetish) + 2);
break;
case MAJOR_BOOST:
fetishesFromClothing.add(associatedFetish);
break;
case MINOR_DRAIN:
clothingFetishDesireModifiersMap.putIfAbsent(associatedFetish,0);
clothingFetishDesireModifiersMap.put(associatedFetish,clothingFetishDesireModifiersMap.get(associatedFetish) - 1);
break;
case DRAIN:
clothingFetishDesireModifiersMap.putIfAbsent(associatedFetish,0);
clothingFetishDesireModifiersMap.put(associatedFetish,clothingFetishDesireModifiersMap.get(associatedFetish) - 2);
break;
case MAJOR_DRAIN:
clothingFetishDesireModifiersMap.putIfAbsent(associatedFetish,0);
clothingFetishDesireModifiersMap.put(associatedFetish,clothingFetishDesireModifiersMap.get(associatedFetish) - 999);
break;
}
}
}
}

Fixed version (ground truth):
private void applyEquipClothingEffects(AbstractClothing newClothing){
  incrementBonusAttribute(Attribute.RESISTANCE_PHYSICAL,newClothing.getClothingType().getPhysicalResistance());
  for (  Entry<Attribute,Integer> e : newClothing.getAttributeModifiers().entrySet()) {
    incrementBonusAttribute(e.getKey(),e.getValue());
  }
  for (  ItemEffect ie : newClothing.getEffects()) {
    if (ie.getSecondaryModifier() != null && ie.getSecondaryModifier().getFetish() != null) {
      Fetish associatedFetish=ie.getSecondaryModifier().getFetish();
switch (ie.getPotency()) {
case MINOR_BOOST:
        clothingFetishDesireModifiersMap.putIfAbsent(ie.getSecondaryModifier().getFetish(),0);
      clothingFetishDesireModifiersMap.put(associatedFetish,clothingFetishDesireModifiersMap.get(associatedFetish) + 1);
    break;
case BOOST:
  clothingFetishDesireModifiersMap.putIfAbsent(associatedFetish,0);
clothingFetishDesireModifiersMap.put(associatedFetish,clothingFetishDesireModifiersMap.get(associatedFetish) + 2);
break;
case MAJOR_BOOST:
fetishesFromClothing.add(associatedFetish);
applyFetishGainEffects(associatedFetish);
break;
case MINOR_DRAIN:
clothingFetishDesireModifiersMap.putIfAbsent(associatedFetish,0);
clothingFetishDesireModifiersMap.put(associatedFetish,clothingFetishDesireModifiersMap.get(associatedFetish) - 1);
break;
case DRAIN:
clothingFetishDesireModifiersMap.putIfAbsent(associatedFetish,0);
clothingFetishDesireModifiersMap.put(associatedFetish,clothingFetishDesireModifiersMap.get(associatedFetish) - 2);
break;
case MAJOR_DRAIN:
clothingFetishDesireModifiersMap.putIfAbsent(associatedFetish,0);
clothingFetishDesireModifiersMap.put(associatedFetish,clothingFetishDesireModifiersMap.get(associatedFetish) - 999);
break;
}
}
}
}