nus-yam/ex-repair huggingface dataset:
Program: 12966
Project: 12966
Buggy source:
/** 
 * Handles the &lt;ClassDoc> tag.
 * @param node the XML element that specifies which components to document
 * @param contentTree the content tree to which the documentation will be added
 */
public void buildClassDoc(XMLNode node,Content contentTree) throws Exception {
  String key;
  if (isInterface) {
    key="String_Node_Str";
  }
 else   if (isEnum) {
    key="String_Node_Str";
  }
 else {
    key="String_Node_Str";
  }
  contentTree=writer.getHeader(configuration.getText(key) + "String_Node_Str" + classDoc.name());
  Content classContentTree=writer.getClassContentHeader();
  buildChildren(node,classContentTree);
  contentTree.addContent(classContentTree);
  writer.addFooter(contentTree);
  writer.printDocument(contentTree);
  writer.close();
  copyDocFiles();
}

Fixed version (ground truth):
/** 
 * Handles the   {@literal <ClassDoc>} tag.
 * @param node the XML element that specifies which components to document
 * @param contentTree the content tree to which the documentation will be added
 */
public void buildClassDoc(XMLNode node,Content contentTree) throws Exception {
  String key;
  if (isInterface) {
    key="String_Node_Str";
  }
 else   if (isEnum) {
    key="String_Node_Str";
  }
 else {
    key="String_Node_Str";
  }
  contentTree=writer.getHeader(configuration.getText(key) + "String_Node_Str" + classDoc.name());
  Content classContentTree=writer.getClassContentHeader();
  buildChildren(node,classContentTree);
  contentTree.addContent(classContentTree);
  writer.addFooter(contentTree);
  writer.printDocument(contentTree);
  writer.close();
  copyDocFiles();
}
Program: 12967
Project: 12967
Buggy source:
/** 
 * Enter a binary operation, as above but with two opcodes, which get encoded as (opcode1 << ByteCodeTags.preShift) + opcode2.
 * @param opcode1     First opcode.
 * @param opcode2     Second opcode.
 */
private void enterBinop(String name,Type left,Type right,Type res,int opcode1,int opcode2){
  enterBinop(name,left,right,res,(opcode1 << ByteCodes.preShift) | opcode2);
}

Fixed version (ground truth):
/** 
 * Enter a binary operation, as above but with two opcodes, which get encoded as  {@code (opcode1 << ByteCodeTags.preShift) + opcode2 }.
 * @param opcode1     First opcode.
 * @param opcode2     Second opcode.
 */
private void enterBinop(String name,Type left,Type right,Type res,int opcode1,int opcode2){
  enterBinop(name,left,right,res,(opcode1 << ByteCodes.preShift) | opcode2);
}
Program: 12969
Project: 12969
Buggy source:
/** 
 * Construct a tree that represents the closest outer instance <C.this> such that the given symbol is a member of C.
 * @param pos           The source code position to be used for the tree.
 * @param sym           The accessed symbol.
 * @param preciseMatch  should we accept a type that is a subtype ofsym's owner, even if it doesn't contain sym due to hiding, overriding, or non-inheritance due to protection?
 */
JCExpression makeOwnerThis(DiagnosticPosition pos,Symbol sym,boolean preciseMatch){
  Symbol c=sym.owner;
  if (preciseMatch ? sym.isMemberOf(currentClass,types) : currentClass.isSubClass(sym.owner,types)) {
    return make.at(pos).This(c.erasure(types));
  }
 else {
    return makeOwnerThisN(pos,sym,preciseMatch);
  }
}

Fixed version (ground truth):
/** 
 * Construct a tree that represents the closest outer instance  {@code C.this} such that the given symbol is a member of C.
 * @param pos           The source code position to be used for the tree.
 * @param sym           The accessed symbol.
 * @param preciseMatch  should we accept a type that is a subtype ofsym's owner, even if it doesn't contain sym due to hiding, overriding, or non-inheritance due to protection?
 */
JCExpression makeOwnerThis(DiagnosticPosition pos,Symbol sym,boolean preciseMatch){
  Symbol c=sym.owner;
  if (preciseMatch ? sym.isMemberOf(currentClass,types) : currentClass.isSubClass(sym.owner,types)) {
    return make.at(pos).This(c.erasure(types));
  }
 else {
    return makeOwnerThisN(pos,sym,preciseMatch);
  }
}
Program: 12970
Project: 12970
Buggy source:
/** 
 * Construct a tree that represents the outer instance <C.this>. Never pick the current `this'.
 * @param pos           The source code position to be used for the tree.
 * @param c             The qualifier class.
 */
JCExpression makeOuterThis(DiagnosticPosition pos,TypeSymbol c){
  List<VarSymbol> ots=outerThisStack;
  if (ots.isEmpty()) {
    log.error(pos,"String_Node_Str",c);
    Assert.error();
    return makeNull();
  }
  VarSymbol ot=ots.head;
  JCExpression tree=access(make.at(pos).Ident(ot));
  TypeSymbol otc=ot.type.tsym;
  while (otc != c) {
    do {
      ots=ots.tail;
      if (ots.isEmpty()) {
        log.error(pos,"String_Node_Str",c);
        Assert.error();
        return tree;
      }
      ot=ots.head;
    }
 while (ot.owner != otc);
    if (otc.owner.kind != PCK && !otc.hasOuterInstance()) {
      chk.earlyRefError(pos,c);
      Assert.error();
      return makeNull();
    }
    tree=access(make.at(pos).Select(tree,ot));
    otc=ot.type.tsym;
  }
  return tree;
}

Fixed version (ground truth):
/** 
 * Construct a tree that represents the outer instance  {@code C.this}. Never pick the current `this'.
 * @param pos           The source code position to be used for the tree.
 * @param c             The qualifier class.
 */
JCExpression makeOuterThis(DiagnosticPosition pos,TypeSymbol c){
  List<VarSymbol> ots=outerThisStack;
  if (ots.isEmpty()) {
    log.error(pos,"String_Node_Str",c);
    Assert.error();
    return makeNull();
  }
  VarSymbol ot=ots.head;
  JCExpression tree=access(make.at(pos).Ident(ot));
  TypeSymbol otc=ot.type.tsym;
  while (otc != c) {
    do {
      ots=ots.tail;
      if (ots.isEmpty()) {
        log.error(pos,"String_Node_Str",c);
        Assert.error();
        return tree;
      }
      ot=ots.head;
    }
 while (ot.owner != otc);
    if (otc.owner.kind != PCK && !otc.hasOuterInstance()) {
      chk.earlyRefError(pos,c);
      Assert.error();
      return makeNull();
    }
    tree=access(make.at(pos).Select(tree,ot));
    otc=ot.type.tsym;
  }
  return tree;
}
Program: 12971
Project: 12971
Buggy source:
/** 
 * Return tree simulating the assignment <this.this$n = this$n>.
 */
JCStatement initOuterThis(int pos){
  VarSymbol rhs=outerThisStack.head;
  Assert.check(rhs.owner.kind == MTH);
  VarSymbol lhs=outerThisStack.tail.head;
  Assert.check(rhs.owner.owner == lhs.owner);
  make.at(pos);
  return make.Exec(make.Assign(make.Select(make.This(lhs.owner.erasure(types)),lhs),make.Ident(rhs)).setType(lhs.erasure(types)));
}

Fixed version (ground truth):
/** 
 * Return tree simulating the assignment   {@code this.this$n = this$n}.
 */
JCStatement initOuterThis(int pos){
  VarSymbol rhs=outerThisStack.head;
  Assert.check(rhs.owner.kind == MTH);
  VarSymbol lhs=outerThisStack.tail.head;
  Assert.check(rhs.owner.owner == lhs.owner);
  make.at(pos);
  return make.Exec(make.Assign(make.Select(make.This(lhs.owner.erasure(types)),lhs),make.Ident(rhs)).setType(lhs.erasure(types)));
}
Program: 12972
Project: 12972
Buggy source:
/** 
 * Construct a tree simulating the expression <C.this>.
 * @param pos           The source code position to be used for the tree.
 * @param c             The qualifier class.
 */
JCExpression makeThis(DiagnosticPosition pos,TypeSymbol c){
  if (currentClass == c) {
    return make.at(pos).This(c.erasure(types));
  }
 else {
    return makeOuterThis(pos,c);
  }
}

Fixed version (ground truth):
/** 
 * Construct a tree simulating the expression   {@code C.this}.
 * @param pos           The source code position to be used for the tree.
 * @param c             The qualifier class.
 */
JCExpression makeThis(DiagnosticPosition pos,TypeSymbol c){
  if (currentClass == c) {
    return make.at(pos).This(c.erasure(types));
  }
 else {
    return makeOuterThis(pos,c);
  }
}
Program: 12974
Project: 12974
Buggy source:
/** 
 * Return tree simulating the assignment <this.name = name>, where name is the name of a free variable.
 */
JCStatement initField(int pos,Name name){
  Scope.Entry e=proxies.lookup(name);
  Symbol rhs=e.sym;
  Assert.check(rhs.owner.kind == MTH);
  Symbol lhs=e.next().sym;
  Assert.check(rhs.owner.owner == lhs.owner);
  make.at(pos);
  return make.Exec(make.Assign(make.Select(make.This(lhs.owner.erasure(types)),lhs),make.Ident(rhs)).setType(lhs.erasure(types)));
}

Fixed version (ground truth):
/** 
 * Return tree simulating the assignment   {@code this.name = name}, where name is the name of a free variable.
 */
JCStatement initField(int pos,Name name){
  Scope.Entry e=proxies.lookup(name);
  Symbol rhs=e.sym;
  Assert.check(rhs.owner.kind == MTH);
  Symbol lhs=e.next().sym;
  Assert.check(rhs.owner.owner == lhs.owner);
  make.at(pos);
  return make.Exec(make.Assign(make.Select(make.This(lhs.owner.erasure(types)),lhs),make.Ident(rhs)).setType(lhs.erasure(types)));
}
Program: 12975
Project: 12975
Buggy source:
/** 
 * A name designates an operator if it consists of a non-empty sequence of operator symbols +-~!/*%&|^<>=
 */
boolean isOperator(Name name){
  int i=0;
  while (i < name.getByteLength() && "String_Node_Str".indexOf(name.getByteAt(i)) >= 0)   i++;
  return i > 0 && i == name.getByteLength();
}

Fixed version (ground truth):
/** 
 * A name designates an operator if it consists of a non-empty sequence of operator symbols   {@literal +-~!/*%&|^<>= }
 */
boolean isOperator(Name name){
  int i=0;
  while (i < name.getByteLength() && "String_Node_Str".indexOf(name.getByteAt(i)) >= 0)   i++;
  return i > 0 && i == name.getByteLength();
}
Program: 12976
Project: 12976
Buggy source:
/** 
 * This method scans all the constructor symbol in a given class scope - assuming that the original scope contains a constructor of the kind: Foo(X x, Y y), where X,Y are class type-variables declared in Foo, a method check is executed against the modified constructor type: <X,Y>Foo<X,Y>(X x, Y y). This is crucial in order to enable diamond inference. The inferred return type of the synthetic constructor IS the inferred type for the diamond operator.
 */
private Symbol findDiamond(Env<AttrContext> env,Type site,List<Type> argtypes,List<Type> typeargtypes,boolean allowBoxing,boolean useVarargs){
  Symbol bestSoFar=methodNotFound;
  for (Scope.Entry e=site.tsym.members().lookup(names.init); e.scope != null; e=e.next()) {
    if (e.sym.kind == MTH && (e.sym.flags_field & SYNTHETIC) == 0) {
      List<Type> oldParams=e.sym.type.tag == FORALL ? ((ForAll)e.sym.type).tvars : List.<Type>nil();
      Type constrType=new ForAll(site.tsym.type.getTypeArguments().appendList(oldParams),types.createMethodTypeWithReturn(e.sym.type.asMethodType(),site));
      bestSoFar=selectBest(env,site,argtypes,typeargtypes,new MethodSymbol(e.sym.flags(),names.init,constrType,site.tsym),bestSoFar,allowBoxing,useVarargs,false);
    }
  }
  return bestSoFar;
}

Fixed version (ground truth):
/** 
 * This method scans all the constructor symbol in a given class scope - assuming that the original scope contains a constructor of the kind:  {@code Foo(X x, Y y)}, where X,Y are class type-variables declared in Foo, a method check is executed against the modified constructor type:  {@code <X,Y>Foo<X,Y>(X x, Y y)}. This is crucial in order to enable diamond inference. The inferred return type of the synthetic constructor IS the inferred type for the diamond operator.
 */
private Symbol findDiamond(Env<AttrContext> env,Type site,List<Type> argtypes,List<Type> typeargtypes,boolean allowBoxing,boolean useVarargs){
  Symbol bestSoFar=methodNotFound;
  for (Scope.Entry e=site.tsym.members().lookup(names.init); e.scope != null; e=e.next()) {
    if (e.sym.kind == MTH && (e.sym.flags_field & SYNTHETIC) == 0) {
      List<Type> oldParams=e.sym.type.tag == FORALL ? ((ForAll)e.sym.type).tvars : List.<Type>nil();
      Type constrType=new ForAll(site.tsym.type.getTypeArguments().appendList(oldParams),types.createMethodTypeWithReturn(e.sym.type.asMethodType(),site));
      bestSoFar=selectBest(env,site,argtypes,typeargtypes,new MethodSymbol(e.sym.flags(),names.init,constrType,site.tsym),bestSoFar,allowBoxing,useVarargs,false);
    }
  }
  return bestSoFar;
}
Program: 12977
Project: 12977
Buggy source:
/** 
 * Source file positions in CRT are integers in the format: line-number << LINESHIFT + column-number
 */
private int encodePosition(int pos,Position.LineMap lineMap,Log log){
  int line=lineMap.getLineNumber(pos);
  int col=lineMap.getColumnNumber(pos);
  int new_pos=Position.encodePosition(line,col);
  if (crtDebug) {
    System.out.println("String_Node_Str" + line + "String_Node_Str"+ col+ "String_Node_Str"+ new_pos);
  }
  if (new_pos == Position.NOPOS)   log.warning(pos,"String_Node_Str",line);
  return new_pos;
}

Fixed version (ground truth):
/** 
 * Source file positions in CRT are integers in the format:  {@literal line-number << LINESHIFT + column-number }
 */
private int encodePosition(int pos,Position.LineMap lineMap,Log log){
  int line=lineMap.getLineNumber(pos);
  int col=lineMap.getColumnNumber(pos);
  int new_pos=Position.encodePosition(line,col);
  if (crtDebug) {
    System.out.println("String_Node_Str" + line + "String_Node_Str"+ col+ "String_Node_Str"+ new_pos);
  }
  if (new_pos == Position.NOPOS)   log.warning(pos,"String_Node_Str",line);
  return new_pos;
}
Program: 12978
Project: 12978
Buggy source:
public Log make(){
  return Bark.instance(context);
}

Fixed version (ground truth):
public Log make(Context c){
  return Bark.instance(c);
}
Program: 12979
Project: 12979
Buggy source:
/** 
 * Preregisters factories to create and use a Bark object for use as both a Log and a Bark.
 */
public static void preRegister(final Context context){
  context.put(barkKey,new Context.Factory<Bark>(){
    public Bark make(){
      return new Bark(context);
    }
  }
);
  context.put(Log.logKey,new Context.Factory<Log>(){
    public Log make(){
      return Bark.instance(context);
    }
  }
);
}

Fixed version (ground truth):
/** 
 * Preregisters factories to create and use a Bark object for use as both a Log and a Bark.
 */
public static void preRegister(Context context){
  context.put(barkKey,new Context.Factory<Bark>(){
    public Bark make(    Context c){
      return new Bark(c);
    }
  }
);
  context.put(Log.logKey,new Context.Factory<Log>(){
    public Log make(    Context c){
      return Bark.instance(c);
    }
  }
);
}
Program: 12980
Project: 12980
Buggy source:
/** 
 * Register that a compilation is about to start.
 */
void beginContext(final Context context){
  if (compilationInProgress)   throw new IllegalStateException("String_Node_Str");
  compilationInProgress=true;
  final JavaFileManager givenFileManager=context.get(JavaFileManager.class);
  context.put(JavaFileManager.class,(JavaFileManager)null);
  context.put(JavaFileManager.class,new Context.Factory<JavaFileManager>(){
    public JavaFileManager make(){
      if (givenFileManager != null) {
        context.put(JavaFileManager.class,givenFileManager);
        return givenFileManager;
      }
 else {
        return new JavacFileManager(context,true,null);
      }
    }
  }
);
}

Fixed version (ground truth):
/** 
 * Register that a compilation is about to start.
 */
void beginContext(Context context){
  if (compilationInProgress)   throw new IllegalStateException("String_Node_Str");
  compilationInProgress=true;
  final JavaFileManager givenFileManager=context.get(JavaFileManager.class);
  context.put(JavaFileManager.class,(JavaFileManager)null);
  context.put(JavaFileManager.class,new Context.Factory<JavaFileManager>(){
    public JavaFileManager make(    Context c){
      if (givenFileManager != null) {
        c.put(JavaFileManager.class,givenFileManager);
        return givenFileManager;
      }
 else {
        return new JavacFileManager(c,true,null);
      }
    }
  }
);
}
Program: 12981
Project: 12981
Buggy source:
public JavaFileManager make(){
  if (givenFileManager != null) {
    context.put(JavaFileManager.class,givenFileManager);
    return givenFileManager;
  }
 else {
    return new JavacFileManager(context,true,null);
  }
}

Fixed version (ground truth):
public JavaFileManager make(Context c){
  if (givenFileManager != null) {
    c.put(JavaFileManager.class,givenFileManager);
    return givenFileManager;
  }
 else {
    return new JavacFileManager(c,true,null);
  }
}
Program: 12982
Project: 12982
Buggy source:
public FSInfo make(){
  FSInfo instance=new CacheFSInfo();
  context.put(FSInfo.class,instance);
  return instance;
}

Fixed version (ground truth):
public FSInfo make(Context c){
  FSInfo instance=new CacheFSInfo();
  c.put(FSInfo.class,instance);
  return instance;
}
Program: 12983
Project: 12983
Buggy source:
/** 
 * Register a Context.Factory to create a singleton CacheFSInfo.
 */
public static void preRegister(final Context context){
  context.put(FSInfo.class,new Context.Factory<FSInfo>(){
    public FSInfo make(){
      FSInfo instance=new CacheFSInfo();
      context.put(FSInfo.class,instance);
      return instance;
    }
  }
);
}

Fixed version (ground truth):
/** 
 * Register a Context.Factory to create a CacheFSInfo.
 */
public static void preRegister(Context context){
  context.put(FSInfo.class,new Context.Factory<FSInfo>(){
    public FSInfo make(    Context c){
      FSInfo instance=new CacheFSInfo();
      c.put(FSInfo.class,instance);
      return instance;
    }
  }
);
}
Program: 12984
Project: 12984
Buggy source:
/** 
 * Register a Context.Factory to create a JavacFileManager.
 */
public static void preRegister(final Context context){
  context.put(JavaFileManager.class,new Context.Factory<JavaFileManager>(){
    public JavaFileManager make(){
      return new JavacFileManager(context,true,null);
    }
  }
);
}

Fixed version (ground truth):
/** 
 * Register a Context.Factory to create a JavacFileManager.
 */
public static void preRegister(Context context){
  context.put(JavaFileManager.class,new Context.Factory<JavaFileManager>(){
    public JavaFileManager make(    Context c){
      return new JavacFileManager(c,true,null);
    }
  }
);
}
Program: 12985
Project: 12985
Buggy source:
public JavaFileManager make(){
  return new JavacFileManager(context,true,null);
}

Fixed version (ground truth):
public JavaFileManager make(Context c){
  return new JavacFileManager(c,true,null);
}
Program: 12988
Project: 12988
Buggy source:
public Context(){
}

Fixed version (ground truth):
public Context(Context prev){
  kt.putAll(prev.kt);
  ft.putAll(prev.ft);
  ht.putAll(prev.ft);
}
Program: 12989
Project: 12989
Buggy source:
public void clear(){
  ht=null;
  kt=null;
}

Fixed version (ground truth):
public void clear(){
  ht=null;
  kt=null;
  ft=null;
}
Program: 12990
Project: 12990
Buggy source:
T make();

Fixed version (ground truth):
T make(Context c);
Program: 12991
Project: 12991
Buggy source:
public ClassReader make(){
  return new JavadocClassReader(context);
}

Fixed version (ground truth):
public ClassReader make(Context c){
  return new JavadocClassReader(c);
}
Program: 12992
Project: 12992
Buggy source:
public static void preRegister(final Context context){
  context.put(classReaderKey,new Context.Factory<ClassReader>(){
    public ClassReader make(){
      return new JavadocClassReader(context);
    }
  }
);
}

Fixed version (ground truth):
public static void preRegister(Context context){
  context.put(classReaderKey,new Context.Factory<ClassReader>(){
    public ClassReader make(    Context c){
      return new JavadocClassReader(c);
    }
  }
);
}
Program: 12993
Project: 12993
Buggy source:
public Enter make(){
  return new JavadocEnter(context);
}

Fixed version (ground truth):
public Enter make(Context c){
  return new JavadocEnter(c);
}
Program: 12994
Project: 12994
Buggy source:
public static void preRegister(final Context context){
  context.put(enterKey,new Context.Factory<Enter>(){
    public Enter make(){
      return new JavadocEnter(context);
    }
  }
);
}

Fixed version (ground truth):
public static void preRegister(Context context){
  context.put(enterKey,new Context.Factory<Enter>(){
    public Enter make(    Context c){
      return new JavadocEnter(c);
    }
  }
);
}
Program: 12995
Project: 12995
Buggy source:
public MemberEnter make(){
  return new JavadocMemberEnter(context);
}

Fixed version (ground truth):
public MemberEnter make(Context c){
  return new JavadocMemberEnter(c);
}
Program: 12996
Project: 12996
Buggy source:
public static void preRegister(final Context context){
  context.put(memberEnterKey,new Context.Factory<MemberEnter>(){
    public MemberEnter make(){
      return new JavadocMemberEnter(context);
    }
  }
);
}

Fixed version (ground truth):
public static void preRegister(Context context){
  context.put(memberEnterKey,new Context.Factory<MemberEnter>(){
    public MemberEnter make(    Context c){
      return new JavadocMemberEnter(c);
    }
  }
);
}
Program: 12997
Project: 12997
Buggy source:
public Todo make(){
  return new JavadocTodo(context);
}

Fixed version (ground truth):
public Todo make(Context c){
  return new JavadocTodo(c);
}
Program: 12998
Project: 12998
Buggy source:
public static void preRegister(final Context context){
  context.put(todoKey,new Context.Factory<Todo>(){
    public Todo make(){
      return new JavadocTodo(context);
    }
  }
);
}

Fixed version (ground truth):
public static void preRegister(Context context){
  context.put(todoKey,new Context.Factory<Todo>(){
    public Todo make(    Context c){
      return new JavadocTodo(c);
    }
  }
);
}
Program: 12999
Project: 12999
Buggy source:
public Log make(){
  return new Messager(context,programName,errWriter,warnWriter,noticeWriter);
}

Fixed version (ground truth):
public Log make(Context c){
  return new Messager(c,programName,errWriter,warnWriter,noticeWriter);
}
Program: 13000
Project: 13000
Buggy source:
public static void preRegister(final Context context,final String programName,final PrintWriter errWriter,final PrintWriter warnWriter,final PrintWriter noticeWriter){
  context.put(logKey,new Context.Factory<Log>(){
    public Log make(){
      return new Messager(context,programName,errWriter,warnWriter,noticeWriter);
    }
  }
);
}

Fixed version (ground truth):
public static void preRegister(Context context,final String programName,final PrintWriter errWriter,final PrintWriter warnWriter,final PrintWriter noticeWriter){
  context.put(logKey,new Context.Factory<Log>(){
    public Log make(    Context c){
      return new Messager(c,programName,errWriter,warnWriter,noticeWriter);
    }
  }
);
}
Program: 13001
Project: 13001
Buggy source:
public JavacMessages make(){
  return new ArgTypeMessages(c){
    @Override public String getLocalizedString(    Locale l,    String key,    Object... args){
      return getKeyArgsString(key,args);
    }
  }
;
}

Fixed version (ground truth):
public JavacMessages make(Context c){
  return new ArgTypeMessages(c){
    @Override public String getLocalizedString(    Locale l,    String key,    Object... args){
      return getKeyArgsString(key,args);
    }
  }
;
}
Program: 13002
Project: 13002
Buggy source:
static void preRegister(final Context c){
  c.put(JavacMessages.messagesKey,new Context.Factory<JavacMessages>(){
    public JavacMessages make(){
      return new ArgTypeMessages(c){
        @Override public String getLocalizedString(        Locale l,        String key,        Object... args){
          return getKeyArgsString(key,args);
        }
      }
;
    }
  }
);
}

Fixed version (ground truth):
static void preRegister(Context context){
  context.put(JavacMessages.messagesKey,new Context.Factory<JavacMessages>(){
    public JavacMessages make(    Context c){
      return new ArgTypeMessages(c){
        @Override public String getLocalizedString(        Locale l,        String key,        Object... args){
          return getKeyArgsString(key,args);
        }
      }
;
    }
  }
);
}
Program: 13003
Project: 13003
Buggy source:
public JavacMessages make(){
  return new MessageTracker(c){
    @Override public String getLocalizedString(    Locale l,    String key,    Object... args){
      keys.add(key);
      return super.getLocalizedString(l,key,args);
    }
  }
;
}

Fixed version (ground truth):
public JavacMessages make(Context c){
  return new MessageTracker(c){
    @Override public String getLocalizedString(    Locale l,    String key,    Object... args){
      keys.add(key);
      return super.getLocalizedString(l,key,args);
    }
  }
;
}
Program: 13004
Project: 13004
Buggy source:
static void preRegister(final Context c,final Set<String> keys){
  if (keys != null) {
    c.put(JavacMessages.messagesKey,new Context.Factory<JavacMessages>(){
      public JavacMessages make(){
        return new MessageTracker(c){
          @Override public String getLocalizedString(          Locale l,          String key,          Object... args){
            keys.add(key);
            return super.getLocalizedString(l,key,args);
          }
        }
;
      }
    }
);
  }
}

Fixed version (ground truth):
static void preRegister(Context c,final Set<String> keys){
  if (keys != null) {
    c.put(JavacMessages.messagesKey,new Context.Factory<JavacMessages>(){
      public JavacMessages make(      Context c){
        return new MessageTracker(c){
          @Override public String getLocalizedString(          Locale l,          String key,          Object... args){
            keys.add(key);
            return super.getLocalizedString(l,key,args);
          }
        }
;
      }
    }
);
  }
}
Program: 13005
Project: 13005
Buggy source:
protected Scope(Symbol owner,ScopeCounter scopeCounter){
  this(null,owner,new Entry[INITIAL_SIZE],scopeCounter);
}

Fixed version (ground truth):
protected Scope(Symbol owner,ScopeCounter scopeCounter){
  this(null,owner,new Entry[INITIAL_SIZE],scopeCounter);
  for (int i=0; i < INITIAL_SIZE; i++)   table[i]=sentinel;
}
Program: 13006
Project: 13006
Buggy source:
public Entry next(){
  Entry e=super.shadowed;
  while (e.scope != null && (e.sym.name != sym.name || e.sym.owner != e.scope.owner))   e=e.shadowed;
  return e;
}

Fixed version (ground truth):
public Entry next(){
  Entry e=super.shadowed;
  while (isBogus())   e=e.shadowed;
  return e;
}
Program: 13007
Project: 13007
Buggy source:
protected Scope(Symbol owner,ScopeCounter scopeCounter){
  this(null,owner,new Entry[INITIAL_SIZE],scopeCounter);
  for (int i=0; i < INITIAL_SIZE; i++)   table[i]=sentinel;
}

Fixed version (ground truth):
protected Scope(Symbol owner,ScopeCounter scopeCounter){
  this(null,owner,new Entry[INITIAL_SIZE],scopeCounter);
}
Program: 13008
Project: 13008
Buggy source:
@Override public void write(int b) throws IOException {
  size++;
}

Fixed version (ground truth):
@Override public void write(int b){
  size++;
}
Program: 13009
Project: 13009
Buggy source:
public int byteLength(){
class SizeOutputStream extends OutputStream {
    @Override public void write(    int b) throws IOException {
      size++;
    }
    int size;
  }
  SizeOutputStream sizeOut=new SizeOutputStream();
  DataOutputStream out=new DataOutputStream(sizeOut);
  try {
    out.writeUTF(value);
  }
 catch (  IOException ignore) {
  }
  return 1 + sizeOut.size;
}

Fixed version (ground truth):
public int byteLength(){
class SizeOutputStream extends OutputStream {
    @Override public void write(    int b){
      size++;
    }
    int size;
  }
  SizeOutputStream sizeOut=new SizeOutputStream();
  DataOutputStream out=new DataOutputStream(sizeOut);
  try {
    out.writeUTF(value);
  }
 catch (  IOException ignore) {
  }
  return 1 + sizeOut.size;
}
Program: 13010
Project: 13010
Buggy source:
/** 
 * Constructor
 * @param context      Context for this javadoc instance.
 */
private DocEnv(Context context){
  context.put(docEnvKey,this);
  messager=Messager.instance0(context);
  syms=Symtab.instance(context);
  reader=JavadocClassReader.instance0(context);
  enter=JavadocEnter.instance0(context);
  attr=Attr.instance(context);
  names=Names.instance(context);
  externalizableSym=reader.enterClass(names.fromString("String_Node_Str"));
  chk=Check.instance(context);
  types=Types.instance(context);
  fileManager=context.get(JavaFileManager.class);
  this.doclocale=new DocLocale(this,"String_Node_Str",breakiterator);
}

Fixed version (ground truth):
/** 
 * Constructor
 * @param context      Context for this javadoc instance.
 */
private DocEnv(Context context){
  context.put(docEnvKey,this);
  messager=Messager.instance0(context);
  syms=Symtab.instance(context);
  reader=JavadocClassReader.instance0(context);
  enter=JavadocEnter.instance0(context);
  names=Names.instance(context);
  externalizableSym=reader.enterClass(names.fromString("String_Node_Str"));
  chk=Check.instance(context);
  types=Types.instance(context);
  fileManager=context.get(JavaFileManager.class);
  this.doclocale=new DocLocale(this,"String_Node_Str",breakiterator);
}
Program: 13011
Project: 13011
Buggy source:
/** 
 * Default class enter visitor method: do nothing.
 */
public void visitTree(JCTree tree){
  result=null;
}

Fixed version (ground truth):
/** 
 * Default class enter visitor method: do nothing.
 */
@Override public void visitTree(JCTree tree){
  result=null;
}
Program: 13014
Project: 13014
Buggy source:
/** 
 * Class enter visitor method for type parameters. Enter a symbol for type parameter in local scope, after checking that it is unique.
 */
public void visitTypeParameter(JCTypeParameter tree){
  TypeVar a=(tree.type != null) ? (TypeVar)tree.type : new TypeVar(tree.name,env.info.scope.owner,syms.botType);
  tree.type=a;
  if (chk.checkUnique(tree.pos(),a.tsym,env.info.scope)) {
    env.info.scope.enter(a.tsym);
  }
  result=a;
}

Fixed version (ground truth):
/** 
 * Class enter visitor method for type parameters. Enter a symbol for type parameter in local scope, after checking that it is unique.
 */
@Override public void visitTypeParameter(JCTypeParameter tree){
  TypeVar a=(tree.type != null) ? (TypeVar)tree.type : new TypeVar(tree.name,env.info.scope.owner,syms.botType);
  tree.type=a;
  if (chk.checkUnique(tree.pos(),a.tsym,env.info.scope)) {
    env.info.scope.enter(a.tsym);
  }
  result=a;
}
Program: 13015
Project: 13015
Buggy source:
/** 
 * Main method: enter one class from a list of toplevel trees and place the rest on uncompleted for later processing.
 * @param trees      The list of trees to be processed.
 * @param c          The class symbol to be processed.
 */
public void complete(List<JCCompilationUnit> trees,ClassSymbol c){
  annotate.enterStart();
  ListBuffer<ClassSymbol> prevUncompleted=uncompleted;
  if (memberEnter.completionEnabled)   uncompleted=new ListBuffer<ClassSymbol>();
  try {
    classEnter(trees,null);
    if (memberEnter.completionEnabled) {
      while (uncompleted.nonEmpty()) {
        ClassSymbol clazz=uncompleted.next();
        if (c == null || c == clazz || prevUncompleted == null)         clazz.complete();
 else         prevUncompleted.append(clazz);
      }
      for (      JCCompilationUnit tree : trees) {
        if (tree.starImportScope.elems == null) {
          JavaFileObject prev=log.useSource(tree.sourcefile);
          Env<AttrContext> env=typeEnvs.get(tree);
          if (env == null)           env=topLevelEnv(tree);
          memberEnter.memberEnter(tree,env);
          log.useSource(prev);
        }
      }
    }
  }
  finally {
    uncompleted=prevUncompleted;
    annotate.enterDone();
  }
}

Fixed version (ground truth):
/** 
 * Main method: enter one class from a list of toplevel trees and place the rest on uncompleted for later processing.
 * @param trees      The list of trees to be processed.
 * @param c          The class symbol to be processed.
 */
public void complete(List<JCCompilationUnit> trees,ClassSymbol c){
  annotate.enterStart();
  ListBuffer<ClassSymbol> prevUncompleted=uncompleted;
  if (memberEnter.completionEnabled)   uncompleted=new ListBuffer<ClassSymbol>();
  try {
    classEnter(trees,null);
    if (memberEnter.completionEnabled) {
      while (uncompleted.nonEmpty()) {
        ClassSymbol clazz=uncompleted.next();
        if (c == null || c == clazz || prevUncompleted == null)         clazz.complete();
 else         prevUncompleted.append(clazz);
      }
      for (      JCCompilationUnit tree : trees) {
        if (tree.starImportScope.elems == null) {
          JavaFileObject prev=log.useSource(tree.sourcefile);
          Env<AttrContext> topEnv=topLevelEnv(tree);
          memberEnter.memberEnter(tree,topEnv);
          log.useSource(prev);
        }
      }
    }
  }
  finally {
    uncompleted=prevUncompleted;
    annotate.enterDone();
  }
}
Program: 13016
Project: 13016
Buggy source:
public void visitNewArray(JCNewArray tree){
  tree.elemtype=translate(tree.elemtype,null);
  translate(tree.dims,syms.intType);
  tree.elems=translate(tree.elems,(tree.type == null) ? null : erasure(types.elemtype(tree.type)));
  tree.type=erasure(tree.type);
  result=tree;
}

Fixed version (ground truth):
public void visitNewArray(JCNewArray tree){
  tree.elemtype=translate(tree.elemtype,null);
  translate(tree.dims,syms.intType);
  if (tree.type != null) {
    tree.elems=translate(tree.elems,erasure(types.elemtype(tree.type)));
    tree.type=erasure(tree.type);
  }
 else {
    tree.elems=translate(tree.elems,null);
  }
  result=tree;
}
Program: 13017
Project: 13017
Buggy source:
/** 
 * A KindName representing a given symbol
 */
public static KindName kindName(Symbol sym){
switch (sym.getKind()) {
case PACKAGE:
    return KindName.PACKAGE;
case ENUM:
case ANNOTATION_TYPE:
case INTERFACE:
case CLASS:
  return KindName.CLASS;
case TYPE_PARAMETER:
return KindName.TYPEVAR;
case ENUM_CONSTANT:
case FIELD:
case PARAMETER:
case LOCAL_VARIABLE:
case EXCEPTION_PARAMETER:
return KindName.VAR;
case METHOD:
case CONSTRUCTOR:
case STATIC_INIT:
case INSTANCE_INIT:
return KindName.METHOD;
default :
if (sym.kind == VAL) return KindName.VAL;
 else throw new AssertionError("String_Node_Str" + sym.getKind());
}
}

Fixed version (ground truth):
/** 
 * A KindName representing a given symbol
 */
public static KindName kindName(Symbol sym){
switch (sym.getKind()) {
case PACKAGE:
    return KindName.PACKAGE;
case ENUM:
  return KindName.ENUM;
case ANNOTATION_TYPE:
case CLASS:
return KindName.CLASS;
case INTERFACE:
return KindName.INTERFACE;
case TYPE_PARAMETER:
return KindName.TYPEVAR;
case ENUM_CONSTANT:
case FIELD:
case PARAMETER:
case LOCAL_VARIABLE:
case EXCEPTION_PARAMETER:
return KindName.VAR;
case CONSTRUCTOR:
return KindName.CONSTRUCTOR;
case METHOD:
case STATIC_INIT:
case INSTANCE_INIT:
return KindName.METHOD;
default :
if (sym.kind == VAL) return KindName.VAL;
 else throw new AssertionError("String_Node_Str" + sym.getKind());
}
}
Program: 13018
Project: 13018
Buggy source:
/** 
 * The number of errors reported so far.
 */
public int errorCount(){
  if (delegateCompiler != null && delegateCompiler != this)   return delegateCompiler.errorCount();
 else   return log.nerrors;
}

Fixed version (ground truth):
/** 
 * The number of errors reported so far.
 */
public int errorCount(){
  if (delegateCompiler != null && delegateCompiler != this)   return delegateCompiler.errorCount();
 else {
    if (werror && log.nerrors == 0 && log.nwarnings > 0) {
      log.error("String_Node_Str");
    }
  }
  return log.nerrors;
}
Program: 13025
Project: 13025
Buggy source:
@RequestMapping(value="String_Node_Str",method=RequestMethod.POST) @ResponseBody public void createSelectionParam(@PathVariable String resourceName,@PathVariable String paramName,@RequestBody String paramValue){
  getResourceManager().createSelectionParam(resourceName,paramName,paramValue);
}

Fixed version (ground truth):
@RequestMapping(value="String_Node_Str",method=RequestMethod.POST) @ResponseBody public void createSelectionParam(@PathVariable String resourceName,@RequestParam String paramName,@RequestParam String paramValue){
  getResourceManager().createSelectionParam(resourceName,paramName,paramValue);
}
Program: 13027
Project: 13027
Buggy source:
@Override public void deleteConnectionParam(String name,String paramName){
  ConnectionDetails connectionDetails=connectionDetailsMap.get(name);
  if (connectionDetails != null)   connectionDetails.getParams().remove(paramName);
}

Fixed version (ground truth):
@Override public void deleteConnectionParam(String name,String paramName){
  ConnectionDetails connectionDetails=connectionDetailsMap.get(name);
  connectionDetails.removeParam(paramName);
}
Program: 13028
Project: 13028
Buggy source:
@Override public void createConnectionParam(String name,String paramName,String paramValue){
  ConnectionDetails connectionDetails=connectionDetailsMap.get(name);
  if (connectionDetails != null)   connectionDetails.put(paramName,paramValue);
}

Fixed version (ground truth):
@Override public void createConnectionParam(String name,String paramName,String paramValue){
  ConnectionDetails connectionDetails=connectionDetailsMap.get(name);
  connectionDetails.put(paramName,paramValue);
}
Program: 13029
Project: 13029
Buggy source:
@Override public void updateConnectionParam(String name,String paramName,String paramValue){
  ConnectionDetails connectionDetails=connectionDetailsMap.get(name);
  if (connectionDetails.getParam(paramName) != null) {
    connectionDetails.put(paramName,paramValue);
  }
 else {
  }
}

Fixed version (ground truth):
@Override public void updateConnectionParam(String name,String paramName,String paramValue){
  ConnectionDetails connectionDetails=connectionDetailsMap.get(name);
  connectionDetails.put(paramName,paramValue);
}
Program: 13030
Project: 13030
Buggy source:
@RequestMapping(value="String_Node_Str",method=RequestMethod.POST) @ResponseBody public void createConnection(@RequestBody String name){
  getConnectionDetailsManager().createConnection(name,null);
}

Fixed version (ground truth):
@RequestMapping(value="String_Node_Str",method=RequestMethod.POST) @ResponseBody public void createConnection(@RequestBody String name){
  getConnectionDetailsManager().createConnection(name,new ConnectionDetails());
}
Program: 13032
Project: 13032
Buggy source:
public List<GraphmlNode> getNonSubnetNeighbours(){
  List<GraphmlNode> neighbourNodes=new ArrayList<>();
  List<DeviceNeighbour> deviceNeighbours=device.getDeviceNeighbours();
  for (  DeviceNeighbour deviceNeighbour : deviceNeighbours) {
    String neighbourIpAddress=deviceNeighbour.getIpAddress();
    String neighbourHostName=deviceNeighbour.getNeighbourHostName();
    String neighbourMac=deviceNeighbour.getNeighbourMac();
    String neighbourId=getNeighbourIdFromAliases(neighbourHostName,neighbourIpAddress,neighbourMac);
    if (neighbourId == null) {
      logger.info("String_Node_Str" + deviceNeighbour);
      continue;
    }
    GraphmlNode graphmlNode=new GraphmlNode(neighbourId,neighbourId);
    neighbourNodes.add(graphmlNode);
  }
  return neighbourNodes;
}

Fixed version (ground truth):
public List<GraphmlNode> getNonSubnetNeighbours(){
  List<GraphmlNode> neighbourNodes=new ArrayList<>();
  List<DeviceNeighbour> deviceNeighbours=device.getDeviceNeighbours();
  for (  DeviceNeighbour deviceNeighbour : deviceNeighbours) {
    String neighbourIpAddress=deviceNeighbour.getIpAddress();
    String neighbourHostName=deviceNeighbour.getNeighbourHostName();
    String neighbourMac=deviceNeighbour.getNeighbourMac();
    AliasResolver aliasResolver=new AliasResolver(node,neighbourHostName,neighbourIpAddress,neighbourMac);
    String neighbourId=aliasResolver.getNeighbourIdFromAliases();
    if (neighbourId == null) {
      logger.info("String_Node_Str" + deviceNeighbour);
      continue;
    }
    GraphmlNode graphmlNode=new GraphmlNode(neighbourId,neighbourId);
    neighbourNodes.add(graphmlNode);
  }
  return neighbourNodes;
}
Program: 13034
Project: 13034
Buggy source:
@RequestMapping(value="String_Node_Str",method=RequestMethod.DELETE) @ResponseBody void deleteConnectionParam(@PathVariable String connectionDetailsName,@PathVariable String paramName){
  getConnectionDetailsManager().getConnection(connectionDetailsName).getParams().remove(paramName);
}

Fixed version (ground truth):
@RequestMapping(value="String_Node_Str",method=RequestMethod.DELETE) @ResponseBody void deleteConnectionParam(@PathVariable String connectionDetailsName,@PathVariable String paramName){
  getConnectionDetailsManager().deleteConnectionParam(connectionDetailsName,paramName);
}
Program: 13035
Project: 13035
Buggy source:
@RequestMapping(value="String_Node_Str",method=RequestMethod.POST) @ResponseBody void createConnectionParam(@PathVariable String connectionDetailsName,@RequestBody String paramName,@RequestBody String paramValue){
  Map<String,String> params=getConnectionDetailsManager().getConnection(connectionDetailsName).getParams();
  params.put(paramName,paramValue);
}

Fixed version (ground truth):
@RequestMapping(value="String_Node_Str",method=RequestMethod.POST) @ResponseBody void createConnectionParam(@PathVariable String connectionDetailsName,@RequestParam String paramName,@RequestParam String paramValue){
  getConnectionDetailsManager().createConnectionParam(connectionDetailsName,paramName,paramValue);
}
Program: 13036
Project: 13036
Buggy source:
@RequestMapping(value="String_Node_Str",method=RequestMethod.PUT) @ResponseBody void updateConnectionParam(@PathVariable String connectionDetailsName,@PathVariable String paramName,@RequestBody String paramValue){
  Map<String,String> params=getConnectionDetailsManager().getConnection(connectionDetailsName).getParams();
  params.put(paramName,paramValue);
}

Fixed version (ground truth):
@RequestMapping(value="String_Node_Str",method=RequestMethod.PUT) @ResponseBody void updateConnectionParam(@PathVariable String connectionDetailsName,@PathVariable String paramName,@RequestBody String paramValue){
  getConnectionDetailsManager().updateConnectionParam(connectionDetailsName,paramName,paramValue);
}
Program: 13037
Project: 13037
Buggy source:
public void setDeviceSubnets(List<Subnet> deviceSubnets){
  this.deviceSubnets=deviceSubnets;
}

Fixed version (ground truth):
public void setDeviceSubnets(Set<Subnet> deviceSubnets){
  this.deviceSubnets=deviceSubnets;
}
Program: 13038
Project: 13038
Buggy source:
public List<Subnet> getDeviceSubnets(){
  return deviceSubnets;
}

Fixed version (ground truth):
public Set<Subnet> getDeviceSubnets(){
  return deviceSubnets;
}
Program: 13040
Project: 13040
Buggy source:
public Device createDevice(DiscoveredDeviceData discoveredDeviceData){
  Device device=new Device(discoveredDeviceData.getName());
  List<DeviceNeighbour> deviceNeighbours=createDeviceNeighbours(discoveredDeviceData);
  List<Subnet> deviceSubnets=createDeviceSubnets(discoveredDeviceData);
  List<MacAddress> deviceMacAddresses=createDeviceMacAddreses(discoveredDeviceData);
  device.setDeviceNeighbours(deviceNeighbours);
  device.setDeviceSubnets(deviceSubnets);
  device.setDeviceMacAddresses(deviceMacAddresses);
  return device;
}

Fixed version (ground truth):
public Device createDevice(DiscoveredDeviceData discoveredDeviceData){
  Device device=new Device(discoveredDeviceData.getName());
  List<DeviceNeighbour> deviceNeighbours=createDeviceNeighbours(discoveredDeviceData);
  Set<Subnet> deviceSubnets=createDeviceSubnets(discoveredDeviceData);
  List<MacAddress> deviceMacAddresses=createDeviceMacAddreses(discoveredDeviceData);
  device.setDeviceNeighbours(deviceNeighbours);
  device.setDeviceSubnets(deviceSubnets);
  device.setDeviceMacAddresses(deviceMacAddresses);
  return device;
}
Program: 13041
Project: 13041
Buggy source:
private LogicalDeviceData createLogicalData(ObjectType objectType){
  List<DeviceNeighbour> neighbours=new ArrayList<>();
  List<ObjectType> objList2=objectType.getObject();
  for (  ObjectType type : objList2) {
    if (type.getObjectType().equals("String_Node_Str")) {
      neighbours.add(createNeighbour(objectType));
    }
 else {
      logger.info("String_Node_Str" + type.getObjectType());
    }
  }
  return new LogicalDeviceData(neighbours);
}

Fixed version (ground truth):
private LogicalDeviceData createLogicalData(ObjectType objectType){
  List<DeviceNeighbour> neighbours=new ArrayList<>();
  List<ObjectType> objList2=objectType.getObject();
  for (  ObjectType type : objList2) {
    if (type.getObjectType().equals("String_Node_Str")) {
      neighbours.add(createNeighbour(type));
      System.out.println("String_Node_Str");
    }
 else {
      logger.info("String_Node_Str" + type.getObjectType());
    }
  }
  return new LogicalDeviceData(neighbours);
}
Program: 13043
Project: 13043
Buggy source:
public String render(String template,HashMap<String,Object> parameters) throws Exception {
  VelocityEngine ve=new VelocityEngine();
  ve.init();
  Template t=ve.getTemplate(template);
  VelocityContext context=new VelocityContext();
  for (  Map.Entry<String,Object> entry : parameters.entrySet()) {
    context.put(entry.getKey(),entry.getValue());
  }
  StringWriter writer=new StringWriter();
  t.merge(context,writer);
  return writer.toString();
}

Fixed version (ground truth):
public String render(String template,HashMap<String,Object> parameters) throws Exception {
  VelocityEngine ve=new VelocityEngine();
  ve.setProperty(RuntimeConstants.RESOURCE_LOADER,"String_Node_Str");
  ve.setProperty("String_Node_Str",ClasspathResourceLoader.class.getName());
  ve.init();
  Template t=ve.getTemplate(template);
  VelocityContext context=new VelocityContext();
  for (  Map.Entry<String,Object> entry : parameters.entrySet()) {
    context.put(entry.getKey(),entry.getValue());
  }
  StringWriter writer=new StringWriter();
  t.merge(context,writer);
  return writer.toString();
}
Program: 13044
Project: 13044
Buggy source:
@Override public void networkDiscovered(NetworkDiscoveryResult result){
  File baseDir=new File(projectPath,ProjectConstants.networkGraphmlFileName);
  if (!baseDir.exists())   baseDir.mkdir();
  File labelDirPath=new File(baseDir,labelDirName);
  if (!labelDirPath.exists())   labelDirPath.mkdir();
  File graphmlDir=new File(labelDirName,getGraphmlDirName());
  if (!graphmlDir.exists())   graphmlDir.mkdir();
  Map<String,NodeDiscoveryResult> discoveryResultMap=result.getDiscoveredData();
  for (  String node : discoveryResultMap.keySet()) {
    byte[] discoveredDeviceData=(byte[])discoveryResultMap.get(node).getDiscoveredData("String_Node_Str");
    try {
      final String fileName=ProjectConstants.networkGraphmlFileName;
      final File nodeFile=new File(graphmlDir,fileName);
      String graphml=new String(discoveredDeviceData);
      FileUtils.writeStringToFile(nodeFile,graphml);
      FileWriter writer=new FileWriter(new File(labelDirName,"String_Node_Str" + "String_Node_Str"),true);
      writer.append(String.valueOf(fileName)).append("String_Node_Str");
      writer.close();
    }
 catch (    IOException e) {
      e.printStackTrace();
    }
  }
}

Fixed version (ground truth):
@Override public void networkDiscovered(NetworkDiscoveryResult result){
  File baseDir=new File(projectPath);
  if (!baseDir.exists())   baseDir.mkdir();
  File labelDirPath=new File(baseDir,labelDirName);
  if (!labelDirPath.exists())   labelDirPath.mkdir();
  File graphmlDir=new File(labelDirPath,graphmlDirName);
  if (!graphmlDir.exists())   graphmlDir.mkdir();
  Map<String,NodeDiscoveryResult> discoveryResultMap=result.getDiscoveredData();
  for (  String node : discoveryResultMap.keySet()) {
    byte[] discoveredDeviceData=(byte[])discoveryResultMap.get(node).getDiscoveredData("String_Node_Str");
    try {
      final String fileName=ProjectConstants.networkGraphmlFileName;
      final File nodeFile=new File(graphmlDir,fileName);
      String graphml=new String(discoveredDeviceData);
      FileUtils.writeStringToFile(nodeFile,graphml);
      FileWriter writer=new FileWriter(new File(labelDirPath,"String_Node_Str" + "String_Node_Str"),true);
      writer.append(String.valueOf(fileName)).append("String_Node_Str");
      writer.close();
    }
 catch (    IOException e) {
      e.printStackTrace();
    }
  }
}