nus-yam/ex-repair huggingface dataset:
Program: 10511
Project: 10511
Buggy source:
/** 
 * Shortcut to disable all buttons.
 */
private void disableAllButtons(){
  this.selectFileButton.setEnabled(false);
  this.dataLoadButton.setEnabled(false);
  this.guessParametersButton.setEnabled(false);
  this.discretizeButton.setEnabled(false);
  this.findAnomaliesButton.setEnabled(false);
  this.displayChartButton.setEnabled(false);
  this.clusterRulesButton.setEnabled(false);
  this.rankRulesButton.setEnabled(false);
  this.displayRulesDensityButton.setEnabled(false);
  this.displayRulesLenHistogramButton.setEnabled(false);
  this.saveChartButton.setEnabled(false);
}

Fixed version (ground truth):
/** 
 * Shortcut to disable all buttons.
 */
private void disableAllButtons(){
  this.selectFileButton.setEnabled(true);
  this.dataLoadButton.setEnabled(false);
  this.guessParametersButton.setEnabled(false);
  this.discretizeButton.setEnabled(false);
  this.findAnomaliesButton.setEnabled(false);
  this.displayChartButton.setEnabled(false);
  this.clusterRulesButton.setEnabled(false);
  this.rankRulesButton.setEnabled(false);
  this.displayRulesDensityButton.setEnabled(false);
  this.displayRulesLenHistogramButton.setEnabled(false);
  this.saveChartButton.setEnabled(false);
}
Program: 10512
Project: 10512
Buggy source:
public void bindToTheFrameSize(){
  this.getTopLevelAncestor().addComponentListener(new ComponentAdapter(){
    @Override public void componentResized(    ComponentEvent e){
      if (null != chartPanel) {
        System.err.println("String_Node_Str");
        chartPanel.setMaximumDrawHeight(e.getComponent().getHeight());
        chartPanel.setMaximumDrawWidth(e.getComponent().getWidth());
        chartPanel.setMinimumDrawWidth(0);
        chartPanel.setMinimumDrawHeight(0);
        chartPanel.revalidate();
      }
    }
  }
);
}

Fixed version (ground truth):
public void bindToTheFrameSize(){
  this.getTopLevelAncestor().addComponentListener(new ComponentAdapter(){
    @Override public void componentResized(    ComponentEvent e){
      if (null != chartPanel) {
        chartPanel.setMaximumDrawHeight(e.getComponent().getHeight());
        chartPanel.setMaximumDrawWidth(e.getComponent().getWidth());
        chartPanel.setMinimumDrawWidth(0);
        chartPanel.setMinimumDrawHeight(0);
        chartPanel.revalidate();
      }
    }
  }
);
}
Program: 10514
Project: 10514
Buggy source:
@Override public void componentResized(ComponentEvent e){
  if (null != chartPanel) {
    System.err.println("String_Node_Str");
    chartPanel.setMaximumDrawHeight(e.getComponent().getHeight());
    chartPanel.setMaximumDrawWidth(e.getComponent().getWidth());
    chartPanel.setMinimumDrawWidth(0);
    chartPanel.setMinimumDrawHeight(0);
    chartPanel.revalidate();
  }
}

Fixed version (ground truth):
@Override public void componentResized(ComponentEvent e){
  if (null != chartPanel) {
    chartPanel.setMaximumDrawHeight(e.getComponent().getHeight());
    chartPanel.setMaximumDrawWidth(e.getComponent().getWidth());
    chartPanel.setMinimumDrawWidth(0);
    chartPanel.setMinimumDrawHeight(0);
    chartPanel.revalidate();
  }
}
Program: 10515
Project: 10515
Buggy source:
/** 
 * Creates the chart panel, puts it on display.
 */
public void resetChartPanel(){
  if (null == this.session.chartData && null != this.tsData) {
    paintTheChart(this.tsData);
  }
 else {
    paintTheChart(this.session.chartData.getOriginalTimeseries());
  }
  chartPanel=new ChartPanel(this.chart);
  chartPanel.setMaximumDrawHeight(this.getParent().getHeight());
  chartPanel.setMaximumDrawWidth(this.getParent().getWidth());
  chartPanel.setMinimumDrawWidth(0);
  chartPanel.setMinimumDrawHeight(0);
  chartPanel.setMouseWheelEnabled(true);
  this.removeAll();
  this.add(chartPanel);
  this.validate();
  chartPanel.validate();
}

Fixed version (ground truth):
/** 
 * Creates the chart panel, puts it on display.
 */
public void resetChartPanel(){
  if (null == this.session.chartData && null != this.tsData) {
    paintTheChart(this.tsData);
  }
 else {
    paintTheChart(this.session.chartData.getOriginalTimeseries());
  }
  chartPanel=new ChartPanel(this.chart);
  chartPanel.setMaximumDrawHeight(this.getParent().getHeight());
  chartPanel.setMaximumDrawWidth(this.getParent().getWidth());
  chartPanel.setMinimumDrawWidth(0);
  chartPanel.setMinimumDrawHeight(0);
  chartPanel.setMouseWheelEnabled(true);
  this.removeAll();
  this.add(chartPanel);
  this.revalidate();
}
Program: 10516
Project: 10516
Buggy source:
private ArrayList<String[]> findCluster(Cluster cluster,double cutDist,int minPatternPerCls){
  ArrayList<String[]> clusterTSIdx=new ArrayList<String[]>();
  if (cluster.getDistance() != null) {
    if (cluster.getDistanceValue() > cutDist) {
      if (cluster.getChildren().size() > 0) {
        clusterTSIdx.addAll(findCluster(cluster.getChildren().get(0),cutDist,minPatternPerCls));
        clusterTSIdx.addAll(findCluster(cluster.getChildren().get(1),cutDist,minPatternPerCls));
      }
    }
 else {
      String[] idxes=cluster.getName().split("String_Node_Str");
      if (idxes.length > minPatternPerCls) {
        clusterTSIdx.add(idxes);
      }
    }
  }
  return clusterTSIdx;
}

Fixed version (ground truth):
private ArrayList<String[]> findCluster(Cluster cluster,double cutDist,int minPatternPerCls){
  ArrayList<String[]> clusterTSIdx=new ArrayList<String[]>();
  if (cluster.getDistance() != null) {
    if (cluster.getDistanceValue() > cutDist) {
      if (cluster.getChildren().size() > 0) {
        clusterTSIdx.addAll(findCluster(cluster.getChildren().get(0),cutDist,minPatternPerCls));
        clusterTSIdx.addAll(findCluster(cluster.getChildren().get(1),cutDist,minPatternPerCls));
      }
    }
 else {
      ArrayList<String> itemsInCluster=getNameInCluster(cluster);
      String[] idxes=itemsInCluster.toArray(new String[itemsInCluster.size()]);
      if (idxes.length > minPatternPerCls) {
        clusterTSIdx.add(idxes);
      }
    }
  }
  return clusterTSIdx;
}
Program: 10518
Project: 10518
Buggy source:
private double getCoverDelta(boolean[] range,GrammarRuleRecord rule){
  int cover=0;
  int overlap=0;
  for (  RuleInterval i : rule.getRuleIntervals()) {
    int start=i.getStartPos();
    int end=i.getEndPos();
    for (int j=start; j <= end; j++) {
      if (false == range[j]) {
        cover++;
      }
 else {
        overlap++;
      }
    }
  }
  if (0 == cover) {
    return 0.0;
  }
  if (0 == overlap) {
    return (double)cover / (double)(rule.getExpandedRuleString().length() + rule.getRuleIntervals().size());
  }
  return ((double)cover / (double)overlap) / (double)(rule.getExpandedRuleString().length() + rule.getRuleIntervals().size());
}

Fixed version (ground truth):
private double getCoverDelta(boolean[] range,GrammarRuleRecord rule){
  int cover=0;
  int overlap=0;
  for (  RuleInterval i : rule.getRuleIntervals()) {
    int start=i.getStartPos();
    int end=i.getEndPos();
    for (int j=start; j <= end; j++) {
      if (false == range[j]) {
        cover++;
      }
 else {
        overlap++;
      }
    }
  }
  if (0 == cover) {
    return 0.0;
  }
  if (0 == overlap) {
    return (double)cover / (double)(rule.getExpandedRuleString().length() + rule.getRuleIntervals().size());
  }
  return ((double)cover / (double)(cover + overlap)) / (double)(rule.getExpandedRuleString().length() + rule.getRuleIntervals().size());
}
Program: 10521
Project: 10521
Buggy source:
public GrammarVizAnomalyFinder(MotifChartData motifChartData){
  super();
  this.chartData=motifChartData;
}

Fixed version (ground truth):
/** 
 * Constructor.
 * @param motifChartData The chartdata object -- i.e., info about the input and parameters.
 */
public GrammarVizAnomalyFinder(MotifChartData motifChartData){
  super();
  this.chartData=motifChartData;
}
Program: 10523
Project: 10523
Buggy source:
/** 
 * Reads timeseries from a file. Assumes that file has a single double value on every line. Assigned timestamps are the line numbers.
 * @param filename The file to read from.
 * @param columnIdx The column index.
 * @param sizeLimit The number of lines to read, 0 == all.
 * @return data.
 * @throws NumberFormatException if error occurs.
 * @throws IOException if error occurs.
 * @throws TSException if error occurs.
 */
public static double[] readFileColumn(String filename,int columnIdx,int sizeLimit) throws NumberFormatException, IOException, TSException {
  BufferedReader br=new BufferedReader(new InputStreamReader(new FileInputStream(filename),"String_Node_Str"));
  ArrayList<Double> preRes=new ArrayList<Double>();
  int lineCounter=0;
  String line=null;
  while ((line=br.readLine()) != null) {
    line=line.trim();
    String[] split=line.split("String_Node_Str");
    if (split.length < columnIdx) {
      String message="String_Node_Str" + columnIdx + "String_Node_Str"+ filename;
      br.close();
      throw new TSException(message);
    }
    preRes.add(Double.valueOf(split[columnIdx]));
    lineCounter++;
    if ((0 != sizeLimit || -1 != sizeLimit) && (lineCounter >= sizeLimit)) {
      break;
    }
  }
  br.close();
  double[] res=new double[preRes.size()];
  for (int i=0; i < preRes.size(); i++) {
    res[i]=preRes.get(i);
  }
  return res;
}

Fixed version (ground truth):
/** 
 * Reads timeseries from a file. Assumes that file has a single double value on every line. Assigned timestamps are the line numbers.
 * @param filename The file to read from.
 * @param columnIdx The column index.
 * @param sizeLimit The number of lines to read, 0 == all.
 * @return data.
 * @throws NumberFormatException if error occurs.
 * @throws IOException if error occurs.
 * @throws TSException if error occurs.
 */
public static double[] readFileColumn(String filename,int columnIdx,int sizeLimit) throws NumberFormatException, IOException, TSException {
  BufferedReader br=new BufferedReader(new InputStreamReader(new FileInputStream(filename),"String_Node_Str"));
  ArrayList<Double> preRes=new ArrayList<Double>();
  int lineCounter=0;
  String line=null;
  while ((line=br.readLine()) != null) {
    line=line.trim();
    String[] split=line.split("String_Node_Str");
    if (split.length < columnIdx) {
      String message="String_Node_Str" + columnIdx + "String_Node_Str"+ filename;
      br.close();
      throw new TSException(message);
    }
    preRes.add(Double.valueOf(split[columnIdx]));
    lineCounter++;
    if (!(0 == sizeLimit || -1 == sizeLimit) && (lineCounter >= sizeLimit)) {
      break;
    }
  }
  br.close();
  double[] res=new double[preRes.size()];
  for (int i=0; i < preRes.size(); i++) {
    res[i]=preRes.get(i);
  }
  return res;
}
Program: 10524
Project: 10524
Buggy source:
public DigramFrequencies(){
  super();
  digramsToEntries=new HashMap<String,DigramFrequencyEntry>();
  bucketsToEntries=new TreeMap<Integer,ArrayList<DigramFrequencyEntry>>();
}

Fixed version (ground truth):
/** 
 * Constructor. Inits data structures.
 */
public DigramFrequencies(){
  super();
  digramsToEntries=new HashMap<String,DigramFrequencyEntry>();
  bucketsToEntries=new TreeMap<Integer,ArrayList<DigramFrequencyEntry>>();
}
Program: 10525
Project: 10525
Buggy source:
public DigramFrequencyEntry get(String string){
  return this.digramsToEntries.get(string);
}

Fixed version (ground truth):
/** 
 * get the frequency entry by the digram string key.
 * @param string the string key.
 * @return the digram frequency entry if exists.
 */
public DigramFrequencyEntry get(String string){
  return this.digramsToEntries.get(string);
}
Program: 10526
Project: 10526
Buggy source:
public DigramFrequencyEntry getTop(){
  if (bucketsToEntries.keySet().isEmpty()) {
    return null;
  }
 else {
    Integer maxBucket=Collections.max(bucketsToEntries.keySet());
    return bucketsToEntries.get(maxBucket).get(0);
  }
}

Fixed version (ground truth):
/** 
 * Gets the most frequent entry.
 * @return the most frequent entry.
 */
public DigramFrequencyEntry getTop(){
  if (bucketsToEntries.keySet().isEmpty()) {
    return null;
  }
 else {
    Integer maxBucket=Collections.max(bucketsToEntries.keySet());
    return bucketsToEntries.get(maxBucket).get(0);
  }
}
Program: 10527
Project: 10527
Buggy source:
public void put(DigramFrequencyEntry digramFrequencyEntry){
  this.digramsToEntries.put(digramFrequencyEntry.getDigram(),digramFrequencyEntry);
  Integer freq=digramFrequencyEntry.getFrequency();
  ArrayList<DigramFrequencyEntry> bucket=this.bucketsToEntries.get(freq);
  if (null == bucket) {
    bucket=new ArrayList<DigramFrequencyEntry>();
    this.bucketsToEntries.put(freq,bucket);
  }
  bucket.add(digramFrequencyEntry);
}

Fixed version (ground truth):
/** 
 * Puts the digram into collection, it overrides the old entry.
 * @param digramFrequencyEntry The digram entry.
 */
public void put(DigramFrequencyEntry digramFrequencyEntry){
  this.digramsToEntries.put(digramFrequencyEntry.getDigram(),digramFrequencyEntry);
  Integer freq=digramFrequencyEntry.getFrequency();
  ArrayList<DigramFrequencyEntry> bucket=this.bucketsToEntries.get(freq);
  if (null == bucket) {
    bucket=new ArrayList<DigramFrequencyEntry>();
    this.bucketsToEntries.put(freq,bucket);
  }
  bucket.add(digramFrequencyEntry);
}
Program: 10528
Project: 10528
Buggy source:
public void incrementFrequency(DigramFrequencyEntry entry,int index){
  ArrayList<DigramFrequencyEntry> oldBucket=this.bucketsToEntries.get(entry.getFrequency());
  oldBucket.remove(entry);
  if (0 == oldBucket.size() || oldBucket.isEmpty()) {
    this.bucketsToEntries.remove(entry.getFrequency());
  }
  int newFreq=entry.getFrequency() + index;
  entry.setFrequency(newFreq);
  ArrayList<DigramFrequencyEntry> bucket=this.bucketsToEntries.get(newFreq);
  if (null == bucket) {
    bucket=new ArrayList<DigramFrequencyEntry>();
    this.bucketsToEntries.put(newFreq,bucket);
  }
  bucket.add(entry);
}

Fixed version (ground truth):
/** 
 * Increments a frequency counter for a digram.
 * @param entry the entry.
 * @param increment the increment value.
 */
public void incrementFrequency(DigramFrequencyEntry entry,int increment){
  ArrayList<DigramFrequencyEntry> oldBucket=this.bucketsToEntries.get(entry.getFrequency());
  oldBucket.remove(entry);
  if (0 == oldBucket.size() || oldBucket.isEmpty()) {
    this.bucketsToEntries.remove(entry.getFrequency());
  }
  int newFreq=entry.getFrequency() + increment;
  entry.setFrequency(newFreq);
  ArrayList<DigramFrequencyEntry> bucket=this.bucketsToEntries.get(newFreq);
  if (null == bucket) {
    bucket=new ArrayList<DigramFrequencyEntry>();
    this.bucketsToEntries.put(newFreq,bucket);
  }
  bucket.add(entry);
}
Program: 10529
Project: 10529
Buggy source:
public void remove(String digram){
  DigramFrequencyEntry entry=this.digramsToEntries.get(digram);
  int freq=entry.getFrequency();
  ArrayList<DigramFrequencyEntry> bucket=this.bucketsToEntries.get(freq);
  if (!bucket.remove(entry)) {
    throw (new RuntimeException("String_Node_Str"));
  }
  if (0 == bucket.size() || bucket.isEmpty()) {
    this.bucketsToEntries.remove(entry.getFrequency());
  }
  this.digramsToEntries.remove(entry);
  entry=null;
}

Fixed version (ground truth):
/** 
 * Removes the digram frequency entry from the collection.
 * @param digramStr the digram string.
 */
public void remove(String digramStr){
  DigramFrequencyEntry entry=this.digramsToEntries.get(digramStr);
  if (null == entry) {
    return;
  }
 else {
    int freq=entry.getFrequency();
    ArrayList<DigramFrequencyEntry> bucket=this.bucketsToEntries.get(freq);
    if (!bucket.remove(entry)) {
      throw (new RuntimeException("String_Node_Str"));
    }
    if (bucket.isEmpty()) {
      this.bucketsToEntries.remove(freq);
    }
    this.digramsToEntries.remove(digramStr);
  }
  entry=null;
}
Program: 10530
Project: 10530
Buggy source:
public DigramFrequencyEntry(String digram,int frequency,int firstOccurrence){
  super();
  this.digram=digram;
  this.frequency=frequency;
  this.firstOccurrence=firstOccurrence;
}

Fixed version (ground truth):
/** 
 * Constructor.
 * @param digram the digram string.
 * @param frequency the digram frequency.
 * @param firstOccurrence the digram first occurrence.
 */
public DigramFrequencyEntry(String digram,int frequency,int firstOccurrence){
  super();
  this.digram=digram;
  this.frequency=frequency;
  this.firstOccurrence=firstOccurrence;
}
Program: 10531
Project: 10531
Buggy source:
public String getDigram(){
  return digram;
}

Fixed version (ground truth):
/** 
 * Get the payload.
 * @return the digram string.
 */
public String getDigram(){
  return digram;
}
Program: 10532
Project: 10532
Buggy source:
public int getFirstOccurrence(){
  return firstOccurrence;
}

Fixed version (ground truth):
/** 
 * Get the first occurrence.
 * @return the first occurrence.
 */
public int getFirstOccurrence(){
  return firstOccurrence;
}
Program: 10533
Project: 10533
Buggy source:
public int getFrequency(){
  return frequency;
}

Fixed version (ground truth):
/** 
 * Frequency getter.
 * @return the frequency value.
 */
public int getFrequency(){
  return frequency;
}
Program: 10534
Project: 10534
Buggy source:
public void setDigram(String digram){
  this.digram=digram;
}

Fixed version (ground truth):
/** 
 * Set the digram string.
 * @param digram the string.
 */
public void setDigram(String digram){
  this.digram=digram;
}
Program: 10535
Project: 10535
Buggy source:
public void setFrequency(int frequency){
  this.frequency=frequency;
}

Fixed version (ground truth):
/** 
 * Frequency setter.
 * @param frequency the new frequency value.
 */
public void setFrequency(int frequency){
  this.frequency=frequency;
}
Program: 10536
Project: 10536
Buggy source:
public void setFirstOccurrence(int firstOccurrence){
  this.firstOccurrence=firstOccurrence;
}

Fixed version (ground truth):
/** 
 * Set the first occurrence.
 * @param firstOccurrence the new value.
 */
public void setFirstOccurrence(int firstOccurrence){
  this.firstOccurrence=firstOccurrence;
}
Program: 10537
Project: 10537
Buggy source:
/** 
 * Set a string payload.
 * @param str the string payload.
 */
public void setStr(char[] str){
  int i=0;
  while (i < str.length && i < this.payload.length) {
    this.payload[i]=str[i];
    i++;
  }
}

Fixed version (ground truth):
/** 
 * Set a string payload.
 * @param str the string payload.
 */
public void setStr(char[] str){
  this.payload=str.clone();
}
Program: 10538
Project: 10538
Buggy source:
/** 
 * Build the actual trie.
 * @param root The root of the current tree.
 * @param alphabetSize The alphabet size.
 * @param depth2Go The depth of the tree left.
 */
private void buildTrie(TrieAbstractNode root,Integer alphabetSize,Integer depth2Go){
  if (depth2Go > 1) {
    for (int i=0; i < alphabetSize; i++) {
      char curChar=(char)(i + aStart);
      TrieInnerNode node=new TrieInnerNode(String.valueOf(curChar));
      ((TrieInnerNode)root).addNext(node);
      buildTrie(node,alphabetSize,depth2Go - 1);
    }
  }
 else {
    for (int i=0; i < alphabetSize; i++) {
      char curChar=(char)(i + aStart);
      TrieLeafNode node=new TrieLeafNode(String.valueOf(curChar));
      ((TrieInnerNode)root).addNext(node);
    }
  }
}

Fixed version (ground truth):
/** 
 * Build the actual trie.
 * @param root The root of the current tree.
 * @param alphabetSize The alphabet size.
 * @param depth2Go The depth of the tree left.
 */
private void buildTrie(TrieAbstractNode root,Integer alphabetSize,Integer depth2Go){
  if (depth2Go > 1) {
    for (int i=0; i < alphabetSize; i++) {
      char curChar=(char)(i + ALPHABET_CODE_START);
      TrieInnerNode node=new TrieInnerNode(String.valueOf(curChar));
      ((TrieInnerNode)root).addNext(node);
      buildTrie(node,alphabetSize,depth2Go - 1);
    }
  }
 else {
    for (int i=0; i < alphabetSize; i++) {
      char curChar=(char)(i + ALPHABET_CODE_START);
      TrieLeafNode node=new TrieLeafNode(String.valueOf(curChar));
      ((TrieInnerNode)root).addNext(node);
    }
  }
}
Program: 10539
Project: 10539
Buggy source:
/** 
 * The string validator - check if string has only proper letters.
 * @param str The string to check.
 * @return True if string contains only acceptable (valid) symbols.
 */
private boolean containsWrongSymbols(String str){
  int maxSymbol=aStart + alphabetSize;
  for (int i=0; i < str.length(); i++) {
    if (((int)str.charAt(i)) >= maxSymbol) {
      return true;
    }
  }
  return false;
}

Fixed version (ground truth):
/** 
 * The string validator - check if string has only proper letters.
 * @param str The string to check.
 * @return True if string contains only acceptable (valid) symbols.
 */
private boolean containsWrongSymbols(String str){
  int maxSymbol=ALPHABET_CODE_START + alphabetSize;
  for (int i=0; i < str.length(); i++) {
    if (((int)str.charAt(i)) >= maxSymbol) {
      return true;
    }
  }
  return false;
}
Program: 10540
Project: 10540
Buggy source:
/** 
 * Constructor.
 * @param alphabetSize The alphabet size.
 * @throws TrieException If wrong parameters specified.
 */
public SAXTrieTree(Integer alphabetSize) throws TrieException {
  if ((null != alphabetSize) && (alphabetSize > 0) && (alphabetSize < (aEnd - aStart))) {
    this.alphabetSize=alphabetSize;
    root=new TrieInnerNode("String_Node_Str");
    buildTrie(root,alphabetSize,alphabetSize);
  }
 else {
    throw new TrieException("String_Node_Str" + alphabetSize);
  }
}

Fixed version (ground truth):
/** 
 * Constructor.
 * @param alphabetSize The alphabet size.
 * @throws TrieException If wrong parameters specified.
 */
public SAXTrieTree(Integer alphabetSize) throws TrieException {
  if ((null != alphabetSize) && (alphabetSize > 0) && (alphabetSize < (ALPHABET_CODE_END - ALPHABET_CODE_START))) {
    this.alphabetSize=alphabetSize;
    root=new TrieInnerNode("String_Node_Str");
    buildTrie(root,alphabetSize,alphabetSize);
  }
 else {
    throw new TrieException("String_Node_Str" + alphabetSize);
  }
}
Program: 10542
Project: 10542
Buggy source:
/** 
 * Test parallel SAX conversion.
 * @throws Exception if error occurs.
 */
@Test public void testParallelSAX() throws Exception {
  double[] ts=TSUtils.readFileColumn(filenameTEK14,0,0);
  SAXFrequencyData sequentialRes=SAXFactory.ts2saxZNorm(new Timeseries(ts),128,7,new NormalAlphabet(),7);
  String sequentialString=sequentialRes.getSAXString("String_Node_Str");
  ParallelSAXImplementation ps1=new ParallelSAXImplementation();
  SAXRecords parallelRes=ps1.process(ts,THREADS_NUM,128,7,7,NumerosityReductionStrategy.EXACT,0.005);
  assertTrue(sequentialString.equalsIgnoreCase(parallelRes.getSAXString("String_Node_Str")));
  SAXFrequencyData sequentialRes2=SAXFactory.data2sax(ts,100,8,4);
  String sequentialString2=sequentialRes2.getSAXString("String_Node_Str");
  ParallelSAXImplementation ps2=new ParallelSAXImplementation();
  SAXRecords parallelRes2=ps2.process(ts,THREADS_NUM,100,8,4,NumerosityReductionStrategy.EXACT,0.005);
  assertTrue(sequentialString2.equalsIgnoreCase(parallelRes2.getSAXString("String_Node_Str")));
}

Fixed version (ground truth):
/** 
 * Test parallel SAX conversion.
 * @throws Exception if error occurs.
 */
@Test public void testParallelSAX() throws Exception {
  double[] ts=TSUtils.readFileColumn(filenameTEK14,0,0);
  SAXFrequencyData sequentialRes=SAXFactory.ts2saxZNorm(new Timeseries(ts),128,7,new NormalAlphabet(),7);
  String sequentialString=sequentialRes.getSAXString("String_Node_Str");
  ParallelSAXImplementation ps1=new ParallelSAXImplementation();
  SAXRecords parallelRes=ps1.process(ts,THREADS_NUM,128,7,7,NumerosityReductionStrategy.EXACT,0.005);
  assertTrue(sequentialString.equalsIgnoreCase(parallelRes.getSAXString("String_Node_Str")));
  for (  int i : parallelRes.getIndexes()) {
    String entrySerial=sequentialRes.getPositionsAndWords().get(i);
    String entryParallel=String.valueOf(parallelRes.getByIndex(i).getPayload());
    assertTrue(entrySerial.equalsIgnoreCase(entryParallel));
  }
  SAXFrequencyData sequentialRes2=SAXFactory.data2sax(ts,100,8,4);
  String sequentialString2=sequentialRes2.getSAXString("String_Node_Str");
  ParallelSAXImplementation ps2=new ParallelSAXImplementation();
  SAXRecords parallelRes2=ps2.process(ts,THREADS_NUM,100,8,4,NumerosityReductionStrategy.EXACT,0.005);
  assertTrue(sequentialString2.equalsIgnoreCase(parallelRes2.getSAXString("String_Node_Str")));
  for (  int i : parallelRes2.getIndexes()) {
    String entrySerial=sequentialRes2.getPositionsAndWords().get(i);
    String entryParallel=String.valueOf(parallelRes2.getByIndex(i).getPayload());
    assertTrue(entrySerial.equalsIgnoreCase(entryParallel));
  }
}
Program: 10543
Project: 10543
Buggy source:
private File getReleaseApkFile(AndroidPublisherExtension publisherExtension){
  String variantName=publisherExtension.getVariantName();
  DefaultDomainObjectSet<ApplicationVariant> variants=getProject().getExtensions().getByType(AppExtension.class).getApplicationVariants();
  ApplicationVariant releaseVariant=null;
  for (  ApplicationVariant variant : variants) {
    if (variant.getName().equals(variantName)) {
      releaseVariant=variant;
      break;
    }
  }
  if (releaseVariant == null) {
    throw new InvalidUserDataException(String.format("String_Node_Str",variantName));
  }
  for (  BaseVariantOutput output : releaseVariant.getOutputs()) {
    if (output != null) {
      getLogger().info("String_Node_Str" + output.getName());
      if (output.getName().endsWith("String_Node_Str"))       return output.getOutputFile();
    }
  }
  throw new InvalidUserDataException(String.format("String_Node_Str",variantName));
}

Fixed version (ground truth):
private File getReleaseApkFile(AndroidPublisherExtension publisherExtension){
  String variantName=publisherExtension.getVariantName();
  DefaultDomainObjectSet<ApplicationVariant> variants=getProject().getExtensions().getByType(AppExtension.class).getApplicationVariants();
  ApplicationVariant releaseVariant=null;
  for (  ApplicationVariant variant : variants) {
    if (variant.getName().equals(variantName)) {
      releaseVariant=variant;
      break;
    }
  }
  if (releaseVariant == null) {
    throw new InvalidUserDataException(String.format("String_Node_Str",variantName));
  }
  for (  BaseVariantOutput output : releaseVariant.getOutputs()) {
    if (output != null) {
      return output.getOutputFile();
    }
  }
  throw new InvalidUserDataException(String.format("String_Node_Str",variantName));
}
Program: 10544
Project: 10544
Buggy source:
private AndroidPublisherExtension getAndVerifyExtension(){
  AndroidPublisherExtension publisherExtension=getProject().getExtensions().getByType(AndroidPublisherExtension.class);
  Preconditions.checkArgument(!Strings.isNullOrEmpty(publisherExtension.getApplicationName()),"String_Node_Str");
  Preconditions.checkArgument(!Strings.isNullOrEmpty(publisherExtension.getTrack()),"String_Node_Str");
  Preconditions.checkArgument(!Strings.isNullOrEmpty(publisherExtension.getTrack()),"String_Node_Str");
  Preconditions.checkArgument(!Strings.isNullOrEmpty(publisherExtension.getPackageName()),"String_Node_Str");
  Preconditions.checkArgument(!Strings.isNullOrEmpty(publisherExtension.getServiceAccountEmail()),"String_Node_Str");
  Preconditions.checkArgument(publisherExtension.getServiceAccountKeyFile() != null,"String_Node_Str");
  return publisherExtension;
}

Fixed version (ground truth):
private AndroidPublisherExtension getAndVerifyExtension(){
  AndroidPublisherExtension publisherExtension=getProject().getExtensions().getByType(AndroidPublisherExtension.class);
  Preconditions.checkArgument(!Strings.isNullOrEmpty(publisherExtension.getApplicationName()),"String_Node_Str");
  Preconditions.checkArgument(!Strings.isNullOrEmpty(publisherExtension.getTrack()),"String_Node_Str");
  Preconditions.checkArgument(!Strings.isNullOrEmpty(publisherExtension.getPromotionTrack()),"String_Node_Str");
  Preconditions.checkArgument(!publisherExtension.getTrack().equals(publisherExtension.getPromotionTrack()),"String_Node_Str");
  Preconditions.checkArgument(!Strings.isNullOrEmpty(publisherExtension.getPackageName()),"String_Node_Str");
  Preconditions.checkArgument(!Strings.isNullOrEmpty(publisherExtension.getServiceAccountEmail()),"String_Node_Str");
  Preconditions.checkArgument(publisherExtension.getServiceAccountKeyFile() != null,"String_Node_Str");
  return publisherExtension;
}
Program: 10547
Project: 10547
Buggy source:
/** 
 * Create an alarm against the given managed entity using the alarm specification
 * @param me The  {@link ManagedEntity} to alarm against.
 * @param as The  {@link AlarmSpec} used to generate the alarm.
 * @return The new {@link ALarm} created
 * @throws InvalidName if the alarm name exceeds the max length or is empty.
 * @throws DuplicateName if an alarm with the same name already exists.
 * @throws RuntimeFault if any unhandled runtime fault occurs
 * @throws RemoteException
 */
public Alarm createAlarm(ManagedEntity me,AlarmSpec as) throws InvalidName, DuplicateName, RuntimeFault, RemoteException {
  if (me == null) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  ManagedObjectReference mor=getVimService().createAlarm(getMOR(),me.getMOR(),as);
  return new Alarm(getServerConnection(),mor);
}

Fixed version (ground truth):
/** 
 * Create an alarm against the given managed entity using the alarm specification
 * @param me The  {@link ManagedEntity} to alarm against.
 * @param as The  {@link AlarmSpec} used to generate the alarm.
 * @return The new {@link Alarm} created
 * @throws InvalidName if the alarm name exceeds the max length or is empty.
 * @throws DuplicateName if an alarm with the same name already exists.
 * @throws RuntimeFault if any unhandled runtime fault occurs
 * @throws RemoteException
 */
public Alarm createAlarm(ManagedEntity me,AlarmSpec as) throws InvalidName, DuplicateName, RuntimeFault, RemoteException {
  if (me == null) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  ManagedObjectReference mor=getVimService().createAlarm(getMOR(),me.getMOR(),as);
  return new Alarm(getServerConnection(),mor);
}
Program: 10548
Project: 10548
Buggy source:
/** 
 * @param propertyName The property name of current managed object
 * @return it will return either an array of related data objects, or an data object itself.ManagedObjectReference objects are data objects!!!
 * @throws RemoteException
 * @throws RuntimeFault
 * @throws InvalidProperty
 */
protected Object getCurrentProperty(String propertyName){
  ObjectContent objContent=retrieveObjectProperties(new String[]{propertyName});
  Object propertyValue=null;
  if (objContent != null) {
    DynamicProperty[] dynaProps=objContent.getPropSet();
    if ((dynaProps != null) && (dynaProps[0] != null)) {
      propertyValue=PropertyCollectorUtil.convertProperty(dynaProps[0].getVal());
    }
  }
  return propertyValue;
}

Fixed version (ground truth):
/** 
 * @param propertyName The property name of current managed object
 * @return it will return either an array of related data objects, or an data object itself.ManagedObjectReference objects are data objects!!!
 */
protected Object getCurrentProperty(String propertyName){
  ObjectContent objContent=retrieveObjectProperties(new String[]{propertyName});
  Object propertyValue=null;
  if (objContent != null) {
    DynamicProperty[] dynaProps=objContent.getPropSet();
    if ((dynaProps != null) && (dynaProps[0] != null)) {
      propertyValue=PropertyCollectorUtil.convertProperty(dynaProps[0].getVal());
    }
  }
  return propertyValue;
}
Program: 10549
Project: 10549
Buggy source:
private static byte[] toByteArray(List<String> values){
  byte[] bs=new byte[values.size()];
  for (int i=0; i < bs.length; i++) {
    bs[i]=Byte.parseByte(values.get(i));
  }
  return bs;
}

Fixed version (ground truth):
protected static byte[] toByteArray(List<String> values){
  byte[] bs=new byte[values.size()];
  try {
    for (int i=0; i < bs.length; i++) {
      bs[i]=Byte.parseByte(values.get(i));
    }
    return bs;
  }
 catch (  NumberFormatException ignore) {
    String tempStr="String_Node_Str";
    for (    String s : values) {
      tempStr+=s;
    }
    return DatatypeConverter.parseBase64Binary(tempStr);
  }
}
Program: 10551
Project: 10551
Buggy source:
public static Object convertProperty(Object dynaPropVal){
  Object propertyValue=null;
  Class<?> propClass=dynaPropVal.getClass();
  String propName=propClass.getName();
  if (propName.contains("String_Node_Str")) {
    String methodName=propName.substring(propName.indexOf("String_Node_Str") + "String_Node_Str".length());
    try {
      Method getMethod;
      try {
        getMethod=propClass.getMethod("String_Node_Str" + methodName,(Class[])null);
      }
 catch (      NoSuchMethodException nsme) {
        getMethod=propClass.getMethod("String_Node_Str" + methodName.toLowerCase(),(Class[])null);
      }
      propertyValue=getMethod.invoke(dynaPropVal,(Object[])null);
    }
 catch (    Exception e) {
      log.error("String_Node_Str",e);
    }
  }
 else   if (dynaPropVal.getClass().isArray()) {
    propertyValue=dynaPropVal;
  }
 else {
    propertyValue=dynaPropVal;
  }
  return propertyValue;
}

Fixed version (ground truth):
public static Object convertProperty(Object dynaPropVal){
  Object propertyValue=null;
  Class<?> propClass=dynaPropVal.getClass();
  String propName=propClass.getName();
  if (propName.contains("String_Node_Str")) {
    String methodName=propName.substring(propName.indexOf("String_Node_Str") + "String_Node_Str".length());
    try {
      Method getMethod;
      try {
        getMethod=propClass.getMethod("String_Node_Str" + methodName,(Class[])null);
      }
 catch (      NoSuchMethodException ignore) {
        getMethod=propClass.getMethod("String_Node_Str" + methodName.toLowerCase(),(Class[])null);
      }
      propertyValue=getMethod.invoke(dynaPropVal,(Object[])null);
    }
 catch (    Exception e) {
      log.error("String_Node_Str",e);
    }
  }
 else   if (dynaPropVal.getClass().isArray()) {
    propertyValue=dynaPropVal;
  }
 else {
    propertyValue=dynaPropVal;
  }
  return propertyValue;
}
Program: 10553
Project: 10553
Buggy source:
public static SSLConnectionSocketFactory trust(){
  SSLContextBuilder builder=new SSLContextBuilder();
  log.trace("String_Node_Str");
  try {
    builder.loadTrustMaterial(null,new TrustSelfSignedStrategy());
    log.trace("String_Node_Str");
  }
 catch (  NoSuchAlgorithmException e) {
    log.error("String_Node_Str",e);
    return null;
  }
catch (  KeyStoreException e) {
    log.error("String_Node_Str",e);
    return null;
  }
  SSLConnectionSocketFactory sslConnectionSocketFactory;
  try {
    sslConnectionSocketFactory=new SSLConnectionSocketFactory(builder.build());
    log.trace("String_Node_Str");
  }
 catch (  NoSuchAlgorithmException e) {
    log.error("String_Node_Str",e);
    return null;
  }
catch (  KeyManagementException e) {
    log.error("String_Node_Str",e);
    return null;
  }
  log.trace("String_Node_Str");
  return sslConnectionSocketFactory;
}

Fixed version (ground truth):
public static SSLConnectionSocketFactory trust(){
  SSLContextBuilder builder=new SSLContextBuilder();
  log.trace("String_Node_Str");
  try {
    builder.loadTrustMaterial(null,new TrustSelfSignedStrategy());
    log.trace("String_Node_Str");
  }
 catch (  NoSuchAlgorithmException e) {
    log.error("String_Node_Str",e);
    return null;
  }
catch (  KeyStoreException e) {
    log.error("String_Node_Str",e);
    return null;
  }
  SSLConnectionSocketFactory sslConnectionSocketFactory;
  try {
    sslConnectionSocketFactory=new SSLConnectionSocketFactory(builder.build(),new AllowAllHostnameVerifier());
    log.trace("String_Node_Str");
  }
 catch (  NoSuchAlgorithmException e) {
    log.error("String_Node_Str",e);
    return null;
  }
catch (  KeyManagementException e) {
    log.error("String_Node_Str",e);
    return null;
  }
  log.trace("String_Node_Str");
  return sslConnectionSocketFactory;
}
Program: 10554
Project: 10554
Buggy source:
/** 
 * Copyright 2009 NetApp, contribution by Eric Forgette Modified by Steve Jin (sjin@vmware.com) This constructor builds a new ServiceInstance based on a ServiceInstance. The new ServiceInstance is effectively a clone of the first.  This clone will NOT become invalid when the first is logged out.
 * @author Eric Forgette (forgette@netapp.com)
 * @throws RemoteException 
 * @throws RuntimeFault 
 * @throws InvalidLogin 
 * @throws MalformedURLException 
 */
public ServiceInstance cloneSession(boolean ignoreCert) throws InvalidLogin, RuntimeFault, RemoteException, MalformedURLException {
  ServiceInstance oldsi=getServerConnection().getServiceInstance();
  ServerConnection oldsc=oldsi.getServerConnection();
  String ticket=oldsi.getSessionManager().acquireCloneTicket();
  VimPortType vimService=new VimPortType(oldsc.getUrl().toString(),ignoreCert);
  vimService.getWsc().setVimNameSpace(oldsc.getVimService().getWsc().getVimNameSpace());
  ServerConnection newsc=new ServerConnection(oldsc.getUrl(),vimService,null);
  ServiceInstance newsi=new ServiceInstance(newsc);
  newsc.setServiceInstance(newsi);
  UserSession userSession=newsi.getSessionManager().cloneSession(ticket);
  newsc.setUserSession(userSession);
  return newsi;
}

Fixed version (ground truth):
/** 
 * Copyright 2009 NetApp, contribution by Eric Forgette Modified by Steve Jin (sjin@vmware.com) This constructor builds a new ServiceInstance based on a ServiceInstance. The new ServiceInstance is effectively a clone of the first.  This clone will NOT become invalid when the first is logged out.
 * @author Eric Forgette (forgette@netapp.com)
 * @throws RemoteException 
 * @throws RuntimeFault 
 * @throws InvalidLogin 
 * @throws MalformedURLException 
 */
public ServiceInstance cloneSession(boolean ignoreCert) throws InvalidLogin, RuntimeFault, RemoteException, MalformedURLException {
  ServiceInstance oldsi=getServerConnection().getServiceInstance();
  ServerConnection oldsc=oldsi.getServerConnection();
  String ticket=oldsi.getSessionManager().acquireCloneTicket();
  VimPortType vimService=new VimPortType(oldsc.getUrl().toString(),ignoreCert);
  vimService.getWsc().setVimNameSpace(oldsc.getVimService().getWsc().getVimNameSpace());
  vimService.getWsc().setSoapActionOnApiVersion(oldsi.getAboutInfo().getApiVersion());
  ServerConnection newsc=new ServerConnection(oldsc.getUrl(),vimService,null);
  ServiceInstance newsi=new ServiceInstance(newsc);
  newsc.setServiceInstance(newsi);
  UserSession userSession=newsi.getSessionManager().cloneSession(ticket);
  newsc.setUserSession(userSession);
  return newsi;
}
Program: 10556
Project: 10556
Buggy source:
public InputStream post(String soapMsg) throws IOException {
  HttpURLConnection postCon=(HttpURLConnection)baseUrl.openConnection();
  if (connectTimeout > 0)   postCon.setConnectTimeout(connectTimeout);
  if (readTimeout > 0)   postCon.setReadTimeout(readTimeout);
  try {
    postCon.setRequestMethod("String_Node_Str");
  }
 catch (  ProtocolException e) {
    e.printStackTrace();
  }
  postCon.setDoOutput(true);
  postCon.setDoInput(true);
  postCon.setRequestProperty(SOAP_ACTION_HEADER,soapAction);
  if (cookie != null) {
    postCon.setRequestProperty("String_Node_Str",cookie);
  }
  OutputStream os=postCon.getOutputStream();
  OutputStreamWriter out=new OutputStreamWriter(os);
  out.write(soapMsg);
  out.close();
  InputStream is;
  try {
    is=postCon.getInputStream();
  }
 catch (  IOException ioe) {
    is=postCon.getErrorStream();
  }
  if (cookie == null) {
    cookie=postCon.getHeaderField("String_Node_Str");
  }
  return is;
}

Fixed version (ground truth):
public InputStream post(String soapMsg) throws IOException {
  HttpURLConnection postCon=(HttpURLConnection)baseUrl.openConnection();
  if (connectTimeout > 0)   postCon.setConnectTimeout(connectTimeout);
  if (readTimeout > 0)   postCon.setReadTimeout(readTimeout);
  try {
    postCon.setRequestMethod("String_Node_Str");
  }
 catch (  ProtocolException e) {
    e.printStackTrace();
  }
  postCon.setDoOutput(true);
  postCon.setDoInput(true);
  postCon.setRequestProperty(SOAP_ACTION_HEADER,soapAction);
  postCon.setRequestProperty("String_Node_Str","String_Node_Str");
  if (cookie != null) {
    postCon.setRequestProperty("String_Node_Str",cookie);
  }
  OutputStream os=postCon.getOutputStream();
  OutputStreamWriter out=new OutputStreamWriter(os,"String_Node_Str");
  out.write(soapMsg);
  out.close();
  InputStream is;
  try {
    is=postCon.getInputStream();
  }
 catch (  IOException ioe) {
    is=postCon.getErrorStream();
  }
  if (cookie == null) {
    cookie=postCon.getHeaderField("String_Node_Str");
  }
  return is;
}
Program: 10557
Project: 10557
Buggy source:
public Profile[] findAssociatedProfile(ManagedEntity entity) throws RuntimeFault, RemoteException {
  ManagedObjectReference[] mors=getVimService().findAssociatedProfile(getMOR(),entity.getMOR());
  Profile[] pfs=new Profile[mors.length];
  for (int i=0; i < mors.length; i++) {
    pfs[i]=new Profile(getServerConnection(),mors[i]);
  }
  return pfs;
}

Fixed version (ground truth):
public Profile[] findAssociatedProfile(ManagedEntity entity) throws RuntimeFault, RemoteException {
  ManagedObjectReference[] mors=getVimService().findAssociatedProfile(getMOR(),entity.getMOR());
  return convert2Profiles(mors);
}
Program: 10558
Project: 10558
Buggy source:
public Profile[] getProfile(){
  return (Profile[])getCurrentProperty("String_Node_Str");
}

Fixed version (ground truth):
public Profile[] getProfile(){
  ManagedObjectReference[] mors=(ManagedObjectReference[])getCurrentProperty("String_Node_Str");
  return convert2Profiles(mors);
}
Program: 10559
Project: 10559
Buggy source:
public String post(String urlStr,Map<String,String> para) throws Exception {
  urlStr=preProcessUrl(urlStr);
  HttpURLConnection getCon=(HttpURLConnection)new URL(urlStr).openConnection();
  getCon.connect();
  String cookie=getCon.getHeaderField("String_Node_Str");
  cookie=cookie.substring(0,cookie.indexOf("String_Node_Str"));
  HttpURLConnection postCon=(HttpURLConnection)new URL(urlStr).openConnection();
  postCon.setRequestMethod("String_Node_Str");
  postCon.setDoOutput(true);
  postCon.setDoInput(true);
  postCon.setRequestProperty("String_Node_Str",cookie);
  OutputStream os=postCon.getOutputStream();
  OutputStreamWriter out=new OutputStreamWriter(os);
  Iterator<String> keys=para.keySet().iterator();
  while (keys.hasNext()) {
    String key=keys.next();
    String value=para.get(key);
    key=URLEncoder.encode(key,"String_Node_Str");
    value=URLEncoder.encode(value,"String_Node_Str");
    out.write(key + "String_Node_Str" + value);
  }
  out.close();
  InputStream is=postCon.getInputStream();
  StringBuffer sb=readStream(is);
  String resultFlag="String_Node_Str";
  int start=sb.indexOf(resultFlag);
  String result=sb.substring(start + resultFlag.length());
  return ResultConverter.convert2Xml(result);
}

Fixed version (ground truth):
public String post(String urlStr,Map<String,String> para) throws Exception {
  urlStr=preProcessUrl(urlStr);
  HttpURLConnection getCon=(HttpURLConnection)new URL(urlStr).openConnection();
  getCon.connect();
  String cookie=getCon.getHeaderField("String_Node_Str");
  cookie=cookie.substring(0,cookie.indexOf("String_Node_Str"));
  String nonceStr=findVMwareSessionNonce(getCon.getInputStream());
  HttpURLConnection postCon=(HttpURLConnection)new URL(urlStr).openConnection();
  postCon.setRequestMethod("String_Node_Str");
  postCon.setDoOutput(true);
  postCon.setDoInput(true);
  postCon.setRequestProperty("String_Node_Str",cookie);
  OutputStream os=postCon.getOutputStream();
  OutputStreamWriter out=new OutputStreamWriter(os);
  if (nonceStr != null) {
    out.write(NONCE + "String_Node_Str" + nonceStr);
  }
  Iterator<String> keys=para.keySet().iterator();
  while (keys.hasNext()) {
    String key=keys.next();
    String value=para.get(key);
    key=URLEncoder.encode(key,"String_Node_Str");
    value=URLEncoder.encode(value,"String_Node_Str");
    out.write(key + "String_Node_Str" + value);
  }
  out.close();
  InputStream is=postCon.getInputStream();
  StringBuffer sb=readStream(is);
  String resultFlag="String_Node_Str";
  int start=sb.indexOf(resultFlag);
  String result=sb.substring(start + resultFlag.length());
  return ResultConverter.convert2Xml(result);
}
Program: 10561
Project: 10561
Buggy source:
public void watch(PropertyFilterSpec pfs){
  mom.watch(pfs);
}

Fixed version (ground truth):
/** 
 * Add PropertyFilterSpec for advanced settings
 * @param pfs the property filter spec which specifiesthe managed objects and properties to watch.
 */
public void watch(PropertyFilterSpec pfs){
  mom.watch(pfs);
}
Program: 10562
Project: 10562
Buggy source:
public Object getCopy(ManagedObjectReference mor,String propName){
  return getCopy(mor,propName);
}

Fixed version (ground truth):
/** 
 * Get a copy of the cached property. You can change the returned object as you like
 * @param mor Managed object reference
 * @param propName property name
 * @return the data object identified by the propName.NullObject.NULL if the data object is really null
 */
public Object getCopy(ManagedObjectReference mor,String propName){
  return getCopy(mor,propName);
}
Program: 10563
Project: 10563
Buggy source:
public Object get(ManagedObjectReference mor,String propName){
  Map<ManagedObjectReference,Map<String,Object>> items=cache.getCachedItems();
  Map<String,Object> moMap=items.get(mor);
  if (moMap != null) {
    return moMap.get(propName);
  }
  return null;
}

Fixed version (ground truth):
/** 
 * Get the value of cached property whose name is propName. You should NEVER change the returned data object.
 * @param mor Managed object reference pointing to the managed object
 * @param propName Property name
 * @return the data object identified by the propName.NullObject.NULL if the data object is really null
 */
public Object get(ManagedObjectReference mor,String propName){
  Map<ManagedObjectReference,Map<String,Object>> items=cache.getCachedItems();
  Map<String,Object> moMap=items.get(mor);
  if (moMap != null) {
    return moMap.get(propName);
  }
  return null;
}
Program: 10564
Project: 10564
Buggy source:
public ServiceInstance getServiceInstance(){
  return si;
}

Fixed version (ground truth):
/** 
 * Get the corresponding ServiceInstance
 * @return ServiceInstance object
 */
public ServiceInstance getServiceInstance(){
  return si;
}
Program: 10565
Project: 10565
Buggy source:
public boolean isReady(){
  return cache.isReady();
}

Fixed version (ground truth):
/** 
 * Check if the CacheInstance is ready for retrieval
 * @return true if ready; false otherwise
 */
public boolean isReady(){
  return cache.isReady();
}
Program: 10566
Project: 10566
Buggy source:
public void start(){
  mThread=new Thread(mom);
  mThread.setName("String_Node_Str" + si.getServerConnection().getUrl());
  mThread.start();
}

Fixed version (ground truth):
/** 
 * Start the caching service. Called after specifying the managed objects and their properties to watch.
 */
public void start(){
  mThread=new Thread(mom);
  mThread.setName("String_Node_Str" + si.getServerConnection().getUrl());
  mThread.start();
}
Program: 10567
Project: 10567
Buggy source:
public void destroy(){
  mom.cleanUp();
  mThread.stop();
  si=null;
  mom=null;
  cache=null;
  mThread=null;
}

Fixed version (ground truth):
/** 
 * Destrory the caching service when no longer needed.
 */
public void destroy(){
  mom.cleanUp();
  mThread.stop();
  si=null;
  mom=null;
  cache=null;
  mThread=null;
}