Program: 88607
Project: 88607
Buggy source:
/** 
 * creates the Jimple for an anon class - in the AST there is no class  decl for anon classes - the revelant fields and methods are  created 
 */
private void createAnonClassDecl(polyglot.ast.New aNew){
  SootClass outerClass=((soot.RefType)Util.getSootType(aNew.anonType().outer())).getSootClass();
  if (InitialResolver.v().getInnerClassInfoMap() == null) {
    InitialResolver.v().setInnerClassInfoMap(new HashMap());
  }
  InitialResolver.v().getInnerClassInfoMap().put(sootClass,new InnerClassInfo(outerClass,"String_Node_Str",InnerClassInfo.ANON));
  sootClass.setOuterClass(outerClass);
  soot.SootClass typeClass=((soot.RefType)Util.getSootType(aNew.objectType().type())).getSootClass();
  if (((polyglot.types.ClassType)aNew.objectType().type()).flags().isInterface()) {
    sootClass.addInterface(typeClass);
    sootClass.setSuperclass(soot.Scene.v().getSootClass("String_Node_Str"));
  }
 else {
    sootClass.setSuperclass(typeClass);
    if (((polyglot.types.ClassType)aNew.objectType().type()).isNested()) {
      polyglot.types.ClassType superType=(polyglot.types.ClassType)aNew.objectType().type();
      Util.addInnerClassTag(sootClass,typeClass.getName(),((soot.RefType)Util.getSootType(superType.outer())).toString(),superType.name(),Util.getModifier(superType.flags()));
    }
  }
  ArrayList params=new ArrayList();
  soot.SootMethod method;
  if (((polyglot.types.ClassType)aNew.objectType().type()).flags().isInterface()) {
    method=new soot.SootMethod("String_Node_Str",params,soot.VoidType.v());
  }
 else {
    Iterator aIt=aNew.arguments().iterator();
    while (aIt.hasNext()) {
      polyglot.types.Type pType=((polyglot.ast.Expr)aIt.next()).type();
      params.add(Util.getSootType(pType));
    }
    method=new soot.SootMethod("String_Node_Str",params,soot.VoidType.v());
  }
  AnonClassInitMethodSource src=new AnonClassInitMethodSource();
  method.setSource(src);
  sootClass.addMethod(method);
  AnonLocalClassInfo info=(AnonLocalClassInfo)InitialResolver.v().finalLocalInfo().get(new polyglot.util.IdentityKey(aNew.anonType()));
  if (aNew.qualifier() != null) {
    addQualifierRefToInit(aNew.qualifier().type());
    src.hasQualifier(true);
  }
  if (!info.inStaticMethod()) {
    addOuterClassThisRefToInit(aNew.anonType().outer());
    addOuterClassThisRefField(aNew.anonType().outer());
    src.thisOuterType(Util.getSootType(aNew.anonType().outer()));
    src.hasOuterRef(true);
  }
  src.inStaticMethod(info.inStaticMethod());
  if (info != null) {
    src.setFinalsList(addFinalLocals(aNew.body(),info.finalLocals(),(polyglot.types.ClassType)aNew.anonType(),info));
  }
  src.outerClassType(Util.getSootType(aNew.anonType().outer()));
  if (((polyglot.types.ClassType)aNew.objectType().type()).isNested()) {
    src.superOuterType(Util.getSootType(((polyglot.types.ClassType)aNew.objectType().type()).outer()));
    src.isSubType(Util.isSubType(aNew.anonType().outer(),((polyglot.types.ClassType)aNew.objectType().type()).outer()));
  }
}

Fixed version (ground truth):
/** 
 * creates the Jimple for an anon class - in the AST there is no class  decl for anon classes - the revelant fields and methods are  created 
 */
private void createAnonClassDecl(polyglot.ast.New aNew){
  SootClass outerClass=((soot.RefType)Util.getSootType(aNew.anonType().outer())).getSootClass();
  if (InitialResolver.v().getInnerClassInfoMap() == null) {
    InitialResolver.v().setInnerClassInfoMap(new HashMap());
  }
  InitialResolver.v().getInnerClassInfoMap().put(sootClass,new InnerClassInfo(outerClass,"String_Node_Str",InnerClassInfo.ANON));
  sootClass.setOuterClass(outerClass);
  soot.SootClass typeClass=((soot.RefType)Util.getSootType(aNew.objectType().type())).getSootClass();
  if (((polyglot.types.ClassType)aNew.objectType().type()).flags().isInterface()) {
    sootClass.addInterface(typeClass);
    sootClass.setSuperclass(soot.Scene.v().getSootClass("String_Node_Str"));
  }
 else {
    sootClass.setSuperclass(typeClass);
    if (((polyglot.types.ClassType)aNew.objectType().type()).isNested()) {
      polyglot.types.ClassType superType=(polyglot.types.ClassType)aNew.objectType().type();
      Util.addInnerClassTag(sootClass,typeClass.getName(),((soot.RefType)Util.getSootType(superType.outer())).toString(),superType.name(),Util.getModifier(superType.flags()));
    }
  }
  ArrayList params=new ArrayList();
  soot.SootMethod method;
  if (((polyglot.types.ClassType)aNew.objectType().type()).flags().isInterface()) {
    method=new soot.SootMethod("String_Node_Str",params,soot.VoidType.v());
  }
 else {
    Iterator aIt=aNew.arguments().iterator();
    while (aIt.hasNext()) {
      polyglot.types.Type pType=((polyglot.ast.Expr)aIt.next()).type();
      params.add(Util.getSootType(pType));
    }
    method=new soot.SootMethod("String_Node_Str",params,soot.VoidType.v());
  }
  AnonClassInitMethodSource src=new AnonClassInitMethodSource();
  method.setSource(src);
  sootClass.addMethod(method);
  AnonLocalClassInfo info=(AnonLocalClassInfo)InitialResolver.v().finalLocalInfo().get(new polyglot.util.IdentityKey(aNew.anonType()));
  if (aNew.qualifier() != null) {
    addQualifierRefToInit(aNew.qualifier().type());
    src.hasQualifier(true);
  }
  if (!info.inStaticMethod()) {
    addOuterClassThisRefToInit(aNew.anonType().outer());
    addOuterClassThisRefField(aNew.anonType().outer());
    src.thisOuterType(Util.getSootType(aNew.anonType().outer()));
    src.hasOuterRef(true);
  }
  src.inStaticMethod(info.inStaticMethod());
  if (info != null) {
    src.setFinalsList(addFinalLocals(aNew.body(),info.finalLocalsAvail(),(polyglot.types.ClassType)aNew.anonType(),info));
  }
  src.outerClassType(Util.getSootType(aNew.anonType().outer()));
  if (((polyglot.types.ClassType)aNew.objectType().type()).isNested()) {
    src.superOuterType(Util.getSootType(((polyglot.types.ClassType)aNew.objectType().type()).outer()));
    src.isSubType(Util.isSubType(aNew.anonType().outer(),((polyglot.types.ClassType)aNew.objectType().type()).outer()));
  }
}