nus-yam/ex-repair huggingface dataset:
Program: 53590
Project: 53590
Buggy source:
private CodeSplitter2(TreeLogger logger,JProgram jprogram,JsProgram jsprogram,JavaToJavaScriptMap map,int splitPointsMerge,MultipleDependencyGraphRecorder dependencyRecorder,int leftOverMergeLimit){
  this.jprogram=jprogram;
  this.jsprogram=jsprogram;
  this.splitPointsMerge=splitPointsMerge;
  this.leftOverMergeLimit=leftOverMergeLimit;
  this.fragmentExtractor=new FragmentExtractor(jprogram,jsprogram,map);
  this.initialLoadSequence=new LinkedHashSet<Integer>(jprogram.getSplitPointInitialSequence());
  this.splitPointToFragmentMap=new int[jprogram.getRunAsyncs().size() + 1];
  for (int i=0; i < splitPointToFragmentMap.length; i++) {
    splitPointToFragmentMap[i]=i;
  }
  this.splitPointToCodeIndexMap=new int[jprogram.getRunAsyncs().size() + 1];
  for (int i=0; i < splitPointToCodeIndexMap.length; i++) {
    splitPointToCodeIndexMap[i]=0;
  }
  fieldToLiteralOfClass=buildFieldToClassLiteralMap(jprogram);
  fragmentExtractor=new FragmentExtractor(jprogram,jsprogram,map);
  methodsInJavaScript=fragmentExtractor.findAllMethodsInJavaScript();
}

Fixed version (ground truth):
private CodeSplitter2(TreeLogger logger,JProgram jprogram,JsProgram jsprogram,JavaToJavaScriptMap map,int splitPointsMerge,MultipleDependencyGraphRecorder dependencyRecorder,int leftOverMergeLimit){
  this.jprogram=jprogram;
  this.jsprogram=jsprogram;
  this.splitPointsMerge=splitPointsMerge;
  this.leftOverMergeLimit=leftOverMergeLimit;
  this.dependencyRecorder=dependencyRecorder;
  this.fragmentExtractor=new FragmentExtractor(jprogram,jsprogram,map);
  this.initialLoadSequence=new LinkedHashSet<Integer>(jprogram.getSplitPointInitialSequence());
  this.splitPointToFragmentMap=new int[jprogram.getRunAsyncs().size() + 1];
  for (int i=0; i < splitPointToFragmentMap.length; i++) {
    splitPointToFragmentMap[i]=i;
  }
  this.splitPointToCodeIndexMap=new int[jprogram.getRunAsyncs().size() + 1];
  for (int i=0; i < splitPointToCodeIndexMap.length; i++) {
    splitPointToCodeIndexMap[i]=0;
  }
  fieldToLiteralOfClass=buildFieldToClassLiteralMap(jprogram);
  fragmentExtractor=new FragmentExtractor(jprogram,jsprogram,map);
  methodsInJavaScript=fragmentExtractor.findAllMethodsInJavaScript();
}
Program: 53591
Project: 53591
Buggy source:
public static void exec(TreeLogger logger,JProgram jprogram,JsProgram jsprogram,JavaToJavaScriptMap map,int fragmentsToMerge,MultipleDependencyGraphRecorder dependencyRecorder,int leftOverMergeLimit){
  if (jprogram.getRunAsyncs().size() == 0) {
    return;
  }
  Event codeSplitterEvent=SpeedTracerLogger.start(CompilerEventType.CODE_SPLITTER);
  new CodeSplitter2(logger,jprogram,jsprogram,map,fragmentsToMerge,dependencyRecorder,leftOverMergeLimit).execImpl();
  codeSplitterEvent.end();
}

Fixed version (ground truth):
public static void exec(TreeLogger logger,JProgram jprogram,JsProgram jsprogram,JavaToJavaScriptMap map,int fragmentsToMerge,MultipleDependencyGraphRecorder dependencyRecorder,int leftOverMergeLimit){
  if (jprogram.getRunAsyncs().size() == 0) {
    return;
  }
  Event codeSplitterEvent=SpeedTracerLogger.start(CompilerEventType.CODE_SPLITTER);
  dependencyRecorder.open();
  new CodeSplitter2(logger,jprogram,jsprogram,map,fragmentsToMerge,dependencyRecorder,leftOverMergeLimit).execImpl();
  codeSplitterEvent.end();
}
Program: 53593
Project: 53593
Buggy source:
/** 
 * Compute a CFA that covers the entire live code of the program.
 */
private ControlFlowAnalyzer computeCompleteCfa(){
  ControlFlowAnalyzer everything=new ControlFlowAnalyzer(jprogram);
  everything.traverseEverything();
  return everything;
}

Fixed version (ground truth):
/** 
 * Compute a CFA that covers the entire live code of the program.
 */
private ControlFlowAnalyzer computeCompleteCfa(){
  dependencyRecorder.startDependencyGraph("String_Node_Str",null);
  ControlFlowAnalyzer everything=new ControlFlowAnalyzer(jprogram);
  everything.setDependencyRecorder(dependencyRecorder);
  everything.traverseEverything();
  dependencyRecorder.endDependencyGraph();
  return everything;
}
Program: 53594
Project: 53594
Buggy source:
/** 
 * This is the high level algorithm of the pass.
 */
private void execImpl(){
  initiallyLive=computeInitiallyLive(jprogram,CodeSplitter.NULL_RECORDER);
  recordLiveSet(initiallyLive,liveness,0);
  for (  JRunAsync runAsync : jprogram.getRunAsyncs()) {
    if (initialLoadSequence.contains(runAsync.getSplitPoint())) {
      initiallyLive=computeLiveSet(initiallyLive,liveness,runAsync);
    }
  }
  for (  JRunAsync runAsync : jprogram.getRunAsyncs()) {
    if (!initialLoadSequence.contains(runAsync.getSplitPoint())) {
      computeLiveSet(initiallyLive,liveness,runAsync);
    }
  }
  fixUpLoadOrderDependencies(liveness,-1);
  partitionFragments();
  extractStatements(computeInitiallyLive(jprogram,CodeSplitter.NULL_RECORDER));
  replaceFragmentId();
}

Fixed version (ground truth):
/** 
 * This is the high level algorithm of the pass.
 */
private void execImpl(){
  initiallyLive=computeInitiallyLive(jprogram,CodeSplitter.NULL_RECORDER);
  recordLiveSet(initiallyLive,liveness,0);
  for (  JRunAsync runAsync : jprogram.getRunAsyncs()) {
    if (initialLoadSequence.contains(runAsync.getSplitPoint())) {
      initiallyLive=computeLiveSet(initiallyLive,liveness,runAsync);
    }
  }
  for (  JRunAsync runAsync : jprogram.getRunAsyncs()) {
    if (!initialLoadSequence.contains(runAsync.getSplitPoint())) {
      computeLiveSet(initiallyLive,liveness,runAsync);
    }
  }
  fixUpLoadOrderDependencies(liveness,-1);
  partitionFragments();
  extractStatements(computeInitiallyLive(jprogram,dependencyRecorder));
  replaceFragmentId();
}
Program: 53595
Project: 53595
Buggy source:
private ControlFlowAnalyzer computeAllButNCfas(ControlFlowAnalyzer liveAfterInitialSequence,List<Integer> sp){
  List<ControlFlowAnalyzer> allButOnes=new ArrayList<ControlFlowAnalyzer>();
  ControlFlowAnalyzer cfa=new ControlFlowAnalyzer(liveAfterInitialSequence);
  for (  JRunAsync otherRunAsync : jprogram.getRunAsyncs()) {
    if (isInitial(otherRunAsync.getSplitPoint())) {
      continue;
    }
    if (sp.contains(otherRunAsync.getSplitPoint())) {
      continue;
    }
    cfa.traverseFromRunAsync(otherRunAsync);
  }
  return cfa;
}

Fixed version (ground truth):
private ControlFlowAnalyzer computeAllButNCfas(ControlFlowAnalyzer liveAfterInitialSequence,List<Integer> sp,ControlFlowAnalyzer.DependencyRecorder dependencyRecorder){
  List<ControlFlowAnalyzer> allButOnes=new ArrayList<ControlFlowAnalyzer>();
  ControlFlowAnalyzer cfa=new ControlFlowAnalyzer(liveAfterInitialSequence);
  cfa.setDependencyRecorder(dependencyRecorder);
  for (  JRunAsync otherRunAsync : jprogram.getRunAsyncs()) {
    if (isInitial(otherRunAsync.getSplitPoint())) {
      continue;
    }
    if (sp.contains(otherRunAsync.getSplitPoint())) {
      continue;
    }
    cfa.traverseFromRunAsync(otherRunAsync);
  }
  return cfa;
}
Program: 53596
Project: 53596
Buggy source:
private FragmentPartitioningResult(int[] splitPointToFragmentMap,int numFragments){
  this.splitPointToFragmentMap=splitPointToFragmentMap;
  fragmentToSplitPoint=new int[numFragments];
  for (int i=0, len=splitPointToFragmentMap.length - 1; i < len; i++) {
    System.out.println("String_Node_Str" + i + "String_Node_Str"+ splitPointToFragmentMap[i]);
  }
  for (int i=1, len=splitPointToFragmentMap.length - 1; i < len; i++) {
    if (fragmentToSplitPoint[splitPointToFragmentMap[i]] == 0) {
      fragmentToSplitPoint[splitPointToFragmentMap[i]]=i;
    }
 else {
      fragmentToSplitPoint[splitPointToFragmentMap[i]]=-1;
    }
  }
}

Fixed version (ground truth):
private FragmentPartitioningResult(int[] splitPointToFragmentMap,int numFragments){
  this.splitPointToFragmentMap=splitPointToFragmentMap;
  fragmentToSplitPoint=new int[numFragments];
  for (int i=1, len=splitPointToFragmentMap.length - 1; i < len; i++) {
    if (fragmentToSplitPoint[splitPointToFragmentMap[i]] == 0) {
      fragmentToSplitPoint[splitPointToFragmentMap[i]]=i;
    }
 else {
      fragmentToSplitPoint[splitPointToFragmentMap[i]]=-1;
    }
  }
}
Program: 53597
Project: 53597
Buggy source:
/** 
 * Compiles a Java class <code>test.EntryPoint</code> and use the code splitter on it with leftover merge enabled.
 */
protected void compileSnippetWithLeftoverMerge(final String code,int mergeLimit) throws UnableToCompleteException {
  addMockIntrinsic();
  sourceOracle.addOrReplace(new MockJavaResource("String_Node_Str"){
    @Override public CharSequence getContent(){
      return code;
    }
  }
);
  addBuiltinClasses(sourceOracle);
  CompilationState state=CompilationStateBuilder.buildFrom(logger,sourceOracle.getResources(),getAdditionalTypeProviderDelegate(),sourceLevel);
  jProgram=JavaAstConstructor.construct(logger,state,"String_Node_Str","String_Node_Str");
  jProgram.addEntryMethod(findMethod(jProgram,"String_Node_Str"));
  CastNormalizer.exec(jProgram,false);
  ArrayNormalizer.exec(jProgram);
  Map<StandardSymbolData,JsName> symbolTable=new TreeMap<StandardSymbolData,JsName>(new SymbolData.ClassIdentComparator());
  JavaToJavaScriptMap map=GenerateJavaScriptAST.exec(jProgram,jsProgram,JsOutputOption.PRETTY,symbolTable,new PropertyOracle[]{new StaticPropertyOracle(orderedProps,orderedPropValues,configProps)}).getLeft();
  CodeSplitter2.exec(logger,jProgram,jsProgram,map,4,null,mergeLimit);
}

Fixed version (ground truth):
/** 
 * Compiles a Java class <code>test.EntryPoint</code> and use the code splitter on it with leftover merge enabled.
 */
protected void compileSnippetWithLeftoverMerge(final String code,int mergeLimit) throws UnableToCompleteException {
  addMockIntrinsic();
  sourceOracle.addOrReplace(new MockJavaResource("String_Node_Str"){
    @Override public CharSequence getContent(){
      return code;
    }
  }
);
  addBuiltinClasses(sourceOracle);
  CompilationState state=CompilationStateBuilder.buildFrom(logger,sourceOracle.getResources(),getAdditionalTypeProviderDelegate(),sourceLevel);
  jProgram=JavaAstConstructor.construct(logger,state,"String_Node_Str","String_Node_Str");
  jProgram.addEntryMethod(findMethod(jProgram,"String_Node_Str"));
  CastNormalizer.exec(jProgram,false);
  ArrayNormalizer.exec(jProgram);
  Map<StandardSymbolData,JsName> symbolTable=new TreeMap<StandardSymbolData,JsName>(new SymbolData.ClassIdentComparator());
  JavaToJavaScriptMap map=GenerateJavaScriptAST.exec(jProgram,jsProgram,JsOutputOption.PRETTY,symbolTable,new PropertyOracle[]{new StaticPropertyOracle(orderedProps,orderedPropValues,configProps)}).getLeft();
  CodeSplitter2.exec(logger,jProgram,jsProgram,map,4,NULL_RECORDER,mergeLimit);
}
Program: 53598
Project: 53598
Buggy source:
/** 
 * Compiles a Java class <code>test.EntryPoint</code> and use the code splitter on it.
 */
protected void compileSnippet(final String code) throws UnableToCompleteException {
  addMockIntrinsic();
  sourceOracle.addOrReplace(new MockJavaResource("String_Node_Str"){
    @Override public CharSequence getContent(){
      return code;
    }
  }
);
  addBuiltinClasses(sourceOracle);
  CompilationState state=CompilationStateBuilder.buildFrom(logger,sourceOracle.getResources(),getAdditionalTypeProviderDelegate(),sourceLevel);
  jProgram=JavaAstConstructor.construct(logger,state,"String_Node_Str","String_Node_Str");
  jProgram.addEntryMethod(findMethod(jProgram,"String_Node_Str"));
  CastNormalizer.exec(jProgram,false);
  ArrayNormalizer.exec(jProgram);
  Map<StandardSymbolData,JsName> symbolTable=new TreeMap<StandardSymbolData,JsName>(new SymbolData.ClassIdentComparator());
  JavaToJavaScriptMap map=GenerateJavaScriptAST.exec(jProgram,jsProgram,JsOutputOption.PRETTY,symbolTable,new PropertyOracle[]{new StaticPropertyOracle(orderedProps,orderedPropValues,configProps)}).getLeft();
  CodeSplitter2.exec(logger,jProgram,jsProgram,map,4,null,0);
}

Fixed version (ground truth):
/** 
 * Compiles a Java class <code>test.EntryPoint</code> and use the code splitter on it.
 */
protected void compileSnippet(final String code) throws UnableToCompleteException {
  addMockIntrinsic();
  sourceOracle.addOrReplace(new MockJavaResource("String_Node_Str"){
    @Override public CharSequence getContent(){
      return code;
    }
  }
);
  addBuiltinClasses(sourceOracle);
  CompilationState state=CompilationStateBuilder.buildFrom(logger,sourceOracle.getResources(),getAdditionalTypeProviderDelegate(),sourceLevel);
  jProgram=JavaAstConstructor.construct(logger,state,"String_Node_Str","String_Node_Str");
  jProgram.addEntryMethod(findMethod(jProgram,"String_Node_Str"));
  CastNormalizer.exec(jProgram,false);
  ArrayNormalizer.exec(jProgram);
  Map<StandardSymbolData,JsName> symbolTable=new TreeMap<StandardSymbolData,JsName>(new SymbolData.ClassIdentComparator());
  JavaToJavaScriptMap map=GenerateJavaScriptAST.exec(jProgram,jsProgram,JsOutputOption.PRETTY,symbolTable,new PropertyOracle[]{new StaticPropertyOracle(orderedProps,orderedPropValues,configProps)}).getLeft();
  CodeSplitter2.exec(logger,jProgram,jsProgram,map,4,NULL_RECORDER,0);
}
Program: 53599
Project: 53599
Buggy source:
/** 
 * Compiles source using the JDT. The   {@link UnitProcessor#process} callback method will be calledonce for each compiled file. If the compiler aborts, logs a message and throws UnableToCompleteException.
 */
public void doCompile(TreeLogger logger,Collection<CompilationUnitBuilder> builders) throws UnableToCompleteException {
  if (builders.isEmpty()) {
    return;
  }
  List<ICompilationUnit> icus=new ArrayList<ICompilationUnit>();
  for (  CompilationUnitBuilder builder : builders) {
    addPackages(Shared.getPackageName(builder.getTypeName()).replace('.','/'));
    icus.add(new Adapter(builder));
  }
  compilerImpl=new CompilerImpl();
  try {
    compilerImpl.compile(icus.toArray(new ICompilationUnit[icus.size()]));
  }
 catch (  AbortCompilation e) {
    String filename=new String(e.problem.getOriginatingFileName());
    TreeLogger branch=logger.branch(TreeLogger.Type.ERROR,"String_Node_Str" + filename + "String_Node_Str"+ e.problem.getSourceLineNumber());
    branch.log(TreeLogger.Type.ERROR,"String_Node_Str" + e.problem.getMessage());
    throw new UnableToCompleteException();
  }
 finally {
    compilerImpl=null;
  }
}

Fixed version (ground truth):
/** 
 * Compiles source using the JDT. The   {@link UnitProcessor#process} callback method will be calledonce for each compiled file. If the compiler aborts, logs a message and throws UnableToCompleteException.
 */
public void doCompile(TreeLogger logger,Collection<CompilationUnitBuilder> builders) throws UnableToCompleteException {
  if (builders.isEmpty()) {
    return;
  }
  List<ICompilationUnit> icus=new ArrayList<ICompilationUnit>();
  for (  CompilationUnitBuilder builder : builders) {
    addPackages(Shared.getPackageName(builder.getTypeName()).replace('.','/'));
    icus.add(new Adapter(builder));
  }
  compilerImpl=new CompilerImpl();
  try {
    compilerImpl.compile(icus.toArray(new ICompilationUnit[icus.size()]));
  }
 catch (  AbortCompilation e) {
    if (e.problem.getOriginatingFileName() != null) {
      String filename=new String(e.problem.getOriginatingFileName());
      TreeLogger branch=logger.branch(TreeLogger.Type.ERROR,"String_Node_Str" + filename + "String_Node_Str"+ e.problem.getSourceLineNumber());
      branch.log(TreeLogger.Type.ERROR,"String_Node_Str" + e.problem.getMessage());
    }
 else {
      logger.log(TreeLogger.Type.ERROR,"String_Node_Str" + e.problem.getMessage());
    }
    throw new UnableToCompleteException();
  }
 finally {
    compilerImpl=null;
  }
}
Program: 53600
Project: 53600
Buggy source:
/** 
 * @skip This function contains common logic for parsing a String in a given radix and validating the result.
 */
protected static int __parseAndValidateInt(String s,int radix,int lowerBound,int upperBound) throws NumberFormatException {
  if (s == null) {
    throw new NumberFormatException("String_Node_Str");
  }
  if (radix < Character.MIN_RADIX || radix > Character.MAX_RADIX) {
    throw new NumberFormatException("String_Node_Str" + radix + "String_Node_Str");
  }
  int length=s.length();
  int startIndex=(length > 0) && (s.charAt(0) == '-') ? 1 : 0;
  for (int i=startIndex; i < length; i++) {
    if (Character.digit(s.charAt(i),radix) == -1) {
      throw NumberFormatException.forInputString(s);
    }
  }
  int toReturn=__parseInt(s,radix);
  if (__isNaN(toReturn)) {
    throw NumberFormatException.forInputString(s);
  }
 else   if (toReturn < lowerBound || toReturn > upperBound) {
    throw NumberFormatException.forInputString(s);
  }
  return toReturn;
}

Fixed version (ground truth):
/** 
 * @skip This function contains common logic for parsing a String in a given radix and validating the result.
 */
protected static int __parseAndValidateInt(String s,int radix,int lowerBound,int upperBound) throws NumberFormatException {
  if (s == null) {
    throw new NumberFormatException("String_Node_Str");
  }
  if (radix < Character.MIN_RADIX || radix > Character.MAX_RADIX) {
    throw new NumberFormatException("String_Node_Str" + radix + "String_Node_Str");
  }
  int length=s.length();
  int startIndex=(length > 0) && (s.charAt(0) == '-') ? 1 : 0;
  for (int i=startIndex; i < length; i++) {
    if (Character.digit(s.charAt(i),radix) == -1) {
      throw NumberFormatException.forInputString(s);
    }
  }
  int toReturn=__parseInt(s,radix);
  boolean isTooLow=toReturn < lowerBound;
  if (__isNaN(toReturn)) {
    throw NumberFormatException.forInputString(s);
  }
 else   if (isTooLow || toReturn > upperBound) {
    throw NumberFormatException.forInputString(s);
  }
  return toReturn;
}
Program: 53601
Project: 53601
Buggy source:
public void testValueOf(){
  assertEquals(new Integer(12345),Integer.valueOf("String_Node_Str"));
  assertEquals(new Integer(1865),Integer.valueOf("String_Node_Str",6));
  assertEquals(12345,Integer.parseInt("String_Node_Str"));
  assertEquals(1865,Integer.parseInt("String_Node_Str",6));
}

Fixed version (ground truth):
public void testValueOf(){
  assertEquals(new Integer(12345),Integer.valueOf("String_Node_Str"));
  assertEquals(new Integer(1865),Integer.valueOf("String_Node_Str",6));
}
Program: 53602
Project: 53602
Buggy source:
/** 
 * Construct an simple AST representing an entire   {@link CompilationState}. Does not support deferred binding. Implementation mostly copied from  {@link JavaToJavaScriptCompiler}.
 */
public static JProgram construct(TreeLogger logger,final CompilationState state,JJSOptions options) throws UnableToCompleteException {
  InternalCompilerException.preload();
  RebindPermutationOracle rpo=new RebindPermutationOracle(){
    @Override public void clear(){
    }
    @Override public String[] getAllPossibleRebindAnswers(    TreeLogger logger,    String sourceTypeName) throws UnableToCompleteException {
      return new String[0];
    }
    public CompilationState getCompilationState(){
      return state;
    }
    public StandardGeneratorContext getGeneratorContext(){
      return null;
    }
  }
;
  JProgram jprogram=new JProgram();
  JsProgram jsProgram=new JsProgram();
  UnifyAst unifyAst=new UnifyAst(jprogram,jsProgram,options,rpo);
  unifyAst.buildEverything(logger);
  jprogram.typeOracle.computeBeforeAST();
  FixAssignmentToUnbox.exec(jprogram);
  if (options.isEnableAssertions()) {
    AssertionNormalizer.exec(jprogram);
  }
 else {
    AssertionRemover.exec(jprogram);
  }
  if (options.isRunAsyncEnabled()) {
    ReplaceRunAsyncs.exec(logger,jprogram);
  }
  ImplementClassLiteralsAsFields.exec(jprogram);
  return jprogram;
}

Fixed version (ground truth):
/** 
 * Construct an simple AST representing an entire   {@link CompilationState}. Does not support deferred binding. Implementation mostly copied from  {@link JavaToJavaScriptCompiler}.
 */
public static JProgram construct(TreeLogger logger,final CompilationState state,JJSOptions options) throws UnableToCompleteException {
  InternalCompilerException.preload();
  RebindPermutationOracle rpo=new RebindPermutationOracle(){
    @Override public void clear(){
    }
    @Override public String[] getAllPossibleRebindAnswers(    TreeLogger logger,    String sourceTypeName) throws UnableToCompleteException {
      return new String[0];
    }
    public CompilationState getCompilationState(){
      return state;
    }
    public StandardGeneratorContext getGeneratorContext(){
      return null;
    }
  }
;
  JProgram jprogram=new JProgram();
  JsProgram jsProgram=new JsProgram();
  UnifyAst unifyAst=new UnifyAst(logger,jprogram,jsProgram,options,rpo);
  unifyAst.buildEverything();
  jprogram.typeOracle.computeBeforeAST();
  FixAssignmentToUnbox.exec(jprogram);
  if (options.isEnableAssertions()) {
    AssertionNormalizer.exec(jprogram);
  }
 else {
    AssertionRemover.exec(jprogram);
  }
  if (options.isRunAsyncEnabled()) {
    ReplaceRunAsyncs.exec(logger,jprogram);
  }
  ImplementClassLiteralsAsFields.exec(jprogram);
  return jprogram;
}
Program: 53604
Project: 53604
Buggy source:
/** 
 * Special AST construction, useful for tests. Everything is resolved, translated, and unified.
 */
public void buildEverything(TreeLogger logger) throws UnableToCompleteException {
  this.logger=logger;
  for (  String internalName : classFileMap.keySet()) {
    String typeName=InternalName.toBinaryName(internalName);
    searchForTypeByBinary(typeName);
  }
  for (  JDeclaredType type : program.getDeclaredTypes()) {
    instantiate(type);
    for (    JField field : type.getFields()) {
      flowInto(field);
    }
    for (    JMethod method : type.getMethods()) {
      flowInto(method);
    }
  }
  mainLoop();
  computeOverrides();
  if (errorsFound) {
    throw new UnableToCompleteException();
  }
}

Fixed version (ground truth):
/** 
 * Special AST construction, useful for tests. Everything is resolved, translated, and unified.
 */
public void buildEverything() throws UnableToCompleteException {
  for (  String internalName : classFileMap.keySet()) {
    String typeName=InternalName.toBinaryName(internalName);
    searchForTypeByBinary(typeName);
  }
  for (  JDeclaredType type : program.getDeclaredTypes()) {
    instantiate(type);
    for (    JField field : type.getFields()) {
      flowInto(field);
    }
    for (    JMethod method : type.getMethods()) {
      flowInto(method);
    }
  }
  mainLoop();
  computeOverrides();
  if (errorsFound) {
    throw new UnableToCompleteException();
  }
}
Program: 53605
Project: 53605
Buggy source:
public UnifyAst(JProgram program,JsProgram jsProgram,JJSOptions options,RebindPermutationOracle rpo){
  this.program=program;
  this.jsProgram=jsProgram;
  this.options=options;
  this.rpo=rpo;
  this.classFileMap=rpo.getCompilationState().getClassFileMap();
  this.classFileMapBySource=rpo.getCompilationState().getClassFileMapBySource();
}

Fixed version (ground truth):
public UnifyAst(TreeLogger logger,JProgram program,JsProgram jsProgram,JJSOptions options,RebindPermutationOracle rpo){
  this.logger=logger;
  this.program=program;
  this.jsProgram=jsProgram;
  this.options=options;
  this.rpo=rpo;
  this.classFileMap=rpo.getCompilationState().getClassFileMap();
  this.classFileMapBySource=rpo.getCompilationState().getClassFileMapBySource();
}
Program: 53607
Project: 53607
Buggy source:
private Entry<K,V> implFindEntry(Object key,boolean remove){
  for (Iterator<Entry<K,V>> iter=entrySet().iterator(); iter.hasNext(); ) {
    Entry<K,V> entry=iter.next();
    K k=entry.getKey();
    if (key == null ? k == null : key.equals(k)) {
      if (remove) {
        iter.remove();
      }
      return entry;
    }
  }
  return null;
}

Fixed version (ground truth):
private Entry<K,V> implFindEntry(Object key,boolean remove){
  for (Iterator<Entry<K,V>> iter=entrySet().iterator(); iter.hasNext(); ) {
    Entry<K,V> entry=iter.next();
    K k=entry.getKey();
    if (key == null ? k == null : key.equals(k)) {
      if (remove) {
        entry=new MapEntryImpl<K,V>(entry.getKey(),entry.getValue());
        iter.remove();
      }
      return entry;
    }
  }
  return null;
}
Program: 53608
Project: 53608
Buggy source:
@Override public boolean hasSideEffects(){
  return false;
}

Fixed version (ground truth):
@Override public boolean hasSideEffects(){
  return expr.hasSideEffects();
}
Program: 53609
Project: 53609
Buggy source:
@Override protected boolean optimizeMethod(JProgram program,JMethod method){
  MethodCallTightener.exec(program);
  OptimizerStats result=DeadCodeElimination.exec(program,method);
  if (result.didChange()) {
    assertFalse(DeadCodeElimination.exec(program,method).didChange());
  }
  return result.didChange();
}

Fixed version (ground truth):
@Override protected boolean optimizeMethod(JProgram program,JMethod method){
  MethodCallTightener.exec(program);
  if (runMethodInliner) {
    MethodInliner.exec(program);
  }
  OptimizerStats result=DeadCodeElimination.exec(program,method);
  if (result.didChange()) {
    assertFalse(DeadCodeElimination.exec(program,method).didChange());
  }
  return result.didChange();
}
Program: 53610
Project: 53610
Buggy source:
@Override public void setUp() throws Exception {
  addSnippetClassDecl("String_Node_Str");
  addSnippetClassDecl("String_Node_Str");
  addSnippetClassDecl("String_Node_Str");
  addSnippetClassDecl("String_Node_Str");
  addSnippetClassDecl("String_Node_Str");
  addSnippetClassDecl("String_Node_Str");
  addSnippetClassDecl("String_Node_Str");
  addSnippetClassDecl("String_Node_Str");
}

Fixed version (ground truth):
@Override public void setUp() throws Exception {
  addSnippetClassDecl("String_Node_Str");
  addSnippetClassDecl("String_Node_Str");
  addSnippetClassDecl("String_Node_Str");
  addSnippetClassDecl("String_Node_Str");
  addSnippetClassDecl("String_Node_Str");
  addSnippetClassDecl("String_Node_Str");
  addSnippetClassDecl("String_Node_Str");
  addSnippetClassDecl("String_Node_Str");
  runMethodInliner=false;
}
Program: 53613
Project: 53613
Buggy source:
private TypeInfoComputed checkArrayInstantiable(TreeLogger logger,JArrayType array,TypePath path,ProblemReport problems){
}

Fixed version (ground truth):
private TypeInfoComputed checkArrayInstantiable(TreeLogger logger,JArrayType array,TypePath path,ProblemReport problems){
  JType leafType=array.getLeafType();
  JWildcardType leafWild=leafType.isWildcard();
  if (leafWild != null) {
    JArrayType arrayType=getArrayType(typeOracle,array.getRank(),leafWild.getUpperBound());
    return checkArrayInstantiable(logger,arrayType,path,problems);
  }
  TypeInfoComputed tic=ensureTypeInfoComputed(array,path);
  if (tic.isDone() || tic.isPendingInstantiable()) {
    return tic;
  }
  tic.setPendingInstantiable();
  JTypeParameter isLeafTypeParameter=leafType.isTypeParameter();
  if (isLeafTypeParameter != null && !typeParametersInRootTypes.contains(isLeafTypeParameter)) {
    tic.setInstantiableSubtypes(true);
    tic.setInstantiable(false);
    return tic;
  }
  if (!isAllowedByFilter(array,problems)) {
    tic.setInstantiable(false);
    return tic;
  }
  TreeLogger branch=logger.branch(TreeLogger.DEBUG,"String_Node_Str",null);
  TypeInfoComputed leafTic=computeTypeInstantiability(branch,leafType,TypePaths.createArrayComponentPath(array,path),problems);
  boolean succeeded=leafTic.hasInstantiableSubtypes();
  tic.setInstantiable(succeeded);
  return tic;
}
Program: 53615
Project: 53615
Buggy source:
public CfgOptionalThrowNode(CfgNode<?> parent,JMethodCall node){
  super(parent,node);
}

Fixed version (ground truth):
public CfgOptionalThrowNode(CfgNode<?> parent,JExpression node){
  super(parent,node);
}
Program: 53616
Project: 53616
Buggy source:
@Override public String toDebugString(){
  return "String_Node_Str" + getJNode().getTarget().getName() + "String_Node_Str";
}

Fixed version (ground truth):
@Override public String toDebugString(){
  if (getJNode() instanceof JMethodCall) {
    return "String_Node_Str" + ((JMethodCall)getJNode()).getTarget().getName() + "String_Node_Str";
  }
  return "String_Node_Str" + getJNode().toSource() + "String_Node_Str";
}
Program: 53619
Project: 53619
Buggy source:
static String extractNameFromToString(String fnToString){
  String toReturn="String_Node_Str";
  fnToString=fnToString.trim();
  int index=fnToString.indexOf("String_Node_Str");
  if (index != -1) {
    int start=fnToString.startsWith("String_Node_Str") ? 8 : 0;
    toReturn=fnToString.substring(start,index).trim();
  }
  return toReturn.length() > 0 ? toReturn : "String_Node_Str";
}

Fixed version (ground truth):
static String extractNameFromToString(String fnToString){
  String toReturn="String_Node_Str";
  fnToString=fnToString.trim();
  int index=fnToString.indexOf("String_Node_Str");
  int start=fnToString.startsWith("String_Node_Str") ? 8 : 0;
  if (index == -1) {
    index=fnToString.indexOf('@');
    start=fnToString.startsWith("String_Node_Str") ? 9 : 0;
  }
  if (index != -1) {
    toReturn=fnToString.substring(start,index).trim();
  }
  return toReturn.length() > 0 ? toReturn : "String_Node_Str";
}
Program: 53621
Project: 53621
Buggy source:
/** 
 * Compute deltas for each entity seen by the context.
 */
private List<OperationMessage> makePayloadOperations(){
  List<OperationMessage> operations=new ArrayList<OperationMessage>();
  for (  AutoBean<? extends BaseProxy> currentView : state.editedProxies.values()) {
    OperationMessage operation=makeOperationMessage(BaseProxyCategory.stableId(currentView),currentView,true).as();
    operations.add(operation);
  }
  return operations;
}

Fixed version (ground truth):
/** 
 * Compute deltas for each entity seen by the context. <p> TODO(t.broyer): reduce payload size by only sending proxies that are directly referenced by invocation arguments or by other proxies. For backwards-compatibility with no-op requests and operation-only requests, only do so when there's at least one invocation (or we can choose to break backwards compatibility for those edge-cases).
 */
private List<OperationMessage> makePayloadOperations(){
}
Program: 53622
Project: 53622
Buggy source:
public boolean isChanged(){
  for (  AutoBean<? extends BaseProxy> bean : state.editedProxies.values()) {
    AutoBean<?> previous=bean.getTag(Constants.PARENT_OBJECT);
    if (previous == null) {
      Class<?> proxyClass=stableId(bean).getProxyClass();
      previous=getAutoBeanFactory().create(proxyClass);
    }
    if (!AutoBeanUtils.diff(previous,bean).isEmpty()) {
      return true;
    }
  }
  return false;
}

Fixed version (ground truth):
public boolean isChanged(){
}
Program: 53623
Project: 53623
Buggy source:
/** 
 * Sniff all return values and ensure that if the current bean is a mutable EntityProxy, that its return values are mutable.
 */
public static <T>T __intercept(AutoBean<?> bean,T returnValue){
  AbstractRequestContext context=requestContext(bean);
  if (context == null || context.isLocked()) {
    return returnValue;
  }
  if (returnValue instanceof BaseProxy) {
    @SuppressWarnings("String_Node_Str") T toReturn=(T)context.editProxy((BaseProxy)returnValue);
    return toReturn;
  }
  if (returnValue instanceof Poser<?>) {
    ((Poser<?>)returnValue).setFrozen(false);
  }
  AutoBean<T> otherBean=AutoBeanUtils.getAutoBean(returnValue);
  if (otherBean != null) {
    otherBean.setTag(REQUEST_CONTEXT_STATE,bean.getTag(REQUEST_CONTEXT_STATE));
  }
  return returnValue;
}

Fixed version (ground truth):
/** 
 * Sniff all return values and ensure that if the current bean is a mutable EntityProxy, that its return values are mutable.
 */
public static <T>T __intercept(AutoBean<?> bean,T returnValue){
  AbstractRequestContext context=requestContext(bean);
  if (context == null || context.isLocked() || context.isDiffing()) {
    return returnValue;
  }
  if (returnValue instanceof BaseProxy) {
    @SuppressWarnings("String_Node_Str") T toReturn=(T)context.editProxy((BaseProxy)returnValue);
    return toReturn;
  }
  if (returnValue instanceof Poser<?>) {
    ((Poser<?>)returnValue).setFrozen(false);
  }
  AutoBean<T> otherBean=AutoBeanUtils.getAutoBean(returnValue);
  if (otherBean != null) {
    otherBean.setTag(REQUEST_CONTEXT_STATE,bean.getTag(REQUEST_CONTEXT_STATE));
  }
  return returnValue;
}
Program: 53624
Project: 53624
Buggy source:
/** 
 * EntityProxies are equal if they are from the same RequestContext and their stableIds are equal.
 */
public static boolean equals(AutoBean<? extends EntityProxy> bean,Object o){
  if (!(o instanceof EntityProxy)) {
    return false;
  }
  AutoBean<EntityProxy> other=AutoBeanUtils.getAutoBean((EntityProxy)o);
  if (other == null) {
    return false;
  }
  return stableId(bean).equals(stableId(other)) && requestContext(bean) == requestContext(other);
}

Fixed version (ground truth):
/** 
 * EntityProxies are equal if they are from the same RequestContext and their stableIds are equal.
 */
public static boolean equals(AutoBean<? extends EntityProxy> bean,Object o){
  if (!(o instanceof EntityProxy)) {
    return false;
  }
  AutoBean<EntityProxy> other=AutoBeanUtils.getAutoBean((EntityProxy)o);
  if (other == null) {
    return false;
  }
  return stableId(bean).equals(stableId(other)) && nonDiffingRequestContext(bean) == nonDiffingRequestContext(other);
}
Program: 53625
Project: 53625
Buggy source:
public static Test suite(){
  GWTTestSuite suite=new GWTTestSuite("String_Node_Str");
  suite.addTestSuite(RequestBatcherTest.class);
  suite.addTestSuite(BoxesAndPrimitivesTest.class);
  suite.addTestSuite(ComplexKeysTest.class);
  suite.addTestSuite(EditorTest.class);
  suite.addTestSuite(FanoutReceiverTest.class);
  suite.addTestSuite(FindServiceTest.class);
  suite.addTestSuite(LocatorTest.class);
  suite.addTestSuite(RequestFactoryTest.class);
  suite.addTestSuite(RequestFactoryChainedContextTest.class);
  suite.addTestSuite(RequestFactoryExceptionHandlerTest.class);
  suite.addTestSuite(RequestFactoryExceptionPropagationTest.class);
  suite.addTestSuite(RequestFactoryPolymorphicTest.class);
  suite.addTestSuite(RequestFactoryUnicodeEscapingTest.class);
  suite.addTestSuite(ServiceInheritanceTest.class);
  return suite;
}

Fixed version (ground truth):
public static Test suite(){
  GWTTestSuite suite=new GWTTestSuite("String_Node_Str");
  suite.addTestSuite(RequestBatcherTest.class);
  suite.addTestSuite(BoxesAndPrimitivesTest.class);
  suite.addTestSuite(ComplexKeysTest.class);
  suite.addTestSuite(EditorTest.class);
  suite.addTestSuite(FanoutReceiverTest.class);
  suite.addTestSuite(FindServiceTest.class);
  suite.addTestSuite(LocatorTest.class);
  suite.addTestSuite(RequestFactoryTest.class);
  suite.addTestSuite(RequestFactoryChainedContextTest.class);
  suite.addTestSuite(RequestFactoryExceptionHandlerTest.class);
  suite.addTestSuite(RequestFactoryExceptionPropagationTest.class);
  suite.addTestSuite(RequestFactoryPolymorphicTest.class);
  suite.addTestSuite(RequestFactoryUnicodeEscapingTest.class);
  suite.addTestSuite(RequestPayloadTest.class);
  suite.addTestSuite(ServiceInheritanceTest.class);
  return suite;
}
Program: 53626
Project: 53626
Buggy source:
public List<SimpleValue> getSimpleValues(){
  return Arrays.asList(simpleValueField);
}

Fixed version (ground truth):
public List<SimpleValue> getSimpleValues(){
  return simpleValueField;
}
Program: 53627
Project: 53627
Buggy source:
public SimpleValue getSimpleValue(){
  return simpleValueField;
}

Fixed version (ground truth):
public SimpleValue getSimpleValue(){
  return simpleValueField != null && simpleValueField.size() > 0 ? simpleValueField.get(0) : null;
}
Program: 53628
Project: 53628
Buggy source:
public void setSimpleValue(SimpleValue simpleValueField){
  this.simpleValueField=simpleValueField;
}

Fixed version (ground truth):
public void setSimpleValue(SimpleValue simpleValueField){
  this.simpleValueField=Collections.singletonList(simpleValueField);
}
Program: 53629
Project: 53629
Buggy source:
public void setSimpleValues(List<SimpleValue> simpleValueField){
  this.simpleValueField=simpleValueField.get(0);
}

Fixed version (ground truth):
public void setSimpleValues(List<SimpleValue> simpleValueField){
  this.simpleValueField=simpleValueField;
}
Program: 53631
Project: 53631
Buggy source:
/** 
 * Returns the name of the   {@code ComputeScriptBase} script.  By default,returns  {@code "com/google/gwt/core/ext/linker/impl/computeScriptBase.js"}.
 * @param context a LinkerContext
 */
protected String getJsComputeScriptBase(LinkerContext context){
  return "String_Node_Str";
}

Fixed version (ground truth):
/** 
 * Returns the name of the   {@code ComputeScriptBase} script.  By default,returns  {@code "com/google/gwt/core/ext/linker/impl/computeScriptBase.js"}.
 * @param context a LinkerContext
 */
protected String getJsComputeScriptBase(LinkerContext context){
  return getStringConfigurationProperty(context,"String_Node_Str","String_Node_Str");
}
Program: 53632
Project: 53632
Buggy source:
/** 
 * Returns true if the given object should be selected by default. Subclasses implement this method in order to define the default selection behavior.
 * @param object an object of this {@link SelectionModel}'s type
 * @return true if the object should be selected by default
 */
public abstract boolean isDefaultSelected(T object);

Fixed version (ground truth):
/** 
 * Returns true if the given item should be selected by default. Subclasses implement this method in order to define the default selection behavior.
 * @param item an object of this {@link SelectionModel}'s type
 * @return true if the item should be selected by default
 */
public abstract boolean isDefaultSelected(T item);
Program: 53633
Project: 53633
Buggy source:
/** 
 * Sets an object's selection state. If the object is currently marked as an exception, and the new selected state differs from the previous selected state, the object is removed from the list of exceptions. Otherwise, the object is added to the list of exceptions with the given selected state.
 */
public void setSelected(T object,boolean selected){
  selectionChanges.put(object,selected);
  scheduleSelectionChangeEvent();
}

Fixed version (ground truth):
/** 
 * Sets an item's selection state. If the item is currently marked as an exception, and the new selected state differs from the previous selected state, the object is removed from the list of exceptions. Otherwise, the object is added to the list of exceptions with the given selected state.
 */
@Override public void setSelected(T item,boolean selected){
  selectionChanges.put(getKey(item),new SelectionChange<T>(item,selected));
  scheduleSelectionChangeEvent();
}
Program: 53634
Project: 53634
Buggy source:
/** 
 * If the given object is marked as an exception, return the exception value. Otherwise, return the value of isDefaultSelected for the given object.
 */
public boolean isSelected(T object){
  resolveChanges();
  Object key=getKey(object);
  Boolean exception=exceptions.get(key);
  if (exception != null) {
    return exception.booleanValue();
  }
  return isDefaultSelected(object);
}

Fixed version (ground truth):
/** 
 * If the given item is marked as an exception, return the exception value. Otherwise, return the value of isDefaultSelected for the given item.
 */
@Override public boolean isSelected(T item){
  resolveChanges();
  Object key=getKey(item);
  Boolean exception=exceptions.get(key);
  if (exception != null) {
    return exception.booleanValue();
  }
  return isDefaultSelected(item);
}
Program: 53635
Project: 53635
Buggy source:
private void resolveChanges(){
  boolean changed=false;
  for (  Map.Entry<T,Boolean> entry : selectionChanges.entrySet()) {
    T object=entry.getKey();
    boolean selected=entry.getValue();
    boolean defaultSelected=isDefaultSelected(object);
    Object key=getKey(object);
    Boolean previousException=exceptions.get(key);
    if (defaultSelected == selected) {
      if (previousException != null) {
        exceptions.remove(key);
        changed=true;
      }
    }
 else {
      if (previousException != Boolean.valueOf(selected)) {
        exceptions.put(key,selected);
        changed=true;
      }
    }
  }
  selectionChanges.clear();
  if (changed) {
    SelectionChangeEvent.fire(this);
  }
}

Fixed version (ground truth):
private void resolveChanges(){
  boolean changed=false;
  for (  Map.Entry<Object,SelectionChange<T>> entry : selectionChanges.entrySet()) {
    Object key=entry.getKey();
    SelectionChange<T> value=entry.getValue();
    T item=value.getItem();
    boolean selected=value.isSelected();
    boolean defaultSelected=isDefaultSelected(item);
    Boolean previousException=exceptions.get(key);
    if (defaultSelected == selected) {
      if (previousException != null) {
        exceptions.remove(key);
        changed=true;
      }
    }
 else {
      if (previousException != Boolean.valueOf(selected)) {
        exceptions.put(key,selected);
        changed=true;
      }
    }
  }
  selectionChanges.clear();
  if (changed) {
    SelectionChangeEvent.fire(this);
  }
}
Program: 53636
Project: 53636
Buggy source:
/** 
 * Constructs a DefaultSelectionModel with the given key provider.
 * @param keyProvider an instance of ProvidesKey<T>, or null if the recordobject should act as its own key
 */
public DefaultSelectionModel(ProvidesKey<T> keyProvider){
  super(keyProvider);
}

Fixed version (ground truth):
/** 
 * Constructs a DefaultSelectionModel with the given key provider.
 * @param keyProvider an instance of ProvidesKey<T>, or null if the itemshould act as its own key
 */
public DefaultSelectionModel(ProvidesKey<T> keyProvider){
  super(keyProvider);
}
Program: 53637
Project: 53637
Buggy source:
@Override public void setSelected(T object,boolean selected){
  selectionChanges.put(object,selected);
  scheduleSelectionChangeEvent();
}

Fixed version (ground truth):
@Override public void setSelected(T item,boolean selected){
  selectionChanges.put(getKey(item),new SelectionChange<T>(item,selected));
  scheduleSelectionChangeEvent();
}
Program: 53638
Project: 53638
Buggy source:
/** 
 * Construct a MultiSelectionModel with the given key provider and implementations of selectedSet and selectionChanges. Different implementations allow for enforcing order on selection.
 * @param keyProvider an instance of ProvidesKey<T>, or null if the recordobject should act as its own key
 * @param selectedSet an instance of Map
 * @param selectionChanges an instance of Map
 */
MultiSelectionModel(ProvidesKey<T> keyProvider,Map<Object,T> selectedSet,Map<T,Boolean> selectionChanges){
  super(keyProvider);
  this.selectedSet=selectedSet;
  this.selectionChanges=selectionChanges;
}

Fixed version (ground truth):
/** 
 * Construct a MultiSelectionModel with the given key provider and implementations of selectedSet and selectionChanges. Different implementations allow for enforcing order on selection.
 * @param keyProvider an instance of ProvidesKey<T>, or null if the itemshould act as its own key
 * @param selectedSet an instance of Map
 * @param selectionChanges an instance of Map
 */
MultiSelectionModel(ProvidesKey<T> keyProvider,Map<Object,T> selectedSet,Map<Object,SelectionChange<T>> selectionChanges){
  super(keyProvider);
  this.selectedSet=selectedSet;
  this.selectionChanges=selectionChanges;
}
Program: 53639
Project: 53639
Buggy source:
/** 
 * Deselect all selected values.
 */
public void clear(){
  selectionChanges.clear();
  for (  T value : selectedSet.values()) {
    selectionChanges.put(value,false);
  }
  scheduleSelectionChangeEvent();
}

Fixed version (ground truth):
/** 
 * Deselect all selected values.
 */
public void clear(){
  selectionChanges.clear();
  for (  T value : selectedSet.values()) {
    selectionChanges.put(getKey(value),new SelectionChange<T>(value,false));
  }
  scheduleSelectionChangeEvent();
}
Program: 53640
Project: 53640
Buggy source:
@Override public boolean isSelected(T object){
  resolveChanges();
  return selectedSet.containsKey(getKey(object));
}

Fixed version (ground truth):
@Override public boolean isSelected(T item){
  resolveChanges();
  return selectedSet.containsKey(getKey(item));
}
Program: 53641
Project: 53641
Buggy source:
void resolveChanges(){
  if (selectionChanges.isEmpty()) {
    return;
  }
  boolean changed=false;
  for (  Map.Entry<T,Boolean> entry : selectionChanges.entrySet()) {
    T object=entry.getKey();
    boolean selected=entry.getValue();
    Object key=getKey(object);
    T oldValue=selectedSet.get(key);
    if (selected) {
      selectedSet.put(key,object);
      Object oldKey=getKey(oldValue);
      if (!changed) {
        changed=(oldKey == null) ? (key != null) : !oldKey.equals(key);
      }
    }
 else {
      if (oldValue != null) {
        selectedSet.remove(key);
        changed=true;
      }
    }
  }
  selectionChanges.clear();
  if (changed) {
    SelectionChangeEvent.fire(this);
  }
}

Fixed version (ground truth):
void resolveChanges(){
  if (selectionChanges.isEmpty()) {
    return;
  }
  boolean changed=false;
  for (  Map.Entry<Object,SelectionChange<T>> entry : selectionChanges.entrySet()) {
    Object key=entry.getKey();
    SelectionChange<T> value=entry.getValue();
    boolean selected=value.isSelected;
    T oldValue=selectedSet.get(key);
    if (selected) {
      selectedSet.put(key,value.item);
      Object oldKey=getKey(oldValue);
      if (!changed) {
        changed=(oldKey == null) ? (key != null) : !oldKey.equals(key);
      }
    }
 else {
      if (oldValue != null) {
        selectedSet.remove(key);
        changed=true;
      }
    }
  }
  selectionChanges.clear();
  if (changed) {
    SelectionChangeEvent.fire(this);
  }
}
Program: 53642
Project: 53642
Buggy source:
/** 
 * Get the set of selected items as a copy.
 * @return the set of selected items
 */
public Set<T> getSelectedSet(){
  resolveChanges();
  return new HashSet<T>(selectedSet.values());
}

Fixed version (ground truth):
/** 
 * Get the set of selected items as a copy. If multiple selected items share the same key, only the last selected item is included in the set.
 * @return the set of selected items
 */
public Set<T> getSelectedSet(){
  resolveChanges();
  return new HashSet<T>(selectedSet.values());
}
Program: 53643
Project: 53643
Buggy source:
/** 
 * Gets the object that was last selected.
 * @return the last selected object
 */
public T getLastSelectedObject(){
  return lastSelection;
}

Fixed version (ground truth):
/** 
 * Gets the item that was last selected.
 * @return the last selected item
 */
public T getLastSelectedObject(){
  return lastSelection;
}
Program: 53644
Project: 53644
Buggy source:
public void setSelected(T object,boolean selected){
  Object key=getKey(object);
  if (selected) {
    lastSelection=object;
    lastKey=key;
  }
 else   if (lastKey != null && lastKey.equals(key)) {
    lastSelection=null;
    lastKey=null;
  }
  scheduleSelectionChangeEvent();
}

Fixed version (ground truth):
@Override public void setSelected(T item,boolean selected){
  Object key=getKey(item);
  if (selected) {
    lastSelection=item;
    lastKey=key;
  }
 else   if (lastKey != null && lastKey.equals(key)) {
    lastSelection=null;
    lastKey=null;
  }
  scheduleSelectionChangeEvent();
}
Program: 53645
Project: 53645
Buggy source:
/** 
 * Constructs a NoSelectionModel with the given key provider.
 * @param keyProvider an instance of ProvidesKey<T>, or null if the recordobject should act as its own key
 */
public NoSelectionModel(ProvidesKey<T> keyProvider){
  super(keyProvider);
}

Fixed version (ground truth):
/** 
 * Constructs a NoSelectionModel with the given key provider.
 * @param keyProvider an instance of ProvidesKey<T>, or null if the itemshould act as its own key
 */
public NoSelectionModel(ProvidesKey<T> keyProvider){
  super(keyProvider);
}
Program: 53646
Project: 53646
Buggy source:
public boolean isSelected(T object){
  return false;
}

Fixed version (ground truth):
@Override public boolean isSelected(T item){
  return false;
}
Program: 53647
Project: 53647
Buggy source:
public native void selectRemoveOption(SelectElement select,int index);

Fixed version (ground truth):
@Override public native void selectRemoveOption(SelectElement select,int index);
Program: 53648
Project: 53648
Buggy source:
public int getScrollLeft(Element elem){
  int left=getScrollLeftImpl(elem);
  if (isRTL(elem)) {
    left=-left;
  }
  return left;
}

Fixed version (ground truth):
@Override public int getScrollLeft(Element elem){
  int left=getScrollLeftImpl(elem);
  if (isRTL(elem)) {
    left=-left;
  }
  return left;
}
Program: 53649
Project: 53649
Buggy source:
/** 
 * Get the z-index css property.
 */
public final String getZIndex(){
  return getProperty(STYLE_Z_INDEX);
}

Fixed version (ground truth):
/** 
 * Get the z-index css property.
 */
public final String getZIndex(){
  return DOMImpl.impl.getNumericStyleProperty(this,STYLE_Z_INDEX);
}