nus-yam/ex-repair huggingface dataset:
Program: 19772
Project: 19772
Buggy source:
/** 
 * Computes the score of an edge.
 * @param the edge which score we want to compute
 * @return the score of an edge
 */
private double computeEdgeScore(Edge edge,float languageModelWeight){
  return (edge.getAcousticScore() / languageModelWeight + edge.getLMScore());
}

Fixed version (ground truth):
/** 
 * Computes the score of an edge.
 * @param edge the edge which score we want to compute
 * @param languageModelWeight the language model weight to use
 * @return the score of an edge
 */
private double computeEdgeScore(Edge edge,float languageModelWeight){
  return (edge.getAcousticScore() / languageModelWeight + edge.getLMScore());
}
Program: 19773
Project: 19773
Buggy source:
/** 
 * Creates a GrammarNode with the word in the given RuleToken.
 * @param ruleToken the RuleToken that contains the word
 * @return a GrammarNode with the word in the given RuleToken
 */
private GrammarGraph parseRuleToken(RuleToken ruleToken){
  debugPrintln("String_Node_Str" + ruleToken.toString());
  GrammarNode node=createGrammarNode(ruleToken.getText());
  return new GrammarGraph(node,node);
}

Fixed version (ground truth):
/** 
 * Creates a GrammarNode with the word in the given RuleToken.
 * @param ruleToken the RuleToken that contains the word
 * @return a GrammarNode with the word in the given RuleToken
 */
private GrammarGraph parseRuleToken(RuleToken ruleToken){
  GrammarNode node=createGrammarNode(ruleToken.getText());
  return new GrammarGraph(node,node);
}
Program: 19774
Project: 19774
Buggy source:
/** 
 * Parses the given RuleName into a network of GrammarNodes.
 * @param initialRuleName the RuleName rule to parse
 * @return a grammar graph
 */
private GrammarGraph parseRuleName(RuleName initialRuleName) throws GrammarException {
  debugPrintln("String_Node_Str" + initialRuleName.toString());
  GrammarGraph result=(GrammarGraph)ruleNameStack.get(initialRuleName.getRuleName());
  if (false && result != null) {
    return result;
  }
 else {
    result=new GrammarGraph();
    ruleNameStack.put(initialRuleName.getRuleName(),result);
  }
  RuleName ruleName=ruleGrammar.resolve(initialRuleName);
  if (ruleName == RuleName.NULL) {
    result.getStartNode().add(result.getEndNode(),0.0f);
  }
 else   if (ruleName == RuleName.VOID) {
  }
 else {
    if (ruleName == null) {
      throw new GrammarException("String_Node_Str" + initialRuleName + "String_Node_Str"+ initialRuleName.getFullGrammarName());
    }
    RuleGrammar rg=recognizer.getRuleGrammar(ruleName.getFullGrammarName());
    if (rg == null) {
      throw new GrammarException("String_Node_Str" + ruleName.getFullGrammarName());
    }
    Rule rule=rg.getRule(ruleName.getSimpleRuleName());
    if (rule == null) {
      throw new GrammarException("String_Node_Str" + ruleName.getRuleName());
    }
    GrammarGraph ruleResult=parseRule(rule);
    result.getStartNode().add(ruleResult.getStartNode(),0.0f);
    ruleResult.getEndNode().add(result.getEndNode(),0.0f);
    ruleNameStack.remove(ruleName.getRuleName());
  }
  return result;
}

Fixed version (ground truth):
/** 
 * Parses the given RuleName into a network of GrammarNodes.
 * @param initialRuleName the RuleName rule to parse
 * @return a grammar graph
 */
private GrammarGraph parseRuleName(RuleName initialRuleName) throws GrammarException {
  debugPrintln("String_Node_Str" + initialRuleName.toString());
  GrammarGraph result=(GrammarGraph)ruleStack.contains(initialRuleName.getRuleName());
  if (result != null) {
    return result;
  }
 else {
    result=new GrammarGraph();
    ruleStack.push(initialRuleName.getRuleName(),result);
  }
  RuleName ruleName=ruleGrammar.resolve(initialRuleName);
  if (ruleName == RuleName.NULL) {
    result.getStartNode().add(result.getEndNode(),0.0f);
  }
 else   if (ruleName == RuleName.VOID) {
  }
 else {
    if (ruleName == null) {
      throw new GrammarException("String_Node_Str" + initialRuleName + "String_Node_Str"+ initialRuleName.getFullGrammarName());
    }
    RuleGrammar rg=recognizer.getRuleGrammar(ruleName.getFullGrammarName());
    if (rg == null) {
      throw new GrammarException("String_Node_Str" + ruleName.getFullGrammarName());
    }
    Rule rule=rg.getRule(ruleName.getSimpleRuleName());
    if (rule == null) {
      throw new GrammarException("String_Node_Str" + ruleName.getRuleName());
    }
    GrammarGraph ruleResult=parseRule(rule);
    if (result != ruleResult) {
      result.getStartNode().add(ruleResult.getStartNode(),0.0f);
      ruleResult.getEndNode().add(result.getEndNode(),0.0f);
    }
  }
  ruleStack.pop();
  return result;
}
Program: 19775
Project: 19775
Buggy source:
/** 
 * Commit changes to all loaded grammars and all changes of grammar since the last commitChange
 */
public void commitChanges() throws IOException {
  try {
    if (loadGrammar) {
      recognizer=new BaseRecognizer();
      recognizer.allocate();
      ruleGrammar=recognizer.loadJSGF(baseURL,grammarName);
      ruleGrammar.setEnabled(true);
      loadGrammar=false;
    }
    recognizer.commitChanges();
    ruleNameStack=new HashMap();
    newGrammar();
    firstNode=createGrammarNode("String_Node_Str");
    GrammarNode finalNode=createGrammarNode("String_Node_Str");
    finalNode.setFinalNode(true);
    String[] ruleNames=ruleGrammar.listRuleNames();
    for (int i=0; i < ruleNames.length; i++) {
      String ruleName=ruleNames[i];
      if (ruleGrammar.isRulePublic(ruleName)) {
        debugPrintln("String_Node_Str" + ruleName);
        Rule rule=ruleGrammar.getRule(ruleName);
        GrammarGraph graph=parseRule(rule);
        firstNode.add(graph.getStartNode(),0.0f);
        graph.getEndNode().add(finalNode,0.0f);
      }
    }
    postProcessGrammar();
  }
 catch (  EngineException ee) {
    throw new IOException(ee.toString());
  }
catch (  GrammarException ge) {
    dumpGrammarException(ge);
    throw new IOException("String_Node_Str" + ge);
  }
catch (  MalformedURLException mue) {
    throw new IOException("String_Node_Str" + baseURL + "String_Node_Str"+ mue);
  }
}

Fixed version (ground truth):
/** 
 * Commit changes to all loaded grammars and all changes of grammar since the last commitChange
 */
public void commitChanges() throws IOException {
  try {
    if (loadGrammar) {
      recognizer=new BaseRecognizer();
      recognizer.allocate();
      ruleGrammar=recognizer.loadJSGF(baseURL,grammarName);
      ruleGrammar.setEnabled(true);
      loadGrammar=false;
    }
    recognizer.commitChanges();
    ruleStack=new RuleStack();
    newGrammar();
    firstNode=createGrammarNode("String_Node_Str");
    GrammarNode finalNode=createGrammarNode("String_Node_Str");
    finalNode.setFinalNode(true);
    String[] ruleNames=ruleGrammar.listRuleNames();
    for (int i=0; i < ruleNames.length; i++) {
      String ruleName=ruleNames[i];
      if (ruleGrammar.isRulePublic(ruleName)) {
        String fullName=getFullRuleName(ruleName);
        GrammarGraph publicRuleGraph=new GrammarGraph();
        ruleStack.push(fullName,publicRuleGraph);
        Rule rule=ruleGrammar.getRule(ruleName);
        GrammarGraph graph=parseRule(rule);
        ruleStack.pop();
        firstNode.add(publicRuleGraph.getStartNode(),0.0f);
        publicRuleGraph.getEndNode().add(finalNode,0.0f);
        publicRuleGraph.getStartNode().add(graph.getStartNode(),0.0f);
        graph.getEndNode().add(publicRuleGraph.getEndNode(),0.0f);
      }
    }
    postProcessGrammar();
  }
 catch (  EngineException ee) {
    throw new IOException(ee.toString());
  }
catch (  GrammarException ge) {
    dumpGrammarException(ge);
    throw new IOException("String_Node_Str" + ge);
  }
catch (  MalformedURLException mue) {
    throw new IOException("String_Node_Str" + baseURL + "String_Node_Str"+ mue);
  }
}
Program: 19776
Project: 19776
Buggy source:
/** 
 * Adds an arc to the given node 
 * @param node the node that this new arc goes to
 * @param logProbability the log probability of the transition occuring
 */
public void add(GrammarNode node,float logProbability){
  arcList.add(new GrammarArc(node,logProbability));
}

Fixed version (ground truth):
/** 
 * Adds an arc to the given node 
 * @param node the node that this new arc goes to
 * @param logProbability the log probability of the transition occuring
 */
public void add(GrammarNode node,float logProbability){
  if (isEmpty() && this == node) {
    return;
  }
  arcList.add(new GrammarArc(node,logProbability));
}
Program: 19777
Project: 19777
Buggy source:
/** 
 * Optimize this grammar node.
 */
void optimize(){
  for (int i=0; i < arcList.size(); i++) {
    GrammarArc arc=(GrammarArc)arcList.get(i);
    arcList.set(i,optimizeArc(arc));
  }
}

Fixed version (ground truth):
/** 
 * Optimize this grammar node.
 */
void optimize(){
  for (int i=0; i < arcList.size(); i++) {
    GrammarArc arc=(GrammarArc)arcList.get(i);
    arcList.set(i,optimizeArc(arc));
  }
  if (this.isEmpty()) {
    for (ListIterator i=arcList.listIterator(); i.hasNext(); ) {
      GrammarArc arc=(GrammarArc)i.next();
      if (this == arc.getGrammarNode()) {
        i.remove();
      }
    }
  }
}
Program: 19778
Project: 19778
Buggy source:
/** 
 * Deallocate the resources for the Engine and put it in the  DEALLOCATED state.
 */
public void deallocate() throws EngineException, EngineStateError {
  if (testEngineState(DEALLOCATED))   return;
  releaseFocus();
  long[] states=setEngineState(CLEAR_ALL_STATE,DEALLOCATING_RESOURCES);
  postEngineDeallocatingResources(states[0],states[1]);
  states=setEngineState(CLEAR_ALL_STATE,DEALLOCATED);
  postEngineDeallocated(states[0],states[1]);
}

Fixed version (ground truth):
/** 
 * Deallocate the resources for the Engine and put it in the  DEALLOCATED state.
 */
public void deallocate() throws EngineException, EngineStateError {
  if (testEngineState(DEALLOCATED))   return;
  releaseFocus();
  long[] states=setEngineState(CLEAR_ALL_STATE,DEALLOCATING_RESOURCES);
  postEngineDeallocatingResources(states[0],states[1]);
  states=setEngineState(CLEAR_ALL_STATE,DEALLOCATED);
  postEngineDeallocated(states[0],states[1]);
  handleDeallocate();
}
Program: 19779
Project: 19779
Buggy source:
/** 
 * Allocate the resources for the Engine and put it in the ALLOCATED, RESUMED, QUEUE_EMPTY state.
 */
public void allocate() throws EngineException, EngineStateError {
  if (testEngineState(ALLOCATED)) {
    return;
  }
  long[] states=setEngineState(CLEAR_ALL_STATE,ALLOCATING_RESOURCES);
  postEngineAllocatingResources(states[0],states[1]);
synchronized (engineStateLock) {
    long newState=ALLOCATED | RESUMED | LISTENING| FOCUS_ON;
    states=setEngineState(CLEAR_ALL_STATE,newState);
  }
  postEngineAllocated(states[0],states[1]);
}

Fixed version (ground truth):
/** 
 * Allocate the resources for the Engine and put it in the ALLOCATED, RESUMED, QUEUE_EMPTY state.
 */
public void allocate() throws EngineException, EngineStateError {
  if (testEngineState(ALLOCATED)) {
    return;
  }
  long[] states=setEngineState(CLEAR_ALL_STATE,ALLOCATING_RESOURCES);
  postEngineAllocatingResources(states[0],states[1]);
synchronized (engineStateLock) {
    long newState=ALLOCATED | RESUMED | LISTENING| FOCUS_ON;
    states=setEngineState(CLEAR_ALL_STATE,newState);
  }
  postEngineAllocated(states[0],states[1]);
  handleAllocate();
}
Program: 19782
Project: 19782
Buggy source:
/** 
 * Get the Edges from this Node
 * @return Edges from this Node
 */
public Collection getEnteringEdges(){
  return enteringEdges;
}

Fixed version (ground truth):
/** 
 * Get the Edges to this Node
 * @return Edges to this Node
 */
public Collection getEnteringEdges(){
  return enteringEdges;
}
Program: 19783
Project: 19783
Buggy source:
/** 
 * Get the Edges to this Node
 * @return Edges to this Node
 */
public Collection getLeavingEdges(){
  return leavingEdges;
}

Fixed version (ground truth):
/** 
 * Get the Edges from this Node
 * @return Edges from this Node
 */
public Collection getLeavingEdges(){
  return leavingEdges;
}
Program: 19784
Project: 19784
Buggy source:
/** 
 * Reads one frame of audio data, and adds it to the given Utterance.
 * @return an Data object containing the audio data
 */
private Data readData(Utterance utterance) throws IOException {
  byte[] data=new byte[frameSizeInBytes];
  int channels=audioStream.getFormat().getChannels();
  long collectTime=System.currentTimeMillis();
  long firstSampleNumber=totalSamplesRead / channels;
  int numBytesRead=audioStream.read(data,0,data.length);
  if (!started) {
synchronized (this) {
      started=true;
      notifyAll();
    }
  }
  if (logger.isLoggable(Level.FINE)) {
    logger.info("String_Node_Str" + numBytesRead + "String_Node_Str");
  }
  if (numBytesRead <= 0) {
    endOfStream=true;
    return null;
  }
  int sampleSizeInBytes=audioStream.getFormat().getSampleSizeInBits() / 8;
  totalSamplesRead+=(numBytesRead / sampleSizeInBytes);
  if (numBytesRead != frameSizeInBytes) {
    if (numBytesRead % sampleSizeInBytes != 0) {
      throw new Error("String_Node_Str");
    }
    byte[] shrinked=new byte[numBytesRead];
    System.arraycopy(data,0,shrinked,0,numBytesRead);
    data=shrinked;
  }
  if (keepDataReference) {
    utterance.add(data);
  }
  double[] samples=DataUtil.bytesToValues(data,0,data.length,sampleSizeInBytes,signed);
  if (channels > 1) {
    samples=convertStereoToMono(samples,channels);
  }
  return (new DoubleData(samples,(int)audioStream.getFormat().getSampleRate(),collectTime,firstSampleNumber));
}

Fixed version (ground truth):
/** 
 * Reads one frame of audio data, and adds it to the given Utterance.
 * @return an Data object containing the audio data
 */
private Data readData(Utterance utterance) throws IOException {
  byte[] data=new byte[frameSizeInBytes];
  int channels=audioStream.getFormat().getChannels();
  long collectTime=System.currentTimeMillis();
  long firstSampleNumber=totalSamplesRead / channels;
  int numBytesRead=audioStream.read(data,0,data.length);
  if (!started) {
synchronized (this) {
      started=true;
      notifyAll();
    }
  }
  if (logger.isLoggable(Level.FINE)) {
    logger.info("String_Node_Str" + numBytesRead + "String_Node_Str");
  }
  if (numBytesRead <= 0) {
    return null;
  }
  int sampleSizeInBytes=audioStream.getFormat().getSampleSizeInBits() / 8;
  totalSamplesRead+=(numBytesRead / sampleSizeInBytes);
  if (numBytesRead != frameSizeInBytes) {
    if (numBytesRead % sampleSizeInBytes != 0) {
      throw new Error("String_Node_Str");
    }
    byte[] shrinked=new byte[numBytesRead];
    System.arraycopy(data,0,shrinked,0,numBytesRead);
    data=shrinked;
  }
  if (keepDataReference) {
    utterance.add(data);
  }
  double[] samples=DataUtil.bytesToValues(data,0,data.length,sampleSizeInBytes,signed);
  if (channels > 1) {
    samples=convertStereoToMono(samples,channels);
  }
  return (new DoubleData(samples,(int)audioStream.getFormat().getSampleRate(),collectTime,firstSampleNumber));
}
Program: 19785
Project: 19785
Buggy source:
/** 
 * Implements the run() method of the Thread class. Records audio, and cache them in the audio buffer.
 */
public void run(){
  totalSamplesRead=0;
  logger.info("String_Node_Str");
  if (keepDataReference) {
    currentUtterance=new Utterance("String_Node_Str",audioStream.getFormat());
  }
  audioList.add(new DataStartSignal());
  logger.info("String_Node_Str");
  try {
    audioLine.start();
    while (!endOfStream) {
      Data data=readData(currentUtterance);
      if (data == null) {
        break;
      }
      audioList.add(data);
    }
    audioLine.flush();
    if (closeBetweenUtterances) {
      audioStream.close();
    }
  }
 catch (  IOException ioe) {
    logger.warning("String_Node_Str" + ioe.getMessage());
  }
  long duration=(long)(((double)totalSamplesRead / (double)audioStream.getFormat().getSampleRate()) * 1000.0);
  audioList.add(new DataEndSignal(duration));
  logger.info("String_Node_Str");
  logger.info("String_Node_Str");
}

Fixed version (ground truth):
/** 
 * Implements the run() method of the Thread class. Records audio, and cache them in the audio buffer.
 */
public void run(){
  totalSamplesRead=0;
  logger.info("String_Node_Str");
  if (keepDataReference) {
    currentUtterance=new Utterance("String_Node_Str",audioStream.getFormat());
  }
  audioList.add(new DataStartSignal());
  logger.info("String_Node_Str");
  try {
    audioLine.start();
    while (!done) {
      Data data=readData(currentUtterance);
      if (data == null) {
        done=true;
        break;
      }
      audioList.add(data);
    }
    audioLine.flush();
    if (closeBetweenUtterances) {
      audioStream.close();
    }
  }
 catch (  IOException ioe) {
    logger.warning("String_Node_Str" + ioe.getMessage());
    ioe.printStackTrace();
  }
  long duration=(long)(((double)totalSamplesRead / (double)audioStream.getFormat().getSampleRate()) * 1000.0);
  audioList.add(new DataEndSignal(duration));
  logger.info("String_Node_Str");
  logger.info("String_Node_Str");
synchronized (lock) {
    lock.notify();
  }
}
Program: 19786
Project: 19786
Buggy source:
/** 
 * Starts recording audio. This method will return only when a START event is received, meaning that this Microphone has started capturing audio.
 * @return true if the recording started successfully; false otherwise
 */
public synchronized boolean startRecording(){
  if (recording) {
    return false;
  }
  if (!open()) {
    return false;
  }
  utteranceEndReached=false;
  recording=true;
  if (audioLine.isRunning()) {
    logger.severe("String_Node_Str");
  }
  RecordingThread recorder=new RecordingThread("String_Node_Str");
  recorder.start();
  return true;
}

Fixed version (ground truth):
/** 
 * Starts recording audio. This method will return only when a START event is received, meaning that this Microphone has started capturing audio.
 * @return true if the recording started successfully; false otherwise
 */
public synchronized boolean startRecording(){
  if (recording) {
    return false;
  }
  if (!open()) {
    return false;
  }
  utteranceEndReached=false;
  if (audioLine.isRunning()) {
    logger.severe("String_Node_Str");
  }
  assert(recorder == null);
  recorder=new RecordingThread("String_Node_Str");
  recorder.start();
  recording=true;
  return true;
}
Program: 19787
Project: 19787
Buggy source:
/** 
 * Constructs a Microphone with the given InputStream.
 * @throws IOException if an I/O error occurs
 */
public void initialize(){
  super.initialize();
  audioList=new DataList();
  DataLine.Info info=new DataLine.Info(TargetDataLine.class,desiredFormat);
  if (!AudioSystem.isLineSupported(info)) {
    logger.info(desiredFormat + "String_Node_Str");
    AudioFormat nativeFormat=getNativeAudioFormat(desiredFormat);
    if (nativeFormat == null) {
      logger.severe("String_Node_Str");
      return;
    }
 else {
      finalFormat=nativeFormat;
      doConversion=AudioSystem.isConversionSupported(desiredFormat,nativeFormat);
      if (doConversion) {
        logger.info("String_Node_Str" + finalFormat.getSampleRate() + "String_Node_Str"+ desiredFormat.getSampleRate()+ "String_Node_Str");
      }
 else {
        logger.info("String_Node_Str" + finalFormat.getSampleRate() + "String_Node_Str"+ desiredFormat.getSampleRate()+ "String_Node_Str");
      }
    }
  }
 else {
    logger.info("String_Node_Str" + desiredFormat + "String_Node_Str");
    finalFormat=desiredFormat;
  }
  try {
    logger.info("String_Node_Str" + finalFormat);
    info=new DataLine.Info(TargetDataLine.class,finalFormat);
    audioLine=(TargetDataLine)AudioSystem.getLine(info);
    audioLine.addLineListener(new LineListener(){
      public void update(      LineEvent event){
        logger.info("String_Node_Str" + event);
      }
    }
);
  }
 catch (  LineUnavailableException e) {
    logger.severe("String_Node_Str" + e.getMessage());
  }
}

Fixed version (ground truth):
/** 
 * Constructs a Microphone with the given InputStream.
 * @throws IOException if an I/O error occurs
 */
public void initialize(){
  super.initialize();
  audioList=new DataList();
  DataLine.Info info=new DataLine.Info(TargetDataLine.class,desiredFormat);
  if (!AudioSystem.isLineSupported(info)) {
    logger.info(desiredFormat + "String_Node_Str");
    AudioFormat nativeFormat=DataUtil.getNativeAudioFormat(desiredFormat);
    if (nativeFormat == null) {
      logger.severe("String_Node_Str");
      return;
    }
 else {
      finalFormat=nativeFormat;
      doConversion=AudioSystem.isConversionSupported(desiredFormat,nativeFormat);
      if (doConversion) {
        logger.info("String_Node_Str" + finalFormat.getSampleRate() + "String_Node_Str"+ desiredFormat.getSampleRate()+ "String_Node_Str");
      }
 else {
        logger.info("String_Node_Str" + finalFormat.getSampleRate() + "String_Node_Str"+ desiredFormat.getSampleRate()+ "String_Node_Str");
      }
    }
  }
 else {
    logger.info("String_Node_Str" + desiredFormat + "String_Node_Str");
    finalFormat=desiredFormat;
  }
  try {
    logger.info("String_Node_Str" + finalFormat);
    info=new DataLine.Info(TargetDataLine.class,finalFormat);
    audioLine=(TargetDataLine)AudioSystem.getLine(info);
    audioLine.addLineListener(new LineListener(){
      public void update(      LineEvent event){
        logger.info("String_Node_Str" + event);
      }
    }
);
  }
 catch (  LineUnavailableException e) {
    logger.severe("String_Node_Str" + e.getMessage());
  }
}
Program: 19788
Project: 19788
Buggy source:
/** 
 * Stops recording audio.
 */
public synchronized void stopRecording(){
  if (audioLine != null) {
    recording=false;
    audioLine.stop();
  }
}

Fixed version (ground truth):
/** 
 * Stops the thread. This method does not return until recording has actually stopped, and all the data has been read from the audio line.
 */
public void stopRecording(){
  audioLine.stop();
  try {
synchronized (lock) {
      while (!done) {
        lock.wait();
      }
    }
  }
 catch (  InterruptedException e) {
    e.printStackTrace();
  }
}
Program: 19789
Project: 19789
Buggy source:
/** 
 * Parses the given RuleName into a network of GrammarNodes.
 * @param initialRuleName the RuleName rule to parse
 * @return a grammar graph
 */
private GrammarGraph parseRuleName(RuleName initialRuleName) throws GrammarException {
  debugPrintln("String_Node_Str" + initialRuleName.toString());
  GrammarGraph result=(GrammarGraph)ruleNameStack.get(initialRuleName.getRuleName());
  if (result != null) {
    return result;
  }
 else {
    result=new GrammarGraph();
    ruleNameStack.put(initialRuleName.getRuleName(),result);
  }
  RuleName ruleName=ruleGrammar.resolve(initialRuleName);
  if (ruleName == RuleName.NULL) {
    result.getStartNode().add(result.getEndNode(),0.0f);
  }
 else   if (ruleName == RuleName.VOID) {
  }
 else {
    if (ruleName == null) {
      throw new GrammarException("String_Node_Str" + initialRuleName + "String_Node_Str"+ initialRuleName.getFullGrammarName());
    }
    RuleGrammar rg=recognizer.getRuleGrammar(ruleName.getFullGrammarName());
    if (rg == null) {
      throw new GrammarException("String_Node_Str" + ruleName.getFullGrammarName());
    }
    Rule rule=rg.getRule(ruleName.getSimpleRuleName());
    if (rule == null) {
      throw new GrammarException("String_Node_Str" + ruleName.getRuleName());
    }
    GrammarGraph ruleResult=parseRule(rule);
    result.getStartNode().add(ruleResult.getStartNode(),0.0f);
    ruleResult.getEndNode().add(result.getEndNode(),0.0f);
    ruleNameStack.remove(ruleName.getRuleName());
  }
  return result;
}

Fixed version (ground truth):
/** 
 * Parses the given RuleName into a network of GrammarNodes.
 * @param initialRuleName the RuleName rule to parse
 * @return a grammar graph
 */
private GrammarGraph parseRuleName(RuleName initialRuleName) throws GrammarException {
  debugPrintln("String_Node_Str" + initialRuleName.toString());
  GrammarGraph result=(GrammarGraph)ruleNameStack.get(initialRuleName.getRuleName());
  if (false && result != null) {
    return result;
  }
 else {
    result=new GrammarGraph();
    ruleNameStack.put(initialRuleName.getRuleName(),result);
  }
  RuleName ruleName=ruleGrammar.resolve(initialRuleName);
  if (ruleName == RuleName.NULL) {
    result.getStartNode().add(result.getEndNode(),0.0f);
  }
 else   if (ruleName == RuleName.VOID) {
  }
 else {
    if (ruleName == null) {
      throw new GrammarException("String_Node_Str" + initialRuleName + "String_Node_Str"+ initialRuleName.getFullGrammarName());
    }
    RuleGrammar rg=recognizer.getRuleGrammar(ruleName.getFullGrammarName());
    if (rg == null) {
      throw new GrammarException("String_Node_Str" + ruleName.getFullGrammarName());
    }
    Rule rule=rg.getRule(ruleName.getSimpleRuleName());
    if (rule == null) {
      throw new GrammarException("String_Node_Str" + ruleName.getRuleName());
    }
    GrammarGraph ruleResult=parseRule(rule);
    result.getStartNode().add(ruleResult.getStartNode(),0.0f);
    ruleResult.getEndNode().add(result.getEndNode(),0.0f);
    ruleNameStack.remove(ruleName.getRuleName());
  }
  return result;
}
Program: 19791
Project: 19791
Buggy source:
/** 
 * Creates an OogHMMState
 * @param hmmState the hmm state associated with this search state
 * @parma logProbability the probability of transitioning to thisstate
 */
OogHMMState(HMMState hmmState,float logProbability){
  this.hmmState=hmmState;
  this.logProbability=logProbability;
}

Fixed version (ground truth):
/** 
 * Creates an OogHMMState
 * @param hmmState the hmm state associated with this search state
 * @param logProbability the probability of transitioning to thisstate
 */
OogHMMState(HMMState hmmState,float logProbability){
  this.hmmState=hmmState;
  this.logProbability=logProbability;
}
Program: 19793
Project: 19793
Buggy source:
/** 
 * Allocates the acoustic model.
 */
protected void allocateAcousticModel() throws IOException {
  acousticModel.allocate();
}

Fixed version (ground truth):
/** 
 * Allocates the acoustic model.
 */
protected void allocateAcousticModel() throws IOException {
  acousticModel.allocate();
  if (addOutOfGrammarBranch) {
    phoneLoopAcousticModel.allocate();
  }
}
Program: 19795
Project: 19795
Buggy source:
public void register(String name,Registry registry) throws PropertyException {
  this.name=name;
  registry.register(PROP_GRAMMAR,PropertyType.COMPONENT);
  registry.register(PROP_ACOUSTIC_MODEL,PropertyType.COMPONENT);
  registry.register(PROP_LOG_MATH,PropertyType.COMPONENT);
  registry.register(PROP_WORD_INSERTION_PROBABILITY,PropertyType.DOUBLE);
  registry.register(PROP_SILENCE_INSERTION_PROBABILITY,PropertyType.DOUBLE);
  registry.register(PROP_UNIT_INSERTION_PROBABILITY,PropertyType.DOUBLE);
  registry.register(PROP_LANGUAGE_WEIGHT,PropertyType.FLOAT);
  registry.register(PROP_SHOW_SEARCH_SPACE,PropertyType.BOOLEAN);
  registry.register(PROP_DUMP_GSTATES,PropertyType.BOOLEAN);
  registry.register(PROP_SHOW_COMPILATION_PROGRESS,PropertyType.BOOLEAN);
  registry.register(PROP_SPREAD_WORD_PROBABILITIES_ACROSS_PRONUNCIATIONS,PropertyType.BOOLEAN);
  registry.register(PROP_UNIT_MANAGER,PropertyType.COMPONENT);
  registry.register(PROP_ADD_OUT_OF_GRAMMAR_BRANCH,PropertyType.BOOLEAN);
  registry.register(PROP_OUT_OF_GRAMMAR_PROBABILITY,PropertyType.DOUBLE);
  registry.register(PROP_PHONE_INSERTION_PROBABILITY,PropertyType.DOUBLE);
}

Fixed version (ground truth):
public void register(String name,Registry registry) throws PropertyException {
  this.name=name;
  registry.register(PROP_GRAMMAR,PropertyType.COMPONENT);
  registry.register(PROP_ACOUSTIC_MODEL,PropertyType.COMPONENT);
  registry.register(PROP_LOG_MATH,PropertyType.COMPONENT);
  registry.register(PROP_WORD_INSERTION_PROBABILITY,PropertyType.DOUBLE);
  registry.register(PROP_SILENCE_INSERTION_PROBABILITY,PropertyType.DOUBLE);
  registry.register(PROP_UNIT_INSERTION_PROBABILITY,PropertyType.DOUBLE);
  registry.register(PROP_LANGUAGE_WEIGHT,PropertyType.FLOAT);
  registry.register(PROP_SHOW_SEARCH_SPACE,PropertyType.BOOLEAN);
  registry.register(PROP_DUMP_GSTATES,PropertyType.BOOLEAN);
  registry.register(PROP_SHOW_COMPILATION_PROGRESS,PropertyType.BOOLEAN);
  registry.register(PROP_SPREAD_WORD_PROBABILITIES_ACROSS_PRONUNCIATIONS,PropertyType.BOOLEAN);
  registry.register(PROP_UNIT_MANAGER,PropertyType.COMPONENT);
  registry.register(PROP_ADD_OUT_OF_GRAMMAR_BRANCH,PropertyType.BOOLEAN);
  registry.register(PROP_OUT_OF_GRAMMAR_PROBABILITY,PropertyType.DOUBLE);
  registry.register(PROP_PHONE_INSERTION_PROBABILITY,PropertyType.DOUBLE);
  registry.register(PROP_PHONE_LOOP_ACOUSTIC_MODEL,PropertyType.COMPONENT);
}
Program: 19796
Project: 19796
Buggy source:
/** 
 * Sets the current recognizer to the one with the given name.
 * @param recognizerName name of the recognizer to use
 */
public void setDecoder(String recognizerName) throws IOException {
  String changeMessage="String_Node_Str" + recognizerName + "String_Node_Str";
  info(changeMessage);
  liveFrame.setMessage(changeMessage);
  if (currentRecognizer != null) {
    currentRecognizer.deallocate();
    currentRecognizer=null;
  }
  LiveRecognizer nextRecognizer=(LiveRecognizer)recognizers.get(recognizerName);
  if (nextRecognizer.allocate()) {
    currentRecognizer=nextRecognizer;
    liveFrame.setTestFile(currentRecognizer.getTestFile());
    if (!handsFree) {
      liveFrame.setReferenceLabel(currentRecognizer.getNextReference());
    }
 else {
      liveFrame.setReferenceLabel("String_Node_Str");
    }
    liveFrame.setRecognitionLabel("String_Node_Str");
    liveFrame.setMessage(recognizerName + "String_Node_Str");
  }
 else {
    liveFrame.setMessage("String_Node_Str" + recognizerName);
  }
  info("String_Node_Str");
}

Fixed version (ground truth):
/** 
 * Sets the current recognizer to the one with the given name.
 * @param recognizerName name of the recognizer to use
 */
public void setDecoder(String recognizerName) throws IOException {
  String changeMessage="String_Node_Str" + recognizerName + "String_Node_Str";
  info(changeMessage);
  liveFrame.setMessage(changeMessage);
  liveFrame.setSpeakButtonEnabled(false);
  liveFrame.setNextButtonEnabled(false);
  if (currentRecognizer != null) {
    currentRecognizer.deallocate();
    currentRecognizer=null;
  }
  LiveRecognizer nextRecognizer=(LiveRecognizer)recognizers.get(recognizerName);
  if (nextRecognizer.allocate()) {
    currentRecognizer=nextRecognizer;
    liveFrame.setTestFile(currentRecognizer.getTestFile());
    if (!handsFree) {
      liveFrame.setReferenceLabel(currentRecognizer.getNextReference());
    }
 else {
      liveFrame.setReferenceLabel("String_Node_Str");
    }
    liveFrame.setRecognitionLabel("String_Node_Str");
    liveFrame.setSpeakButtonEnabled(true);
    liveFrame.setNextButtonEnabled(true);
    liveFrame.setMessage(recognizerName + "String_Node_Str");
  }
 else {
    liveFrame.setMessage("String_Node_Str" + recognizerName);
  }
  info("String_Node_Str");
}
Program: 19797
Project: 19797
Buggy source:
public void run(){
  speakButton.setEnabled(!speaking);
  stopButton.setEnabled(speaking);
  playButton.setEnabled(!speaking);
  decoderComboBox.setEnabled(!speaking);
}

Fixed version (ground truth):
public void run(){
  String decoderName=(String)getSelectedItem();
  try {
    live.setDecoder(decoderName);
    lastIndex=getSelectedIndex();
  }
 catch (  IOException ioe) {
    setMessage("String_Node_Str" + decoderName);
  }
}
Program: 19798
Project: 19798
Buggy source:
/** 
 * Invoked when an action is performed on this DecoderComboBox.
 * @param e the ActionEvent performed
 */
public void actionPerformed(ActionEvent e){
  if (getSelectedIndex() != lastIndex) {
    try {
      String decoderName=(String)getSelectedItem();
      live.setDecoder(decoderName);
      lastIndex=getSelectedIndex();
    }
 catch (    IOException ioe) {
      ioe.printStackTrace();
    }
  }
}

Fixed version (ground truth):
/** 
 * Invoked when an action is performed on this DecoderComboBox.
 * @param e the ActionEvent performed
 */
public void actionPerformed(ActionEvent e){
  if (getSelectedIndex() != lastIndex) {
    Thread t=new Thread(){
      public void run(){
        String decoderName=(String)getSelectedItem();
        try {
          live.setDecoder(decoderName);
          lastIndex=getSelectedIndex();
        }
 catch (        IOException ioe) {
          setMessage("String_Node_Str" + decoderName);
        }
      }
    }
;
    t.start();
  }
}
Program: 19800
Project: 19800
Buggy source:
/** 
 * Converts strings like "thisIsAString" into "This Is A String".
 * @return a readable form of strings like "thisIsAString"
 */
private String getReadableForm(String original){
  if (original.length() > 0) {
    StringBuffer sb=new StringBuffer(original.length() * 2);
    int i=0;
    sb.append(Character.toUpperCase(original.charAt(i++)));
    for (; i < original.length(); i++) {
      char c=original.charAt(i);
      if (Character.isUpperCase(c)) {
        sb.append("String_Node_Str");
      }
      sb.append(c);
    }
    return sb.toString();
  }
 else {
    return original;
  }
}

Fixed version (ground truth):
/** 
 * Converts strings like "thisIsAString" into "This Is A String".
 * @param original the original string
 * @return a readable form of strings like "thisIsAString"
 */
private String getReadableForm(String original){
  if (original.length() > 0) {
    StringBuffer sb=new StringBuffer(original.length() * 2);
    int i=0;
    sb.append(Character.toUpperCase(original.charAt(i++)));
    for (; i < original.length(); i++) {
      char c=original.charAt(i);
      if (Character.isUpperCase(c)) {
        sb.append("String_Node_Str");
      }
      sb.append(c);
    }
    return sb.toString();
  }
 else {
    return original;
  }
}
Program: 19801
Project: 19801
Buggy source:
public static void main(String[] argv){
  try {
    PropertiesDumper dumper=new PropertiesDumper("String_Node_Str");
    System.out.println();
    System.out.println(dumper.toString());
  }
 catch (  IOException ioe) {
    ioe.printStackTrace();
  }
}

Fixed version (ground truth):
/** 
 * Dumps the properties file 'model.props' that is in the same directory as this class.
 */
public static void main(String[] argv){
  try {
    PropertiesDumper dumper=new PropertiesDumper("String_Node_Str");
    System.out.println();
    System.out.println(dumper.toString());
  }
 catch (  IOException ioe) {
    ioe.printStackTrace();
  }
}
Program: 19802
Project: 19802
Buggy source:
/** 
 * Returns a string that describes this TiedStateAcousticModel.
 */
public String toString(){
  String result=((String)props.get("String_Node_Str")) + "String_Node_Str";
  for (Enumeration e=props.propertyNames(); e.hasMoreElements(); ) {
    String key=(String)e.nextElement();
    String value=(String)props.get(key);
    result+=("String_Node_Str" + getReadableForm(key) + "String_Node_Str"+ value);
  }
  result+="String_Node_Str";
  return result;
}

Fixed version (ground truth):
/** 
 * Returns a string of the properties.
 * @return a string of the properties
 */
public String toString(){
  String result=((String)props.get("String_Node_Str")) + "String_Node_Str";
  for (Enumeration e=props.propertyNames(); e.hasMoreElements(); ) {
    String key=(String)e.nextElement();
    String value=(String)props.get(key);
    result+=("String_Node_Str" + getReadableForm(key) + "String_Node_Str"+ value);
  }
  result+="String_Node_Str";
  return result;
}
Program: 19803
Project: 19803
Buggy source:
/** 
 * Constructs a PropertiesDumper of the given acoustic model properties.
 */
public PropertiesDumper(Properties properties) throws IOException {
  props=properties;
}

Fixed version (ground truth):
/** 
 * Constructs a PropertiesDumper of the given acoustic model properties.
 * @param properties the Properties object to dump
 */
public PropertiesDumper(Properties properties) throws IOException {
  props=properties;
}
Program: 19804
Project: 19804
Buggy source:
/** 
 * Expand the pronunciation given the left context
 * @param leftContext the left context
 * @param pronunciation the pronunciation to expand
 * @param which unique ID for this pronunciation
 */
private void expandPronunciation(UnitContext leftContext,Pronunciation pronunciation,int which){
  UnitContext startingContext=getStartingContext(pronunciation);
  String pname="String_Node_Str" + pronunciation.getWord() + "String_Node_Str"+ leftContext+ "String_Node_Str"+ startingContext+ "String_Node_Str";
  PronunciationState ps=new PronunciationState(pname,pronunciation,which);
  T("String_Node_Str" + ps.getPronunciation() + "String_Node_Str"+ leftContext);
  ContextPair cp=ContextPair.get(leftContext,startingContext);
  List epList=(List)entryPoints.get(cp);
  if (epList == null) {
    throw new Error("String_Node_Str" + cp);
  }
 else {
    epList.add(ps);
  }
  Unit[] units=pronunciation.getUnits();
  int fanOutPoint=units.length - getRightContextSize();
  if (fanOutPoint < 0) {
    fanOutPoint=0;
  }
  SentenceHMMState tail=ps;
  for (int i=0; tail != null && i < fanOutPoint; i++) {
    tail=attachUnit(ps,tail,units,i,leftContext,UnitContext.EMPTY);
  }
  SentenceHMMState branchTail=tail;
  for (Iterator iter=rightContexts.iterator(); iter.hasNext(); ) {
    UnitContext finalRightContext=(UnitContext)iter.next();
    tail=branchTail;
    for (int i=fanOutPoint; tail != null && i < units.length; i++) {
      tail=attachUnit(ps,tail,units,i,leftContext,finalRightContext);
    }
  }
}

Fixed version (ground truth):
/** 
 * Expand the pronunciation given the left context
 * @param leftContext the left context
 * @param pronunciation the pronunciation to expand
 * @param which unique ID for this pronunciation
 */
private void expandPronunciation(UnitContext leftContext,Pronunciation pronunciation,int which){
  UnitContext startingContext=getStartingContext(pronunciation);
  String pname="String_Node_Str" + pronunciation.getWord() + "String_Node_Str"+ leftContext+ "String_Node_Str"+ startingContext+ "String_Node_Str"+ getNode().getID();
  PronunciationState ps=new PronunciationState(pname,pronunciation,which);
  T("String_Node_Str" + ps.getPronunciation() + "String_Node_Str"+ leftContext);
  ContextPair cp=ContextPair.get(leftContext,startingContext);
  List epList=(List)entryPoints.get(cp);
  if (epList == null) {
    throw new Error("String_Node_Str" + cp);
  }
 else {
    epList.add(ps);
  }
  Unit[] units=pronunciation.getUnits();
  int fanOutPoint=units.length - getRightContextSize();
  if (fanOutPoint < 0) {
    fanOutPoint=0;
  }
  SentenceHMMState tail=ps;
  for (int i=0; tail != null && i < fanOutPoint; i++) {
    tail=attachUnit(ps,tail,units,i,leftContext,UnitContext.EMPTY);
  }
  SentenceHMMState branchTail=tail;
  for (Iterator iter=rightContexts.iterator(); iter.hasNext(); ) {
    UnitContext finalRightContext=(UnitContext)iter.next();
    tail=branchTail;
    for (int i=fanOutPoint; tail != null && i < units.length; i++) {
      tail=attachUnit(ps,tail,units,i,leftContext,finalRightContext);
    }
  }
}
Program: 19805
Project: 19805
Buggy source:
public void newProperties(PropertySheet ps) throws PropertyException {
  Recognizer newRecognizer=(Recognizer)ps.getComponent(PROP_RECOGNIZER,Recognizer.class);
  if (recognizer == null) {
    recognizer=newRecognizer;
  }
 else   if (recognizer != newRecognizer) {
    recognizer.removeResultListener(this);
    recognizer.removeStateListener(this);
    recognizer=newRecognizer;
  }
  recognizer.addResultListener(this);
  recognizer.addStateListener(this);
  showSummary=ps.getBoolean(PROP_SHOW_SUMMARY,PROP_SHOW_SUMMARY_DEFAULT);
  showDetails=ps.getBoolean(PROP_SHOW_DETAILS,PROP_SHOW_DETAILS_DEFAULT);
  showResults=ps.getBoolean(PROP_SHOW_RESULTS,PROP_SHOW_RESULTS_DEFAULT);
  showAlignedResults=ps.getBoolean(PROP_SHOW_ALIGNED_RESULTS,PROP_SHOW_ALIGNED_RESULTS_DEFAULT);
  showRaw=ps.getBoolean(PROP_SHOW_RAW_RESULTS,PROP_SHOW_RAW_RESULTS_DEFAULT);
  aligner=new NISTAlign(showResults,showAlignedResults);
}

Fixed version (ground truth):
public void newProperties(PropertySheet ps) throws PropertyException {
  Recognizer newRecognizer=(Recognizer)ps.getComponent(PROP_RECOGNIZER,Recognizer.class);
  if (recognizer == null) {
    recognizer=newRecognizer;
    recognizer.addResultListener(this);
    recognizer.addStateListener(this);
  }
 else   if (recognizer != newRecognizer) {
    recognizer.removeResultListener(this);
    recognizer.removeStateListener(this);
    recognizer=newRecognizer;
    recognizer.addResultListener(this);
    recognizer.addStateListener(this);
  }
  showSummary=ps.getBoolean(PROP_SHOW_SUMMARY,PROP_SHOW_SUMMARY_DEFAULT);
  showDetails=ps.getBoolean(PROP_SHOW_DETAILS,PROP_SHOW_DETAILS_DEFAULT);
  showResults=ps.getBoolean(PROP_SHOW_RESULTS,PROP_SHOW_RESULTS_DEFAULT);
  showAlignedResults=ps.getBoolean(PROP_SHOW_ALIGNED_RESULTS,PROP_SHOW_ALIGNED_RESULTS_DEFAULT);
  showRaw=ps.getBoolean(PROP_SHOW_RAW_RESULTS,PROP_SHOW_RAW_RESULTS_DEFAULT);
  aligner=new NISTAlign(showResults,showAlignedResults);
}
Program: 19806
Project: 19806
Buggy source:
public void newProperties(PropertySheet ps) throws PropertyException {
  Recognizer newRecognizer=(Recognizer)ps.getComponent(PROP_RECOGNIZER,Recognizer.class);
  if (recognizer == null) {
    recognizer=newRecognizer;
  }
 else   if (recognizer != newRecognizer) {
    recognizer.removeResultListener(this);
    recognizer.removeStateListener(this);
    recognizer=newRecognizer;
  }
  recognizer.addResultListener(this);
  recognizer.addStateListener(this);
  logMath=(LogMath)ps.getComponent(PROP_LOG_MATH,LogMath.class);
  showSummary=ps.getBoolean(PROP_SHOW_SUMMARY,PROP_SHOW_SUMMARY_DEFAULT);
  showDetails=ps.getBoolean(PROP_SHOW_DETAILS,PROP_SHOW_DETAILS_DEFAULT);
  enabled=ps.getBoolean(PROP_ENABLED,PROP_ENABLED_DEFAULT);
}

Fixed version (ground truth):
public void newProperties(PropertySheet ps) throws PropertyException {
  Recognizer newRecognizer=(Recognizer)ps.getComponent(PROP_RECOGNIZER,Recognizer.class);
  if (recognizer == null) {
    recognizer=newRecognizer;
    recognizer.addResultListener(this);
    recognizer.addStateListener(this);
  }
 else   if (recognizer != newRecognizer) {
    recognizer.removeResultListener(this);
    recognizer.removeStateListener(this);
    recognizer=newRecognizer;
    recognizer.addResultListener(this);
    recognizer.addStateListener(this);
  }
  logMath=(LogMath)ps.getComponent(PROP_LOG_MATH,LogMath.class);
  showSummary=ps.getBoolean(PROP_SHOW_SUMMARY,PROP_SHOW_SUMMARY_DEFAULT);
  showDetails=ps.getBoolean(PROP_SHOW_DETAILS,PROP_SHOW_DETAILS_DEFAULT);
  enabled=ps.getBoolean(PROP_ENABLED,PROP_ENABLED_DEFAULT);
}
Program: 19807
Project: 19807
Buggy source:
public void newProperties(PropertySheet ps) throws PropertyException {
  Recognizer newRecognizer=(Recognizer)ps.getComponent(PROP_RECOGNIZER,Recognizer.class);
  if (recognizer == null) {
    recognizer=newRecognizer;
  }
 else   if (recognizer != newRecognizer) {
    recognizer.removeResultListener(this);
    recognizer.removeStateListener(this);
    recognizer=newRecognizer;
  }
  recognizer.addResultListener(this);
  recognizer.addStateListener(this);
  showSummary=ps.getBoolean(PROP_SHOW_SUMMARY,PROP_SHOW_SUMMARY_DEFAULT);
  showDetails=ps.getBoolean(PROP_SHOW_DETAILS,PROP_SHOW_DETAILS_DEFAULT);
}

Fixed version (ground truth):
public void newProperties(PropertySheet ps) throws PropertyException {
  Recognizer newRecognizer=(Recognizer)ps.getComponent(PROP_RECOGNIZER,Recognizer.class);
  if (recognizer == null) {
    recognizer=newRecognizer;
    recognizer.addResultListener(this);
    recognizer.addStateListener(this);
  }
 else   if (recognizer != newRecognizer) {
    recognizer.removeResultListener(this);
    recognizer.removeStateListener(this);
    recognizer=newRecognizer;
    recognizer.addResultListener(this);
    recognizer.addStateListener(this);
  }
  showSummary=ps.getBoolean(PROP_SHOW_SUMMARY,PROP_SHOW_SUMMARY_DEFAULT);
  showDetails=ps.getBoolean(PROP_SHOW_DETAILS,PROP_SHOW_DETAILS_DEFAULT);
}
Program: 19808
Project: 19808
Buggy source:
public void newProperties(PropertySheet ps) throws PropertyException {
  Recognizer newRecognizer=(Recognizer)ps.getComponent(PROP_RECOGNIZER,Recognizer.class);
  if (recognizer == null) {
    recognizer=newRecognizer;
  }
 else   if (recognizer != newRecognizer) {
    recognizer.removeStateListener(this);
    recognizer=newRecognizer;
  }
  recognizer.addStateListener(this);
  allocatedMonitors=ps.getComponentList(PROP_ALLOCATED_MONITORS,Runnable.class);
  deallocatedMonitors=ps.getComponentList(PROP_DEALLOCATED_MONITORS,Runnable.class);
}

Fixed version (ground truth):
public void newProperties(PropertySheet ps) throws PropertyException {
  Recognizer newRecognizer=(Recognizer)ps.getComponent(PROP_RECOGNIZER,Recognizer.class);
  if (recognizer == null) {
    recognizer=newRecognizer;
    recognizer.addStateListener(this);
  }
 else   if (recognizer != newRecognizer) {
    recognizer.removeStateListener(this);
    recognizer=newRecognizer;
    recognizer.addStateListener(this);
  }
  allocatedMonitors=ps.getComponentList(PROP_ALLOCATED_MONITORS,Runnable.class);
  deallocatedMonitors=ps.getComponentList(PROP_DEALLOCATED_MONITORS,Runnable.class);
}
Program: 19809
Project: 19809
Buggy source:
public void newProperties(PropertySheet ps) throws PropertyException {
  Recognizer newRecognizer=(Recognizer)ps.getComponent(PROP_RECOGNIZER,Recognizer.class);
  if (recognizer == null) {
    recognizer=newRecognizer;
  }
 else   if (recognizer != newRecognizer) {
    recognizer.removeResultListener(this);
    recognizer.removeStateListener(this);
    recognizer=newRecognizer;
  }
  recognizer.addResultListener(this);
  recognizer.addStateListener(this);
  FrontEnd newFrontEnd=(FrontEnd)ps.getComponent(PROP_FRONTEND,FrontEnd.class);
  if (frontEnd == null) {
    frontEnd=newFrontEnd;
  }
 else   if (frontEnd != newFrontEnd) {
    frontEnd.removeSignalListener(this);
    frontEnd=newFrontEnd;
  }
  frontEnd.addSignalListener(this);
  showSummary=ps.getBoolean(PROP_SHOW_SUMMARY,PROP_SHOW_SUMMARY_DEFAULT);
  showDetails=ps.getBoolean(PROP_SHOW_DETAILS,PROP_SHOW_DETAILS_DEFAULT);
  showResponseTime=ps.getBoolean(PROP_SHOW_RESPONSE_TIME,PROP_SHOW_RESPONSE_TIME_DEFAULT);
  showTimers=ps.getBoolean(PROP_SHOW_TIMERS,PROP_SHOW_TIMERS_DEFAULT);
}

Fixed version (ground truth):
public void newProperties(PropertySheet ps) throws PropertyException {
  Recognizer newRecognizer=(Recognizer)ps.getComponent(PROP_RECOGNIZER,Recognizer.class);
  if (recognizer == null) {
    recognizer=newRecognizer;
    recognizer.addResultListener(this);
    recognizer.addStateListener(this);
  }
 else   if (recognizer != newRecognizer) {
    recognizer.removeResultListener(this);
    recognizer.removeStateListener(this);
    recognizer=newRecognizer;
    recognizer.addResultListener(this);
    recognizer.addStateListener(this);
  }
  FrontEnd newFrontEnd=(FrontEnd)ps.getComponent(PROP_FRONTEND,FrontEnd.class);
  if (frontEnd == null) {
    frontEnd=newFrontEnd;
    frontEnd.addSignalListener(this);
  }
 else   if (frontEnd != newFrontEnd) {
    frontEnd.removeSignalListener(this);
    frontEnd=newFrontEnd;
    frontEnd.addSignalListener(this);
  }
  showSummary=ps.getBoolean(PROP_SHOW_SUMMARY,PROP_SHOW_SUMMARY_DEFAULT);
  showDetails=ps.getBoolean(PROP_SHOW_DETAILS,PROP_SHOW_DETAILS_DEFAULT);
  showResponseTime=ps.getBoolean(PROP_SHOW_RESPONSE_TIME,PROP_SHOW_RESPONSE_TIME_DEFAULT);
  showTimers=ps.getBoolean(PROP_SHOW_TIMERS,PROP_SHOW_TIMERS_DEFAULT);
}
Program: 19810
Project: 19810
Buggy source:
/** 
 * Sets the level of output
 * @param level the output level
 */
public void setTerse(boolean terse){
  this.terse=terse;
}

Fixed version (ground truth):
/** 
 * Sets the level of output
 * @param terse if true, the output level should be terse
 */
public void setTerse(boolean terse){
  this.terse=terse;
}