Program: 9135
Project: 9135
Buggy source:
/** 
 * Build the bytecode for the concrete aspect
 * @return concrete aspect bytecode
 */
public byte[] getBytes(){
  if (!isValid) {
    throw new RuntimeException("String_Node_Str");
  }
  if (bytes != null) {
    return bytes;
  }
  PerClause parentPerClause=(parent != null ? parent.getPerClause() : null);
  if (parentPerClause == null) {
    parentPerClause=new PerSingleton();
  }
  PerClause.Kind perclauseKind=PerClause.SINGLETON;
  String perclauseString=null;
  if (concreteAspect.perclause != null) {
    perclauseString=concreteAspect.perclause;
    if (perclauseString.startsWith("String_Node_Str")) {
      perclauseKind=PerClause.SINGLETON;
    }
 else     if (perclauseString.startsWith("String_Node_Str")) {
      perclauseKind=PerClause.PERCFLOW;
    }
 else     if (perclauseString.startsWith("String_Node_Str")) {
      perclauseKind=PerClause.PERTYPEWITHIN;
    }
 else     if (perclauseString.startsWith("String_Node_Str")) {
      perclauseKind=PerClause.PEROBJECT;
    }
 else     if (perclauseString.startsWith("String_Node_Str")) {
      perclauseKind=PerClause.PEROBJECT;
    }
 else     if (perclauseString.startsWith("String_Node_Str")) {
      perclauseKind=PerClause.PERCFLOW;
    }
  }
  String parentName="String_Node_Str";
  if (parent != null) {
    if (parent.isParameterizedType()) {
      parentName=parent.getGenericType().getName().replace('.','/');
    }
 else {
      parentName=parent.getName().replace('.','/');
    }
  }
  LazyClassGen cg=new LazyClassGen(concreteAspect.name.replace('.','/'),parentName,null,Modifier.PUBLIC + Constants.ACC_SUPER,EMPTY_STRINGS,world);
  if (parent != null && parent.isParameterizedType()) {
    cg.setSuperClass(parent);
  }
  if (perclauseString == null) {
    AnnotationGen ag=new AnnotationGen(new ObjectType("String_Node_Str"),Collections.<NameValuePair>emptyList(),true,cg.getConstantPool());
    cg.addAnnotation(ag);
  }
 else {
    List<NameValuePair> elems=new ArrayList<NameValuePair>();
    elems.add(new NameValuePair("String_Node_Str",new SimpleElementValue(ElementValue.STRING,cg.getConstantPool(),perclauseString),cg.getConstantPool()));
    AnnotationGen ag=new AnnotationGen(new ObjectType("String_Node_Str"),elems,true,cg.getConstantPool());
    cg.addAnnotation(ag);
  }
  if (concreteAspect.precedence != null) {
    SimpleElementValue svg=new SimpleElementValue(ElementValue.STRING,cg.getConstantPool(),concreteAspect.precedence);
    List<NameValuePair> elems=new ArrayList<NameValuePair>();
    elems.add(new NameValuePair("String_Node_Str",svg,cg.getConstantPool()));
    AnnotationGen agprec=new AnnotationGen(new ObjectType("String_Node_Str"),elems,true,cg.getConstantPool());
    cg.addAnnotation(agprec);
  }
  LazyMethodGen init=new LazyMethodGen(Modifier.PUBLIC,Type.VOID,"String_Node_Str",EMPTY_TYPES,EMPTY_STRINGS,cg);
  InstructionList cbody=init.getBody();
  cbody.append(InstructionConstants.ALOAD_0);
  cbody.append(cg.getFactory().createInvoke(parentName,"String_Node_Str",Type.VOID,EMPTY_TYPES,Constants.INVOKESPECIAL));
  cbody.append(InstructionConstants.RETURN);
  cg.addMethodGen(init);
  for (Iterator<Definition.Pointcut> it=concreteAspect.pointcuts.iterator(); it.hasNext(); ) {
    Definition.Pointcut abstractPc=(Definition.Pointcut)it.next();
    LazyMethodGen mg=new LazyMethodGen(Modifier.PUBLIC,Type.VOID,abstractPc.name,EMPTY_TYPES,EMPTY_STRINGS,cg);
    SimpleElementValue svg=new SimpleElementValue(ElementValue.STRING,cg.getConstantPool(),abstractPc.expression);
    List<NameValuePair> elems=new ArrayList<NameValuePair>();
    elems.add(new NameValuePair("String_Node_Str",svg,cg.getConstantPool()));
    AnnotationGen mag=new AnnotationGen(new ObjectType("String_Node_Str"),elems,true,cg.getConstantPool());
    AnnotationAJ max=new BcelAnnotation(mag,world);
    mg.addAnnotation(max);
    InstructionList body=mg.getBody();
    body.append(InstructionConstants.RETURN);
    cg.addMethodGen(mg);
  }
  if (concreteAspect.deows.size() > 0) {
    int counter=1;
    for (    Definition.DeclareErrorOrWarning deow : concreteAspect.deows) {
      FieldGen field=new FieldGen(Modifier.FINAL,ObjectType.STRING,"String_Node_Str" + (counter++),cg.getConstantPool());
      SimpleElementValue svg=new SimpleElementValue(ElementValue.STRING,cg.getConstantPool(),deow.pointcut);
      List<NameValuePair> elems=new ArrayList<NameValuePair>();
      elems.add(new NameValuePair("String_Node_Str",svg,cg.getConstantPool()));
      AnnotationGen mag=new AnnotationGen(new ObjectType("String_Node_Str" + (deow.isError ? "String_Node_Str" : "String_Node_Str")),elems,true,cg.getConstantPool());
      field.addAnnotation(mag);
      field.setValue(deow.message);
      cg.addField(field,null);
    }
  }
  if (concreteAspect.pointcutsAndAdvice.size() > 0) {
    int adviceCounter=1;
    for (    PointcutAndAdvice paa : concreteAspect.pointcutsAndAdvice) {
      generateAdviceMethod(paa,adviceCounter,cg);
      adviceCounter++;
    }
  }
  if (concreteAspect.declareAnnotations.size() > 0) {
    int decCounter=1;
    for (    Definition.DeclareAnnotation da : concreteAspect.declareAnnotations) {
      generateDeclareAnnotation(da,decCounter++,cg);
    }
  }
  ReferenceType rt=new ReferenceType(ResolvedType.forName(concreteAspect.name).getSignature(),world);
  GeneratedReferenceTypeDelegate grtd=new GeneratedReferenceTypeDelegate(rt);
  grtd.setSuperclass(parent);
  rt.setDelegate(grtd);
  BcelPerClauseAspectAdder perClauseMunger=new BcelPerClauseAspectAdder(rt,perclauseKind);
  perClauseMunger.forceMunge(cg,false);
  JavaClass jc=cg.getJavaClass((BcelWorld)world);
  ((BcelWorld)world).addSourceObjectType(jc,true);
  bytes=jc.getBytes();
  return bytes;
}

Fixed version (ground truth):
/** 
 * Build the bytecode for the concrete aspect
 * @return concrete aspect bytecode
 */
public byte[] getBytes(){
  if (!isValid) {
    throw new RuntimeException("String_Node_Str");
  }
  if (bytes != null) {
    return bytes;
  }
  PerClause.Kind perclauseKind=PerClause.SINGLETON;
  PerClause parentPerClause=(parent != null ? parent.getPerClause() : null);
  if (parentPerClause != null) {
    perclauseKind=parentPerClause.getKind();
  }
  String perclauseString=null;
  if (concreteAspect.perclause != null) {
    perclauseString=concreteAspect.perclause;
    if (perclauseString.startsWith("String_Node_Str")) {
      perclauseKind=PerClause.SINGLETON;
    }
 else     if (perclauseString.startsWith("String_Node_Str")) {
      perclauseKind=PerClause.PERCFLOW;
    }
 else     if (perclauseString.startsWith("String_Node_Str")) {
      perclauseKind=PerClause.PERTYPEWITHIN;
    }
 else     if (perclauseString.startsWith("String_Node_Str")) {
      perclauseKind=PerClause.PEROBJECT;
    }
 else     if (perclauseString.startsWith("String_Node_Str")) {
      perclauseKind=PerClause.PEROBJECT;
    }
 else     if (perclauseString.startsWith("String_Node_Str")) {
      perclauseKind=PerClause.PERCFLOW;
    }
  }
  String parentName="String_Node_Str";
  if (parent != null) {
    if (parent.isParameterizedType()) {
      parentName=parent.getGenericType().getName().replace('.','/');
    }
 else {
      parentName=parent.getName().replace('.','/');
    }
  }
  LazyClassGen cg=new LazyClassGen(concreteAspect.name.replace('.','/'),parentName,null,Modifier.PUBLIC + Constants.ACC_SUPER,EMPTY_STRINGS,world);
  if (parent != null && parent.isParameterizedType()) {
    cg.setSuperClass(parent);
  }
  if (perclauseString == null) {
    AnnotationGen ag=new AnnotationGen(new ObjectType("String_Node_Str"),Collections.<NameValuePair>emptyList(),true,cg.getConstantPool());
    cg.addAnnotation(ag);
  }
 else {
    List<NameValuePair> elems=new ArrayList<NameValuePair>();
    elems.add(new NameValuePair("String_Node_Str",new SimpleElementValue(ElementValue.STRING,cg.getConstantPool(),perclauseString),cg.getConstantPool()));
    AnnotationGen ag=new AnnotationGen(new ObjectType("String_Node_Str"),elems,true,cg.getConstantPool());
    cg.addAnnotation(ag);
  }
  if (concreteAspect.precedence != null) {
    SimpleElementValue svg=new SimpleElementValue(ElementValue.STRING,cg.getConstantPool(),concreteAspect.precedence);
    List<NameValuePair> elems=new ArrayList<NameValuePair>();
    elems.add(new NameValuePair("String_Node_Str",svg,cg.getConstantPool()));
    AnnotationGen agprec=new AnnotationGen(new ObjectType("String_Node_Str"),elems,true,cg.getConstantPool());
    cg.addAnnotation(agprec);
  }
  LazyMethodGen init=new LazyMethodGen(Modifier.PUBLIC,Type.VOID,"String_Node_Str",EMPTY_TYPES,EMPTY_STRINGS,cg);
  InstructionList cbody=init.getBody();
  cbody.append(InstructionConstants.ALOAD_0);
  cbody.append(cg.getFactory().createInvoke(parentName,"String_Node_Str",Type.VOID,EMPTY_TYPES,Constants.INVOKESPECIAL));
  cbody.append(InstructionConstants.RETURN);
  cg.addMethodGen(init);
  for (Iterator<Definition.Pointcut> it=concreteAspect.pointcuts.iterator(); it.hasNext(); ) {
    Definition.Pointcut abstractPc=(Definition.Pointcut)it.next();
    LazyMethodGen mg=new LazyMethodGen(Modifier.PUBLIC,Type.VOID,abstractPc.name,EMPTY_TYPES,EMPTY_STRINGS,cg);
    SimpleElementValue svg=new SimpleElementValue(ElementValue.STRING,cg.getConstantPool(),abstractPc.expression);
    List<NameValuePair> elems=new ArrayList<NameValuePair>();
    elems.add(new NameValuePair("String_Node_Str",svg,cg.getConstantPool()));
    AnnotationGen mag=new AnnotationGen(new ObjectType("String_Node_Str"),elems,true,cg.getConstantPool());
    AnnotationAJ max=new BcelAnnotation(mag,world);
    mg.addAnnotation(max);
    InstructionList body=mg.getBody();
    body.append(InstructionConstants.RETURN);
    cg.addMethodGen(mg);
  }
  if (concreteAspect.deows.size() > 0) {
    int counter=1;
    for (    Definition.DeclareErrorOrWarning deow : concreteAspect.deows) {
      FieldGen field=new FieldGen(Modifier.FINAL,ObjectType.STRING,"String_Node_Str" + (counter++),cg.getConstantPool());
      SimpleElementValue svg=new SimpleElementValue(ElementValue.STRING,cg.getConstantPool(),deow.pointcut);
      List<NameValuePair> elems=new ArrayList<NameValuePair>();
      elems.add(new NameValuePair("String_Node_Str",svg,cg.getConstantPool()));
      AnnotationGen mag=new AnnotationGen(new ObjectType("String_Node_Str" + (deow.isError ? "String_Node_Str" : "String_Node_Str")),elems,true,cg.getConstantPool());
      field.addAnnotation(mag);
      field.setValue(deow.message);
      cg.addField(field,null);
    }
  }
  if (concreteAspect.pointcutsAndAdvice.size() > 0) {
    int adviceCounter=1;
    for (    PointcutAndAdvice paa : concreteAspect.pointcutsAndAdvice) {
      generateAdviceMethod(paa,adviceCounter,cg);
      adviceCounter++;
    }
  }
  if (concreteAspect.declareAnnotations.size() > 0) {
    int decCounter=1;
    for (    Definition.DeclareAnnotation da : concreteAspect.declareAnnotations) {
      generateDeclareAnnotation(da,decCounter++,cg);
    }
  }
  ReferenceType rt=new ReferenceType(ResolvedType.forName(concreteAspect.name).getSignature(),world);
  GeneratedReferenceTypeDelegate grtd=new GeneratedReferenceTypeDelegate(rt);
  grtd.setSuperclass(parent);
  rt.setDelegate(grtd);
  BcelPerClauseAspectAdder perClauseMunger=new BcelPerClauseAspectAdder(rt,perclauseKind);
  perClauseMunger.forceMunge(cg,false);
  JavaClass jc=cg.getJavaClass((BcelWorld)world);
  ((BcelWorld)world).addSourceObjectType(jc,true);
  bytes=jc.getBytes();
  return bytes;
}