nus-yam/ex-repair huggingface dataset:
Program: 29977
Project: 29977
Buggy source:
/** 
 * Generate code for Resource class corresponding to given parentBeanName and command
 * @param parentBeanName
 * @param metaData
 */
private void generateCommandResourceClass(String parentBeanName,CommandResourceMetaData metaData){
  String commandResourceClassName=getClassName(parentBeanName + getBeanName(metaData.resourcePath));
  String commandName=metaData.command;
  String commandDisplayName=metaData.resourcePath;
  String httpMethod=metaData.httpMethod;
  String commandAction=metaData.displayName;
  String baseClassName;
  if (httpMethod.equals("String_Node_Str")) {
    baseClassName="String_Node_Str";
  }
 else   if (httpMethod.equals("String_Node_Str")) {
    baseClassName="String_Node_Str";
  }
 else   if (httpMethod.equals("String_Node_Str")) {
    baseClassName="String_Node_Str";
  }
 else {
    throw new GeneratorException("String_Node_Str" + httpMethod);
  }
  ClassWriter writer=getClassWriter(commandResourceClassName,baseClassName,null);
  boolean isLinkedToParent=false;
  if (metaData.commandParams != null) {
    for (    CommandResourceMetaData.ParameterMetaData parameterMetaData : metaData.commandParams) {
      if (Constants.VAR_PARENT.equals(parameterMetaData.value)) {
        isLinkedToParent=true;
      }
    }
  }
  writer.createCommandResourceConstructor(commandResourceClassName,commandName,httpMethod,isLinkedToParent,metaData.commandParams,commandDisplayName,commandAction);
  writer.done();
}

Fixed version (ground truth):
/** 
 * Generate code for Resource class corresponding to given parentBeanName and command
 * @param parentBeanName
 * @param metaData
 */
private void generateCommandResourceClass(String parentBeanName,CommandResourceMetaData metaData){
  String commandResourceClassName=getClassName(parentBeanName + getBeanName(metaData.resourcePath));
  String commandName=metaData.command;
  String commandDisplayName=metaData.resourcePath;
  String httpMethod=metaData.httpMethod;
  String commandAction=metaData.displayName;
  String baseClassName;
  if ("String_Node_Str".equals(httpMethod)) {
    baseClassName="String_Node_Str";
  }
 else   if ("String_Node_Str".equals(httpMethod)) {
    baseClassName="String_Node_Str";
  }
 else   if ("String_Node_Str".equals(httpMethod)) {
    baseClassName="String_Node_Str";
  }
 else {
    throw new GeneratorException("String_Node_Str" + httpMethod);
  }
  ClassWriter writer=getClassWriter(commandResourceClassName,baseClassName,null);
  boolean isLinkedToParent=false;
  if (metaData.commandParams != null) {
    for (    CommandResourceMetaData.ParameterMetaData parameterMetaData : metaData.commandParams) {
      if (Constants.VAR_PARENT.equals(parameterMetaData.value)) {
        isLinkedToParent=true;
      }
    }
  }
  writer.createCommandResourceConstructor(commandResourceClassName,commandName,httpMethod,isLinkedToParent,metaData.commandParams,commandDisplayName,commandAction);
  writer.done();
}
Program: 29978
Project: 29978
Buggy source:
public JavaClientClassWriter(final ConfigModel model,final String className,Class parent,File baseDirectory){
  this.className=className;
  File packageDir=new File(baseDirectory,Constants.CLIENT_JAVA_PACKAGE_DIR);
  packageDir.deleteOnExit();
  boolean success=packageDir.exists() || packageDir.mkdirs();
  if (!success) {
    throw new RuntimeException("String_Node_Str");
  }
  File classFile=new File(packageDir,className + "String_Node_Str");
  try {
    classFile.createNewFile();
    classFile.deleteOnExit();
    source=new BufferedWriter(new FileWriter(classFile));
  }
 catch (  IOException ioe) {
    throw new RuntimeException(ioe);
  }
  if (parent.isAssignableFrom(RestClientBase.class)) {
    generateRestClientBaseChild(model);
  }
 else {
    generateSimpleCtor(parent.getName());
  }
}

Fixed version (ground truth):
public JavaClientClassWriter(final ConfigModel model,final String className,Class parent,File baseDirectory){
  this.className=className;
  File packageDir=new File(baseDirectory,Constants.CLIENT_JAVA_PACKAGE_DIR);
  packageDir.deleteOnExit();
  boolean success=packageDir.exists() || packageDir.mkdirs();
  if (!success) {
    throw new RuntimeException("String_Node_Str");
  }
  File classFile=new File(packageDir,className + "String_Node_Str");
  try {
    boolean createSuccess=classFile.createNewFile();
    if (!createSuccess) {
      Logger.getLogger(JavaClientClassWriter.class.getName()).log(Level.SEVERE,"String_Node_Str",classFile.getName());
    }
    classFile.deleteOnExit();
    source=new BufferedWriter(new FileWriter(classFile));
  }
 catch (  IOException ioe) {
    throw new RuntimeException(ioe);
  }
  if (parent.isAssignableFrom(RestClientBase.class)) {
    generateRestClientBaseChild(model);
  }
 else {
    generateSimpleCtor(parent.getName());
  }
}
Program: 29979
Project: 29979
Buggy source:
private void add(File source,JarOutputStream target) throws IOException {
  BufferedInputStream in=null;
  try {
    if (source.isDirectory()) {
      String name=source.getPath().replace("String_Node_Str","String_Node_Str");
      if (!name.isEmpty()) {
        if (!name.endsWith("String_Node_Str")) {
          name+="String_Node_Str";
        }
        JarEntry entry=new JarEntry(name);
        entry.setTime(source.lastModified());
        target.putNextEntry(entry);
        target.closeEntry();
      }
      for (      File nestedFile : source.listFiles()) {
        add(nestedFile,target);
      }
      return;
    }
    String sourcePath=source.getPath().replace("String_Node_Str","String_Node_Str").substring(baseDirectory.getPath().length() + 1);
    JarEntry entry=new JarEntry(sourcePath);
    entry.setTime(source.lastModified());
    target.putNextEntry(entry);
    in=new BufferedInputStream(new FileInputStream(source));
    byte[] buffer=new byte[1024];
    while (true) {
      int count=in.read(buffer);
      if (count == -1) {
        break;
      }
      target.write(buffer,0,count);
    }
    target.closeEntry();
  }
  finally {
    if (in != null) {
      in.close();
    }
  }
}

Fixed version (ground truth):
private void add(File source,JarOutputStream target) throws IOException {
  BufferedInputStream in=null;
  try {
    String sourcePath=source.getPath().replace("String_Node_Str","String_Node_Str").substring(baseDirectory.getPath().length() + 1);
    JarEntry entry=new JarEntry(sourcePath);
    entry.setTime(source.lastModified());
    target.putNextEntry(entry);
    in=new BufferedInputStream(new FileInputStream(source));
    byte[] buffer=new byte[1024];
    while (true) {
      int count=in.read(buffer);
      if (count == -1) {
        break;
      }
      target.write(buffer,0,count);
    }
    target.closeEntry();
  }
  finally {
    if (in != null) {
      in.close();
    }
  }
}
Program: 29980
Project: 29980
Buggy source:
private void compileSources(){
  try {
    List<File> files=new ArrayList<File>();
    gatherFiles(baseDirectory,files);
    JavaCompiler compiler=ToolProvider.getSystemJavaCompiler();
    StandardJavaFileManager fileManager=compiler.getStandardFileManager(null,null,null);
    List<String> options=new ArrayList<String>();
    options.add("String_Node_Str");
    StringBuilder sb=new StringBuilder();
    sb.append(ASClassLoaderUtil.getModuleClassPath(habitat,"String_Node_Str",null));
    options.add(sb.toString());
    Iterable<? extends JavaFileObject> compilationUnits=fileManager.getJavaFileObjectsFromFiles(files);
    boolean success=compiler.getTask(null,fileManager,null,options,null,compilationUnits).call();
    fileManager.close();
  }
 catch (  IOException ex) {
    Logger.getLogger(JavaClientGenerator.class.getName()).log(Level.SEVERE,null,ex);
  }
}

Fixed version (ground truth):
private void compileSources(){
  try {
    List<File> files=new ArrayList<File>();
    gatherFiles(baseDirectory,files);
    JavaCompiler compiler=ToolProvider.getSystemJavaCompiler();
    StandardJavaFileManager fileManager=compiler.getStandardFileManager(null,null,null);
    List<String> options=new ArrayList<String>();
    options.add("String_Node_Str");
    StringBuilder sb=new StringBuilder();
    sb.append(ASClassLoaderUtil.getModuleClassPath(habitat,"String_Node_Str",null));
    options.add(sb.toString());
    Iterable<? extends JavaFileObject> compilationUnits=fileManager.getJavaFileObjectsFromFiles(files);
    if (!compiler.getTask(null,fileManager,null,options,null,compilationUnits).call()) {
      Logger.getLogger(JavaClientGenerator.class.getName()).log(Level.INFO,"String_Node_Str");
    }
    fileManager.close();
  }
 catch (  IOException ex) {
    Logger.getLogger(JavaClientGenerator.class.getName()).log(Level.SEVERE,null,ex);
  }
}
Program: 29981
Project: 29981
Buggy source:
private void addPom(String versionString){
  try {
    String pom=new Scanner(getClass().getResourceAsStream("String_Node_Str")).useDelimiter("String_Node_Str").next();
    pom=pom.replace("String_Node_Str",versionString);
    File out=File.createTempFile("String_Node_Str","String_Node_Str");
    out.deleteOnExit();
    FileWriter writer=new FileWriter(out);
    writer.write(pom);
    writer.close();
    artifacts.put("String_Node_Str",out.toURI());
  }
 catch (  IOException ex) {
    Logger.getLogger(JavaClientGenerator.class.getName()).log(Level.SEVERE,null,ex);
  }
}

Fixed version (ground truth):
private void addPom(String versionString){
  FileWriter writer=null;
  try {
    String pom=new Scanner(Thread.currentThread().getContextClassLoader().getResourceAsStream("String_Node_Str")).useDelimiter("String_Node_Str").next();
    pom=pom.replace("String_Node_Str",versionString);
    File out=File.createTempFile("String_Node_Str","String_Node_Str");
    out.deleteOnExit();
    writer=new FileWriter(out);
    writer.write(pom);
    writer.close();
    artifacts.put("String_Node_Str",out.toURI());
  }
 catch (  IOException ex) {
    Logger.getLogger(JavaClientGenerator.class.getName()).log(Level.SEVERE,null,ex);
  }
 finally {
    if (writer != null) {
      try {
        writer.close();
      }
 catch (      Exception e) {
      }
    }
  }
}
Program: 29982
Project: 29982
Buggy source:
public PythonClientClassWriter(ConfigModel model,String className,Class parent,File baseDirectory){
  this.className=className;
  final boolean hasKey=Util.getKeyAttributeName(model) != null;
  packageDir=baseDirectory;
  packageDir.deleteOnExit();
  boolean success=packageDir.exists() || packageDir.mkdirs();
  if (!success) {
    throw new RuntimeException("String_Node_Str");
  }
  source=new StringBuilder(TMPL_CTOR.replace("String_Node_Str",className));
}

Fixed version (ground truth):
public PythonClientClassWriter(ConfigModel model,String className,Class parent,File baseDirectory){
  this.className=className;
  packageDir=baseDirectory;
  packageDir.deleteOnExit();
  boolean success=packageDir.exists() || packageDir.mkdirs();
  if (!success) {
    throw new RuntimeException("String_Node_Str");
  }
  source=new StringBuilder(TMPL_CTOR.replace("String_Node_Str",className));
}
Program: 29983
Project: 29983
Buggy source:
static public HashMap<String,String> getStringMap(Map map){
  HashMap<String,String> stringMap=new HashMap<String,String>();
  if (map != null) {
    String key=null;
    Object value=null;
    Iterator<String> iterator=map.keySet().iterator();
    while (iterator.hasNext()) {
      key=iterator.next();
      value=map.get(key);
      stringMap.put(key,value.toString());
    }
  }
  return stringMap;
}

Fixed version (ground truth):
static public HashMap<String,String> getStringMap(Map<String,Object> map){
  HashMap<String,String> stringMap=new HashMap<String,String>();
  if (map != null) {
    String key=null;
    Object value=null;
    for (    Map.Entry<String,Object> entry : map.entrySet()) {
      stringMap.put(entry.getKey(),entry.getValue().toString());
    }
  }
  return stringMap;
}
Program: 29986
Project: 29986
Buggy source:
/** 
 * Pick out all methods in the listener with the correct annotation, look up the referenced Probe and return a list of all such pairs. Validate that the methods really do matchup properly.
 * @throws RuntimeException if there is any serious problem.
 * @param listenerClass
 * @return
 */
private List<MethodProbe> handleListenerAnnotations(Class listenerClass,String invokerId){
  List<MethodProbe> mp=new LinkedList<MethodProbe>();
  for (  Method method : listenerClass.getMethods()) {
    Annotation[] anns=method.getAnnotations();
    ProbeListener probeAnn=method.getAnnotation(ProbeListener.class);
    if (probeAnn == null)     continue;
    String probeString=probeAnn.value();
    if ((probeString != null) && (invokerId != null)) {
      String[] strArr=probeString.split("String_Node_Str");
      probeString=strArr[0] + "String_Node_Str" + strArr[1]+ "String_Node_Str"+ strArr[2]+ invokerId+ "String_Node_Str"+ strArr[3];
    }
    FlashlightProbe probe=probeRegistry.getProbe(probeString);
    if (probe == null) {
      String errStr=localStrings.getLocalString("String_Node_Str","String_Node_Str",probeString);
      throw new RuntimeException(errStr);
    }
    mp.add(new MethodProbe(method,probe));
  }
  return mp;
}

Fixed version (ground truth):
/** 
 * Pick out all methods in the listener with the correct annotation, look up the referenced Probe and return a list of all such pairs. Validate that the methods really do matchup properly.
 * @throws RuntimeException if there is any serious problem.
 * @param listenerClass
 * @return
 */
private List<MethodProbe> handleListenerAnnotations(Class listenerClass,String invokerId){
  List<MethodProbe> mp=new LinkedList<MethodProbe>();
  for (  Method method : listenerClass.getMethods()) {
    ProbeListener probeAnn=method.getAnnotation(ProbeListener.class);
    if (probeAnn == null)     continue;
    String probeString=probeAnn.value();
    if ((probeString != null) && (invokerId != null)) {
      String[] strArr=probeString.split("String_Node_Str");
      probeString=strArr[0] + "String_Node_Str" + strArr[1]+ "String_Node_Str"+ strArr[2]+ invokerId+ "String_Node_Str"+ strArr[3];
    }
    FlashlightProbe probe=probeRegistry.getProbe(probeString);
    if (probe == null) {
      String errStr=localStrings.getLocalString("String_Node_Str","String_Node_Str",probeString);
      throw new RuntimeException(errStr);
    }
    mp.add(new MethodProbe(method,probe));
  }
  return mp;
}
Program: 29987
Project: 29987
Buggy source:
public void start(BundleContext bCtx){
  this.myBundleContext=bCtx;
}

Fixed version (ground truth):
public void start(BundleContext bCtx){
}
Program: 29988
Project: 29988
Buggy source:
WindowsSystemEnvironment(){
  super();
  getWmicResult("String_Node_Str","String_Node_Str","String_Node_Str");
  setSystemModel(getWmicResult("String_Node_Str","String_Node_Str","String_Node_Str"));
  setSystemManufacturer(getWmicResult("String_Node_Str","String_Node_Str","String_Node_Str"));
  setSerialNumber(getWmicResult("String_Node_Str","String_Node_Str","String_Node_Str"));
  String cpuMfr=getWmicResult("String_Node_Str","String_Node_Str","String_Node_Str");
  if (cpuMfr.length() == 0) {
    String procId=System.getenv("String_Node_Str");
    if (procId != null) {
      String[] s=procId.split("String_Node_Str");
      cpuMfr=s[s.length - 1].trim();
    }
  }
  setCpuManufacturer(cpuMfr);
  setSockets(getWindowsSockets());
  setCores(getWindowsCores());
  setVirtCpus(getWindowsVirtCpus());
  setPhysMem(getWindowsPhysMem());
  setCpuName(getWmicResult("String_Node_Str","String_Node_Str","String_Node_Str"));
  setClockRate(getWmicResult("String_Node_Str","String_Node_Str","String_Node_Str"));
  try {
    File f=new File("String_Node_Str");
    if (f.exists()) {
      f.delete();
    }
  }
 catch (  Exception e) {
  }
}

Fixed version (ground truth):
WindowsSystemEnvironment(){
  super();
  getWmicResult("String_Node_Str","String_Node_Str","String_Node_Str");
  setSystemModel(getWmicResult("String_Node_Str","String_Node_Str","String_Node_Str"));
  setSystemManufacturer(getWmicResult("String_Node_Str","String_Node_Str","String_Node_Str"));
  setSerialNumber(getWmicResult("String_Node_Str","String_Node_Str","String_Node_Str"));
  String cpuMfr=getWmicResult("String_Node_Str","String_Node_Str","String_Node_Str");
  if (cpuMfr.length() == 0) {
    String procId=System.getenv("String_Node_Str");
    if (procId != null) {
      String[] s=procId.split("String_Node_Str");
      cpuMfr=s[s.length - 1].trim();
    }
  }
  setCpuManufacturer(cpuMfr);
  setSockets(getWindowsSockets());
  setCores(getWindowsCores());
  setVirtCpus(getWindowsVirtCpus());
  setPhysMem(getWindowsPhysMem());
  setCpuName(getWmicResult("String_Node_Str","String_Node_Str","String_Node_Str"));
  setClockRate(getWmicResult("String_Node_Str","String_Node_Str","String_Node_Str"));
  try {
    File f=new File("String_Node_Str");
    if (f.exists()) {
      boolean b=f.delete();
      if (!b)       logger.finest("String_Node_Str" + f.getAbsolutePath());
    }
  }
 catch (  Exception e) {
    logger.finest(e.getMessage());
  }
}
Program: 29989
Project: 29989
Buggy source:
public RegistrationAccount getRegistrationAccount(RegistrationAccountConfig rc) throws ClassNotFoundException, NoSuchMethodException, InstantiationException, IllegalAccessException, InvocationTargetException {
  final String className=rc.getClassName();
  Class registrationClass=Class.forName(rc.getClassName());
  if (rc.getParams() != null) {
    Class[] types={RegistrationAccountConfig.class};
    Constructor constructor=registrationClass.getConstructor(types);
    return (RegistrationAccount)constructor.newInstance(new Object[]{rc});
  }
  return (RegistrationAccount)registrationClass.newInstance();
}

Fixed version (ground truth):
public RegistrationAccount getRegistrationAccount(RegistrationAccountConfig rc) throws ClassNotFoundException, NoSuchMethodException, InstantiationException, IllegalAccessException, InvocationTargetException {
  Class registrationClass=Class.forName(rc.getClassName());
  if (rc.getParams() != null) {
    Class[] types={RegistrationAccountConfig.class};
    Constructor constructor=registrationClass.getConstructor(types);
    return (RegistrationAccount)constructor.newInstance(new Object[]{rc});
  }
  return (RegistrationAccount)registrationClass.newInstance();
}
Program: 29990
Project: 29990
Buggy source:
public RegistrationService getRegistrationService(RegistrationServiceConfig rc) throws ClassNotFoundException, NoSuchMethodException, InstantiationException, IllegalAccessException, InvocationTargetException {
  final String className=rc.getClassName();
  Class registrationClass=Class.forName(rc.getClassName());
  if (rc.getParams() != null) {
    Class[] types={RegistrationServiceConfig.class};
    Constructor constructor=registrationClass.getConstructor(types);
    return (RegistrationService)constructor.newInstance(new Object[]{rc});
  }
  return (RegistrationService)registrationClass.newInstance();
}

Fixed version (ground truth):
public RegistrationService getRegistrationService(RegistrationServiceConfig rc) throws ClassNotFoundException, NoSuchMethodException, InstantiationException, IllegalAccessException, InvocationTargetException {
  Class registrationClass=Class.forName(rc.getClassName());
  if (rc.getParams() != null) {
    Class[] types={RegistrationServiceConfig.class};
    Constructor constructor=registrationClass.getConstructor(types);
    return (RegistrationService)constructor.newInstance(new Object[]{rc});
  }
  return (RegistrationService)registrationClass.newInstance();
}
Program: 29991
Project: 29991
Buggy source:
private String getLogMessage(LogRecord record) throws IOException {
  String logMessage=record.getMessage();
  if (logMessage == null || logMessage.trim().equals("String_Node_Str")) {
    if (record.getThrown() != null) {
      StringWriter sw=new StringWriter();
      PrintWriter pw=new PrintWriter(sw);
      record.getThrown().printStackTrace(pw);
      pw.close();
      logMessage=sw.toString();
      sw.close();
    }
 else {
      logMessage="String_Node_Str";
    }
  }
 else {
    if (logMessage.indexOf("String_Node_Str") >= 0 && record.getParameters() != null) {
      logMessage=java.text.MessageFormat.format(logMessage,record.getParameters());
    }
 else {
      ResourceBundle rb=getResourceBundle(record.getLoggerName());
      if (rb != null) {
        try {
          logMessage=MessageFormat.format(rb.getString(logMessage),record.getParameters());
        }
 catch (        java.util.MissingResourceException e) {
        }
      }
    }
  }
  return logMessage;
}

Fixed version (ground truth):
private String getLogMessage(LogRecord record) throws IOException {
  String logMessage=record.getMessage();
  if (logMessage == null || logMessage.trim().equals("String_Node_Str")) {
    if (record.getThrown() != null) {
      StringWriter sw=new StringWriter();
      PrintWriter pw=new PrintWriter(sw);
      record.getThrown().printStackTrace(pw);
      pw.close();
      logMessage=sw.toString();
      sw.close();
    }
 else {
      logMessage="String_Node_Str";
    }
  }
 else {
    if (logMessage.indexOf("String_Node_Str") >= 0 && logMessage.contains("String_Node_Str") && record.getParameters() != null) {
      logMessage=java.text.MessageFormat.format(logMessage,record.getParameters());
    }
 else {
      ResourceBundle rb=getResourceBundle(record.getLoggerName());
      if (rb != null) {
        try {
          logMessage=MessageFormat.format(rb.getString(logMessage),record.getParameters());
        }
 catch (        java.util.MissingResourceException e) {
        }
      }
    }
  }
  return logMessage;
}
Program: 29993
Project: 29993
Buggy source:
/** 
 * This method invokes wmic outside of the normal environment collection routines. An initial call to wmic can be costly in terms of time.   <code> Details of why the first call is costly can be found at: http://support.microsoft.com/kb/290216/en-us "When you run the Wmic.exe utility for the first time, the utility compiles its .mof files into the repository. To save time during Windows installation, this operation takes place as necessary." </code>
 */
private String getWmicResult(String alias,String verb,String property){
  String res="String_Node_Str";
  BufferedReader in=null;
  try {
    ProcessBuilder pb=new ProcessBuilder("String_Node_Str","String_Node_Str","String_Node_Str",alias,verb,property);
    Process p=pb.start();
    BufferedWriter bw=new BufferedWriter(new OutputStreamWriter(p.getOutputStream()));
    bw.write(13);
    bw.flush();
    bw.close();
    p.waitFor();
    if (p.exitValue() == 0) {
      in=new BufferedReader(new InputStreamReader(p.getInputStream()));
      String line=null;
      while ((line=in.readLine()) != null) {
        line=line.trim();
        if (line.length() == 0) {
          continue;
        }
        res=line;
      }
      return res;
    }
  }
 catch (  Exception e) {
  }
 finally {
    if (in != null) {
      try {
        in.close();
      }
 catch (      IOException e) {
      }
    }
  }
  return res.trim();
}

Fixed version (ground truth):
/** 
 * This method invokes wmic outside of the normal environment collection routines. An initial call to wmic can be costly in terms of time.   <code> Details of why the first call is costly can be found at: http://support.microsoft.com/kb/290216/en-us "When you run the Wmic.exe utility for the first time, the utility compiles its .mof files into the repository. To save time during Windows installation, this operation takes place as necessary." </code>
 */
private String getWmicResult(String alias,String verb,String property){
  String res="String_Node_Str";
  BufferedReader in=null;
  BufferedWriter bw=null;
  try {
    ProcessBuilder pb=new ProcessBuilder("String_Node_Str","String_Node_Str","String_Node_Str",alias,verb,property);
    Process p=pb.start();
    bw=new BufferedWriter(new OutputStreamWriter(p.getOutputStream()));
    bw.write(13);
    p.waitFor();
    if (p.exitValue() == 0) {
      in=new BufferedReader(new InputStreamReader(p.getInputStream()));
      String line=null;
      while ((line=in.readLine()) != null) {
        line=line.trim();
        if (line.length() == 0) {
          continue;
        }
        res=line;
      }
      return res;
    }
  }
 catch (  Exception e) {
  }
 finally {
    if (in != null) {
      try {
        in.close();
      }
 catch (      IOException e) {
      }
    }
    if (bw != null) {
      try {
        bw.flush();
      }
 catch (      Exception ex) {
      }
      try {
        bw.close();
      }
 catch (      Exception ex) {
      }
    }
  }
  return res.trim();
}
Program: 29994
Project: 29994
Buggy source:
public synchronized Map<String,String> updateLoggingProperties(Map<String,String> properties,String targetConfigName) throws IOException {
  Map<String,String> m=new HashMap<String,String>();
  try {
    if (!openPropFile(targetConfigName))     return null;
    String key=null;
    for (    Map.Entry<String,String> e : properties.entrySet()) {
      if (e.getValue() == null)       continue;
      key=LoggingXMLNames.xmltoPropsMap.get(e.getKey());
      if (key == null) {
        key=e.getKey();
      }
      String property=(String)props.setProperty(key,e.getValue());
      if (e.getKey().contains("String_Node_Str")) {
        setWebLoggers(e.getValue());
      }
      m.put(key,property);
    }
    closePropFile();
  }
 catch (  IOException ex) {
    throw ex;
  }
catch (  Exception e) {
  }
  return m;
}

Fixed version (ground truth):
public synchronized Map<String,String> updateLoggingProperties(Map<String,String> properties,String targetConfigName) throws IOException {
  Map<String,String> m=new HashMap<String,String>();
  try {
    if (!openPropFile(targetConfigName))     return null;
    String key=null;
    for (    Map.Entry<String,String> e : properties.entrySet()) {
      if (e.getValue() == null)       continue;
      key=LoggingXMLNames.xmltoPropsMap.get(e.getKey());
      if (key == null) {
        key=e.getKey();
      }
      String property=(String)props.setProperty(key,e.getValue());
      if (e.getKey().contains("String_Node_Str")) {
        setWebLoggers(e.getValue());
      }
      if (property == null) {
        property=(String)props.setProperty(key,e.getValue());
      }
      m.put(key,property);
      String loggerName=key.substring(0,key.lastIndexOf("String_Node_Str"));
      Logger existing=LogManager.getLogManager().getLogger(loggerName);
      if (existing == null) {
        Logger newLogger=new Logger(loggerName,null){
        }
;
        newLogger.setLevel(Level.parse(property));
synchronized (Logger.class) {
          LogManager.getLogManager().addLogger(newLogger);
        }
      }
    }
    closePropFile();
  }
 catch (  IOException ex) {
    throw ex;
  }
catch (  Exception e) {
  }
  return m;
}
Program: 29997
Project: 29997
Buggy source:
private void processGeneratedContent(final File generatedContentParam,final ExtendedDeploymentContext deploymentContext,final Logger logger) throws IOException {
  if (generatedContentParam == null) {
    return;
  }
  final File baseDir=deploymentContext.getScratchDir("String_Node_Str").getParentFile().getParentFile();
  if (!baseDir.exists() && !baseDir.mkdirs()) {
    throw new IOException(localStrings.getLocalString("String_Node_Str","String_Node_Str",baseDir.getAbsolutePath()));
  }
  final URI baseURI=baseDir.toURI();
  final ZipFile zipFile=new ZipFile(generatedContentParam);
  for (Enumeration<? extends ZipEntry> entries=zipFile.entries(); entries.hasMoreElements(); ) {
    final ZipEntry zipEntry=entries.nextElement();
    final URI outputFileURI=Util.resolve(baseURI,zipEntry.getName());
    final File outputFile=new File(outputFileURI);
    if (zipEntry.isDirectory()) {
      outputFile.mkdirs();
    }
 else {
      final FileOutputStream os=new FileOutputStream(outputFile);
      try {
        FileUtils.copy(zipFile.getInputStream(zipEntry),os,zipEntry.getSize());
      }
 catch (      IOException e) {
        os.close();
      }
    }
  }
}

Fixed version (ground truth):
private void processGeneratedContent(final File generatedContentParam,final ExtendedDeploymentContext deploymentContext,final Logger logger) throws IOException {
  if (generatedContentParam == null) {
    return;
  }
  final File baseDir=deploymentContext.getScratchDir("String_Node_Str").getParentFile().getParentFile();
  if (!baseDir.exists() && !baseDir.mkdirs()) {
    throw new IOException(localStrings.getLocalString("String_Node_Str","String_Node_Str",baseDir.getAbsolutePath()));
  }
  final URI baseURI=baseDir.toURI();
  final ZipFile zipFile=new ZipFile(generatedContentParam);
  for (Enumeration<? extends ZipEntry> entries=zipFile.entries(); entries.hasMoreElements(); ) {
    final ZipEntry zipEntry=entries.nextElement();
    final URI outputFileURI=Util.resolve(baseURI,zipEntry.getName());
    final File outputFile=new File(outputFileURI);
    if (zipEntry.isDirectory()) {
      if (!outputFile.exists() && !outputFile.mkdirs()) {
        throw new IOException(localStrings.getLocalString("String_Node_Str","String_Node_Str",baseDir.getAbsolutePath()));
      }
    }
 else {
      final FileOutputStream os=new FileOutputStream(outputFile);
      try {
        FileUtils.copy(zipFile.getInputStream(zipEntry),os,zipEntry.getSize());
      }
 catch (      IOException e) {
        os.close();
      }
    }
  }
}
Program: 29999
Project: 29999
Buggy source:
public void actOn(Logger logger){
  for (  EngineRef module : get("String_Node_Str",EngineRef.class)) {
    try {
      module.stop(context);
    }
 catch (    Exception e) {
    }
  }
  try {
    PreDestroy.class.cast(context).preDestroy();
  }
 catch (  Exception e) {
  }
  for (  EngineRef module : get("String_Node_Str",EngineRef.class)) {
    try {
      module.unload(context);
    }
 catch (    Exception e) {
    }
  }
  try {
    ApplicationInfo appInfo=appRegistry.get(appName);
    if (appInfo != null) {
      events.send(new Event<ApplicationInfo>(Deployment.APPLICATION_DISABLED,appInfo));
    }
  }
 catch (  Exception e) {
  }
  for (  EngineRef module : get("String_Node_Str",EngineRef.class)) {
    try {
      module.clean(context);
    }
 catch (    Exception e) {
    }
  }
  if (!commandParams.keepfailedstubs) {
    try {
      context.clean();
    }
 catch (    Exception e) {
    }
  }
  appRegistry.remove(appName);
}

Fixed version (ground truth):
@Override public void actOn(Logger logger){
  for (  EngineRef module : get("String_Node_Str",EngineRef.class)) {
    try {
      module.stop(context);
    }
 catch (    Exception e) {
    }
  }
  try {
    PreDestroy.class.cast(context).preDestroy();
  }
 catch (  Exception e) {
  }
  for (  EngineRef module : get("String_Node_Str",EngineRef.class)) {
    try {
      module.unload(context);
    }
 catch (    Exception e) {
    }
  }
  try {
    ApplicationInfo appInfo=appRegistry.get(appName);
    if (appInfo != null) {
      events.send(new Event<ApplicationInfo>(Deployment.APPLICATION_DISABLED,appInfo));
    }
  }
 catch (  Exception e) {
  }
  for (  EngineRef module : get("String_Node_Str",EngineRef.class)) {
    try {
      module.clean(context);
    }
 catch (    Exception e) {
    }
  }
  if (!commandParams.keepfailedstubs) {
    try {
      context.clean();
    }
 catch (    Exception e) {
    }
  }
  appRegistry.remove(appName);
}
Program: 30001
Project: 30001
Buggy source:
private void processGeneratedContent(final File generatedContentParam,final ExtendedDeploymentContext deploymentContext,final Logger logger) throws IOException {
  if (generatedContentParam == null) {
    return;
  }
  final File baseDir=deploymentContext.getScratchDir("String_Node_Str").getParentFile().getParentFile();
  if (!baseDir.mkdirs()) {
    throw new IOException(localStrings.getLocalString("String_Node_Str","String_Node_Str",baseDir.getAbsolutePath()));
  }
  final URI baseURI=baseDir.toURI();
  final ZipFile zipFile=new ZipFile(generatedContentParam);
  for (Enumeration<? extends ZipEntry> entries=zipFile.entries(); entries.hasMoreElements(); ) {
    final ZipEntry zipEntry=entries.nextElement();
    final URI outputFileURI=Util.resolve(baseURI,zipEntry.getName());
    final File outputFile=new File(outputFileURI);
    if (zipEntry.isDirectory()) {
      outputFile.mkdirs();
    }
 else {
      final FileOutputStream os=new FileOutputStream(outputFile);
      try {
        FileUtils.copy(zipFile.getInputStream(zipEntry),os,zipEntry.getSize());
      }
 catch (      IOException e) {
        os.close();
      }
    }
  }
}

Fixed version (ground truth):
private void processGeneratedContent(final File generatedContentParam,final ExtendedDeploymentContext deploymentContext,final Logger logger) throws IOException {
  if (generatedContentParam == null) {
    return;
  }
  final File baseDir=deploymentContext.getScratchDir("String_Node_Str").getParentFile().getParentFile();
  if (!baseDir.exists() && !baseDir.mkdirs()) {
    throw new IOException(localStrings.getLocalString("String_Node_Str","String_Node_Str",baseDir.getAbsolutePath()));
  }
  final URI baseURI=baseDir.toURI();
  final ZipFile zipFile=new ZipFile(generatedContentParam);
  for (Enumeration<? extends ZipEntry> entries=zipFile.entries(); entries.hasMoreElements(); ) {
    final ZipEntry zipEntry=entries.nextElement();
    final URI outputFileURI=Util.resolve(baseURI,zipEntry.getName());
    final File outputFile=new File(outputFileURI);
    if (zipEntry.isDirectory()) {
      outputFile.mkdirs();
    }
 else {
      final FileOutputStream os=new FileOutputStream(outputFile);
      try {
        FileUtils.copy(zipFile.getInputStream(zipEntry),os,zipEntry.getSize());
      }
 catch (      IOException e) {
        os.close();
      }
    }
  }
}
Program: 30002
Project: 30002
Buggy source:
private void processGeneratedContent(final File generatedContentParam,final ExtendedDeploymentContext deploymentContext,final Logger logger) throws IOException {
  if (generatedContentParam == null) {
    return;
  }
  final File baseDir=deploymentContext.getScratchDir("String_Node_Str").getParentFile().getParentFile();
  baseDir.mkdirs();
  final URI baseURI=baseDir.toURI();
  final ZipFile zipFile=new ZipFile(generatedContentParam);
  for (Enumeration<? extends ZipEntry> entries=zipFile.entries(); entries.hasMoreElements(); ) {
    final ZipEntry zipEntry=entries.nextElement();
    final URI outputFileURI=Util.resolve(baseURI,zipEntry.getName());
    final File outputFile=new File(outputFileURI);
    if (zipEntry.isDirectory()) {
      outputFile.mkdirs();
    }
 else {
      final FileOutputStream os=new FileOutputStream(outputFile);
      FileUtils.copy(zipFile.getInputStream(zipEntry),os,zipEntry.getSize());
    }
  }
}

Fixed version (ground truth):
private void processGeneratedContent(final File generatedContentParam,final ExtendedDeploymentContext deploymentContext,final Logger logger) throws IOException {
  if (generatedContentParam == null) {
    return;
  }
  final File baseDir=deploymentContext.getScratchDir("String_Node_Str").getParentFile().getParentFile();
  if (!baseDir.mkdirs()) {
    throw new IOException(localStrings.getLocalString("String_Node_Str","String_Node_Str",baseDir.getAbsolutePath()));
  }
  final URI baseURI=baseDir.toURI();
  final ZipFile zipFile=new ZipFile(generatedContentParam);
  for (Enumeration<? extends ZipEntry> entries=zipFile.entries(); entries.hasMoreElements(); ) {
    final ZipEntry zipEntry=entries.nextElement();
    final URI outputFileURI=Util.resolve(baseURI,zipEntry.getName());
    final File outputFile=new File(outputFileURI);
    if (zipEntry.isDirectory()) {
      outputFile.mkdirs();
    }
 else {
      final FileOutputStream os=new FileOutputStream(outputFile);
      try {
        FileUtils.copy(zipFile.getInputStream(zipEntry),os,zipEntry.getSize());
      }
 catch (      IOException e) {
        os.close();
      }
    }
  }
}
Program: 30004
Project: 30004
Buggy source:
public void initialize(Object config) throws IOException {
  String sun_acc=System.getProperty(ACC_XML,"String_Node_Str");
  List<MessageSecurityConfig> msgconfigs=null;
  if (Globals.getDefaultHabitat() == null && sun_acc != null) {
    try {
      InputStream is=new FileInputStream(sun_acc);
      JAXBContext jc=JAXBContext.newInstance(ClientContainer.class);
      Unmarshaller u=jc.createUnmarshaller();
      ClientContainer cc=(ClientContainer)u.unmarshal(is);
      msgconfigs=cc.getMessageSecurityConfig();
    }
 catch (    JAXBException ex) {
      _logger.log(Level.SEVERE,null,ex);
    }
  }
 else {
    Util util=Util.getInstance();
    assert(util != null);
    msgconfigs=(List<MessageSecurityConfig>)util.getAppClientMsgSecConfigs();
  }
  this.initialize(msgconfigs);
}

Fixed version (ground truth):
public void initialize(Object config) throws IOException {
  String sun_acc=System.getProperty(ACC_XML,"String_Node_Str");
  List<MessageSecurityConfig> msgconfigs=null;
  if (Globals.getDefaultHabitat() == null && sun_acc != null) {
    InputStream is=null;
    try {
      is=new FileInputStream(sun_acc);
      JAXBContext jc=JAXBContext.newInstance(ClientContainer.class);
      Unmarshaller u=jc.createUnmarshaller();
      ClientContainer cc=(ClientContainer)u.unmarshal(is);
      msgconfigs=cc.getMessageSecurityConfig();
    }
 catch (    JAXBException ex) {
      _logger.log(Level.SEVERE,null,ex);
    }
 finally {
      if (is != null) {
        is.close();
      }
    }
  }
 else {
    Util util=Util.getInstance();
    assert(util != null);
    msgconfigs=(List<MessageSecurityConfig>)util.getAppClientMsgSecConfigs();
  }
  this.initialize(msgconfigs);
}
Program: 30005
Project: 30005
Buggy source:
private File getPidFile() throws PidException {
  try {
    String configDirString=System.getProperty(SystemPropertyConstants.INSTANCE_ROOT_PROPERTY);
    if (!ok(configDirString))     throw new PidException(strings.get("String_Node_Str","String_Node_Str" + SystemPropertyConstants.INSTANCE_ROOT_PROPERTY));
    File configDir=new File(new File(configDirString),"String_Node_Str");
    if (!configDir.isDirectory())     throw new PidException(strings.get("String_Node_Str",configDir));
    File pidFile=new File(configDir,"String_Node_Str");
    if (pidFile.exists()) {
      pidFile.delete();
      if (pidFile.exists()) {
        throw new PidException(strings.get("String_Node_Str",pidFile));
      }
    }
    return pidFile;
  }
 catch (  PidException pe) {
    throw pe;
  }
catch (  Exception e) {
    throw new PidException(e.getMessage());
  }
}

Fixed version (ground truth):
private File getPidFile() throws PidException {
  try {
    String configDirString=System.getProperty(SystemPropertyConstants.INSTANCE_ROOT_PROPERTY);
    if (!ok(configDirString))     throw new PidException(strings.get("String_Node_Str","String_Node_Str" + SystemPropertyConstants.INSTANCE_ROOT_PROPERTY));
    File configDir=new File(new File(configDirString),"String_Node_Str");
    if (!configDir.isDirectory())     throw new PidException(strings.get("String_Node_Str",configDir));
    File pidFile=new File(configDir,"String_Node_Str");
    if (pidFile.exists()) {
      if (!pidFile.delete() || pidFile.exists()) {
        throw new PidException(strings.get("String_Node_Str",pidFile));
      }
    }
    return pidFile;
  }
 catch (  PidException pe) {
    throw pe;
  }
catch (  Exception e) {
    throw new PidException(e.getMessage());
  }
}
Program: 30006
Project: 30006
Buggy source:
@Override public void writePidFile(){
  File pidFile=null;
  try {
    pidFile=SmartFile.sanitize(getPidFile());
    File pidFileCopy=new File(pidFile.getPath() + "String_Node_Str");
    String pidString=getPidString();
    FileUtils.writeStringToFile(pidString,pidFile);
    FileUtils.writeStringToFile(pidString,pidFileCopy);
  }
 catch (  PidException pe) {
    _logger.warning(pe.getMessage());
  }
catch (  Exception e) {
    _logger.warning(strings.get("String_Node_Str",e));
  }
 finally {
    pidFile.deleteOnExit();
  }
}

Fixed version (ground truth):
@Override public void writePidFile(){
  File pidFile=null;
  try {
    pidFile=SmartFile.sanitize(getPidFile());
    File pidFileCopy=new File(pidFile.getPath() + "String_Node_Str");
    String pidString=getPidString();
    FileUtils.writeStringToFile(pidString,pidFile);
    FileUtils.writeStringToFile(pidString,pidFileCopy);
  }
 catch (  PidException pe) {
    _logger.warning(pe.getMessage());
  }
catch (  Exception e) {
    _logger.warning(strings.get("String_Node_Str",e));
  }
 finally {
    if (pidFile != null) {
      pidFile.deleteOnExit();
    }
  }
}
Program: 30007
Project: 30007
Buggy source:
public Set<ServiceDescription> getImplicitServiceDescriptions(ReadableArchive readableArchive,String appName){
  HashSet<ServiceDescription> defs=new HashSet<ServiceDescription>();
  if (DeploymentUtils.isJavaEE(readableArchive,habitat)) {
    ServiceDescription sd=generateDefaultServiceDescription(appName);
    defs.add(sd);
  }
  return defs;
}

Fixed version (ground truth):
public Set<ServiceDescription> getImplicitServiceDescriptions(ReadableArchive readableArchive,String appName){
  HashSet<ServiceDescription> defs=new HashSet<ServiceDescription>();
  if (JavaEEDeploymentUtils.isJavaEE(readableArchive,habitat)) {
    ServiceDescription sd=generateDefaultServiceDescription(appName);
    defs.add(sd);
  }
  return defs;
}
Program: 30009
Project: 30009
Buggy source:
public Set<ServiceDescription> getImplicitServiceDescriptions(ReadableArchive cloudArchive,String appName){
  HashSet<ServiceDescription> implicitServiceDescriptions=new HashSet<ServiceDescription>();
  if (!DeploymentUtils.isJavaEE(cloudArchive,habitat)) {
    return implicitServiceDescriptions;
  }
  Set<ServiceReference> serviceReferences=discoverServiceReferences(cloudArchive,appName);
  boolean hasJMSReference=false;
  for (  ServiceReference serviceReference : serviceReferences) {
    if (serviceReferenceTypes.contains(serviceReference.getType())) {
      hasJMSReference=true;
      break;
    }
  }
  if (hasJMSReference) {
    implicitServiceDescriptions.add(getDefaultServiceDescription(appName,null));
  }
  return implicitServiceDescriptions;
}

Fixed version (ground truth):
public Set<ServiceDescription> getImplicitServiceDescriptions(ReadableArchive cloudArchive,String appName){
  HashSet<ServiceDescription> implicitServiceDescriptions=new HashSet<ServiceDescription>();
  if (!JavaEEDeploymentUtils.isJavaEE(cloudArchive,habitat)) {
    return implicitServiceDescriptions;
  }
  Set<ServiceReference> serviceReferences=discoverServiceReferences(cloudArchive,appName);
  boolean hasJMSReference=false;
  for (  ServiceReference serviceReference : serviceReferences) {
    if (serviceReferenceTypes.contains(serviceReference.getType())) {
      hasJMSReference=true;
      break;
    }
  }
  if (hasJMSReference) {
    implicitServiceDescriptions.add(getDefaultServiceDescription(appName,null));
  }
  return implicitServiceDescriptions;
}
Program: 30010
Project: 30010
Buggy source:
void setCommandLine() throws GFLauncherException {
  List<String> cmdLine=getCommandLine();
  cmdLine.clear();
  addIgnoreNull(cmdLine,javaExe);
  addIgnoreNull(cmdLine,"String_Node_Str");
  addIgnoreNull(cmdLine,getClasspath());
  addIgnoreNull(cmdLine,debugOptions);
  String CLIStartTime=System.getProperty("String_Node_Str");
  if (CLIStartTime != null && CLIStartTime.length() > 0) {
    cmdLine.add("String_Node_Str" + CLIStartTime);
  }
  if (jvmOptions != null)   addIgnoreNull(cmdLine,jvmOptions.toStringArray());
  GFLauncherNativeHelper nativeHelper=new GFLauncherNativeHelper(info,javaConfig,jvmOptions,profiler);
  addIgnoreNull(cmdLine,nativeHelper.getCommands());
  addIgnoreNull(cmdLine,getMainClass());
  try {
    addIgnoreNull(cmdLine,getInfo().getArgsAsList());
  }
 catch (  GFLauncherException gfle) {
    throw gfle;
  }
catch (  Exception e) {
  }
}

Fixed version (ground truth):
void setCommandLine() throws GFLauncherException {
  List<String> cmdLine=getCommandLine();
  cmdLine.clear();
  addIgnoreNull(cmdLine,javaExe);
  addIgnoreNull(cmdLine,"String_Node_Str");
  addIgnoreNull(cmdLine,getClasspath());
  addIgnoreNull(cmdLine,debugOptions);
  String CLIStartTime=System.getProperty("String_Node_Str");
  if (CLIStartTime != null && CLIStartTime.length() > 0) {
    cmdLine.add("String_Node_Str" + CLIStartTime);
  }
  GFLauncherNativeHelper nativeHelper=new GFLauncherNativeHelper(info,javaConfig,jvmOptions,profiler);
  addIgnoreNull(cmdLine,nativeHelper.getCommands());
  addIgnoreNull(cmdLine,getMainClass());
  try {
    addIgnoreNull(cmdLine,getInfo().getArgsAsList());
  }
 catch (  GFLauncherException gfle) {
    throw gfle;
  }
catch (  Exception e) {
  }
}
Program: 30012
Project: 30012
Buggy source:
/** 
 * Let's fake-launch domain1  -- which DOES have the jvm logging args
 */
@Test public void test2() throws GFLauncherException, MiniXmlParserException {
  info.setDomainName("String_Node_Str");
  launcher.launch();
  List<String> cmdline=launcher.getCommandLine();
  assertTrue(cmdline.contains("String_Node_Str"));
  assertEquals(cmdline.get(3),"String_Node_Str");
}

Fixed version (ground truth):
/** 
 * Let's fake-launch domain1  -- which DOES have the jvm logging args
 */
@Test public void test2() throws GFLauncherException, MiniXmlParserException {
  info.setDomainName("String_Node_Str");
  launcher.launch();
  List<String> cmdline=launcher.getJvmOptions();
  assertTrue(cmdline.contains("String_Node_Str"));
  assertEquals(cmdline.get(0),"String_Node_Str");
}
Program: 30013
Project: 30013
Buggy source:
/** 
 * Let's fake-launch domain2 -- which does NOT have the jvm logging args
 */
@Test public void test3() throws GFLauncherException, MiniXmlParserException {
  info.setDomainName("String_Node_Str");
  launcher.launch();
  List<String> cmdline=launcher.getCommandLine();
  assertFalse(cmdline.contains("String_Node_Str"));
}

Fixed version (ground truth):
/** 
 * Let's fake-launch domain2 -- which does NOT have the jvm logging args
 */
@Test public void test3() throws GFLauncherException, MiniXmlParserException {
  info.setDomainName("String_Node_Str");
  launcher.launch();
  List<String> cmdline=launcher.getJvmOptions();
  assertFalse(cmdline.contains("String_Node_Str"));
}
Program: 30014
Project: 30014
Buggy source:
private synchronized void init(WebModule wm){
  if (initialized) {
    return;
  }
  ServerContext serverContext=wm.getServerContext();
  if (serverContext == null) {
    String msg=_rb.getString("String_Node_Str");
    msg=MessageFormat.format(msg,wm.getName());
    throw new IllegalStateException(msg);
  }
  im=serverContext.getDefaultServices().forContract(InvocationManager.class).get();
  tm=serverContext.getDefaultServices().forContract(JavaEETransactionManager.class).get();
  injectionMgr=serverContext.getDefaultServices().forContract(InjectionManager.class).get();
  initialized=true;
  securityContext=serverContext.getDefaultServices().forContract(AppServSecurityContext.class).get();
  if (securityContext != null) {
    if (_logger.isLoggable(Level.FINE)) {
      _logger.log(Level.FINE,"String_Node_Str" + securityContext);
    }
  }
 else {
    if (_logger.isLoggable(Level.FINE)) {
      _logger.log(Level.FINE,"String_Node_Str");
    }
  }
}

Fixed version (ground truth):
private synchronized void init(WebModule wm){
  if (initialized) {
    return;
  }
  ServerContext serverContext=wm.getServerContext();
  if (serverContext == null) {
    String msg=_rb.getString("String_Node_Str");
    msg=MessageFormat.format(msg,wm.getName());
    throw new IllegalStateException(msg);
  }
  Services services=serverContext.getDefaultServices();
  im=services.forContract(InvocationManager.class).get();
  tm=getJavaEETransactionManager(services);
  injectionMgr=services.forContract(InjectionManager.class).get();
  initialized=true;
  securityContext=serverContext.getDefaultServices().forContract(AppServSecurityContext.class).get();
  if (securityContext != null) {
    if (_logger.isLoggable(Level.FINE)) {
      _logger.log(Level.FINE,"String_Node_Str" + securityContext);
    }
  }
 else {
    if (_logger.isLoggable(Level.FINE)) {
      _logger.log(Level.FINE,"String_Node_Str");
    }
  }
}