nus-yam/ex-repair huggingface dataset:
Program: 51467
Project: 51467
Buggy source:
/** 
 * gets a resource stream from the runtime context.
 * @param caller resource manager
 * @return input stream
 */
public InputStream getResourceAsStream(final ResourceManager caller) throws ResourceLoadingException {
  try {
    final ISolutionRepository solutionRepository=PentahoSystem.get(ISolutionRepository.class);
    return solutionRepository.getResourceInputStream(key.getIdentifierAsString(),false,ISolutionRepository.ACTION_EXECUTE);
  }
 catch (  FileNotFoundException e) {
    throw new ResourceLoadingException(e.getLocalizedMessage(),e);
  }
}

Fixed version (ground truth):
/** 
 * gets a resource stream from the runtime context.
 * @param caller resource manager
 * @return input stream
 */
public InputStream getResourceAsStream(final ResourceManager caller) throws ResourceLoadingException {
  try {
    IUnifiedRepository unifiedRepository=PentahoSystem.get(IUnifiedRepository.class);
    SimpleRepositoryFileData fileData=unifiedRepository.getDataForRead(key.getIdentifierAsString(),SimpleRepositoryFileData.class);
    return fileData.getStream();
  }
 catch (  UnifiedRepositoryException ex) {
    throw new ResourceLoadingException(ex.getLocalizedMessage(),ex);
  }
}
Program: 51468
Project: 51468
Buggy source:
/** 
 * gets a resource stream from the runtime context.
 * @param caller resource manager
 * @return input stream
 */
public InputStream getResourceAsStream(final ResourceManager caller) throws ResourceLoadingException {
  try {
    final ISolutionRepository solutionRepository=PentahoSystem.get(ISolutionRepository.class);
    return solutionRepository.getResourceInputStream(key.getIdentifier().toString(),false,ISolutionRepository.ACTION_EXECUTE);
  }
 catch (  FileNotFoundException e) {
    throw new ResourceLoadingException(e.getLocalizedMessage(),e);
  }
}

Fixed version (ground truth):
/** 
 * gets a resource stream from the runtime context.
 * @param caller resource manager
 * @return input stream
 */
public InputStream getResourceAsStream(final ResourceManager caller) throws ResourceLoadingException {
  try {
    final ISolutionRepository solutionRepository=PentahoSystem.get(ISolutionRepository.class);
    String fileIdentifier=key.getIdentifierAsString();
    if (fileIdentifier.startsWith("String_Node_Str")) {
      fileIdentifier=fileIdentifier.substring(1);
    }
    return solutionRepository.getResourceInputStream(fileIdentifier,false,ISolutionRepository.ACTION_EXECUTE);
  }
 catch (  FileNotFoundException e) {
    throw new ResourceLoadingException(e.getLocalizedMessage(),e);
  }
}
Program: 51469
Project: 51469
Buggy source:
/** 
 * gets a resource stream from the runtime context.
 * @param caller resource manager
 * @return input stream
 */
public InputStream getResourceAsStream(ResourceManager caller) throws ResourceLoadingException {
  try {
    ISolutionRepository solutionRepository=PentahoSystem.get(ISolutionRepository.class);
    return solutionRepository.getResourceInputStream(key.getIdentifier().toString(),false,ISolutionRepository.ACTION_EXECUTE);
  }
 catch (  FileNotFoundException e) {
    throw new ResourceLoadingException(e.getLocalizedMessage(),e);
  }
}

Fixed version (ground truth):
/** 
 * gets a resource stream from the runtime context.
 * @param caller resource manager
 * @return input stream
 */
public InputStream getResourceAsStream(ResourceManager caller) throws ResourceLoadingException {
  try {
    ISolutionRepository solutionRepository=PentahoSystem.get(ISolutionRepository.class);
    String fileIdentifier=key.getIdentifierAsString();
    if (fileIdentifier.startsWith("String_Node_Str")) {
      fileIdentifier=fileIdentifier.substring(1);
    }
    return solutionRepository.getResourceInputStream(fileIdentifier,false,ISolutionRepository.ACTION_EXECUTE);
  }
 catch (  FileNotFoundException e) {
    throw new ResourceLoadingException(e.getLocalizedMessage(),e);
  }
}
Program: 51470
Project: 51470
Buggy source:
public String serialize(final ResourceKey bundleKey,final ResourceKey key) throws ResourceException {
  throw new ResourceKeyCreationException(Messages.getString("String_Node_Str"));
}

Fixed version (ground truth):
public String serialize(final ResourceKey bundleKey,final ResourceKey key) throws ResourceException {
  throw new ResourceKeyCreationException(Messages.getInstance().getString("String_Node_Str"));
}
Program: 51471
Project: 51471
Buggy source:
public ResourceKey deserialize(final ResourceKey bundleKey,final String stringKey) throws ResourceKeyCreationException {
  throw new ResourceKeyCreationException(Messages.getString("String_Node_Str"));
}

Fixed version (ground truth):
public ResourceKey deserialize(final ResourceKey bundleKey,final String stringKey) throws ResourceKeyCreationException {
  throw new ResourceKeyCreationException(Messages.getInstance().getString("String_Node_Str"));
}
Program: 51472
Project: 51472
Buggy source:
private static File createExperimentalFolder(List<IDesign> problems,File experimentalFolder,String expFolderId) throws InPUTException {
  if (expFolderId != null) {
    File expFolder;
synchronized (globalExperimentCounter) {
      expFolder=new File(expFolderId);
      while (expFolder.exists()) {
        repetitionCounter=globalExperimentCounter.incrementAndGet();
        expFolder=new File(initExperimentalFolder(expFolderId));
      }
      repetitionCounter=globalExperimentCounter.intValue();
    }
    expFolder.mkdirs();
    experimentalFolder=expFolder;
  }
  addProblems(experimentalFolder,problems);
  return experimentalFolder;
}

Fixed version (ground truth):
private static File createExperimentalFolder(List<IDesign> problems,File experimentalFolder,String expFolderId) throws InPUTException {
  if (expFolderId != null) {
    File expFolder;
synchronized (globalExperimentCounter) {
      expFolder=new File(expFolderId);
      while (expFolder.exists()) {
        repetitionCounter=globalExperimentCounter.incrementAndGet();
        expFolder=new File(initExperimentalFolder(expFolderId));
      }
      repetitionCounter=globalExperimentCounter.intValue();
    }
    expFolder.mkdirs();
    experimentalFolder=expFolder;
  }
  if (problems != null)   addProblems(experimentalFolder,problems);
  return experimentalFolder;
}
Program: 51473
Project: 51473
Buggy source:
/** 
 * only for existing investigations that should be proceeded. uses the existing config file.
 */
public void resumeInvestigation(ExperimentConductor<T> conductor,boolean isMinProblem) throws InPUTException, IOException {
  if (investigationPath == null)   throw new IllegalStateException("String_Node_Str");
  String spotConfigPath=investigationPath + File.separator + SPOTQ.SPOT_DESIGN_ID+ Q.XML;
  investigate(spotConfigPath,true,true,conductor);
}

Fixed version (ground truth):
/** 
 * only for existing investigations that should be proceeded. uses the existing config file.
 */
public void resumeInvestigation(ExperimentConductor<T> conductor,boolean isMinProblem,boolean randomProblemChoice) throws InPUTException, IOException {
  if (investigationPath == null)   throw new IllegalStateException("String_Node_Str");
  String spotConfigPath=investigationPath + File.separator + SPOTQ.SPOT_DESIGN_ID+ Q.XML;
  investigate(spotConfigPath,isMinProblem,true,randomProblemChoice,conductor);
}
Program: 51474
Project: 51474
Buggy source:
public void investigate(String spotConfigPath,boolean isMinProblem,ExperimentConductor<T> conductor) throws InPUTException, IOException {
  investigate(spotConfigPath,isMinProblem,false,conductor);
}

Fixed version (ground truth):
public void investigate(String spotConfigPath,boolean isMinProblem,boolean randomProblemChoice,ExperimentConductor<T> conductor) throws InPUTException, IOException {
  investigate(spotConfigPath,isMinProblem,false,randomProblemChoice,conductor);
}
Program: 51475
Project: 51475
Buggy source:
public SPOT(IInPUT input,List<IDesign> problems,String spotConfigPath,String studyId,boolean minProblem,boolean resumeExisting) throws InPUTException {
  super(input,problems,studyId,minProblem);
  config=initConfig(spotConfigPath);
  helper=new SpotHelper(input,config,studyId,minProblem,problems,resumeExisting);
  initSeed();
  currentDesignSize=getTotalAmountRunsInitialDesign();
}

Fixed version (ground truth):
public SPOT(IInPUT input,List<IDesign> problems,String spotConfigPath,String studyId,boolean minProblem,boolean resumeExisting,boolean randomProblemChoice) throws InPUTException {
  super(input,problems,studyId,minProblem,randomProblemChoice);
  config=initConfig(spotConfigPath);
  helper=new SpotHelper(input,config,studyId,minProblem,problems,resumeExisting);
  initSeed();
  currentDesignSize=getTotalAmountRunsInitialDesign();
}
Program: 51476
Project: 51476
Buggy source:
@Override public IExperiment nextExperiment() throws InPUTException {
  if (currentDesignPointer == 0 || currentDesignPointer == currentDesignSize) {
    currentDesignPointer=0;
    currentDesignSize=initNextDesign();
  }
  IExperiment nextExperiment=nextExperiment(currentDesignPointer);
  nextExperiment.setProblemFeatures(randomInstance());
  if (!nextExperiment.same(currentExperiment)) {
    currentExperiment=nextExperiment;
    amountInvestigatedConfigurations++;
  }
  return currentExperiment;
}

Fixed version (ground truth):
@Override public IExperiment nextExperiment() throws InPUTException {
  if (currentDesignPointer == 0 || currentDesignPointer == currentDesignSize) {
    currentDesignPointer=0;
    currentDesignSize=initNextDesign();
  }
  IExperiment nextExperiment=nextExperiment(currentDesignPointer);
  IDesign nextProblem=getNextProblem();
  nextExperiment.setProblemFeatures(nextProblem);
  if (!nextExperiment.same(currentExperiment)) {
    currentExperiment=nextExperiment;
    amountInvestigatedConfigurations++;
  }
  return currentExperiment;
}
Program: 51477
Project: 51477
Buggy source:
/** 
 * A sequential tuner requires an experimental context to be set, that extends the use of an IInPUT element to a concrete problem instance under investigation. To differentiate between different problem instances allows for a differentiated analysis of the results with respect to problem features. However, the setting of problem is optional; a <code>problem</code> context might not even be reasonable, desired, or available (e.g. when interested in configurations for a single possibly very special instance only). When defined, it has to match the problem feature space provided by <code>input</code>.
 * @param input
 * @param studyId
 * @param problem
 * @throws InPUTException
 */
public SequentialTuner(IInPUT input,List<IDesign> problems,String studyId,boolean minProblem) throws InPUTException {
  super(input,studyId,minProblem);
  this.problems=problems;
  if (input.getOutputSpace() == null)   throw new InPUTException("String_Node_Str");
}

Fixed version (ground truth):
/** 
 * A sequential tuner requires an experimental context to be set, that extends the use of an IInPUT element to a concrete problem instance under investigation. To differentiate between different problem instances allows for a differentiated analysis of the results with respect to problem features. However, the setting of problem is optional; a <code>problem</code> context might not even be reasonable, desired, or available (e.g. when interested in configurations for a single possibly very special instance only). When defined, it has to match the problem feature space provided by <code>input</code>.
 * @param input
 * @param studyId
 * @param problem
 * @throws InPUTException
 */
public SequentialTuner(IInPUT input,List<IDesign> problems,String studyId,boolean minProblem,boolean randomProblemChoice) throws InPUTException {
  super(input,studyId,minProblem);
  this.problems=problems;
  this.randomProblemChoice=randomProblemChoice;
  if (input.getOutputSpace() == null)   throw new InPUTException("String_Node_Str");
}
Program: 51478
Project: 51478
Buggy source:
private IDesign randomInstance(){
  if (problems == null || problems.size() == 0)   return null;
  int next=rng.nextInt(problems.size());
  return problems.get(next);
}

Fixed version (ground truth):
private IDesign randomInstance(){
  int next=rng.nextInt(problems.size());
  return problems.get(next);
}
Program: 51479
Project: 51479
Buggy source:
private void initInverseFunction(){
  runCommand("String_Node_Str",false);
}

Fixed version (ground truth):
private void initInverseFunction(){
  runCommand("String_Node_Str",false);
  runCommand("String_Node_Str",false);
}
Program: 51480
Project: 51480
Buggy source:
public Object newInstance(Object[] actualParams) throws InPUTException {
  if (!init)   init();
  try {
    return constructor.newInstance(actualParams);
  }
 catch (  InstantiationException e) {
    throw new InPUTException(param.getId() + "String_Node_Str",e);
  }
catch (  IllegalAccessException e) {
    throw new InPUTException(param.getId() + "String_Node_Str",e);
  }
catch (  IllegalArgumentException e) {
    throw new InPUTException(param.getId() + "String_Node_Str" + constructor.getDeclaringClass().getName()+ "String_Node_Str"+ getClassesForArguments(actualParams),e);
  }
catch (  InvocationTargetException e) {
    throw new InPUTException(param.getId() + "String_Node_Str",e);
  }
}

Fixed version (ground truth):
public Object newInstance(Object[] actualParams) throws InPUTException {
  if (!init)   init();
  try {
    ensureRightArrayTypes(actualParams);
    return constructor.newInstance(actualParams);
  }
 catch (  InstantiationException e) {
    throw new InPUTException(param.getId() + "String_Node_Str",e);
  }
catch (  IllegalAccessException e) {
    throw new InPUTException(param.getId() + "String_Node_Str",e);
  }
catch (  IllegalArgumentException e) {
    throw new InPUTException(param.getId() + "String_Node_Str" + constructor.getDeclaringClass().getName()+ "String_Node_Str"+ getClassesForArguments(actualParams),e);
  }
catch (  InvocationTargetException e) {
    throw new InPUTException(param.getId() + "String_Node_Str",e);
  }
}
Program: 51481
Project: 51481
Buggy source:
@Test public void testInitialNextIteration() throws InPUTException {
  IExperiment experiment=tuner.nextExperiment();
  tuner.feedback(initialResults.get(0));
  assertEquals(12,tuner.getCurrentDesignSize());
  assertEquals(0,tuner.getCurrentDesignPointer());
  for (int i=0; i < 2; i++) {
    assertEquals(experiment,tuner.nextExperiment());
    tuner.feedback(initialResults.get(i + 1));
  }
  assertFalse(experiment.equals(tuner.nextExperiment()));
  TUtil.assertExpectedType(experiment,TUtil.STRUCTURAL_PARENT_PARAM,SomeStructuralParent.class);
  if (YetAnotherThirdChoice.class.isInstance(experiment.getValue(TUtil.STRUCTURAL_PARENT_PARAM))) {
    assertNotNull(experiment.getValue(TUtil.NON_SHARED_PRIMITIVE_SUB_PARAM));
  }
 else {
    assertNull(experiment.getValue(TUtil.NON_SHARED_PRIMITIVE_SUB_PARAM));
  }
}

Fixed version (ground truth):
@Test public void testInitialNextIteration() throws InPUTException {
  IExperiment experiment=tuner.nextExperiment();
  tuner.feedback(initialResults.get(0));
  assertEquals(0,tuner.getCurrentDesignPointer());
  for (int i=0; i < 2; i++) {
    assertEquals(experiment,tuner.nextExperiment());
    tuner.feedback(initialResults.get(i + 1));
  }
  assertFalse(experiment.equals(tuner.nextExperiment()));
  TUtil.assertExpectedType(experiment,TUtil.STRUCTURAL_PARENT_PARAM,SomeStructuralParent.class);
  if (YetAnotherThirdChoice.class.isInstance(experiment.getValue(TUtil.STRUCTURAL_PARENT_PARAM))) {
    assertNotNull(experiment.getValue(TUtil.NON_SHARED_PRIMITIVE_SUB_PARAM));
  }
 else {
    assertNull(experiment.getValue(TUtil.NON_SHARED_PRIMITIVE_SUB_PARAM));
  }
}
Program: 51482
Project: 51482
Buggy source:
@Before public void setUp() throws InPUTException {
  super.setUp();
  tuner=new SPOT(input,null,false);
}

Fixed version (ground truth):
@Before public void setUp() throws InPUTException {
  super.setUp();
  tuner=new SPOT(input,null,null,"String_Node_Str",false,false);
}
Program: 51483
Project: 51483
Buggy source:
void setElement(String paramId,Value<?> newValueE) throws InPUTException {
  Value<?> oldValueE=elementCache.get(paramId);
  if (isValid() && oldValueE == null)   throw new InPUTException("String_Node_Str" + paramId + "String_Node_Str"+ getId()+ "String_Node_Str");
  addElement(paramId,newValueE);
}

Fixed version (ground truth):
void setElement(String paramId,Value<?> newValueE) throws InPUTException {
  Value<?> oldValueE=elementCache.get(paramId);
  if (!newValueE.getParam().isOptional() && isValid() && oldValueE == null)   throw new InPUTException("String_Node_Str" + paramId + "String_Node_Str"+ getId()+ "String_Node_Str");
  addElement(paramId,newValueE);
}
Program: 51484
Project: 51484
Buggy source:
public Object newInstance(Object[] actualParams) throws InPUTException {
  if (!init)   init();
  try {
    return constructor.newInstance(actualParams);
  }
 catch (  InstantiationException e) {
    throw new InPUTException(param.getId() + "String_Node_Str",e);
  }
catch (  IllegalAccessException e) {
    throw new InPUTException(param.getId() + "String_Node_Str",e);
  }
catch (  IllegalArgumentException e) {
    throw new InPUTException(param.getId() + "String_Node_Str" + constructor.getDeclaringClass().getName()+ "String_Node_Str"+ getClassesForArguments(actualParams),e);
  }
catch (  InvocationTargetException e) {
    throw new InPUTException(param.getId() + "String_Node_Str",e);
  }
}

Fixed version (ground truth):
public Object newInstance(Object[] actualParams) throws InPUTException {
  if (!init)   init();
  try {
    ensureRightArrayTypes(actualParams);
    return constructor.newInstance(actualParams);
  }
 catch (  InstantiationException e) {
    throw new InPUTException(param.getId() + "String_Node_Str",e);
  }
catch (  IllegalAccessException e) {
    throw new InPUTException(param.getId() + "String_Node_Str",e);
  }
catch (  IllegalArgumentException e) {
    throw new InPUTException(param.getId() + "String_Node_Str" + constructor.getDeclaringClass().getName()+ "String_Node_Str"+ getClassesForArguments(actualParams),e);
  }
catch (  InvocationTargetException e) {
    throw new InPUTException(param.getId() + "String_Node_Str",e);
  }
}
Program: 51485
Project: 51485
Buggy source:
private void addPairToRoot(Element root,ParamValuePair pair,IDesignSpace space,ParamStore store) throws InPUTException {
  String realParamId=makeParamId(pair.paramId);
  Param<?> param=store.getParam(realParamId);
  Element parent=findParent(root,param,pair,store,space);
  if (isAppropriateSubParam(parent,param)) {
    addToParent(pair,param,parent);
  }
}

Fixed version (ground truth):
private void addPairToRoot(Element root,ParamValuePair pair,IDesignSpace space,ParamStore store) throws InPUTException {
  String realParamId=makeParamId(pair.paramId);
  Param<?> param=store.getParam(realParamId);
  Element parent=findParent(root,param,pair,store,space);
  if (isAppropriateSubParam(parent,param))   addToParent(pair,param,parent);
}
Program: 51486
Project: 51486
Buggy source:
private boolean hasComplexGrandParent(Param<?> param) throws InPUTException {
  Element grandParent=param.getParentElement().getParentElement();
  return grandParent != null && !grandParent.isRootElement() && isComplex((Param<?>)grandParent);
}

Fixed version (ground truth):
private boolean hasComplexGrandParent(Param<?> param) throws InPUTException {
  Element grandParent=param.getParentElement().getParentElement();
  return grandParent != null && !grandParent.isRootElement() && isStructuralArrayType((Param<?>)grandParent);
}
Program: 51487
Project: 51487
Buggy source:
private Element findParent(Element root,Param<?> param,ParamValuePair pair,ParamStore store,IDesignSpace space) throws InPUTException {
  Element resultParent=null;
  if (isComplex(param))   resultParent=findParentForComplex(root,param,pair,store,space);
 else   if (hasComplexGrandParent(param))   addPairToAllSuitableParentsForGrandChildOfComplex(root,param,pair,store,space);
 else   resultParent=findParentForNormal(root,param,pair,store,space);
  return resultParent;
}

Fixed version (ground truth):
private Element findParent(Element root,Param<?> param,ParamValuePair pair,ParamStore store,IDesignSpace space) throws InPUTException {
  Element resultParent=null;
  if (isStructuralArrayType(param))   resultParent=findParentForComplex(root,param,pair,store,space);
 else   if (hasComplexGrandParent(param))   addPairToAllSuitableParentsForGrandChildOfComplex(root,param,pair,store,space);
 else   resultParent=findParentForNormal(root,param,pair,store,space);
  return resultParent;
}
Program: 51488
Project: 51488
Buggy source:
private void addAllFixedEntries(Map<Integer,Set<ParamValuePair>> paramMap,List<Param<?>> fixed) throws InPUTException {
  int depth;
  Set<ParamValuePair> setOfDepth;
  for (  Param<?> param : fixed) {
    depth=param.getId().split(SpotConverter.ID_CHOP_PATTERN).length;
    if (param instanceof SParam && ((SParam)param).isComplex()) {
      setOfDepth=getSetOfDepth(depth + 1,paramMap);
      addAllFixedEntriesForComplexParam(setOfDepth,param.getId(),param.getFixedValue().split("String_Node_Str"));
    }
 else {
      setOfDepth=getSetOfDepth(depth,paramMap);
      setOfDepth.add(new ParamValuePair(param.getId(),param.getFixedValue()));
    }
  }
}

Fixed version (ground truth):
private void addAllFixedEntries(Map<Integer,Set<ParamValuePair>> paramMap,List<Param<?>> fixed) throws InPUTException {
  int depth;
  Set<ParamValuePair> setOfDepth;
  for (  Param<?> param : fixed) {
    depth=param.getId().split(SpotConverter.ID_CHOP_PATTERN).length;
    if (isStructuralArrayType(param)) {
      setOfDepth=getSetOfDepth(depth + 1,paramMap);
      addAllFixedEntriesForComplexParam(setOfDepth,param.getId(),param.getFixedValue().split("String_Node_Str"));
    }
 else {
      setOfDepth=getSetOfDepth(depth,paramMap);
      setOfDepth.add(new ParamValuePair(param.getId(),param.getFixedValue()));
    }
  }
}
Program: 51489
Project: 51489
Buggy source:
private Map<Integer,Set<ParamValuePair>> initValues(List<Param<?>> fixed,SpotDesign spotDesign) throws InPUTException {
  Map<Integer,Set<ParamValuePair>> paramMap=new HashMap<Integer,Set<ParamValuePair>>();
  addAllVariableEntries(paramMap,spotDesign);
  addAllFixedEntries(paramMap,fixed);
  return paramMap;
}

Fixed version (ground truth):
private Map<Integer,Set<ParamValuePair>> initValues(List<Param<?>> fixed,SpotDesign spotDesign) throws InPUTException {
  Map<Integer,Set<ParamValuePair>> paramMap=new HashMap<Integer,Set<ParamValuePair>>();
  System.out.println("String_Node_Str");
  addAllVariableEntries(paramMap,spotDesign);
  addAllFixedEntries(paramMap,fixed);
  return paramMap;
}
Program: 51490
Project: 51490
Buggy source:
private static boolean isParentInDesign(Param<?> p,Map<String,String> sample) throws InPUTException {
  Element parent=p.getParentElement();
  if (parent.isRootElement())   return true;
  boolean flag=false;
  if (parent instanceof SParam || parent instanceof NParam) {
    if (parent instanceof SParam && ((SParam)parent).isComplex() && p instanceof SChoice) {
      String compl, choiceNumber;
      for (int j=1; j <= ((SParam)parent).getDimensions()[0]; j++) {
        compl=p.getParamId() + "String_Node_Str" + j;
        choiceNumber=sample.get(compl);
        if (isRelevantComplexChoice((SChoice)p,sample,(SParam)parent,compl,choiceNumber)) {
          flag=true;
          break;
        }
      }
    }
 else     flag=isParentInDesign((Param<?>)parent,sample);
  }
 else   if (parent instanceof SChoice) {
    flag=checkChoice(sample,parent,flag);
  }
  return flag;
}

Fixed version (ground truth):
private static boolean isParentInDesign(Param<?> p,Map<String,String> sample) throws InPUTException {
  Element parent=p.getParentElement();
  if (parent.isRootElement())   return true;
  boolean flag=false;
  if (parent instanceof SParam || parent instanceof NParam) {
    if (SpotDesignInitializer.isStructuralArrayType(parent) && p instanceof SChoice) {
      String compl, choiceNumber;
      for (int j=1; j <= ((SParam)parent).getDimensions()[0]; j++) {
        compl=p.getParamId() + "String_Node_Str" + j;
        choiceNumber=sample.get(compl);
        if (isRelevantComplexChoice((SChoice)p,sample,(SParam)parent,compl,choiceNumber)) {
          flag=true;
          break;
        }
      }
    }
 else     flag=isParentInDesign((Param<?>)parent,sample);
  }
 else   if (parent instanceof SChoice) {
    flag=checkChoice(sample,parent,flag);
  }
  return flag;
}
Program: 51491
Project: 51491
Buggy source:
public void feedbackSpot(IDesign result) throws InPUTException {
  feedbackSpotInMemory();
  saveSPOTWorkspace();
  currentRES.append(result,currentDES);
}

Fixed version (ground truth):
public void feedbackSpot(IDesign result) throws InPUTException {
  currentRES.append(result,currentDES);
  if (isFileMode())   feedbackResultInRESFile();
  saveSPOTWorkspace();
}
Program: 51492
Project: 51492
Buggy source:
public int initSequentialDesign() throws InPUTException {
  initSPOTSequentialDesign();
  saveSPOTWorkspace();
  currentDES=initializeDesign();
  return currentDES.size();
}

Fixed version (ground truth):
public int initSequentialDesign() throws InPUTException {
  writeResultsToSPOTProjectCache();
  initSPOTSequentialDesign();
  saveSPOTWorkspace();
  currentDES=initializeDesign();
  return currentDES.size();
}
Program: 51493
Project: 51493
Buggy source:
public String toSpot(){
  StringBuilder spotb=new StringBuilder();
  String spotHeader=headerToSpot();
  spotb.append(spotHeader);
  spotb.append('\n');
  for (  SpotResult result : allResults) {
    spotb.append(result.toSpot());
    spotb.append('\n');
  }
  return spotb.toString();
}

Fixed version (ground truth):
public String toSpot(List<SpotResult> results){
  StringBuilder spotb=new StringBuilder();
  String spotHeader=headerToSpot();
  spotb.append(spotHeader);
  spotb.append('\n');
  for (  SpotResult result : results)   spotb.append(result.toSpot());
  return spotb.toString();
}
Program: 51494
Project: 51494
Buggy source:
@Override public String toString(){
  return toSpot();
}

Fixed version (ground truth):
@Override public String toString(){
  return toSpot(allResults);
}
Program: 51495
Project: 51495
Buggy source:
@Override public InputStream export(){
  return new ByteArrayInputStream(toSpot().getBytes());
}

Fixed version (ground truth):
@Override public InputStream export(){
  return new ByteArrayInputStream(toSpot(allResults).getBytes());
}
Program: 51496
Project: 51496
Buggy source:
public String toSpot(){
  StringBuilder b=new StringBuilder();
  for (  String var : header) {
    b.append(variables.get(var));
    b.append(' ');
  }
  return b.toString();
}

Fixed version (ground truth):
public String toSpot(){
  StringBuilder b=new StringBuilder();
  for (  String var : header) {
    b.append(variables.get(var));
    b.append(' ');
  }
  b.append('\n');
  return b.toString();
}
Program: 51497
Project: 51497
Buggy source:
private Class<?> getClassForLocalContext(String identifier) throws InPUTException {
  Class<?> cLass=getClassForNumericParam(identifier);
  if (cLass == null) {
    cLass=getClassForGlobalContext(identifier);
    if (cLass == null) {
      Param<?> paramForId=ParamUtil.getParamForLocalId(identifier,param,ps);
      if (paramForId != null) {
        cLass=getClassForLocalParam(identifier,paramForId);
      }
    }
  }
  return cLass;
}

Fixed version (ground truth):
private Class<?> getClassForLocalContext(String identifier) throws InPUTException {
  Class<?> cLass=getClassForNumericParam(identifier);
  if (cLass == null) {
    cLass=getClassForGlobalContext(identifier);
    if (cLass == null) {
      Param<?> paramForId=ParamUtil.getParamForLocalId(identifier,param,ps);
      if (paramForId != null) {
        cLass=getClassForLocalParam(identifier,paramForId);
      }
    }
  }
  if (cLass == null) {
    Object value=InPUTConfig.getValue(identifier);
    if (value != null)     cLass=value.getClass();
  }
  return cLass;
}
Program: 51498
Project: 51498
Buggy source:
private Class<?> getClassForLocalParam(String identifier,Param<?> param) throws InPUTException {
  Class<?> cLass=null;
  if (param != null)   cLass=param.getInPUTClass();
  return cLass;
}

Fixed version (ground truth):
private Class<?> getClassForLocalParam(String identifier,Param<?> param) throws InPUTException {
  if (param == null)   return null;
  if (param.isArrayType())   return param.getArrayType();
  return param.getInPUTClass();
}
Program: 51499
Project: 51499
Buggy source:
private String getSpotNumericType(NParam param){
  if (param.isCountable())   return SPOT_COUNTABLE;
  return SPOT_NON_COUNTABLE;
}

Fixed version (ground truth):
private String getSpotNumericType(NParam param){
  if (param.isBoolean())   return SPOT_FACTOR;
  if (param.isCountable())   return SPOT_COUNTABLE;
  return SPOT_NON_COUNTABLE;
}
Program: 51500
Project: 51500
Buggy source:
private void writeResultsToSPOTProjectCache(){
  engine.eval("String_Node_Str" + currentRES.toString() + "String_Node_Str");
}

Fixed version (ground truth):
private void writeResultsToSPOTProjectCache(){
  runCommand("String_Node_Str" + currentRES.toString() + "String_Node_Str",false);
}
Program: 51501
Project: 51501
Buggy source:
private void initResultHeading(){
  engine.eval("String_Node_Str" + currentRES.toString() + "String_Node_Str");
}

Fixed version (ground truth):
private void initResultHeading(){
  runCommand("String_Node_Str" + currentRES.toString() + "String_Node_Str",false);
}
Program: 51502
Project: 51502
Buggy source:
private void checkSPOTIsInstalled() throws InPUTException {
  REXP spotInstalled=engine.eval("String_Node_Str");
  if (!spotInstalled.asBool().isTRUE())   throw new InPUTException("String_Node_Str");
}

Fixed version (ground truth):
private void checkSPOTIsInstalled() throws InPUTException {
  REXP spotInstalled=runCommand("String_Node_Str",true);
  if (!spotInstalled.asBool().isTRUE())   throw new InPUTException("String_Node_Str");
}
Program: 51503
Project: 51503
Buggy source:
private void initInverseFunction(){
  engine.eval("String_Node_Str",false);
}

Fixed version (ground truth):
private void initInverseFunction(){
  runCommand("String_Node_Str",false);
}
Program: 51504
Project: 51504
Buggy source:
public SpotDES initializeDesign() throws InPUTException {
  REXP designs=engine.eval("String_Node_Str");
  return new SpotDES(designs.asVector(),paramIds,inputROI);
}

Fixed version (ground truth):
public SpotDES initializeDesign() throws InPUTException {
  REXP designs=runCommand("String_Node_Str",true);
  return new SpotDES(designs.asVector(),paramIds,inputROI);
}
Program: 51505
Project: 51505
Buggy source:
public void initSPOTSequentialDesign(){
  engine.eval("String_Node_Str",false);
}

Fixed version (ground truth):
public void initSPOTSequentialDesign(){
  String command="String_Node_Str";
  runCommand(command,false);
}
Program: 51506
Project: 51506
Buggy source:
public SpotHelper(IInPUT input,IDesign config,String studyId) throws InPUTException {
  this.studyId=studyId;
  experimentalFolder=initExperimentalFolder(studyId,config);
  investigationId=initExperimentId(studyId,config,experimentalFolder);
  this.config=initConfig(investigationId,config);
  this.input=input;
  initInverseFunction();
  checkSPOTIsInstalled();
  inputROI=new SpotROI(input);
  outputROI=new SpotROI(input.getOutputSpace());
  currentRES=new SpotRES(inputROI,outputROI);
  initExperimentalFolder();
}

Fixed version (ground truth):
public SpotHelper(IInPUT input,IDesign config,String studyId) throws InPUTException {
  experimentalFolder=initExperimentalFolder(studyId,config);
  this.studyId=experimentalFolder.getName();
  investigationId=initExperimentId(studyId,config,experimentalFolder);
  this.config=initConfig(investigationId,config);
  this.input=input;
  initInverseFunction();
  checkSPOTIsInstalled();
  inputROI=new SpotROI(input);
  outputROI=new SpotROI(input.getOutputSpace());
  currentRES=new SpotRES(inputROI,outputROI);
  initExperimentalFolder();
}
Program: 51507
Project: 51507
Buggy source:
public void retrieveNextDesign(){
  paramIds=engine.eval("String_Node_Str").asStringArray();
}

Fixed version (ground truth):
public void retrieveNextDesign(){
  REXP expr=runCommand("String_Node_Str",true);
  paramIds=expr.asStringArray();
}
Program: 51508
Project: 51508
Buggy source:
public void initSPOTinitialDesign(){
  initInverseFunction();
  engine.eval("String_Node_Str",false);
}

Fixed version (ground truth):
public void initSPOTinitialDesign(){
  initInverseFunction();
  runCommand("String_Node_Str",false);
}
Program: 51509
Project: 51509
Buggy source:
public void initSPOTConfFileName(){
  engine.eval("String_Node_Str" + investigationId + "String_Node_Str"+ File.separator+ "String_Node_Str",false);
}

Fixed version (ground truth):
public void initSPOTConfFileName(){
  runCommand("String_Node_Str" + investigationId + "String_Node_Str"+ File.separator+ "String_Node_Str",false);
}
Program: 51510
Project: 51510
Buggy source:
public void reset(String studyId) throws InPUTException {
  this.studyId=studyId;
  engine.eval("String_Node_Str",false);
}

Fixed version (ground truth):
public void reset(String studyId) throws InPUTException {
  this.studyId=studyId;
  runCommand("String_Node_Str",false);
}
Program: 51511
Project: 51511
Buggy source:
private void saveSPOTWorkspace() throws InPUTException {
  String rData=initRelativeFileString(studyId,config,"String_Node_Str");
  engine.eval("String_Node_Str" + rData + "String_Node_Str"+ File.separator+ "String_Node_Str",false);
  saveSPOTHistory();
}

Fixed version (ground truth):
private void saveSPOTWorkspace() throws InPUTException {
  runCommand("String_Node_Str" + studyId + "String_Node_Str"+ File.separator+ "String_Node_Str",false);
  saveSPOTHistory();
}
Program: 51512
Project: 51512
Buggy source:
private void saveSPOTHistory() throws InPUTException {
  String rHistory=initRelativeFileString(studyId,config,"String_Node_Str");
  engine.eval("String_Node_Str" + rHistory + "String_Node_Str"+ File.separator+ "String_Node_Str",false);
}

Fixed version (ground truth):
private void saveSPOTHistory() throws InPUTException {
  runCommand("String_Node_Str" + studyId + "String_Node_Str"+ File.separator+ "String_Node_Str",false);
}
Program: 51513
Project: 51513
Buggy source:
private void initValues() throws InPUTException {
  Element root=design.getRootElement();
  List<Element> obsoletes=root.getChildren();
  Element[] obsoletesA=obsoletes.toArray(new Element[]{});
  for (int i=0; i < obsoletesA.length; i++) {
    if (isValueE(obsoletesA[i])) {
      Value<?> newE=createElement(obsoletesA[i],root);
      updateElementCache(newE);
    }
  }
}

Fixed version (ground truth):
private void initValues() throws InPUTException {
  Element root=design.getRootElement();
  List<Element> obsoletes=root.getChildren();
  Element[] obsoletesA=obsoletes.toArray(new Element[]{});
  List<String> paramIds=new ArrayList<String>();
  for (int i=0; i < obsoletesA.length; i++) {
    if (isValueE(obsoletesA[i])) {
      Value<?> newE=createElement(obsoletesA[i],root);
      paramIds.add(newE.getId());
      updateElementCache(newE);
    }
  }
  validateInitialValues(paramIds);
}
Program: 51514
Project: 51514
Buggy source:
private void updateCacheForIndexedValue(Value<?> parentValue) throws InPUTException {
  Element parent=parentValue.getParentElement();
  if (parent instanceof Value<?>) {
    parentValue=(Value<?>)parent;
    parentValue.getParam().init(parentValue,null,elementCache);
    updateElementCache(parentValue);
  }
}

Fixed version (ground truth):
private void updateCacheForIndexedValue(Value<?> parentValue) throws InPUTException {
  Element parent=parentValue.getParentElement();
  if (parent instanceof Value<?>) {
    updateElementCache(parentValue);
    parentValue=(Value<?>)parent;
    parentValue.getParam().init(parentValue,null,elementCache);
  }
}
Program: 51515
Project: 51515
Buggy source:
@Override public void setValue(final String paramId,Object value) throws InPUTException {
  Value<?> valueE;
  Param<?> param=ps.getParam(paramId);
  if (param != null) {
    param.validateInPUT(paramId,value,elementCache);
    if (param.isArrayType())     value=ParamUtil.repackArrayForImport(value);
    valueE=ValueFactory.constructElementByValue(value,param,param.getDimensions(),elementCache);
    setElement(paramId,valueE);
  }
 else {
    valueE=elementCache.get(paramId);
    if (valueE != null) {
      if (valueE.isParentInitialized())       valueE.getParam().validateInPUT(paramId,value,elementCache);
      if (valueE.isArrayType())       value=ParamUtil.repackArrayForImport(value);
      valueE.setInputValue(value);
      updateCacheForIndexedValue(valueE);
    }
 else     throw new InPUTException("String_Node_Str" + paramId + "String_Node_Str");
  }
}

Fixed version (ground truth):
@Override public void setValue(final String paramId,Object value) throws InPUTException {
  if (isReadOnly())   throw new InPUTException("String_Node_Str");
  Param<?> param=ps.getParam(paramId);
  if (param != null)   setValueForExplicitParam(paramId,value,param);
 else   setValueForNoneExplicitParam(paramId,value);
}
Program: 51516
Project: 51516
Buggy source:
private Map<String,Object> initVarsFromElementCache(ElementCache elementCache){
  Map<String,Object> dependencies=new HashMap<String,Object>();
  addDependencies(elementCache,dependencies,getMinDependencies());
  addDependencies(elementCache,dependencies,getMaxDependencies());
  return dependencies;
}

Fixed version (ground truth):
private Map<String,Object> initVarsFromElementCache(ElementCache elementCache) throws InPUTException {
  Map<String,Object> dependencies=new HashMap<String,Object>();
  addDependencies(elementCache,dependencies,getMinDependencies());
  addDependencies(elementCache,dependencies,getMaxDependencies());
  return dependencies;
}
Program: 51517
Project: 51517
Buggy source:
private void checkValidArrayType(String paramId,Object value,ElementCache elementCache) throws InPUTException {
  Value<?> current=elementCache.get(paramId);
  Object flag=value;
  if (current != null && current.getValue() != null) {
    Object currentValue=current.getInputValue(null);
    while (currentValue.getClass().isArray()) {
      currentValue=Array.get(currentValue,0);
      if (!flag.getClass().isArray())       throw new InPUTException("String_Node_Str" + paramId + "String_Node_Str");
      flag=Array.get(flag,0);
    }
    if (flag.getClass().isArray())     throw new InPUTException("String_Node_Str" + paramId + "String_Node_Str");
  }
}

Fixed version (ground truth):
private void checkValidArrayType(String paramId,Object newValue,ElementCache elementCache) throws InPUTException {
  Value<?> current=elementCache.get(paramId);
  if (current != null && current.getValue() != null) {
    Object currentValue=current.getInputValue(null);
    checkDimensionalityValidity(paramId,newValue,currentValue);
  }
  checkArrayEntriesRespectRange(newValue,elementCache);
}
Program: 51518
Project: 51518
Buggy source:
private void addDependencies(ElementCache elementCache,Map<String,Object> dependencies,Set<Param<?>> params){
  for (  Param<?> param : params)   dependencies.put(param.getId(),elementCache.get(param.getId()).getInputValue());
}

Fixed version (ground truth):
private void addDependencies(ElementCache elementCache,Map<String,Object> dependencies,Set<Param<?>> params) throws InPUTException {
  for (  Param<?> param : params)   dependencies.put(param.getId(),elementCache.get(param.getId()).getInputValue(null));
}
Program: 51519
Project: 51519
Buggy source:
public void checkValidity(String paramId,Object value,ElementCache elementCache) throws InPUTException {
  if (isOfValidPlainType(value)) {
    checkValidPlainValidity(paramId,value,elementCache);
  }
 else   if (value.getClass().isArray()) {
    checkValidArrayType(paramId,value,elementCache);
  }
 else   throw new InPUTException("String_Node_Str" + value.toString() + "String_Node_Str"+ value.getClass().getName()+ "String_Node_Str"+ type.getNumClass().getName()+ "String_Node_Str"+ type.getPrimitiveClass().getName()+ "String_Node_Str");
}

Fixed version (ground truth):
public void checkValidity(String paramId,Object value,ElementCache elementCache) throws InPUTException {
  if (isOfValidPlainType(value)) {
    checkPlainValueValidity(paramId,value,elementCache);
  }
 else   if (value.getClass().isArray()) {
    checkValidArrayType(paramId,value,elementCache);
  }
 else   throw new InPUTException("String_Node_Str" + value.toString() + "String_Node_Str"+ value.getClass().getName()+ "String_Node_Str"+ type.getNumClass().getName()+ "String_Node_Str"+ type.getPrimitiveClass().getName()+ "String_Node_Str");
}
Program: 51520
Project: 51520
Buggy source:
public void setFixed(String value) throws InPUTException {
  if (value != null) {
    setAttribute(Q.FIXED_ATTR,value);
  }
 else {
    removeAttribute(Q.FIXED_ATTR);
  }
  generator=initGenerator(true);
}

Fixed version (ground truth):
public void setFixed(String value) throws InPUTException {
  if (value == null)   removeAttribute(Q.FIXED_ATTR);
 else   if (isValidFixedValue(value))   setAttribute(Q.FIXED_ATTR,value);
 else   throw new InPUTException("String_Node_Str");
  generator=initGenerator(true);
}
Program: 51521
Project: 51521
Buggy source:
@Override public boolean isPlainValueElement(Value<?> valueElement){
  String valueString=valueElement.getAttributeValue(Q.VALUE_ATTR);
  return (valueString != null && !valueString.equals(Q.NULL)) || !isArrayType() || (isArrayType() && !getId().equals(getId()));
}

Fixed version (ground truth):
@Override public boolean isPlainValueElement(Value<?> valueElement){
  String valueString=valueElement.getAttributeValue(Q.VALUE_ATTR);
  return (isValidFixedValue(valueString) && !valueString.equals(Q.NULL)) || !isArrayType() || (isArrayType() && !getId().equals(getId()));
}
Program: 51522
Project: 51522
Buggy source:
@Override protected NumericGenerator initGenerator(boolean initRanges) throws InPUTException {
  String fixedValue=getFixedValue();
  NumericGenerator generator;
  if (fixedValue != null)   generator=new FixedNumericGenerator(this,fixedValue);
 else {
    generator=new RandomNumericGenerator(this,initRandom(ps));
  }
  if (initRanges) {
    generator.initRanges();
  }
  return generator;
}

Fixed version (ground truth):
@Override protected NumericGenerator initGenerator(boolean initRanges) throws InPUTException {
  String fixedValue=getFixedValue();
  NumericGenerator generator;
  if (isValidFixedValue(fixedValue))   generator=new FixedNumericGenerator(this,fixedValue);
 else {
    generator=new RandomNumericGenerator(this,initRandom(ps));
  }
  if (initRanges) {
    generator.initRanges();
  }
  return generator;
}
Program: 51523
Project: 51523
Buggy source:
public void setFixed(String value) throws InPUTException {
  if (value != null) {
    setAttribute(Q.FIXED_ATTR,value);
  }
 else   removeAttribute(Q.FIXED_ATTR);
  generator=initGenerator(true);
}

Fixed version (ground truth):
public void setFixed(String value) throws InPUTException {
  if (value == null)   removeAttribute(Q.FIXED_ATTR);
 else   if (getChoiceById(value) != null)   setAttribute(Q.FIXED_ATTR,value);
 else   throw new InPUTException("String_Node_Str" + value + "String_Node_Str"+ getId()+ "String_Node_Str");
  generator=initGenerator(true);
}
Program: 51524
Project: 51524
Buggy source:
private void checkMaxima(Comparable<Comparable<?>> theValue,Ranges evaluatedRanges){
  Comparable<?>[] extremas=evaluatedRanges.getStrongTypedMax();
  if (extremas == null || extremas.length == 0)   return;
  boolean violates=true;
  for (  Comparable<?> extrema : extremas) {
    if (theValue.compareTo(extrema) <= 0) {
      violates=false;
      break;
    }
  }
  if (violates)   throw new IllegalArgumentException(spaceId + "String_Node_Str" + theValue+ "String_Node_Str"+ paramId+ "String_Node_Str"+ extremas[0]+ "String_Node_Str");
}

Fixed version (ground truth):
private void checkMaxima(Comparable<Comparable<?>> theValue,Ranges evaluatedRanges){
  Comparable<?>[] extremas=evaluatedRanges.getStrongTypedMax();
  if (extremas == null || extremas.length == 0)   return;
  Comparable<?> violated=null;
  for (  Comparable<?> extrema : extremas) {
    if (theValue.compareTo(extrema) > 0) {
      violated=extrema;
      break;
    }
  }
  if (violated != null)   throw new IllegalArgumentException(spaceId + "String_Node_Str" + theValue+ "String_Node_Str"+ paramId+ "String_Node_Str"+ violated+ "String_Node_Str");
}
Program: 51525
Project: 51525
Buggy source:
private void checkMinima(Comparable<Comparable<?>> theValue,Ranges evaluatedRanges){
  Comparable<?>[] extremas=evaluatedRanges.getStrongTypedMin();
  if (extremas == null || extremas.length == 0)   return;
  boolean violates=true;
  for (  Comparable<?> extrema : extremas) {
    if (theValue.compareTo(extrema) >= 0) {
      violates=false;
      break;
    }
  }
  if (violates)   throw new IllegalArgumentException(spaceId + "String_Node_Str" + theValue+ "String_Node_Str"+ paramId+ "String_Node_Str"+ min[0]+ "String_Node_Str");
}

Fixed version (ground truth):
private void checkMinima(Comparable<Comparable<?>> theValue,Ranges evaluatedRanges){
  Comparable<?>[] extremas=evaluatedRanges.getStrongTypedMin();
  if (extremas == null || extremas.length == 0)   return;
  Comparable<?> violated=null;
  for (  Comparable<?> extrema : extremas) {
    if (theValue.compareTo(extrema) < 0) {
      violated=extrema;
      break;
    }
  }
  if (violated != null)   throw new IllegalArgumentException(spaceId + "String_Node_Str" + theValue+ "String_Node_Str"+ paramId+ "String_Node_Str"+ violated+ "String_Node_Str");
}
Program: 51526
Project: 51526
Buggy source:
private DesignSpace initDesignSpace(String filePath,String ref) throws InPUTException {
  if (ref == null) {
    throw new InPUTException("String_Node_Str" + getId() + "String_Node_Str"+ filePath+ "String_Node_Str");
  }
  DesignSpace designSpace=DesignSpace.lookup(ref);
  if (designSpace != null)   return designSpace;
  if (!ref.contains(Q.XML))   ref+=Q.XML;
  Document space=SAXUtil.build(ref,InPUTConfig.isValidationActive());
  return new DesignSpace(space);
}

Fixed version (ground truth):
private DesignSpace initDesignSpace(String filePath,String ref) throws InPUTException {
  if (ref == null) {
    throw new InPUTException("String_Node_Str" + getId() + "String_Node_Str"+ filePath+ "String_Node_Str");
  }
  DesignSpace designSpace=DesignSpace.lookup(ref);
  if (designSpace != null)   return designSpace;
  if (!ref.contains(Q.XML))   ref+=Q.XML;
  Document space=SAXUtil.build(ref,InPUTConfig.isValidationActive());
  return new DesignSpace(space,ref);
}
Program: 51527
Project: 51527
Buggy source:
/** 
 * Has as a consequence, that from after its execution, no write operations are allowed anymore, and will lead to the throwing of InPUTExceptions.
 */
void setReadOnly();

Fixed version (ground truth):
/** 
 * Subsequent calls to   {@link #setValue(String,Object) setValue} willthrow an InPUTExceptions.
 */
void setReadOnly();
Program: 51528
Project: 51528
Buggy source:
@Override public int getPlaceholderIndex(String placeholderName){
  int idx=0;
  if (m_havingClause != null)   idx=m_havingClause.getPlaceholderIndex(placeholderName);
  if (idx == 0 && m_where != null)   idx=m_where.getPlaceholderIndex(placeholderName);
  return idx;
}

Fixed version (ground truth):
@Override public int getPlaceholderIndex(String placeholderName){
  int idx=0;
  if (m_havingClause != null)   idx=m_havingClause.getPlaceholderIndex(placeholderName);
  if (idx == 0 && m_where != null)   idx=m_where.getPlaceholderIndex(placeholderName);
  if (idx == 0)   throw new IllegalArgumentException("String_Node_Str");
  return idx;
}
Program: 51529
Project: 51529
Buggy source:
public static void main(String... args) throws SQLException, ClassNotFoundException {
  QbFactory fac=new QbFactoryImp();
  insertTests(fac);
  deleteTests(fac);
  selectTests(fac);
  placeholderTests(fac);
  whereTests(fac);
  updateTests(fac);
  Sample.sample();
  System.out.println("String_Node_Str");
}

Fixed version (ground truth):
public static void main(String... args) throws SQLException, ClassNotFoundException {
  QbFactory fac=new QbFactoryImp();
  insertTests(fac);
  deleteTests(fac);
  selectTests(fac);
  placeholderTests(fac);
  whereTests(fac);
  updateTests(fac);
  exceptionTests(fac);
  Sample.sample();
  System.out.println("String_Node_Str");
}