nus-yam/ex-repair huggingface dataset:
Program: 58440
Project: 58440
Buggy source:
@Override public byte[] transform(String name,String transformedName,byte[] bytes){
  if (bytes == null) {
    return null;
  }
  ClassReader cr=new ClassReader(bytes);
  ClassNode cn=new ClassNode();
  cr.accept(cn,0);
  workingPath.add(transformedName);
  if (this.implement(cn)) {
    System.out.println("String_Node_Str" + transformedName);
    ClassWriter cw=new ClassWriter(ClassWriter.COMPUTE_MAXS);
    cn.accept(cw);
    bytes=cw.toByteArray();
    cr=new ClassReader(bytes);
  }
  if (this.strip(cn)) {
    System.out.println("String_Node_Str" + transformedName);
    ClassWriter cw=new ClassWriter(ClassWriter.COMPUTE_MAXS);
    cn.accept(cw);
    bytes=cw.toByteArray();
    cr=new ClassReader(bytes);
  }
  workingPath.remove(workingPath.size() - 1);
  if ("String_Node_Str".equals(transformedName)) {
    bytes=writeWorldServer(name,transformedName,bytes,cr);
  }
 else   if ("String_Node_Str".equals(transformedName)) {
    bytes=writeWorld(name,transformedName,bytes,cr);
  }
 else   if ("String_Node_Str".equals(transformedName)) {
    bytes=writeWorldProxy(name,bytes,cr);
  }
 else   if ("String_Node_Str".equals(transformedName)) {
    bytes=writeWorldServerProxy(name,bytes,cr);
  }
  return bytes;
}

Fixed version (ground truth):
@Override public byte[] transform(String name,String transformedName,byte[] bytes){
  if (bytes == null) {
    return null;
  }
  ClassReader cr=new ClassReader(bytes);
  ClassNode cn=new ClassNode();
  cr.accept(cn,0);
  workingPath.add(transformedName);
  if (this.implement(cn)) {
    log.info("String_Node_Str" + transformedName);
    ClassWriter cw=new ClassWriter(ClassWriter.COMPUTE_MAXS);
    cn.accept(cw);
    bytes=cw.toByteArray();
    cr=new ClassReader(bytes);
    cn=new ClassNode();
    cr.accept(cn,0);
  }
  if (this.strip(cn)) {
    log.info("String_Node_Str" + transformedName);
    ClassWriter cw=new ClassWriter(ClassWriter.COMPUTE_FRAMES);
    cn.accept(cw);
    bytes=cw.toByteArray();
    cr=new ClassReader(bytes);
  }
  workingPath.remove(workingPath.size() - 1);
  if ("String_Node_Str".equals(transformedName)) {
    bytes=writeWorldServer(name,transformedName,bytes,cr);
  }
 else   if ("String_Node_Str".equals(transformedName)) {
    bytes=writeWorld(name,transformedName,bytes,cr);
  }
 else   if ("String_Node_Str".equals(transformedName)) {
    bytes=writeWorldProxy(name,bytes,cr);
  }
 else   if ("String_Node_Str".equals(transformedName)) {
    bytes=writeWorldServerProxy(name,bytes,cr);
  }
  return bytes;
}
Program: 58442
Project: 58442
Buggy source:
private boolean checkRemove(AnnotationNode node,Iterator<? extends Object> iter){
  if (node.desc.equals(strippableDesc)) {
    if (node.values != null) {
      List<Object> values=node.values;
      for (int i=0, e=values.size(); i < e; ) {
        Object k=values.get(i++);
        Object v=values.get(i++);
        if (k instanceof String && k.equals("String_Node_Str") && v instanceof String[]) {
          String[] value=(String[])v;
          boolean needsRemoved=false;
          for (int j=0, l=value.length; j < l; ++j) {
            String clazz=value[j].trim();
            try {
              if (!workingPath.contains(clazz)) {
                Class.forName(clazz,false,this.getClass().getClassLoader());
              }
            }
 catch (            Throwable _) {
              needsRemoved=true;
              break;
            }
          }
          if (needsRemoved) {
            iter.remove();
            return true;
          }
        }
      }
    }
  }
  return false;
}

Fixed version (ground truth):
private boolean checkRemove(AnnotationNode node,Iterator<? extends Object> iter){
  if (node.desc.equals(stripableDesc)) {
    if (node.values != null) {
      List<Object> values=node.values;
      for (int i=0, e=values.size(); i < e; ) {
        Object k=values.get(i++);
        Object v=values.get(i++);
        if ("String_Node_Str".equals(k) && v instanceof List && ((List<?>)v).size() > 0 && ((List<?>)v).get(0) instanceof String) {
          String[] value=((List<?>)v).toArray(new String[0]);
          boolean needsRemoved=false;
          for (int j=0, l=value.length; j < l; ++j) {
            String clazz=value[j].trim();
            try {
              if (!workingPath.contains(clazz)) {
                Class.forName(clazz,false,this.getClass().getClassLoader());
              }
            }
 catch (            Throwable _) {
              needsRemoved=true;
              break;
            }
          }
          if (needsRemoved) {
            iter.remove();
            return true;
          }
        }
      }
    }
  }
  return false;
}
Program: 58443
Project: 58443
Buggy source:
public PCCASMTransformer(){
  implementableDesc=Type.getDescriptor(Implementable.class);
  strippableDesc=Type.getDescriptor(Stripable.class);
}

Fixed version (ground truth):
public PCCASMTransformer(){
  implementableDesc=Type.getDescriptor(Implementable.class);
  stripableDesc=Type.getDescriptor(Stripable.class);
}
Program: 58444
Project: 58444
Buggy source:
private boolean implement(ClassNode cn){
  if (cn.visibleAnnotations == null) {
    return false;
  }
  boolean interfaces=false;
  for (  AnnotationNode node : cn.visibleAnnotations) {
    if (node.desc.equals(implementableDesc)) {
      if (node.values != null) {
        List<Object> values=node.values;
        for (int i=0, e=values.size(); i < e; ) {
          Object k=values.get(i++);
          Object v=values.get(i++);
          if (k instanceof String && k.equals("String_Node_Str") && v instanceof String[]) {
            String[] value=(String[])v;
            for (int j=0, l=value.length; j < l; ++j) {
              String clazz=value[j].trim();
              String cz=clazz.replace('.','/');
              if (!cn.interfaces.contains(cz)) {
                try {
                  if (!workingPath.contains(clazz)) {
                    Class.forName(clazz,false,this.getClass().getClassLoader());
                  }
                  cn.interfaces.add(cz);
                  interfaces=true;
                }
 catch (                Throwable _) {
                }
              }
            }
          }
        }
      }
    }
  }
  return interfaces;
}

Fixed version (ground truth):
private boolean implement(ClassNode cn){
  if (cn.visibleAnnotations == null) {
    return false;
  }
  boolean interfaces=false;
  for (  AnnotationNode node : cn.visibleAnnotations) {
    if (node.desc.equals(implementableDesc)) {
      if (node.values != null) {
        List<Object> values=node.values;
        for (int i=0, e=values.size(); i < e; ) {
          Object k=values.get(i++);
          Object v=values.get(i++);
          if ("String_Node_Str".equals(k) && v instanceof List && ((List<?>)v).size() > 0 && ((List<?>)v).get(0) instanceof String) {
            String[] value=((List<?>)v).toArray(new String[0]);
            for (int j=0, l=value.length; j < l; ++j) {
              String clazz=value[j].trim();
              String cz=clazz.replace('.','/');
              if (!cn.interfaces.contains(cz)) {
                try {
                  if (!workingPath.contains(clazz)) {
                    Class.forName(clazz,false,this.getClass().getClassLoader());
                  }
                  cn.interfaces.add(cz);
                  interfaces=true;
                }
 catch (                Throwable _) {
                }
              }
            }
          }
        }
      }
    }
  }
  return interfaces;
}
Program: 58445
Project: 58445
Buggy source:
@Override protected void keyTyped(char i,int j){
  this.tbName.textboxKeyTyped(i,j);
  if (j == 1) {
    this.mc.thePlayer.closeScreen();
    return;
  }
  if (this.tbName.isFocused()) {
    if (j == 28) {
      this.mc.getSoundHandler().playSound(new SoundGui("String_Node_Str",1.0F,0.7F));
    }
  }
  updateButtons();
}

Fixed version (ground truth):
@Override protected void keyTyped(char i,int j){
  this.tbName.textboxKeyTyped(i,j);
  if (j == 1) {
    this.mc.thePlayer.closeScreen();
    return;
  }
  if (this.tbName.isFocused()) {
    if (j == 28) {
      this.mc.getSoundHandler().playSound(new SoundBase("String_Node_Str",1.0F,0.7F));
    }
  }
  updateButtons();
}
Program: 58447
Project: 58447
Buggy source:
/** 
 * Sync two replicas 
 */
private void testSyncReplicas(ReplicaRecoveryInfo replica1,ReplicaRecoveryInfo replica2,InterDatanodeProtocol dn1,InterDatanodeProtocol dn2,long expectLen) throws IOException {
  DatanodeInfo[] locs=new DatanodeInfo[]{mock(DatanodeInfo.class),mock(DatanodeInfo.class)};
  RecoveringBlock rBlock=new RecoveringBlock(block,locs,RECOVERY_ID);
  ArrayList<BlockRecord> syncList=new ArrayList<BlockRecord>(2);
  BlockRecord record1=new BlockRecord(new DatanodeID("String_Node_Str","String_Node_Str",44,55),dn1,replica1);
  BlockRecord record2=new BlockRecord(new DatanodeID("String_Node_Str","String_Node_Str",11,22),dn2,replica2);
  syncList.add(record1);
  syncList.add(record2);
  when(dn1.updateReplicaUnderRecovery((Block)anyObject(),anyLong(),anyLong())).thenReturn(new Block(block.getBlockId(),expectLen,block.getGenerationStamp()));
  when(dn2.updateReplicaUnderRecovery((Block)anyObject(),anyLong(),anyLong())).thenReturn(new Block(block.getBlockId(),expectLen,block.getGenerationStamp()));
  dn.syncBlock(rBlock,syncList);
}

Fixed version (ground truth):
/** 
 * Sync two replicas 
 */
private void testSyncReplicas(ReplicaRecoveryInfo replica1,ReplicaRecoveryInfo replica2,InterDatanodeProtocol dn1,InterDatanodeProtocol dn2,long expectLen) throws IOException {
  DatanodeInfo[] locs=new DatanodeInfo[]{mock(DatanodeInfo.class),mock(DatanodeInfo.class)};
  RecoveringBlock rBlock=new RecoveringBlock(block,locs,RECOVERY_ID);
  ArrayList<BlockRecord> syncList=new ArrayList<BlockRecord>(2);
  BlockRecord record1=new BlockRecord(new DatanodeID("String_Node_Str","String_Node_Str",44,55),dn1,replica1);
  BlockRecord record2=new BlockRecord(new DatanodeID("String_Node_Str","String_Node_Str",11,22),dn2,replica2);
  syncList.add(record1);
  syncList.add(record2);
  when(dn1.updateReplicaUnderRecovery((ExtendedBlock)anyObject(),anyLong(),anyLong())).thenReturn(new ExtendedBlock(block.getBlockPoolId(),block.getBlockId(),expectLen,block.getGenerationStamp()));
  when(dn2.updateReplicaUnderRecovery((ExtendedBlock)anyObject(),anyLong(),anyLong())).thenReturn(new ExtendedBlock(block.getBlockPoolId(),block.getBlockId(),expectLen,block.getGenerationStamp()));
  dn.syncBlock(rBlock,syncList);
}
Program: 58448
Project: 58448
Buggy source:
private String getParam(boolean isParam,String value,Long filterId,String type){
  if (isParam) {
    value="String_Node_Str" + filterId + "String_Node_Str"+ getSqlType(type)+ "String_Node_Str";
  }
  return value;
}

Fixed version (ground truth):
private String getParam(boolean isParam,String value,Long filterId,String type){
  if (isParam) {
    String sqlType=getSqlType(type);
    if (!sqlType.equals(type)) {
      value="String_Node_Str" + filterId + "String_Node_Str"+ getSqlType(type)+ "String_Node_Str";
    }
 else {
      value="String_Node_Str" + filterId;
    }
  }
  return value;
}
Program: 58449
Project: 58449
Buggy source:
private File extract(String module,String dirName,String lang,String code){
  List<URL> files=new ArrayList<URL>();
  files.addAll(MetaScanner.findAll(module,dirName,code + CONFIG_PATTERN));
  if (files.isEmpty()) {
    return null;
  }
  if (lang.isEmpty()) {
    files.addAll(MetaScanner.findAll(module,dirName,code + "String_Node_Str"));
  }
 else {
    String dirPath=dirName + "String_Node_Str";
    files.addAll(fetchUrls(module,dirPath + IMG_DIR));
    files.addAll(fetchUrls(module,dirPath + EXT_DIR));
    files.addAll(fetchUrls(module,dirPath + lang));
  }
  final File tmp=Files.createTempDir();
  for (  URL file : files) {
    String name=file.toString();
    name=name.substring(name.lastIndexOf(dirName));
    if (!lang.isEmpty()) {
      name=name.replace(dirName + "String_Node_Str" + lang,dirName);
    }
    try {
      copy(file.openStream(),tmp,name);
    }
 catch (    IOException e) {
      log.error(e.getMessage(),e);
    }
  }
  return tmp;
}

Fixed version (ground truth):
private File extract(String module,String dirName,String lang,String code){
  List<URL> files=new ArrayList<URL>();
  files.addAll(MetaScanner.findAll(module,dirName,code + CONFIG_PATTERN));
  if (files.isEmpty()) {
    log.debug("String_Node_Str",code + CONFIG_PATTERN);
    return null;
  }
  if (lang.isEmpty()) {
    log.debug("String_Node_Str",dirName,code);
    files.addAll(MetaScanner.findAll(module,dirName,code + "String_Node_Str"));
  }
 else {
    String dirPath=dirName + "String_Node_Str";
    log.debug("String_Node_Str",dirName);
    files.addAll(fetchUrls(module,dirPath + IMG_DIR));
    files.addAll(fetchUrls(module,dirPath + EXT_DIR));
    files.addAll(fetchUrls(module,dirPath + lang));
  }
  log.debug("String_Node_Str",files.size());
  final File tmp=Files.createTempDir();
  for (  URL file : files) {
    String name=file.toString();
    name=name.substring(name.lastIndexOf(dirName));
    if (!lang.isEmpty()) {
      name=name.replace(dirName + "String_Node_Str" + lang,dirName.replace("String_Node_Str",File.separator));
      log.debug("String_Node_Str",name);
    }
    try {
      copy(file.openStream(),tmp,name);
    }
 catch (    IOException e) {
      log.error(e.getMessage(),e);
    }
  }
  return tmp;
}
Program: 58450
Project: 58450
Buggy source:
@Override public MetaJsonField save(MetaJsonField metajsonField){
  AppBuilder appBuilder=metajsonField.getAppBuilder();
  if (appBuilder != null) {
    metajsonField.setIncludeIf("String_Node_Str" + appBuilder.getCode() + "String_Node_Str");
  }
  return metajsonField;
}

Fixed version (ground truth):
@Override public MetaJsonField save(MetaJsonField metajsonField){
  AppBuilder appBuilder=metajsonField.getAppBuilder();
  if (appBuilder != null) {
    metajsonField.setIncludeIf("String_Node_Str" + appBuilder.getCode() + "String_Node_Str");
  }
  return super.save(metajsonField);
}
Program: 58451
Project: 58451
Buggy source:
@Override public Lead save(Lead entity){
  if (entity.getUser() != null && entity.getStatusSelect() == LEAD_STATUS_NEW) {
    entity.setStatusSelect(LEAD_STATUS_ASSIGNED);
  }
 else   if (entity.getUser() == null && entity.getStatusSelect() == LEAD_STATUS_ASSIGNED) {
    entity.setStatusSelect(LEAD_STATUS_NEW);
  }
  return super.save(entity);
}

Fixed version (ground truth):
@Override public Lead save(Lead entity){
  if (entity.getUser() != null && entity.getStatusSelect() == LEAD_STATUS_NEW) {
    entity.setStatusSelect(LEAD_STATUS_ASSIGNED);
  }
 else   if (entity.getUser() == null && entity.getStatusSelect() == LEAD_STATUS_ASSIGNED) {
    entity.setStatusSelect(LEAD_STATUS_NEW);
  }
  StringBuilder fullName=new StringBuilder();
  if (!Strings.isNullOrEmpty(entity.getEnterpriseName())) {
    fullName.append(entity.getEnterpriseName());
    if (!Strings.isNullOrEmpty(entity.getName()) || !Strings.isNullOrEmpty(entity.getFirstName()))     fullName.append("String_Node_Str");
  }
  if (!Strings.isNullOrEmpty(entity.getName()) && !Strings.isNullOrEmpty(entity.getFirstName())) {
    fullName.append(entity.getFirstName());
    fullName.append("String_Node_Str");
    fullName.append(entity.getName());
  }
 else   if (!Strings.isNullOrEmpty(entity.getFirstName()))   fullName.append(entity.getFirstName());
 else   if (!Strings.isNullOrEmpty(entity.getName()))   fullName.append(entity.getName());
  entity.setFullName(fullName.toString());
  return super.save(entity);
}
Program: 58452
Project: 58452
Buggy source:
@Override protected void configure(){
  bind(EventRepository.class).to(EventManagementRepository.class);
  bind(LeadRepository.class).to(LeadManagementRepository.class);
  bind(OpportunityRepository.class).to(OpportunityManagementRepository.class);
  bind(OpportunityService.class).to(OpportunityServiceImpl.class);
  bind(ICalendarService.class).to(CalendarService.class);
  bind(AppCrmService.class).to(AppCrmServiceImpl.class);
  bind(EventService.class).to(EventServiceImpl.class);
  bind(CrmBatchRepository.class).to(CrmBatchCrmRepository.class);
  bind(LeadService.class).to(LeadServiceImpl.class);
  ICalendarEventFactory.register(ICalendarRepository.CRM_SYNCHRO,Event::new);
  bind(LeadRepository.class).to(LeadCrmRepository.class);
}

Fixed version (ground truth):
@Override protected void configure(){
  bind(EventRepository.class).to(EventManagementRepository.class);
  bind(LeadRepository.class).to(LeadManagementRepository.class);
  bind(OpportunityRepository.class).to(OpportunityManagementRepository.class);
  bind(OpportunityService.class).to(OpportunityServiceImpl.class);
  bind(ICalendarService.class).to(CalendarService.class);
  bind(AppCrmService.class).to(AppCrmServiceImpl.class);
  bind(EventService.class).to(EventServiceImpl.class);
  bind(CrmBatchRepository.class).to(CrmBatchCrmRepository.class);
  bind(LeadService.class).to(LeadServiceImpl.class);
  ICalendarEventFactory.register(ICalendarRepository.CRM_SYNCHRO,Event::new);
}
Program: 58453
Project: 58453
Buggy source:
@Override public Lead save(Lead entity){
  if (entity.getUser() != null && entity.getStatusSelect() == LEAD_STATUS_NEW) {
    entity.setStatusSelect(LEAD_STATUS_ASSIGNED);
  }
 else   if (entity.getUser() == null && entity.getStatusSelect() == LEAD_STATUS_ASSIGNED) {
    entity.setStatusSelect(LEAD_STATUS_NEW);
  }
  StringBuilder fullName=new StringBuilder();
  if (!Strings.isNullOrEmpty(entity.getEnterpriseName())) {
    fullName.append(entity.getEnterpriseName());
    if (!Strings.isNullOrEmpty(entity.getName()) || !Strings.isNullOrEmpty(entity.getFirstName()))     fullName.append("String_Node_Str");
  }
  if (!Strings.isNullOrEmpty(entity.getName()) && !Strings.isNullOrEmpty(entity.getFirstName())) {
    fullName.append(entity.getFirstName());
    fullName.append("String_Node_Str");
    fullName.append(entity.getName());
  }
 else   if (!Strings.isNullOrEmpty(entity.getFirstName()))   fullName.append(entity.getFirstName());
 else   if (!Strings.isNullOrEmpty(entity.getName()))   fullName.append(entity.getName());
  entity.setFullName(fullName.toString());
  return super.save(entity);
}

Fixed version (ground truth):
@Override public Lead save(Lead entity){
  if (entity.getUser() != null && entity.getStatusSelect() == LEAD_STATUS_NEW) {
    entity.setStatusSelect(LEAD_STATUS_ASSIGNED);
  }
 else   if (entity.getUser() == null && entity.getStatusSelect() == LEAD_STATUS_ASSIGNED) {
    entity.setStatusSelect(LEAD_STATUS_NEW);
  }
  String fullName=Beans.get(LeadService.class).processFullName(entity.getEnterpriseName(),entity.getName(),entity.getFirstName());
  entity.setFullName(fullName);
  return super.save(entity);
}
Program: 58454
Project: 58454
Buggy source:
public Address checkLatLang(Address address,boolean forceUpdate);

Fixed version (ground truth):
public Address checkLatLang(Address address,boolean forceUpdate) throws AxelorException, JSONException ;
Program: 58455
Project: 58455
Buggy source:
@Transactional public Address checkLatLang(Address address,boolean forceUpdate){
  address=addressRepo.find(address.getId());
  BigDecimal latit=address.getLatit();
  BigDecimal longit=address.getLongit();
  if ((BigDecimal.ZERO.compareTo(latit) == 0 || BigDecimal.ZERO.compareTo(longit) == 0) || forceUpdate) {
    Map<String,Object> result=Beans.get(MapService.class).getMap(address.getFullName());
    if (result != null) {
      address.setLatit((BigDecimal)result.get("String_Node_Str"));
      address.setLongit((BigDecimal)result.get("String_Node_Str"));
      address=addressRepo.save(address);
    }
  }
  return address;
}

Fixed version (ground truth):
@Transactional public Address checkLatLang(Address address,boolean forceUpdate) throws AxelorException, JSONException {
  address=addressRepo.find(address.getId());
  BigDecimal latit=address.getLatit();
  BigDecimal longit=address.getLongit();
  if ((BigDecimal.ZERO.compareTo(latit) == 0 || BigDecimal.ZERO.compareTo(longit) == 0) || forceUpdate) {
    Map<String,Object> result=Beans.get(MapService.class).getMap(address.getFullName());
    if (result != null) {
      address.setLatit((BigDecimal)result.get("String_Node_Str"));
      address.setLongit((BigDecimal)result.get("String_Node_Str"));
      address=addressRepo.save(address);
    }
  }
  return address;
}
Program: 58456
Project: 58456
Buggy source:
public HashMap<String,Object> getMapGoogle(String qString){
  LOG.debug("String_Node_Str",qString);
  try {
    JSONObject googleResponse=geocodeGoogle(qString);
    LOG.debug("String_Node_Str",googleResponse);
    if (googleResponse != null) {
      HashMap<String,Object> result=new HashMap<String,Object>();
      BigDecimal latitude=new BigDecimal(googleResponse.get("String_Node_Str").toString());
      BigDecimal longitude=new BigDecimal(googleResponse.get("String_Node_Str").toString());
      LOG.debug("String_Node_Str" + "String_Node_Str" + latitude + "String_Node_Str"+ longitude+ "String_Node_Str");
      result.put("String_Node_Str","String_Node_Str" + getGoogleMapsApiKey() + "String_Node_Str"+ latitude+ "String_Node_Str"+ longitude+ "String_Node_Str");
      result.put("String_Node_Str",latitude);
      result.put("String_Node_Str",longitude);
      return result;
    }
  }
 catch (  Exception e) {
    TraceBackService.trace(e);
  }
  return null;
}

Fixed version (ground truth):
public HashMap<String,Object> getMapGoogle(String qString) throws AxelorException, JSONException {
  LOG.debug("String_Node_Str",qString);
  JSONObject googleResponse=geocodeGoogle(qString);
  LOG.debug("String_Node_Str",googleResponse);
  if (googleResponse != null) {
    HashMap<String,Object> result=new HashMap<String,Object>();
    BigDecimal latitude=new BigDecimal(googleResponse.get("String_Node_Str").toString());
    BigDecimal longitude=new BigDecimal(googleResponse.get("String_Node_Str").toString());
    LOG.debug("String_Node_Str" + "String_Node_Str" + latitude + "String_Node_Str"+ longitude+ "String_Node_Str");
    result.put("String_Node_Str","String_Node_Str" + getGoogleMapsApiKey() + "String_Node_Str"+ latitude+ "String_Node_Str"+ longitude+ "String_Node_Str");
    result.put("String_Node_Str",latitude);
    result.put("String_Node_Str",longitude);
    return result;
  }
  return null;
}
Program: 58457
Project: 58457
Buggy source:
public HashMap<String,Object> getMap(String qString){
  LOG.debug("String_Node_Str",qString);
switch (appBaseService.getAppBase().getMapApiSelect()) {
case AppBaseRepository.MAP_API_GOOGLE:
    return getMapGoogle(qString);
case AppBaseRepository.MAP_API_OPEN_STREET_MAP:
  return getMapOsm(qString);
default :
return null;
}
}

Fixed version (ground truth):
public HashMap<String,Object> getMap(String qString) throws AxelorException, JSONException {
  LOG.debug("String_Node_Str",qString);
switch (appBaseService.getAppBase().getMapApiSelect()) {
case AppBaseRepository.MAP_API_GOOGLE:
    return getMapGoogle(qString);
case AppBaseRepository.MAP_API_OPEN_STREET_MAP:
  return getMapOsm(qString);
default :
return null;
}
}
Program: 58458
Project: 58458
Buggy source:
public String getDirectionUrl(BigDecimal dLat,BigDecimal dLon,BigDecimal aLat,BigDecimal aLon){
  return "String_Node_Str" + dLat + "String_Node_Str"+ dLon+ "String_Node_Str"+ aLat+ "String_Node_Str"+ aLon+ "String_Node_Str"+ getGoogleMapsApiKey();
}

Fixed version (ground truth):
public String getDirectionUrl(String key,BigDecimal dLat,BigDecimal dLon,BigDecimal aLat,BigDecimal aLon){
  return "String_Node_Str" + dLat + "String_Node_Str"+ dLon+ "String_Node_Str"+ aLat+ "String_Node_Str"+ aLon+ "String_Node_Str"+ key;
}
Program: 58459
Project: 58459
Buggy source:
public void checkLatLang(ActionRequest request,ActionResponse response){
  Address address=request.getContext().asType(Address.class);
  addressService.checkLatLang(address,true);
  response.setReload(true);
}

Fixed version (ground truth):
public void checkLatLang(ActionRequest request,ActionResponse response){
  try {
    Address address=request.getContext().asType(Address.class);
    AppBase appBase=Beans.get(AppBase.class);
    if (appBase.getMapApiSelect() == null || (appBase.getMapApiSelect() == AppBaseRepository.MAP_API_GOOGLE && appBase.getGoogleMapsApiKey() == null)) {
      return;
    }
    addressService.checkLatLang(address,true);
    response.setReload(true);
  }
 catch (  Exception e) {
    TraceBackService.trace(response,e);
  }
}
Program: 58461
Project: 58461
Buggy source:
@Override protected void start() throws IllegalAccessException, AxelorException {
  super.start();
  if (batch.getHrBatch().getDayNumber() == null || batch.getHrBatch().getDayNumber().compareTo(BigDecimal.ZERO) == 0 || batch.getHrBatch().getLeaveReason() == null) {
    TraceBackService.trace(new AxelorException(TraceBackRepository.CATEGORY_CONFIGURATION_ERROR,I18n.get(IExceptionMessage.BATCH_CATEGORY_MISSING_FIELD)),IException.LEAVE_MANAGEMENT,batch.getId());
  }
  total=0;
  noValueAnomaly=0;
  confAnomaly=0;
  checkPoint();
}

Fixed version (ground truth):
@Override protected void start() throws IllegalAccessException, AxelorException {
  super.start();
  if (batch.getHrBatch().getDayNumber() == null || batch.getHrBatch().getDayNumber().compareTo(BigDecimal.ZERO) == 0 || batch.getHrBatch().getLeaveReason() == null) {
    TraceBackService.trace(new AxelorException(TraceBackRepository.CATEGORY_CONFIGURATION_ERROR,I18n.get(IExceptionMessage.BATCH_MISSING_FIELD)),IException.LEAVE_MANAGEMENT,batch.getId());
  }
  total=0;
  noValueAnomaly=0;
  confAnomaly=0;
  checkPoint();
}
Program: 58462
Project: 58462
Buggy source:
@Override protected void start() throws IllegalArgumentException, IllegalAccessException, AxelorException {
  super.start();
  if (batch.getHrBatch().getDayNumber() == null || batch.getHrBatch().getDayNumber() == BigDecimal.ZERO || batch.getHrBatch().getLeaveReason() == null)   TraceBackService.trace(new AxelorException(TraceBackRepository.CATEGORY_CONFIGURATION_ERROR,I18n.get(IExceptionMessage.BATCH_CATEGORY_MISSING_FIELD)),IException.LEAVE_MANAGEMENT,batch.getId());
  total=0;
  noValueAnomaly=0;
  confAnomaly=0;
  this.maker=new TemplateMaker(Locale.FRENCH,TEMPLATE_DELIMITER,TEMPLATE_DELIMITER);
  hrConfig=Beans.get(HRConfigRepository.class).all().filter("String_Node_Str",batch.getHrBatch().getCompany().getId()).fetchOne();
  checkPoint();
}

Fixed version (ground truth):
@Override protected void start() throws IllegalArgumentException, IllegalAccessException, AxelorException {
  super.start();
  if (batch.getHrBatch().getDayNumber() == null || batch.getHrBatch().getDayNumber() == BigDecimal.ZERO || batch.getHrBatch().getLeaveReason() == null)   TraceBackService.trace(new AxelorException(TraceBackRepository.CATEGORY_CONFIGURATION_ERROR,I18n.get(IExceptionMessage.BATCH_MISSING_FIELD)),IException.LEAVE_MANAGEMENT,batch.getId());
  total=0;
  noValueAnomaly=0;
  confAnomaly=0;
  this.maker=new TemplateMaker(Locale.FRENCH,TEMPLATE_DELIMITER,TEMPLATE_DELIMITER);
  hrConfig=Beans.get(HRConfigRepository.class).all().filter("String_Node_Str",batch.getHrBatch().getCompany().getId()).fetchOne();
  checkPoint();
}
Program: 58463
Project: 58463
Buggy source:
@Override public SaleOrder save(SaleOrder saleOrder){
  try {
    saleOrder=super.save(saleOrder);
    computeSeq(saleOrder);
    computeFullName(saleOrder);
    computeSubMargin(saleOrder);
    Beans.get(SaleOrderMarginService.class).computeMarginSaleOrder(saleOrder);
    return saleOrder;
  }
 catch (  Exception e) {
    throw new PersistenceException(e.getLocalizedMessage());
  }
}

Fixed version (ground truth):
@Override public SaleOrder save(SaleOrder saleOrder){
  try {
    computeSeq(saleOrder);
    computeFullName(saleOrder);
    computeSubMargin(saleOrder);
    Beans.get(SaleOrderMarginService.class).computeMarginSaleOrder(saleOrder);
    return super.save(saleOrder);
  }
 catch (  Exception e) {
    throw new PersistenceException(e.getLocalizedMessage());
  }
}
Program: 58464
Project: 58464
Buggy source:
public Map<String,Object> getDiscount(Invoice invoice,InvoiceLine invoiceLine,BigDecimal price){
  PriceList priceList=invoice.getPriceList();
  BigDecimal discountAmount=BigDecimal.ZERO;
  Map<String,Object> discounts=null;
  int computeMethodDiscountSelect=appAccountService.getAppBase().getComputeMethodDiscountSelect();
  if (priceList != null) {
    int discountTypeSelect=0;
    PriceListLine priceListLine=this.getPriceListLine(invoiceLine,priceList);
    if (priceListLine != null) {
      discountTypeSelect=priceListLine.getTypeSelect();
    }
    discounts=priceListService.getDiscounts(priceList,priceListLine,price);
    discountAmount=(BigDecimal)discounts.get("String_Node_Str");
    if ((computeMethodDiscountSelect == AppBaseRepository.INCLUDE_DISCOUNT_REPLACE_ONLY && discountTypeSelect == PriceListLineRepository.TYPE_REPLACE) || computeMethodDiscountSelect == AppBaseRepository.INCLUDE_DISCOUNT) {
      discounts.put("String_Node_Str",priceListService.computeDiscount(price,(int)discounts.get("String_Node_Str"),discountAmount));
    }
  }
  return discounts;
}

Fixed version (ground truth):
public Map<String,Object> getDiscount(Invoice invoice,InvoiceLine invoiceLine,BigDecimal price){
  PriceList priceList=invoice.getPriceList();
  if (priceList == null) {
    return null;
  }
  PriceListLine priceListLine=this.getPriceListLine(invoiceLine,priceList);
  return priceListService.getReplacedPriceAndDiscounts(priceList,priceListLine,price);
}
Program: 58466
Project: 58466
Buggy source:
public Map<String,Object> getDiscount(SaleOrder saleOrder,SaleOrderLine saleOrderLine,BigDecimal price){
  PriceList priceList=saleOrder.getPriceList();
  if (priceList != null) {
    int discountTypeSelect=0;
    PriceListLine priceListLine=this.getPriceListLine(saleOrderLine,priceList);
    if (priceListLine != null) {
      discountTypeSelect=priceListLine.getTypeSelect();
    }
    Map<String,Object> discounts=priceListService.getDiscounts(priceList,priceListLine,price);
    if (discounts != null) {
      int computeMethodDiscountSelect=appBaseService.getAppBase().getComputeMethodDiscountSelect();
      if ((computeMethodDiscountSelect == AppBaseRepository.INCLUDE_DISCOUNT_REPLACE_ONLY && discountTypeSelect == PriceListLineRepository.TYPE_REPLACE) || computeMethodDiscountSelect == AppBaseRepository.INCLUDE_DISCOUNT) {
        price=priceListService.computeDiscount(price,(int)discounts.get("String_Node_Str"),(BigDecimal)discounts.get("String_Node_Str"));
        discounts.put("String_Node_Str",price);
        discounts.put("String_Node_Str",PriceListLineRepository.AMOUNT_TYPE_NONE);
        discounts.put("String_Node_Str",BigDecimal.ZERO);
      }
    }
    return discounts;
  }
  return null;
}

Fixed version (ground truth):
public Map<String,Object> getDiscount(SaleOrder saleOrder,SaleOrderLine saleOrderLine,BigDecimal price){
  PriceList priceList=saleOrder.getPriceList();
  if (priceList == null) {
    return null;
  }
  PriceListLine priceListLine=this.getPriceListLine(saleOrderLine,priceList);
  return priceListService.getReplacedPriceAndDiscounts(priceList,priceListLine,price);
}
Program: 58467
Project: 58467
Buggy source:
public String importDataDemo(App app);

Fixed version (ground truth):
public App importDataDemo(App app) throws AxelorException ;
Program: 58468
Project: 58468
Buggy source:
public App installApp(App app,Boolean importDemo);

Fixed version (ground truth):
public App installApp(App app,String language) throws AxelorException ;
Program: 58469
Project: 58469
Buggy source:
@Override public List<String> getNames(List<App> apps){
  List<String> names=new ArrayList<String>();
  for (  App app : apps) {
    names.add(app.getName());
  }
  return names;
}

Fixed version (ground truth):
private List<String> getNames(List<App> apps){
  List<String> names=new ArrayList<String>();
  for (  App app : apps) {
    names.add(app.getName());
  }
  return names;
}
Program: 58470
Project: 58470
Buggy source:
private void importDataInit(App app){
  String lang=getLanguage(app);
  if (lang == null) {
    return;
  }
  importData(app,DIR_INIT);
  app=appRepo.find(app.getId());
  app.setInitDataLoaded(true);
  saveApp(app);
}

Fixed version (ground truth):
private App importDataInit(App app){
  String lang=getLanguage(app);
  if (lang == null) {
    return app;
  }
  importData(app,DIR_INIT);
  app=appRepo.find(app.getId());
  app.setInitDataLoaded(true);
  return app;
}
Program: 58471
Project: 58471
Buggy source:
@Override public App installApp(App app,Boolean importDemo){
  List<App> apps=getDepends(app,false);
  for (  App parentApp : apps) {
    parentApp=appRepo.find(parentApp.getId());
    installApp(parentApp,importDemo);
  }
  app=appRepo.find(app.getId());
  log.debug("String_Node_Str",app.getInitDataLoaded(),app.getCode());
  if (!app.getInitDataLoaded()) {
    importDataInit(app);
  }
  app=appRepo.find(app.getId());
  if (importDemo != null && importDemo && !app.getDemoDataLoaded()) {
    importDataDemo(app);
  }
  app=appRepo.find(app.getId());
  app.setActive(true);
  return saveApp(app);
}

Fixed version (ground truth):
@Override public App installApp(App app,String language) throws AxelorException {
  app=appRepo.find(app.getId());
  if (app.getActive()) {
    return app;
  }
  if (language != null) {
    app.setLanguageSelect(language);
  }
 else {
    language=app.getLanguageSelect();
  }
  List<App> apps=getDepends(app,false);
  for (  App parentApp : apps) {
    installApp(parentApp,language);
  }
  log.debug("String_Node_Str",app.getInitDataLoaded(),app.getCode());
  if (!app.getInitDataLoaded()) {
    app=importDataInit(app);
  }
  app.setActive(true);
  return saveApp(app);
}
Program: 58472
Project: 58472
Buggy source:
@Override @Transactional public App unInstallApp(App app) throws AxelorException {
  List<App> children=getChildren(app,true);
  if (!children.isEmpty()) {
    List<String> childrenNames=getNames(children);
    throw new AxelorException(IException.INCONSISTENCY,IAppExceptionMessages.APP_IN_USE,childrenNames);
  }
  app.setActive(false);
  return appRepo.save(app);
}

Fixed version (ground truth):
@Override public App unInstallApp(App app) throws AxelorException {
  List<App> children=getChildren(app,true);
  if (!children.isEmpty()) {
    List<String> childrenNames=getNames(children);
    throw new AxelorException(IException.INCONSISTENCY,IAppExceptionMessages.APP_IN_USE,childrenNames);
  }
  app.setActive(false);
  return saveApp(app);
}
Program: 58473
Project: 58473
Buggy source:
private void importParentData(App app){
  List<App> depends=getDepends(app,true);
  for (  App parent : depends) {
    parent=appRepo.find(parent.getId());
    if (!parent.getDemoDataLoaded()) {
      importDataDemo(parent);
    }
  }
}

Fixed version (ground truth):
private void importParentData(App app) throws AxelorException {
  List<App> depends=getDepends(app,true);
  for (  App parent : depends) {
    parent=appRepo.find(parent.getId());
    if (!parent.getDemoDataLoaded()) {
      importDataDemo(parent);
    }
  }
}
Program: 58474
Project: 58474
Buggy source:
@Override public List<App> getChildren(App app,Boolean active){
  String code=app.getCode();
  String query="String_Node_Str";
  if (active != null) {
    query="String_Node_Str" + query + "String_Node_Str"+ active;
  }
  List<App> apps=appRepo.all().filter(query,code).fetch();
  log.debug("String_Node_Str",app.getName(),apps.size());
  return apps;
}

Fixed version (ground truth):
private List<App> getChildren(App app,Boolean active){
  String code=app.getCode();
  String query="String_Node_Str";
  if (active != null) {
    query="String_Node_Str" + query + "String_Node_Str"+ active;
  }
  List<App> apps=appRepo.all().filter(query,code).fetch();
  log.debug("String_Node_Str",app.getName(),apps.size());
  return apps;
}
Program: 58475
Project: 58475
Buggy source:
@Override public List<App> sortApps(Collection<App> apps){
  List<App> appsList=new ArrayList<App>();
  appsList.addAll(apps);
  appsList.sort(new Comparator<App>(){
    @Override public int compare(    App app1,    App app2){
      Integer order1=app1.getInstallOrder();
      Integer order2=app2.getInstallOrder();
      if (order1 < order2) {
        return -1;
      }
      if (order1 > order2) {
        return 1;
      }
      return 0;
    }
  }
);
  log.debug("String_Node_Str",getNames(appsList));
  return appsList;
}

Fixed version (ground truth):
private List<App> sortApps(Collection<App> apps){
  List<App> appsList=new ArrayList<App>();
  appsList.addAll(apps);
  appsList.sort(new Comparator<App>(){
    @Override public int compare(    App app1,    App app2){
      Integer order1=app1.getInstallOrder();
      Integer order2=app2.getInstallOrder();
      if (order1 < order2) {
        return -1;
      }
      if (order1 > order2) {
        return 1;
      }
      return 0;
    }
  }
);
  log.debug("String_Node_Str",getNames(appsList));
  return appsList;
}
Program: 58476
Project: 58476
Buggy source:
@Override public String importDataDemo(App app){
  app=appRepo.find(app.getId());
  log.debug("String_Node_Str",app.getCode(),app.getLanguageSelect());
  importParentData(app);
  String lang=getLanguage(app);
  if (lang == null) {
    return I18n.get(IAppExceptionMessages.NO_LANGAUAGE_SELECTED);
  }
  importData(app,DIR_DEMO);
  app=appRepo.find(app.getId());
  app.setDemoDataLoaded(true);
  saveApp(app);
  return I18n.get(IAppExceptionMessages.DEMO_DATA_SUCCESS);
}

Fixed version (ground truth):
@Override public App importDataDemo(App app) throws AxelorException {
  if (app.getDemoDataLoaded()) {
    return app;
  }
  log.debug("String_Node_Str",app.getCode(),app.getLanguageSelect());
  importParentData(app);
  String lang=getLanguage(app);
  if (lang == null) {
    throw new AxelorException(IException.CONFIGURATION_ERROR,I18n.get(IAppExceptionMessages.NO_LANGAUAGE_SELECTED));
  }
  importData(app,DIR_DEMO);
  app=appRepo.find(app.getId());
  app.setDemoDataLoaded(true);
  return saveApp(app);
}
Program: 58477
Project: 58477
Buggy source:
@Override public List<App> getDepends(App app,Boolean active){
  List<App> apps=new ArrayList<App>();
  for (  App depend : app.getDependsOnSet()) {
    if (depend.getActive().equals(active)) {
      apps.add(depend);
    }
  }
  return sortApps(apps);
}

Fixed version (ground truth):
private List<App> getDepends(App app,Boolean active){
  List<App> apps=new ArrayList<App>();
  for (  App depend : app.getDependsOnSet()) {
    if (depend.getActive().equals(active)) {
      apps.add(depend);
    }
  }
  return sortApps(apps);
}
Program: 58478
Project: 58478
Buggy source:
public void bulkInstall(ActionRequest request,ActionResponse response){
  Context context=request.getContext();
  Set<Map<String,Object>> apps=new HashSet<Map<String,Object>>();
  Collection<Map<String,Object>> appsSet=(Collection<Map<String,Object>>)context.get("String_Node_Str");
  if (appsSet != null) {
    apps.addAll(appsSet);
  }
  Boolean importDemo=(Boolean)context.get("String_Node_Str");
  String language=(String)context.get("String_Node_Str");
  List<App> appList=new ArrayList<App>();
  for (  Map<String,Object> appData : apps) {
    App app=appRepo.find(Long.parseLong(appData.get("String_Node_Str").toString()));
    app=appService.updateLanguage(app,language);
    appList.add(app);
  }
  appList=appService.sortApps(appList);
  for (  App app : appList) {
    app=appRepo.find(app.getId());
    app=appService.installApp(app,importDemo);
  }
  response.setFlash(I18n.get(IAppExceptionMessages.BULK_INSTALL_SUCCESS));
  response.setSignal("String_Node_Str",true);
}

Fixed version (ground truth):
public void bulkInstall(ActionRequest request,ActionResponse response) throws AxelorException {
  Context context=request.getContext();
  Set<Map<String,Object>> apps=new HashSet<Map<String,Object>>();
  Collection<Map<String,Object>> appsSet=(Collection<Map<String,Object>>)context.get("String_Node_Str");
  if (appsSet != null) {
    apps.addAll(appsSet);
  }
  Boolean importDemo=(Boolean)context.get("String_Node_Str");
  String language=(String)context.get("String_Node_Str");
  List<App> appList=new ArrayList<App>();
  for (  Map<String,Object> appData : apps) {
    App app=appRepo.find(Long.parseLong(appData.get("String_Node_Str").toString()));
    appList.add(app);
  }
  appService.bulkInstall(appList,importDemo,language);
  response.setFlash(I18n.get(IAppExceptionMessages.BULK_INSTALL_SUCCESS));
  response.setSignal("String_Node_Str",true);
}
Program: 58479
Project: 58479
Buggy source:
public void importDataDemo(ActionRequest request,ActionResponse response){
  App app=request.getContext().asType(App.class);
  app=appRepo.find(app.getId());
  response.setFlash(appService.importDataDemo(app));
  response.setReload(true);
}

Fixed version (ground truth):
public void importDataDemo(ActionRequest request,ActionResponse response) throws AxelorException {
  App app=request.getContext().asType(App.class);
  app=appRepo.find(app.getId());
  appService.importDataDemo(app);
  response.setFlash(I18n.get(IAppExceptionMessages.DEMO_DATA_SUCCESS));
  response.setReload(true);
}
Program: 58480
Project: 58480
Buggy source:
public void installApp(ActionRequest request,ActionResponse response){
  App app=request.getContext().asType(App.class);
  app=appRepo.find(app.getId());
  appService.installApp(app,false);
  response.setSignal("String_Node_Str",true);
}

Fixed version (ground truth):
public void installApp(ActionRequest request,ActionResponse response) throws AxelorException {
  App app=request.getContext().asType(App.class);
  app=appRepo.find(app.getId());
  appService.installApp(app,null);
  response.setSignal("String_Node_Str",true);
}
Program: 58481
Project: 58481
Buggy source:
public Map<String,Object> getDiscounts(PriceList priceList,PriceListLine priceListLine,BigDecimal price){
  Map<String,Object> discounts=new HashMap<String,Object>();
  if (priceListLine != null) {
    discounts.put("String_Node_Str",this.getDiscountAmount(priceListLine,price).setScale(appBaseService.getNbDecimalDigitForUnitPrice(),RoundingMode.HALF_UP));
    discounts.put("String_Node_Str",this.getDiscountTypeSelect(priceListLine));
  }
 else {
    discounts.put("String_Node_Str",priceList.getGeneralDiscount().setScale(appBaseService.getNbDecimalDigitForUnitPrice(),RoundingMode.HALF_UP));
    discounts.put("String_Node_Str",PriceListLineRepository.AMOUNT_TYPE_PERCENT);
  }
  return discounts;
}

Fixed version (ground truth):
public Map<String,Object> getDiscounts(PriceList priceList,PriceListLine priceListLine,BigDecimal price){
  Map<String,Object> discounts=new HashMap<>();
  if (priceListLine != null) {
    discounts.put("String_Node_Str",this.getDiscountAmount(priceListLine,price).setScale(appBaseService.getNbDecimalDigitForUnitPrice(),RoundingMode.HALF_UP));
    discounts.put("String_Node_Str",this.getDiscountTypeSelect(priceListLine));
  }
 else {
    BigDecimal discountAmount=priceList.getGeneralDiscount().setScale(appBaseService.getNbDecimalDigitForUnitPrice(),RoundingMode.HALF_UP);
    discounts.put("String_Node_Str",discountAmount);
    if (discountAmount.compareTo(BigDecimal.ZERO) == 0) {
      discounts.put("String_Node_Str",PriceListLineRepository.AMOUNT_TYPE_NONE);
    }
 else {
      discounts.put("String_Node_Str",PriceListLineRepository.AMOUNT_TYPE_PERCENT);
    }
  }
  return discounts;
}
Program: 58482
Project: 58482
Buggy source:
public Map<String,Object> getDiscount(SaleOrder saleOrder,SaleOrderLine saleOrderLine,BigDecimal price){
  PriceList priceList=saleOrder.getPriceList();
  if (priceList != null) {
    int discountTypeSelect=0;
    PriceListLine priceListLine=this.getPriceListLine(saleOrderLine,priceList);
    if (priceListLine != null) {
      discountTypeSelect=priceListLine.getTypeSelect();
    }
    Map<String,Object> discounts=priceListService.getDiscounts(priceList,priceListLine,price);
    if (discounts != null) {
      int computeMethodDiscountSelect=appBaseService.getAppBase().getComputeMethodDiscountSelect();
      if ((computeMethodDiscountSelect == AppBaseRepository.INCLUDE_DISCOUNT_REPLACE_ONLY && discountTypeSelect == PriceListLineRepository.TYPE_REPLACE) || computeMethodDiscountSelect == AppBaseRepository.INCLUDE_DISCOUNT) {
        price=priceListService.computeDiscount(price,(int)discounts.get("String_Node_Str"),(BigDecimal)discounts.get("String_Node_Str"));
        discounts.put("String_Node_Str",price);
      }
    }
    return discounts;
  }
  return null;
}

Fixed version (ground truth):
public Map<String,Object> getDiscount(SaleOrder saleOrder,SaleOrderLine saleOrderLine,BigDecimal price){
  PriceList priceList=saleOrder.getPriceList();
  if (priceList != null) {
    int discountTypeSelect=0;
    PriceListLine priceListLine=this.getPriceListLine(saleOrderLine,priceList);
    if (priceListLine != null) {
      discountTypeSelect=priceListLine.getTypeSelect();
    }
    Map<String,Object> discounts=priceListService.getDiscounts(priceList,priceListLine,price);
    if (discounts != null) {
      int computeMethodDiscountSelect=appBaseService.getAppBase().getComputeMethodDiscountSelect();
      if ((computeMethodDiscountSelect == AppBaseRepository.INCLUDE_DISCOUNT_REPLACE_ONLY && discountTypeSelect == PriceListLineRepository.TYPE_REPLACE) || computeMethodDiscountSelect == AppBaseRepository.INCLUDE_DISCOUNT) {
        price=priceListService.computeDiscount(price,(int)discounts.get("String_Node_Str"),(BigDecimal)discounts.get("String_Node_Str"));
        discounts.put("String_Node_Str",price);
        discounts.put("String_Node_Str",PriceListLineRepository.AMOUNT_TYPE_NONE);
        discounts.put("String_Node_Str",BigDecimal.ZERO);
      }
    }
    return discounts;
  }
  return null;
}
Program: 58485
Project: 58485
Buggy source:
public Partner addPartnerAddress(Partner partner,Address address,Boolean isDefault,Boolean isInvoicing,Boolean isDelivery){
  PartnerAddress partnerAddress=createPartnerAddress(address,isDefault);
  if (isDefault != null && isDefault) {
    String query="String_Node_Str";
    if ((isInvoicing != null && isInvoicing) && (isDelivery != null && isDelivery)) {
      query="String_Node_Str";
    }
 else     if (isInvoicing != null && isInvoicing) {
      query="String_Node_Str";
    }
 else     if (isDelivery != null && isDelivery) {
      query="String_Node_Str";
    }
    resetDefaultAddress(partner,query);
  }
  partnerAddress.setIsInvoicingAddr(isInvoicing);
  partnerAddress.setIsDeliveryAddr(isDelivery);
  partnerAddress.setIsDefaultAddr(isDefault);
  partner.addPartnerAddressListItem(partnerAddress);
  return partner;
}

Fixed version (ground truth):
public Partner addPartnerAddress(Partner partner,Address address,Boolean isDefault,Boolean isInvoicing,Boolean isDelivery){
  PartnerAddress partnerAddress=createPartnerAddress(address,isDefault);
  if (isDefault != null && isDefault) {
    LOG.debug("String_Node_Str",isDelivery);
    LOG.debug("String_Node_Str",isInvoicing);
    String query=String.format("String_Node_Str",isDelivery,isInvoicing);
    resetDefaultAddress(partner,query);
  }
  partnerAddress.setIsInvoicingAddr(isInvoicing);
  partnerAddress.setIsDeliveryAddr(isDelivery);
  partnerAddress.setIsDefaultAddr(isDefault);
  partner.addPartnerAddressListItem(partnerAddress);
  return partner;
}