nus-yam/ex-repair huggingface dataset:
Program: 91153
Project: 91153
Buggy source:
public static void record(){
  try {
    GlobalScreen.registerNativeHook();
  }
 catch (  NativeHookException nhx) {
    System.err.println("String_Node_Str");
    System.err.println(nhx.getMessage());
    System.exit(1);
  }
  System.out.println(root);
  time=System.nanoTime();
  GlobalScreen.getInstance().addNativeKeyListener(new KeyRecorder(root + file));
  GlobalScreen.getInstance().addNativeMouseListener(new MouseRecorder(root + file));
  GlobalScreen.getInstance().addNativeMouseMotionListener(new MouseRecorder(root + file));
  GlobalScreen.getInstance().addNativeMouseWheelListener(new ScrollRecorder(root + file));
  while (GlobalScreen.isNativeHookRegistered()) {
  }
  UI.gui.resetIcon();
  UI.gui.setState(Frame.NORMAL);
}

Fixed version (ground truth):
public static void record(){
  try {
    GlobalScreen.registerNativeHook();
  }
 catch (  NativeHookException nhx) {
    System.err.println("String_Node_Str");
    System.err.println(nhx.getMessage());
    System.exit(1);
  }
  System.out.println(root);
  time=System.nanoTime();
  KeyRecorder keyListener=new KeyRecorder(root + file);
  MouseRecorder mouseListener=new MouseRecorder(root + file);
  MouseRecorder mouseMotionListener=new MouseRecorder(root + file);
  ScrollRecorder mouseWheelListener=new ScrollRecorder(root + file);
  GlobalScreen.getInstance().addNativeKeyListener(keyListener);
  GlobalScreen.getInstance().addNativeMouseListener(mouseListener);
  GlobalScreen.getInstance().addNativeMouseMotionListener(mouseMotionListener);
  GlobalScreen.getInstance().addNativeMouseWheelListener(mouseWheelListener);
  while (GlobalScreen.isNativeHookRegistered()) {
  }
  GlobalScreen.getInstance().removeNativeKeyListener(keyListener);
  GlobalScreen.getInstance().removeNativeMouseListener(mouseListener);
  GlobalScreen.getInstance().removeNativeMouseMotionListener(mouseMotionListener);
  GlobalScreen.getInstance().removeNativeMouseWheelListener(mouseWheelListener);
  UI.gui.resetIcon();
  UI.gui.setState(Frame.NORMAL);
}
Program: 91154
Project: 91154
Buggy source:
@Override public void nativeMouseDragged(NativeMouseEvent e){
  if (MouseRecorder.mousePressed) {
    nativeMouseMoved(e);
  }
}

Fixed version (ground truth):
@Override public void nativeMouseDragged(NativeMouseEvent e){
  nativeMouseMoved(e);
}
Program: 91155
Project: 91155
Buggy source:
@Override public void nativeMouseReleased(NativeMouseEvent e){
  MouseRecorder.mousePressed=false;
  try {
    long time=System.nanoTime();
    long prevTime=MainRecorder.getTime();
    MainRecorder.setTime(time);
    time=Math.abs(time - prevTime);
    int timeMs=(int)(time / MainRecorder.convertRate);
    BufferedWriter out=new BufferedWriter(new FileWriter(filepath,true));
    int button=e.getButton();
    if (button == 2) {
      button=3;
    }
 else     if (button == 3) {
      button=2;
    }
    out.write("String_Node_Str" + button);
    out.newLine();
    out.write("String_Node_Str" + timeMs);
    out.newLine();
    out.close();
  }
 catch (  IOException iox) {
    System.err.println("String_Node_Str");
    System.err.println(iox.getMessage());
    try {
      BufferedWriter out=new BufferedWriter(new FileWriter("String_Node_Str",true));
      out.write("String_Node_Str");
      out.newLine();
      out.close();
    }
 catch (    IOException idox) {
    }
    System.exit(1);
  }
}

Fixed version (ground truth):
@Override public void nativeMouseReleased(NativeMouseEvent e){
  try {
    long time=System.nanoTime();
    long prevTime=MainRecorder.getTime();
    MainRecorder.setTime(time);
    time=Math.abs(time - prevTime);
    int timeMs=(int)(time / MainRecorder.convertRate);
    BufferedWriter out=new BufferedWriter(new FileWriter(filepath,true));
    int button=e.getButton();
    if (button == 2) {
      button=3;
    }
 else     if (button == 3) {
      button=2;
    }
    out.write("String_Node_Str" + button);
    out.newLine();
    out.write("String_Node_Str" + timeMs);
    out.newLine();
    out.close();
  }
 catch (  IOException iox) {
    System.err.println("String_Node_Str");
    System.err.println(iox.getMessage());
    try {
      BufferedWriter out=new BufferedWriter(new FileWriter("String_Node_Str",true));
      out.write("String_Node_Str");
      out.newLine();
      out.close();
    }
 catch (    IOException idox) {
    }
    System.exit(1);
  }
}
Program: 91156
Project: 91156
Buggy source:
@Override public void nativeMousePressed(NativeMouseEvent e){
  MouseRecorder.mousePressed=true;
  try {
    long time=System.nanoTime();
    long prevTime=MainRecorder.getTime();
    MainRecorder.setTime(time);
    time=Math.abs(time - prevTime);
    int timeMs=(int)(time / MainRecorder.convertRate);
    BufferedWriter out=new BufferedWriter(new FileWriter(filepath,true));
    int button=e.getButton();
    if (button == 2) {
      button=3;
    }
 else     if (button == 3) {
      button=2;
    }
    out.write("String_Node_Str" + button);
    out.newLine();
    out.write("String_Node_Str" + timeMs);
    out.newLine();
    out.close();
  }
 catch (  IOException iox) {
    System.err.println("String_Node_Str");
    System.err.println(iox.getMessage());
    try {
      BufferedWriter out=new BufferedWriter(new FileWriter("String_Node_Str",true));
      out.write("String_Node_Str");
      out.newLine();
      out.close();
    }
 catch (    IOException idox) {
    }
    System.exit(1);
  }
}

Fixed version (ground truth):
@Override public void nativeMousePressed(NativeMouseEvent e){
  try {
    long time=System.nanoTime();
    long prevTime=MainRecorder.getTime();
    MainRecorder.setTime(time);
    time=Math.abs(time - prevTime);
    int timeMs=(int)(time / MainRecorder.convertRate);
    BufferedWriter out=new BufferedWriter(new FileWriter(filepath,true));
    int button=e.getButton();
    if (button == 2) {
      button=3;
    }
 else     if (button == 3) {
      button=2;
    }
    out.write("String_Node_Str" + button);
    out.newLine();
    out.write("String_Node_Str" + timeMs);
    out.newLine();
    out.close();
  }
 catch (  IOException iox) {
    System.err.println("String_Node_Str");
    System.err.println(iox.getMessage());
    try {
      BufferedWriter out=new BufferedWriter(new FileWriter("String_Node_Str",true));
      out.write("String_Node_Str");
      out.newLine();
      out.close();
    }
 catch (    IOException idox) {
    }
    System.exit(1);
  }
}
Program: 91157
Project: 91157
Buggy source:
@Override public void nativeMouseWheelMoved(NativeMouseWheelEvent e){
  try {
    BufferedWriter out=new BufferedWriter(new FileWriter(filepath,true));
    int notch=e.getWheelRotation();
    out.write("String_Node_Str" + notch);
    out.newLine();
    out.close();
  }
 catch (  IOException iox) {
    System.err.println("String_Node_Str");
    System.err.println(iox.getMessage());
    System.exit(1);
  }
}

Fixed version (ground truth):
@Override public void nativeMouseWheelMoved(NativeMouseWheelEvent e){
  try {
    long time=System.nanoTime();
    long prevTime=MainRecorder.getTime();
    MainRecorder.setTime(time);
    time=Math.abs(time - prevTime);
    int timeMs=(int)(time / MainRecorder.convertRate);
    BufferedWriter out=new BufferedWriter(new FileWriter(filepath,true));
    int notch=e.getWheelRotation();
    out.write("String_Node_Str" + notch);
    out.newLine();
    out.write("String_Node_Str" + timeMs);
    out.newLine();
    out.close();
  }
 catch (  IOException iox) {
    System.err.println("String_Node_Str");
    System.err.println(iox.getMessage());
    System.exit(1);
  }
}
Program: 91158
Project: 91158
Buggy source:
@Test public void shouldResolveAllDependencies() throws Exception {
  DependencyResolverMojo resolverMojo=getResolverMojo();
  resolverMojo.setProxySrcDir(proxyRoot.getPath());
  resolverMojo.setProxyDestDir(target.getPath());
  resolverMojo.setProxyRefs(new String[]{proxyRef.getPath()});
  resolverMojo.execute();
  final File policiesDir=new File(target.getPath() + "String_Node_Str");
  final File resDir=new File(target.getPath() + "String_Node_Str");
  final File jsResDir=new File(target.getPath() + "String_Node_Str");
  final File proxiesDir=new File(target.getPath() + "String_Node_Str");
  assertThat(policiesDir.exists(),is(true));
  assertThat(resDir.exists(),is(true));
  assertThat(jsResDir.exists(),is(true));
  assertThat(proxiesDir.exists(),is(true));
  assertThat(new File(policiesDir,"String_Node_Str").exists(),is(false));
  assertThat(new File(resDir,"String_Node_Str").exists(),is(true));
  assertThat(policiesDir.list().length,is(61));
  assertPolicies(policiesDir);
}

Fixed version (ground truth):
@Test public void shouldResolveAllDependencies() throws Exception {
  DependencyResolverMojo resolverMojo=getResolverMojo();
  resolverMojo.setProxySrcDir(proxyRoot.getPath());
  resolverMojo.setProxyDestDir(target.getPath());
  resolverMojo.setProxyRefs(new String[]{proxyRef.getPath()});
  resolverMojo.execute();
  final File policiesDir=new File(target.getPath() + "String_Node_Str");
  final File resDir=new File(target.getPath() + "String_Node_Str");
  final File jsResDir=new File(target.getPath() + "String_Node_Str");
  final File proxiesDir=new File(target.getPath() + "String_Node_Str");
  assertThat(policiesDir.exists(),is(true));
  assertThat(resDir.exists(),is(true));
  assertThat(jsResDir.exists(),is(true));
  assertThat(proxiesDir.exists(),is(true));
  assertThat(new File(policiesDir,"String_Node_Str").exists(),is(false));
  assertThat(new File(resDir,"String_Node_Str").exists(),is(true));
  assertThat(policiesDir.list().length,is(61));
  assertPolicies(policiesDir);
  assertJSFiles(jsResDir);
}
Program: 91159
Project: 91159
Buggy source:
@Test public void shouldResolveAllDependencies() throws Exception {
  DependencyResolverMojo resolverMojo=getResolverMojo();
  resolverMojo.setProxySrcDir(proxyRoot.getPath());
  resolverMojo.setProxyDestDir(target.getPath());
  resolverMojo.setProxyRefs(new String[]{proxyRef.getPath()});
  resolverMojo.execute();
  final File policiesDir=new File(target.getPath() + "String_Node_Str");
  final File resDir=new File(target.getPath() + "String_Node_Str");
  final File jsResDir=new File(target.getPath() + "String_Node_Str");
  final File proxiesDir=new File(target.getPath() + "String_Node_Str");
  assertThat(policiesDir.exists(),is(true));
  assertThat(resDir.exists(),is(true));
  assertThat(jsResDir.exists(),is(true));
  assertThat(proxiesDir.exists(),is(true));
  assertThat(new File(policiesDir,"String_Node_Str").exists(),is(false));
  assertThat(new File(resDir,"String_Node_Str").exists(),is(true));
  assertThat(policiesDir.list().length,is(61));
  assertPolicies(policiesDir);
}

Fixed version (ground truth):
@Test public void shouldResolveAllDependencies() throws Exception {
  DependencyResolverMojo resolverMojo=getResolverMojo();
  resolverMojo.setProxySrcDir(proxyRoot.getPath());
  resolverMojo.setProxyDestDir(target.getPath());
  resolverMojo.setProxyRefs(new String[]{proxyRef.getPath()});
  resolverMojo.execute();
  final File policiesDir=new File(target.getPath() + "String_Node_Str");
  final File resDir=new File(target.getPath() + "String_Node_Str");
  final File jsResDir=new File(target.getPath() + "String_Node_Str");
  final File proxiesDir=new File(target.getPath() + "String_Node_Str");
  assertThat(policiesDir.exists(),is(true));
  assertThat(resDir.exists(),is(true));
  assertThat(jsResDir.exists(),is(true));
  assertThat(proxiesDir.exists(),is(true));
  assertThat(new File(policiesDir,"String_Node_Str").exists(),is(false));
  assertThat(new File(resDir,"String_Node_Str").exists(),is(true));
  assertThat(policiesDir.list().length,is(61));
  assertPolicies(policiesDir);
  assertJSFiles(jsResDir);
}
Program: 91161
Project: 91161
Buggy source:
/** 
 * @return the methods overridden by given method declaration 
 */
public static List<Method> findOverriddenMethods(MethodDeclaration md){
  final List<Method> methods=new ArrayList<Method>();
  collectOverriddenMethods(md,methods);
  return methods.isEmpty() ? Collections.<Method>emptyList() : Collections.unmodifiableList(methods);
}

Fixed version (ground truth):
/** 
 * Returns the methods overridden by given method declaration
 * @param md the method declaration
 * @return the methods overridden by given method declaration
 */
public static List<Method> findOverriddenMethods(MethodDeclaration md){
  final List<Method> methods=new ArrayList<Method>();
  collectOverriddenMethods(md,methods);
  return methods.isEmpty() ? Collections.<Method>emptyList() : Collections.unmodifiableList(methods);
}
Program: 91162
Project: 91162
Buggy source:
/** 
 * @return true if method declaration overrides or implements another method 
 */
public static boolean isMethodOverride(MethodDeclaration md){
  return collectOverriddenMethods(md,null);
}

Fixed version (ground truth):
/** 
 * Returns if a method declaration overrides or implements another method.
 * @param md the method declaration
 * @return true if method declaration overrides or implements another method
 */
public static boolean isMethodOverride(MethodDeclaration md){
  return collectOverriddenMethods(md,null);
}
Program: 91163
Project: 91163
Buggy source:
/** 
 * Sets the type of the method call arguments. In case of foo(1) => int foo(1, 1, 1) => int, int, int Then according the analyzed method, analyzes it can be called from the types. foo(int.. x) foo(int x) foo(Object x)
 * @param typeArgs
 */
public void setTypeArgs(SymbolType[] typeArgs){
  this.typeArgs=typeArgs;
}

Fixed version (ground truth):
/** 
 * Sets the type of the method call arguments. In case of For foo(1) returns int For foo(1, 1, 1) returns int, int, int Then according the analyzed method, analyzes it can be called from the types. foo(int.. x) foo(int x) foo(Object x)
 * @param typeArgs the type of the method call arguments.
 */
public void setTypeArgs(SymbolType[] typeArgs){
  this.typeArgs=typeArgs;
}
Program: 91164
Project: 91164
Buggy source:
/** 
 * @return intersection of raw types of classes and all super classes and interfaces 
 */
public static List<? extends Class<?>> intersectRawTypes(Class<?> clazz1,Class<?> clazz2){
  if (clazz2 == null) {
    clazz2=Object.class;
  }
  if (clazz1 == null) {
    clazz1=Object.class;
  }
  if (clazz1.isPrimitive()) {
    clazz1=Types.getWrapperClass(clazz1.getName());
  }
  if (clazz2.isPrimitive()) {
    clazz2=Types.getWrapperClass(clazz2.getName());
  }
  if (clazz1.equals(clazz2)) {
    return singletonList(clazz1);
  }
  if (Types.isAssignable(clazz2,clazz1)) {
    return singletonList(clazz1);
  }
  if (Types.isAssignable(clazz1,clazz2)) {
    return singletonList(clazz2);
  }
  final Set<Class<?>> common=commonClasses(clazz1,clazz2);
  final List<Class<?>> list=list(removeSubClasses(common));
  return list.isEmpty() ? LIST_OF_OBJECT_CLASS : list;
}

Fixed version (ground truth):
/** 
 * Looks for intersection of raw types of classes and all super classes and interfaces.
 * @param clazz1 one of the classes to intersect
 * @param clazz2 one of the classes to intersect
 * @return intersection of raw types of classes and all super classes and interfaces
 */
public static List<? extends Class<?>> intersectRawTypes(Class<?> clazz1,Class<?> clazz2){
  if (clazz2 == null) {
    clazz2=Object.class;
  }
  if (clazz1 == null) {
    clazz1=Object.class;
  }
  if (clazz1.isPrimitive()) {
    clazz1=Types.getWrapperClass(clazz1.getName());
  }
  if (clazz2.isPrimitive()) {
    clazz2=Types.getWrapperClass(clazz2.getName());
  }
  if (clazz1.equals(clazz2)) {
    return singletonList(clazz1);
  }
  if (Types.isAssignable(clazz2,clazz1)) {
    return singletonList(clazz1);
  }
  if (Types.isAssignable(clazz1,clazz2)) {
    return singletonList(clazz2);
  }
  final Set<Class<?>> common=commonClasses(clazz1,clazz2);
  final List<Class<?>> list=list(removeSubClasses(common));
  return list.isEmpty() ? LIST_OF_OBJECT_CLASS : list;
}
Program: 91165
Project: 91165
Buggy source:
/** 
 * @deprecated use {@link #intersectRawTypes} 
 */
@Deprecated public static List<Class<?>> getTheNearestSuperClasses(List<Class<?>> classes,List<Class<?>> otherClasses){
  return new ArrayList<>(intersectRawTypes(classes,otherClasses));
}

Fixed version (ground truth):
/** 
 * Looks for intersection of raw types of classes and all super classes and interfaces
 * @deprecated use {@link #intersectRawTypes}
 * @param classes the first set of classes to intersect
 * @param otherClasses the second set of classes to intersect
 * @return #interectRawTypes(classes, otherClasses)
 */
@Deprecated public static List<Class<?>> getTheNearestSuperClasses(List<Class<?>> classes,List<Class<?>> otherClasses){
  return new ArrayList<>(intersectRawTypes(classes,otherClasses));
}
Program: 91166
Project: 91166
Buggy source:
/** 
 * @deprecated use {@link #intersectRawTypes} 
 */
@Deprecated public static Class<?> getTheNearestSuperClass(Class<?> clazz1,Class<?> clazz2){
  return intersectRawTypes(clazz1,clazz2).get(0);
}

Fixed version (ground truth):
/** 
 * Looks for intersection of raw types of classes and all super classes and interfaces
 * @param clazz1 one of the classes to intersect.
 * @param clazz2 one of the classes to intersect.
 * @deprecated use {@link #intersectRawTypes}
 * @return #interectRawTypes(clazz1, clazz2).get(0)
 */
@Deprecated public static Class<?> getTheNearestSuperClass(Class<?> clazz1,Class<?> clazz2){
  return intersectRawTypes(clazz1,clazz2).get(0);
}
Program: 91167
Project: 91167
Buggy source:
/** 
 * For anonymous creations the initial symbol data is symbol data of super class. That needs to be replaced with symbol data of anonymous class. If we don't have symbol data we assume we need one. ;-)
 */
public static boolean needsSymbolData(ObjectCreationExpr n){
  final SymbolType st=symbolDataType(n);
  return st == null || !st.isLoadedAnonymousClass();
}

Fixed version (ground truth):
/** 
 * For anonymous creations the initial symbol data is symbol data of super class. That needs to be replaced with symbol data of anonymous class. If we don't have symbol data we assume we need one. ;-)
 * @param n object creation expression
 * @return if the expression does NOT contains a resolved type
 */
public static boolean needsSymbolData(ObjectCreationExpr n){
  final SymbolType st=symbolDataType(n);
  return st == null || !st.isLoadedAnonymousClass();
}
Program: 91168
Project: 91168
Buggy source:
public SymbolType cloneAsTypeVariable(String typeVariable){
  return clone(name != null ? name : name(upperBounds,lowerBounds),arrayCount,typeVariable,null,null);
}

Fixed version (ground truth):
public SymbolType cloneAsTypeVariable(String typeVariable){
  return clone(marker,name != null ? name : name(upperBounds,lowerBounds),arrayCount,typeVariable,null,null);
}
Program: 91169
Project: 91169
Buggy source:
/** 
 * clone with name replaced 
 */
public SymbolType withName(String name){
  return clone(name,arrayCount,typeVariable,null,null);
}

Fixed version (ground truth):
/** 
 * clone with name replaced 
 */
public SymbolType withName(String name){
  return clone(marker,name,arrayCount,typeVariable,null,null);
}
Program: 91170
Project: 91170
Buggy source:
private static String name(List<SymbolType> upperBounds,List<SymbolType> lowerBounds){
  String name=null;
  if (upperBounds != null && !upperBounds.isEmpty()) {
    name=upperBounds.get(0).getName();
  }
 else   if (lowerBounds != null) {
    name="String_Node_Str";
  }
  return name;
}

Fixed version (ground truth):
private static String name(List<SymbolType> upperBounds,List<SymbolType> lowerBounds){
  String name=null;
  if (upperBounds != null) {
    if (!upperBounds.isEmpty()) {
      name=upperBounds.get(0).getName();
    }
  }
 else   if (lowerBounds != null) {
    name="String_Node_Str";
  }
  return name;
}
Program: 91171
Project: 91171
Buggy source:
private SymbolType(String name,int arrayCount){
  this.name=name;
  this.arrayCount=arrayCount;
}

Fixed version (ground truth):
private SymbolType(String name,int arrayCount){
  this(Marker.None,name);
  this.arrayCount=arrayCount;
}
Program: 91172
Project: 91172
Buggy source:
public SymbolType cloneAsArray(String name,int arrayCount){
  return clone(name,arrayCount,typeVariable,null,null);
}

Fixed version (ground truth):
public SymbolType cloneAsArray(String name,int arrayCount){
  return clone(marker,name,arrayCount,typeVariable,null,null);
}
Program: 91174
Project: 91174
Buggy source:
@Override public Scope visit(EnumConstantDeclaration n,SymbolTable symbolTable){
  final Symbol<?> s=symbolTable.findSymbol(n.getName(),ReferenceType.ENUM_LITERAL);
  s.setInnerScope(new Scope(s));
  symbolTable.pushScope(s.getInnerScope());
  SymbolType parentType=symbolTable.getType("String_Node_Str",ReferenceType.VARIABLE);
  List<SymbolAction> actions=new LinkedList<SymbolAction>();
  actions.add(new LoadTypeParamsAction());
  actions.add(new LoadTypeDeclarationsAction(typeTable));
  actions.add(new LoadFieldDeclarationsAction(actionProvider));
  actions.add(new LoadMethodDeclarationsAction(actionProvider,expressionTypeAnalyzer));
  if (actionProvider != null) {
    actions.addAll(actionProvider.getActions(n));
  }
  symbolTable.pushSymbol("String_Node_Str",ReferenceType.VARIABLE,parentType,n.getParentNode(),(List<SymbolAction>)null);
  String name=symbolTable.generateAnonymousClass();
  final SymbolType type=new SymbolType(name);
  symbolTable.pushSymbol(name,ReferenceType.TYPE,type,n,actions);
  symbolTable.pushSymbol("String_Node_Str",ReferenceType.VARIABLE,type,n,actions);
  n.setSymbolData(type);
  symbolTable.popScope(true);
  return s.getInnerScope();
}

Fixed version (ground truth):
@Override public Scope visit(EnumConstantDeclaration n,SymbolTable symbolTable){
  final Symbol<?> s=symbolTable.findSymbol(n.getName(),ReferenceType.ENUM_LITERAL);
  s.setInnerScope(new Scope(s));
  symbolTable.pushScope(s.getInnerScope());
  SymbolType parentType=symbolTable.getType("String_Node_Str",ReferenceType.VARIABLE);
  List<SymbolAction> actions=new LinkedList<SymbolAction>();
  actions.add(new LoadTypeParamsAction());
  actions.add(new LoadTypeDeclarationsAction(typeTable));
  actions.add(new LoadFieldDeclarationsAction(actionProvider));
  actions.add(new LoadMethodDeclarationsAction(actionProvider,expressionTypeAnalyzer));
  if (actionProvider != null) {
    actions.addAll(actionProvider.getActions(n));
  }
  symbolTable.pushSymbol("String_Node_Str",ReferenceType.VARIABLE,parentType,n.getParentNode(),(List<SymbolAction>)null);
  String name=symbolTable.generateAnonymousClass();
  final SymbolType type=SymbolType.enumConstantOf(name);
  symbolTable.pushSymbol(name,ReferenceType.TYPE,type,n,actions);
  symbolTable.pushSymbol("String_Node_Str",ReferenceType.VARIABLE,type,n,actions);
  n.setSymbolData(type);
  symbolTable.popScope(true);
  return s.getInnerScope();
}
Program: 91175
Project: 91175
Buggy source:
public void setTypeArgs(SymbolType[] typeArgs){
  this.typeArgs=typeArgs;
}

Fixed version (ground truth):
/** 
 * Sets the type of the method call arguments. In case of foo(1) => int foo(1, 1, 1) => int, int, int Then according the analyzed method, analyzes it can be called from the types. foo(int.. x) foo(int x) foo(Object x)
 * @param typeArgs
 */
public void setTypeArgs(SymbolType[] typeArgs){
  this.typeArgs=typeArgs;
}
Program: 91178
Project: 91178
Buggy source:
@Test public void testRawTypes() throws Exception {
  compile("String_Node_Str");
  SymbolTable symTable=getSymbolTable();
  symTable.pushScope();
  SymbolType st=new SymbolType(getClassLoader().loadClass("String_Node_Str"));
  symTable.pushSymbol("String_Node_Str",ReferenceType.VARIABLE,st,null);
  FieldAccessExpr expr=(FieldAccessExpr)ASTManager.parse(Expression.class,"String_Node_Str");
  HashMap<String,Object> ctx=new HashMap<String,Object>();
  expressionAnalyzer.visit(expr,ctx);
  SymbolType type=(SymbolType)expr.getSymbolData();
  Assert.assertNotNull(type);
  Assert.assertEquals("String_Node_Str",type.getName());
  Assert.assertNotNull(type.getParameterizedTypes());
  Assert.assertEquals("String_Node_Str",type.getParameterizedTypes().get(0).getName());
}

Fixed version (ground truth):
@Test public void testRawTypes() throws Exception {
  compile("String_Node_Str" + "String_Node_Str");
  SymbolTable symTable=getSymbolTable();
  symTable.pushScope();
  SymbolType st=new SymbolType(getClassLoader().loadClass("String_Node_Str"));
  symTable.pushSymbol("String_Node_Str",ReferenceType.VARIABLE,st,null);
  SymbolType qualified=getSymbolType("String_Node_Str");
  Assert.assertNotNull(qualified);
  Assert.assertEquals("String_Node_Str",qualified.getName());
  Assert.assertNotNull(qualified.getParameterizedTypes());
  Assert.assertEquals("String_Node_Str",qualified.getParameterizedTypes().get(0).getName());
  FieldAccessExpr expr=(FieldAccessExpr)ASTManager.parse(Expression.class,"String_Node_Str");
  HashMap<String,Object> ctx=new HashMap<String,Object>();
  expressionAnalyzer.visit(expr,ctx);
  SymbolType type=(SymbolType)expr.getSymbolData();
  Assert.assertNotNull(type);
  Assert.assertEquals("String_Node_Str",type.getName());
  Assert.assertNull(type.getParameterizedTypes());
}
Program: 91179
Project: 91179
Buggy source:
@Override public String toString(){
  StringBuffer result=new StringBuffer();
  result.append(name);
  if (parameterizedTypes != null) {
    result.append("String_Node_Str");
    Iterator<? extends SymbolData> it=parameterizedTypes.iterator();
    while (it.hasNext()) {
      SymbolType next=(SymbolType)it.next();
      result.append(next.toString());
      if (it.hasNext()) {
        result.append("String_Node_Str");
      }
    }
    result.append("String_Node_Str");
  }
  for (int i=0; i < arrayCount; i++) {
    result.append("String_Node_Str");
  }
  return result.toString();
}

Fixed version (ground truth):
@Override public String toString(){
  StringBuffer result=new StringBuffer();
  addString(result,new ArrayDeque<SymbolType>());
  return result.toString();
}
Program: 91180
Project: 91180
Buggy source:
@Override public String toString(){
  StringBuffer result=new StringBuffer();
  result.append(name);
  if (parameterizedTypes != null) {
    result.append("String_Node_Str");
    Iterator<? extends SymbolData> it=parameterizedTypes.iterator();
    while (it.hasNext()) {
      SymbolType next=(SymbolType)it.next();
      result.append(next.toString());
      if (it.hasNext()) {
        result.append("String_Node_Str");
      }
    }
    result.append("String_Node_Str");
  }
  for (int i=0; i < arrayCount; i++) {
    result.append("String_Node_Str");
  }
  return result.toString();
}

Fixed version (ground truth):
@Override public String toString(){
  StringBuffer result=new StringBuffer();
  addString(result,new ArrayDeque<SymbolType>());
  return result.toString();
}
Program: 91184
Project: 91184
Buggy source:
@Override public SymbolData merge(SymbolData other){
  SymbolType result=null;
  if (other == null) {
    result=this;
  }
 else {
    if (other.getArrayCount() == getArrayCount()) {
      List<Class<?>> bounds=ClassInspector.getTheNearestSuperClasses(getBoundClasses(),other.getBoundClasses());
      if (bounds.isEmpty()) {
        result=null;
      }
 else       if (bounds.size() == 1) {
        result=new SymbolType(bounds.get(0));
      }
 else {
        List<SymbolType> boundsList=new LinkedList<SymbolType>();
        for (        Class<?> bound : bounds) {
          boundsList.add(new SymbolType(bound));
        }
        result=new SymbolType(boundsList);
      }
      if (result != null) {
        if (lowerBounds != null) {
          result.lowerBounds=new LinkedList<SymbolType>();
          for (          SymbolType st : lowerBounds) {
            result.lowerBounds.add(st.clone());
          }
        }
        result.arrayCount=other.getArrayCount();
      }
    }
 else {
      result=new SymbolType(Object.class);
    }
  }
  return result;
}

Fixed version (ground truth):
@Override public SymbolData merge(SymbolData other){
  SymbolType result=null;
  if (other == null || equals(other)) {
    result=this;
  }
 else {
    if (other.getArrayCount() == getArrayCount()) {
      List<Class<?>> bounds=ClassInspector.getTheNearestSuperClasses(getBoundClasses(),other.getBoundClasses());
      if (bounds.isEmpty()) {
        result=null;
      }
 else       if (bounds.size() == 1) {
        result=new SymbolType(bounds.get(0));
      }
 else {
        List<SymbolType> boundsList=new LinkedList<SymbolType>();
        for (        Class<?> bound : bounds) {
          boundsList.add(new SymbolType(bound));
        }
        result=new SymbolType(boundsList);
      }
      if (result != null) {
        if (lowerBounds != null) {
          result.lowerBounds=new LinkedList<SymbolType>();
          for (          SymbolType st : lowerBounds) {
            result.lowerBounds.add(st.clone());
          }
        }
        result.arrayCount=other.getArrayCount();
      }
    }
 else {
      result=new SymbolType(Object.class);
    }
  }
  return result;
}
Program: 91185
Project: 91185
Buggy source:
public static boolean isMoreSpecficFor(Class<?> clazz2,Class<?> clazz1,Class<?> reference){
  boolean isMethod2First=true;
  Integer order2=Types.basicTypeEvaluationOrder(clazz2);
  Integer order1=Types.basicTypeEvaluationOrder(clazz1);
  if (order1 != null && order2 != null) {
    return (order2 <= order1) || ((reference == null || !reference.isPrimitive()) && !clazz2.isPrimitive() && clazz1.isPrimitive());
  }
  boolean isAssignable=Types.isAssignable(clazz2,clazz1);
  if (!isAssignable) {
    if (Types.isAssignable(clazz1,clazz2)) {
      isMethod2First=false;
    }
 else {
      int h2=ClassInspector.getClassHierarchyHeight(clazz2);
      int h1=ClassInspector.getClassHierarchyHeight(clazz1);
      if (h1 == h2) {
        isMethod2First=clazz2 != null && clazz1 != null && clazz2.isArray() && !clazz1.isArray();
        if (!isMethod2First) {
          isMethod2First=clazz2 != null && reference != null && !clazz2.isArray() && !clazz2.isPrimitive() && clazz2.isAssignableFrom(reference);
        }
      }
 else {
        isMethod2First=h2 > h1;
      }
    }
  }
 else {
    isMethod2First=true;
  }
  return isMethod2First;
}

Fixed version (ground truth):
public static boolean isMoreSpecficFor(Class<?> clazz2,Class<?> clazz1,Class<?> reference){
  boolean isMethod2First=true;
  Integer order2=Types.basicTypeEvaluationOrder(clazz2);
  Integer order1=Types.basicTypeEvaluationOrder(clazz1);
  if (order1 != null && order2 != null) {
    return (order2 <= order1) || ((reference == null || !reference.isPrimitive()) && !clazz2.isPrimitive() && clazz1.isPrimitive());
  }
  boolean isAssignable=Types.isAssignable(clazz2,clazz1);
  if (!isAssignable) {
    if (Types.isAssignable(clazz1,clazz2)) {
      isMethod2First=false;
    }
 else {
      int h2=ClassInspector.getClassHierarchyHeight(clazz2);
      int h1=ClassInspector.getClassHierarchyHeight(clazz1);
      if (h1 == h2) {
        isMethod2First=clazz2 != null && clazz1 != null && (clazz2.isArray() && !clazz1.isArray() || (!clazz2.isInterface() && clazz1.isInterface()));
        if (!isMethod2First) {
          isMethod2First=clazz2 != null && reference != null && !clazz2.isArray() && !clazz2.isPrimitive() && clazz2.isAssignableFrom(reference);
        }
      }
 else {
        isMethod2First=h2 > h1;
      }
    }
  }
 else {
    isMethod2First=true;
  }
  return isMethod2First;
}
Program: 91186
Project: 91186
Buggy source:
public List<T> sort(T[] methods,Class<?>[] args){
  Map<String,List<T>> map=new HashMap<String,List<T>>();
  this.args=args;
  LinkedList<T> result=new LinkedList<T>();
  for (  T method : methods) {
    List<T> aux=map.get(method.getName());
    if (aux == null) {
      aux=new LinkedList<T>();
      map.put(method.getName(),aux);
    }
    aux.add(method);
  }
  Set<String> entries=map.keySet();
  for (  String entry : entries) {
    List<T> aux=map.get(entry);
    ArrayList<T> sortedList=new ArrayList<T>();
    Iterator<T> it=aux.iterator();
    while (it.hasNext()) {
      ListIterator<T> li=sortedList.listIterator(sortedList.size());
      T method=it.next();
      boolean inserted=false;
      if (sortedList.isEmpty()) {
        sortedList.add(method);
      }
 else {
        int pos=sortedList.size() - 1;
        while (!inserted && li.hasPrevious()) {
          T previous=li.previous();
          if (compare(method,previous) == 1) {
            sortedList.add(pos + 1,method);
            inserted=true;
          }
          pos--;
        }
        if (!inserted) {
          sortedList.add(0,method);
        }
      }
    }
    result.addAll(sortedList);
  }
  return result;
}

Fixed version (ground truth):
public List<T> sort(T[] methods,Class<?>[] args){
  Map<String,List<T>> map=new HashMap<String,List<T>>();
  this.args=args;
  LinkedList<T> result=new LinkedList<T>();
  for (  T method : methods) {
    List<T> aux=map.get(method.getName());
    if (aux == null) {
      aux=new LinkedList<T>();
      map.put(method.getName(),aux);
    }
    aux.add(method);
  }
  Set<String> entries=map.keySet();
  for (  String entry : entries) {
    List<T> aux=map.get(entry);
    ArrayList<T> sortedList=new ArrayList<T>();
    Iterator<T> it=aux.iterator();
    while (it.hasNext()) {
      Iterator<T> li=sortedList.iterator();
      T method=it.next();
      boolean inserted=false;
      if (sortedList.isEmpty()) {
        sortedList.add(method);
      }
 else {
        int pos=0;
        while (!inserted && li.hasNext()) {
          T previous=li.next();
          if (compare(method,previous) == -1) {
            inserted=true;
          }
 else {
            pos++;
          }
        }
        sortedList.add(pos,method);
      }
    }
    result.addAll(sortedList);
  }
  return result;
}
Program: 91188
Project: 91188
Buggy source:
public static Method getLambdaMethod(Class<?> clazz){
  if (clazz == null || clazz.equals(Object.class)) {
    return null;
  }
  if (!clazz.isInterface()) {
    return null;
  }
  Method[] declMethods=clazz.getDeclaredMethods();
  for (int i=0; i < declMethods.length; i++) {
    int modifiers=declMethods[i].getModifiers();
    if (!Modifier.isPrivate(modifiers) && !Modifier.isAbstract(modifiers) && !declMethods[i].isBridge()&& !declMethods[i].isSynthetic()&& !ModifierSet.isStatic(modifiers)) {
      return declMethods[i];
    }
  }
  return getLambdaMethod(clazz.getSuperclass());
}

Fixed version (ground truth):
public static Method getLambdaMethod(Class<?> clazz,int paramsSize){
  if (clazz == null || clazz.equals(Object.class)) {
    return null;
  }
  boolean isAbstract=Modifier.isAbstract(clazz.getModifiers());
  if (!clazz.isInterface() && !isAbstract) {
    return null;
  }
  Method[] declMethods=clazz.getDeclaredMethods();
  for (int i=0; i < declMethods.length; i++) {
    int modifiers=declMethods[i].getModifiers();
    boolean isDefault=Modifier.isPublic(modifiers) && !Modifier.isStatic(modifiers) && !Modifier.isAbstract(modifiers);
    if (!isDefault && declMethods[i].getParameters().length == paramsSize) {
      return declMethods[i];
    }
  }
  Method result=getLambdaMethod(clazz.getSuperclass(),paramsSize);
  if (isAbstract) {
    Class<?>[] interfaces=clazz.getInterfaces();
    for (int i=0; i < interfaces.length && result == null; i++) {
      result=getLambdaMethod(interfaces[i],paramsSize);
    }
  }
  return result;
}
Program: 91189
Project: 91189
Buggy source:
public static boolean isMoreSpecficFor(Class<?> clazz2,Class<?> clazz1,Class<?> reference){
  boolean isMethod2First=true;
  Integer order2=Types.basicTypeEvaluationOrder(clazz2);
  Integer order1=Types.basicTypeEvaluationOrder(clazz1);
  if (order1 != null && order2 != null) {
    return (order2 <= order1) || ((reference == null || !reference.isPrimitive()) && !clazz2.isPrimitive() && clazz1.isPrimitive());
  }
  boolean isAssignable=Types.isAssignable(clazz2,clazz1);
  if (!isAssignable) {
    if (Types.isAssignable(clazz1,clazz2)) {
      isMethod2First=false;
    }
 else {
      int h2=ClassInspector.getClassHierarchyHeight(clazz2);
      int h1=ClassInspector.getClassHierarchyHeight(clazz1);
      if (h1 == h2) {
        isMethod2First=clazz2 != null && clazz1 != null && (clazz2.isArray() && !clazz1.isArray() || (!clazz2.isInterface() && clazz1.isInterface()));
        if (!isMethod2First) {
          isMethod2First=clazz2 != null && reference != null && !clazz2.isArray() && !clazz2.isPrimitive() && clazz2.isAssignableFrom(reference);
        }
      }
 else {
        isMethod2First=h2 > h1;
      }
    }
  }
 else {
    isMethod2First=true;
  }
  return isMethod2First;
}

Fixed version (ground truth):
public static boolean isMoreSpecficFor(Class<?> clazz2,Class<?> clazz1,Class<?> reference){
  boolean isMethod2First=true;
  Integer order2=Types.basicTypeEvaluationOrder(clazz2);
  Integer order1=Types.basicTypeEvaluationOrder(clazz1);
  if (order1 != null && order2 != null) {
    if ((clazz2.isPrimitive() && clazz1.isPrimitive()) || (!clazz2.isPrimitive() && !clazz1.isPrimitive()) || reference == null) {
      return (order2 <= order1);
    }
    boolean referenceIsPrimitive=reference != null && reference.isPrimitive();
    boolean clazz2First=(referenceIsPrimitive && clazz2.isPrimitive() && !clazz1.isPrimitive()) || ((!referenceIsPrimitive) && !clazz2.isPrimitive() && clazz1.isPrimitive());
    return clazz2First;
  }
  boolean isAssignable=Types.isAssignable(clazz2,clazz1);
  if (!isAssignable) {
    if (Types.isAssignable(clazz1,clazz2)) {
      isMethod2First=false;
    }
 else {
      int h2=ClassInspector.getClassHierarchyHeight(clazz2);
      int h1=ClassInspector.getClassHierarchyHeight(clazz1);
      if (h1 == h2) {
        isMethod2First=clazz2 != null && clazz1 != null && (clazz2.isArray() && !clazz1.isArray() || (!clazz2.isInterface() && clazz1.isInterface()));
        if (!isMethod2First) {
          isMethod2First=clazz2 != null && reference != null && !clazz2.isArray() && !clazz2.isPrimitive() && clazz2.isAssignableFrom(reference);
        }
      }
 else {
        isMethod2First=h2 > h1;
      }
    }
  }
 else {
    isMethod2First=true;
  }
  return isMethod2First;
}
Program: 91195
Project: 91195
Buggy source:
public Symbol<?> findSymbol(String symbolName,SymbolType symbolScope,SymbolType[] args,ReferenceType... referenceType){
  int j=indexStructure.size() - 1;
  Symbol<?> result=null;
  Scope selectedScope=null;
  if (symbolScope != null) {
    Class<?> clazz=symbolScope.getClazz();
    Symbol<?> scopeSymbol=null;
    if (clazz.isAnonymousClass()) {
      scopeSymbol=findSymbol(symbolScope.getClazz().getName(),ReferenceType.TYPE);
    }
 else {
      scopeSymbol=indexStructure.get(0).findSymbol(symbolScope.getClazz().getCanonicalName(),ReferenceType.TYPE);
    }
    if (scopeSymbol != null) {
      if (scopeSymbol.getInnerScope() != null) {
        return scopeSymbol.getInnerScope().findSymbol(symbolName,symbolScope,args,referenceType);
      }
 else       return null;
    }
  }
  if (selectedScope == null) {
    j=indexStructure.size() - 1;
  }
  while (j >= 0 && result == null) {
    Scope scope=indexStructure.get(j);
    Symbol<?> rootSymbol=scope.getRootSymbol();
    if (selectedScope != null && rootSymbol != null) {
      SymbolDefinition sd=rootSymbol.getLocation();
      if (sd instanceof SymbolDataAware<?>) {
        symbolScope=(SymbolType)((SymbolDataAware<?>)sd).getSymbolData();
      }
    }
    result=scope.findSymbol(symbolName,symbolScope,args,referenceType);
    j--;
  }
  return result;
}

Fixed version (ground truth):
public Symbol<?> findSymbol(String symbolName,SymbolType symbolScope,SymbolType[] args,List<Predicate<?>> predicates,ReferenceType... referenceType){
  int j=indexStructure.size() - 1;
  Symbol<?> result=null;
  Scope selectedScope=null;
  if (symbolScope != null) {
    Class<?> clazz=symbolScope.getClazz();
    Symbol<?> scopeSymbol=null;
    if (clazz.isAnonymousClass()) {
      scopeSymbol=findSymbol(symbolScope.getClazz().getName(),ReferenceType.TYPE);
    }
 else {
      scopeSymbol=indexStructure.get(0).findSymbol(symbolScope.getClazz().getCanonicalName(),ReferenceType.TYPE);
    }
    if (scopeSymbol != null) {
      if (scopeSymbol.getInnerScope() != null) {
        return scopeSymbol.getInnerScope().findSymbol(symbolName,symbolScope,args,predicates,referenceType);
      }
 else       return null;
    }
  }
  if (selectedScope == null) {
    j=indexStructure.size() - 1;
  }
  while (j >= 0 && result == null) {
    Scope scope=indexStructure.get(j);
    Symbol<?> rootSymbol=scope.getRootSymbol();
    if (selectedScope != null && rootSymbol != null) {
      SymbolDefinition sd=rootSymbol.getLocation();
      if (sd instanceof SymbolDataAware<?>) {
        symbolScope=(SymbolType)((SymbolDataAware<?>)sd).getSymbolData();
      }
    }
    result=scope.findSymbol(symbolName,symbolScope,args,predicates,referenceType);
    j--;
  }
  return result;
}
Program: 91197
Project: 91197
Buggy source:
public Map<String,SymbolType> createMapping(Class<?> interfaceToInspect,SymbolType inferredArg,Executable method) throws Exception {
  Map<String,SymbolType> typeMapping=new HashMap<String,SymbolType>();
  GenericsBuilderFromClassParameterTypes builder=new GenericsBuilderFromClassParameterTypes(typeMapping,scope,symTable);
  builder.build(method.getDeclaringClass());
  typeMapping=builder.getTypeMapping();
  Map<String,SymbolType> update=new HashMap<String,SymbolType>();
  if (inferredArg != null) {
    SymbolType.valueOf(interfaceToInspect,inferredArg,update,null);
  }
  Map<String,SymbolType> subset=new HashMap<String,SymbolType>();
  Set<String> keys=update.keySet();
  for (  String key : keys) {
    SymbolType st1=update.get(key);
    Class<?> clazz=st1.getClazz();
    if (Object.class.equals(clazz)) {
      SymbolType aux=typeMapping.get(key);
      if (aux != null) {
        subset.put(key,aux);
      }
    }
  }
  update.clear();
  if (inferredArg != null) {
    SymbolType.valueOf(interfaceToInspect,inferredArg,update,subset);
  }
  update.putAll(subset);
  return update;
}

Fixed version (ground truth):
public Map<String,SymbolType> createMapping(Class<?> classToInspect,java.lang.reflect.Type interfaceToInspect,SymbolType inferredArg,Executable method) throws Exception {
  Map<String,SymbolType> typeMapping=new HashMap<String,SymbolType>();
  GenericsBuilderFromClassParameterTypes builder=new GenericsBuilderFromClassParameterTypes(typeMapping,scope,symTable);
  builder.build(method.getDeclaringClass());
  typeMapping=builder.getTypeMapping();
  Map<String,SymbolType> update=new HashMap<String,SymbolType>();
  Map<String,List<String>> equivalences=new HashMap<String,List<String>>();
  createEquivalenceMapping(classToInspect,interfaceToInspect,equivalences);
  Set<String> keys=equivalences.keySet();
  for (  String key : keys) {
    if (typeMapping.containsKey(key)) {
      List<String> list=equivalences.get(key);
      for (      String key2 : list) {
        update.put(key2,typeMapping.get(key));
      }
    }
  }
  keys=typeMapping.keySet();
  for (  String key : keys) {
    if (!equivalences.containsKey(key)) {
      update.put(key,typeMapping.get(key));
    }
  }
  if (inferredArg != null) {
    Map<String,SymbolType> paramsTypeMapping=new HashMap<String,SymbolType>();
    SymbolType.valueOf(classToInspect,inferredArg,paramsTypeMapping,null);
    Map<String,SymbolType> subset=new HashMap<String,SymbolType>();
    keys=paramsTypeMapping.keySet();
    for (    String key : keys) {
      SymbolType st1=paramsTypeMapping.get(key);
      Class<?> clazz=st1.getClazz();
      if (!Object.class.equals(clazz)) {
        subset.put(key,st1);
      }
    }
    update.putAll(subset);
  }
  return update;
}
Program: 91198
Project: 91198
Buggy source:
@Override public boolean filter(Method method) throws Exception {
  SymbolData returnType=expr.getBody().getSymbolData();
  if (returnType == null) {
    try {
      expr.accept(typeResolver,ctx);
    }
 catch (    Exception e) {
      return false;
    }
    returnType=expr.getBody().getSymbolData();
    if (returnType == null) {
      returnType=new SymbolType(void.class);
    }
  }
  Map<String,SymbolType> updateMapping=new HashMap<String,SymbolType>();
  SymbolType st=null;
  if (void.class.equals(method.getReturnType())) {
    st=new SymbolType(void.class);
  }
 else {
    st=SymbolType.valueOf(method.getGenericReturnType(),(SymbolType)returnType,updateMapping,null);
  }
  Map<String,SymbolType> aux=new HashMap<String,SymbolType>(typeMapping);
  aux.putAll(updateMapping);
  boolean isCompatible=("String_Node_Str".equals(st.getName()) && (expr.getBody() instanceof ExpressionStmt)) || (st.isCompatible((SymbolType)returnType));
  if (isCompatible) {
    expr.setSymbolData(SymbolType.valueOf(method.getDeclaringClass(),aux));
  }
  return isCompatible;
}

Fixed version (ground truth):
@Override public boolean filter(Method method) throws Exception {
  SymbolData returnType=expr.getBody().getSymbolData();
  if (returnType == null) {
    int scopeLevel=symTable.getScopeLevel();
    try {
      expr.accept(typeResolver,ctx);
    }
 catch (    Exception e) {
      int currentScopeLevel=symTable.getScopeLevel();
      while (currentScopeLevel > scopeLevel) {
        symTable.popScope(true);
        currentScopeLevel--;
      }
      return false;
    }
    returnType=expr.getBody().getSymbolData();
    if (returnType == null) {
      returnType=new SymbolType(void.class);
    }
  }
  Map<String,SymbolType> updateMapping=new HashMap<String,SymbolType>();
  SymbolType st=null;
  if (void.class.equals(method.getReturnType())) {
    st=new SymbolType(void.class);
  }
 else {
    st=SymbolType.valueOf(method.getGenericReturnType(),(SymbolType)returnType,updateMapping,null);
  }
  Map<String,SymbolType> aux=new HashMap<String,SymbolType>(typeMapping);
  aux.putAll(updateMapping);
  boolean isCompatible=("String_Node_Str".equals(st.getName()) && (expr.getBody() instanceof ExpressionStmt)) || (st.isCompatible((SymbolType)returnType));
  if (isCompatible) {
    expr.setSymbolData(SymbolType.valueOf(method.getDeclaringClass(),aux));
  }
  return isCompatible;
}
Program: 91199
Project: 91199
Buggy source:
public CompatibleLambdaResultPredicate(LambdaExpr expr,VoidVisitor<A> typeResolver,A ctx,Map<String,SymbolType> typeMapping){
  this.expr=expr;
  this.typeResolver=typeResolver;
  this.ctx=ctx;
  this.typeMapping=typeMapping;
}

Fixed version (ground truth):
public CompatibleLambdaResultPredicate(LambdaExpr expr,VoidVisitor<A> typeResolver,A ctx,Map<String,SymbolType> typeMapping,SymbolTable symTable){
  this.expr=expr;
  this.typeResolver=typeResolver;
  this.ctx=ctx;
  this.typeMapping=typeMapping;
  this.symTable=symTable;
}