nus-yam/ex-repair huggingface dataset:
Program: 28651
Project: 28651
Buggy source:
private boolean initializeUniformFormatLogRecord(ParsedLogRecord parsedLogRecord,String logRecord){
  parsedLogRecord.setFormattedLogRecord(logRecord);
  Matcher matcher=ODLFieldPatternHolder.ODL_FIELD_PATTERN.matcher(logRecord);
  int start=0;
  int end=0;
  int fieldIndex=0;
  while (matcher.find()) {
    fieldIndex++;
    start=matcher.start();
    if (end != 0 && start != end + 1) {
      break;
    }
    end=matcher.end();
    String text=matcher.group();
    text=text.substring(1,text.length() - 1);
    if (fieldIndex <= ODL_FIXED_FIELD_COUNT) {
      populateLogRecordFields(fieldIndex,text,parsedLogRecord);
    }
 else {
      populateLogRecordSuppAttrs(text,parsedLogRecord);
    }
  }
  String msg=logRecord.substring(end);
  msg=msg.trim();
  if (msg.startsWith("String_Node_Str")) {
    msg=msg.replaceFirst("String_Node_Str","String_Node_Str");
  }
  msg=msg.trim();
  parsedLogRecord.setFieldValue(ParsedLogRecord.LOG_MESSAGE,msg);
  if (fieldIndex < ODL_FIXED_FIELD_COUNT) {
    return false;
  }
  return true;
}

Fixed version (ground truth):
private boolean initializeUniformFormatLogRecord(ParsedLogRecord parsedLogRecord,String logRecord){
  parsedLogRecord.setFormattedLogRecord(logRecord);
  Matcher matcher=ODLFieldPatternHolder.ODL_FIELD_PATTERN.matcher(logRecord);
  int start=0;
  int end=0;
  int fieldIndex=0;
  while (matcher.find()) {
    fieldIndex++;
    start=matcher.start();
    if (end != 0 && start != end + 1) {
      break;
    }
    end=matcher.end();
    String text=matcher.group();
    text=text.substring(1,text.length() - 1);
    if (fieldIndex <= ODL_FIXED_FIELD_COUNT) {
      populateLogRecordFields(fieldIndex,text,parsedLogRecord);
    }
 else {
      populateLogRecordSuppAttrs(text,parsedLogRecord);
    }
  }
  String msg=logRecord.substring(end);
  msg=msg.trim();
  boolean multiLineBegin=false;
  if (msg.startsWith("String_Node_Str")) {
    msg=msg.replaceFirst("String_Node_Str","String_Node_Str");
    multiLineBegin=true;
  }
  if (multiLineBegin && msg.endsWith("String_Node_Str")) {
    int endIndex=msg.length() - 2;
    if (endIndex > 0) {
      msg=msg.substring(0,endIndex);
    }
  }
  parsedLogRecord.setFieldValue(ParsedLogRecord.LOG_MESSAGE,msg);
  if (fieldIndex < ODL_FIXED_FIELD_COUNT) {
    return false;
  }
  return true;
}
Program: 28652
Project: 28652
Buggy source:
private Server(Builder builder,Properties properties){
  serverName=builder.serverName;
  loggerEnabled=builder.loggerEnabled;
  verbose=builder.verbose;
  loggerFile=builder.loggerFile;
  jmxPort=builder.jmxPort;
  try {
    if (properties == null) {
      properties=new Properties();
    }
    EmbeddedFileSystem fs=builder.fileSystem;
    BootstrapProperties bootstrapProps=new BootstrapProperties(properties);
    setBootstrapProperties(bootstrapProps,fs);
    glassfishRuntime=GlassFishRuntime.bootstrap(bootstrapProps,getClass().getClassLoader());
    GlassFishProperties gfProps=new GlassFishProperties(properties);
    setGlassFishProperties(gfProps,fs);
    glassfish=glassfishRuntime.newGlassFish(gfProps);
    glassfish.start();
    if (fs == null) {
      EmbeddedFileSystem.Builder fsBuilder=new EmbeddedFileSystem.Builder();
      fsBuilder.autoDelete(true);
      fs=fsBuilder.build();
    }
    habitat=glassfish.getService(ServiceLocator.class);
    ServiceLocatorUtilities.addOneConstant(habitat,this);
    fileSystem=habitat.getServiceHandle(ServiceLocatorUtilities.<EmbeddedFileSystem>addOneConstant(habitat,fs,null,EmbeddedFileSystem.class));
    logger.logp(Level.FINER,"String_Node_Str","String_Node_Str","String_Node_Str" + "String_Node_Str",new Object[]{glassfish,glassfish.getStatus()});
  }
 catch (  Throwable ex) {
    throw new RuntimeException(ex);
  }
}

Fixed version (ground truth):
private Server(Builder builder,Properties properties){
  serverName=builder.serverName;
  try {
    if (properties == null) {
      properties=new Properties();
    }
    EmbeddedFileSystem fs=builder.fileSystem;
    BootstrapProperties bootstrapProps=new BootstrapProperties(properties);
    setBootstrapProperties(bootstrapProps,fs);
    glassfishRuntime=GlassFishRuntime.bootstrap(bootstrapProps,getClass().getClassLoader());
    GlassFishProperties gfProps=new GlassFishProperties(properties);
    setGlassFishProperties(gfProps,fs);
    glassfish=glassfishRuntime.newGlassFish(gfProps);
    glassfish.start();
    if (fs == null) {
      EmbeddedFileSystem.Builder fsBuilder=new EmbeddedFileSystem.Builder();
      fsBuilder.autoDelete(true);
      fs=fsBuilder.build();
    }
    habitat=glassfish.getService(ServiceLocator.class);
    ServiceLocatorUtilities.addOneConstant(habitat,this);
    fileSystem=habitat.getServiceHandle(ServiceLocatorUtilities.<EmbeddedFileSystem>addOneConstant(habitat,fs,null,EmbeddedFileSystem.class));
    logger.logp(Level.FINER,"String_Node_Str","String_Node_Str","String_Node_Str" + "String_Node_Str",new Object[]{glassfish,glassfish.getStatus()});
  }
 catch (  Throwable ex) {
    throw new RuntimeException(ex);
  }
}
Program: 28653
Project: 28653
Buggy source:
/** 
 * Enables or disables the logger for this server
 * @param enabled true to enable, false to disable
 * @return this instance
 */
public Builder logger(boolean enabled){
  loggerEnabled=enabled;
  return this;
}

Fixed version (ground truth):
/** 
 * Enables or disables the logger for this server
 * @param enabled true to enable, false to disable
 * @return this instance
 */
public Builder logger(boolean enabled){
  return this;
}
Program: 28654
Project: 28654
Buggy source:
/** 
 * Set the jmx port number. Also enables the jmx connector. This applies only when the default configuration is being used.
 * @param portNumber jmx port number.
 * @return this instance
 */
public Builder jmxPort(int portNumber){
  this.jmxPort=portNumber;
  return this;
}

Fixed version (ground truth):
/** 
 * Set the jmx port number. Also enables the jmx connector. This applies only when the default configuration is being used.
 * @param portNumber jmx port number.
 * @return this instance
 */
public Builder jmxPort(int portNumber){
  return this;
}
Program: 28655
Project: 28655
Buggy source:
/** 
 * Adds a container to this server. Using the configuration instance for the container of type <T>, creating the container from that configuration and finally adding the container instance to the list of managed containers
 * @param info the configuration for the container
 * @param < T > type of the container
 * @return instance of the container <T>
 * @throws IllegalStateException if the container is already started.
 */
public synchronized <T extends EmbeddedContainer>T addContainer(ContainerBuilder<T> info){
  if (status.isStarted()) {
    throw new IllegalStateException("String_Node_Str");
  }
  T container=info.create(this);
  if (container != null && containers.add(new Container(container))) {
    return container;
  }
  return null;
}

Fixed version (ground truth):
/** 
 * Adds a container to this server. Using the configuration instance for the container of type <T>, creating the container from that configuration and finally adding the container instance to the list of managed containers
 * @param info the configuration for the container
 * @param < T > type of the container
 * @return instance of the container <T>
 * @throws IllegalStateException if the container is already started.
 */
public synchronized <T extends EmbeddedContainer>T addContainer(ContainerBuilder<T> info){
  T container=info.create(this);
  if (container != null && containers.add(new Container(container))) {
    return container;
  }
  return null;
}
Program: 28656
Project: 28656
Buggy source:
/** 
 * Turns on of off the verbose flag.
 * @param b true to turn on, false to turn off
 * @return this instance
 */
public Builder verbose(boolean b){
  this.verbose=b;
  return this;
}

Fixed version (ground truth):
/** 
 * Turns on of off the verbose flag.
 * @param b true to turn on, false to turn off
 * @return this instance
 */
public Builder verbose(boolean b){
  return this;
}
Program: 28657
Project: 28657
Buggy source:
/** 
 * Sets the log file location
 * @param f a valid file location
 * @return this instance
 */
public Builder logFile(File f){
  loggerFile=f;
  return this;
}

Fixed version (ground truth):
/** 
 * Sets the log file location
 * @param f a valid file location
 * @return this instance
 */
public Builder logFile(File f){
  return this;
}
Program: 28658
Project: 28658
Buggy source:
URI assembleJAR(String name,File rootDirectory,List<File> classpaths,Map<String,File> metadatas) throws IOException {
  File archive=new File(System.getProperty("String_Node_Str"),name + "String_Node_Str");
  archive.deleteOnExit();
  JarOutputStream jos=new JarOutputStream(new FileOutputStream(archive));
  transferDir(rootDirectory,jos,"String_Node_Str");
  for (  String key : metadatas.keySet()) {
    tranferFile(metadatas.get(key),jos,key,false);
  }
  for (  File classpath : classpaths) {
    if (classpath.isDirectory()) {
      transferDir(classpath,jos,"String_Node_Str");
    }
 else {
      tranferFile(classpath,jos,"String_Node_Str",true);
    }
  }
  jos.close();
  return archive.toURI();
}

Fixed version (ground truth):
URI assembleJAR(String name,File rootDirectory,List<File> classpaths,Map<String,File> metadatas) throws IOException {
  File archive=new File(System.getProperty("String_Node_Str"),name + "String_Node_Str");
  archive.deleteOnExit();
  JarOutputStream jos=new JarOutputStream(new FileOutputStream(archive));
  transferDir(rootDirectory,jos,"String_Node_Str");
  for (  Map.Entry<String,File> me : metadatas.entrySet()) {
    tranferFile(me.getValue(),jos,me.getKey(),false);
  }
  for (  File classpath : classpaths) {
    if (classpath.isDirectory()) {
      transferDir(classpath,jos,"String_Node_Str");
    }
 else {
      tranferFile(classpath,jos,"String_Node_Str",true);
    }
  }
  jos.close();
  return archive.toURI();
}
Program: 28659
Project: 28659
Buggy source:
private URI assembleEAR(String name,Map<String,File> archives,Map<String,File> metadatas) throws IOException {
  File ear=new File(System.getProperty("String_Node_Str"),name + "String_Node_Str");
  ear.deleteOnExit();
  JarOutputStream jos=new JarOutputStream(new FileOutputStream(ear));
  for (  String key : metadatas.keySet()) {
    tranferFile(metadatas.get(key),jos,key,false);
  }
  for (  String archiveName : archives.keySet()) {
    File archive=archives.get(archiveName);
    if (archive.isDirectory()) {
      archive=new File(assembleJAR(archiveName,archive,Collections.EMPTY_LIST,Collections.EMPTY_MAP));
    }
    tranferFile(archive,jos,archiveName,false);
  }
  jos.close();
  return ear.toURI();
}

Fixed version (ground truth):
private URI assembleEAR(String name,Map<String,File> archives,Map<String,File> metadatas) throws IOException {
  File ear=new File(System.getProperty("String_Node_Str"),name + "String_Node_Str");
  ear.deleteOnExit();
  JarOutputStream jos=new JarOutputStream(new FileOutputStream(ear));
  for (  Map.Entry<String,File> me : metadatas.entrySet()) {
    tranferFile(me.getValue(),jos,me.getKey(),false);
  }
  for (  Map.Entry<String,File> ame : archives.entrySet()) {
    File archive=ame.getValue();
    if (archive.isDirectory()) {
      archive=new File(assembleJAR(ame.getKey(),archive,Collections.EMPTY_LIST,Collections.EMPTY_MAP));
    }
    tranferFile(archive,jos,ame.getKey(),false);
  }
  jos.close();
  return ear.toURI();
}
Program: 28660
Project: 28660
Buggy source:
URI assembleWAR(String name,File rootDirectory,List<File> classpaths,Map<String,File> metadatas) throws IOException {
  File archive=new File(System.getProperty("String_Node_Str"),name + "String_Node_Str");
  archive.deleteOnExit();
  JarOutputStream jos=new JarOutputStream(new FileOutputStream(archive));
  transferDir(rootDirectory,jos,"String_Node_Str");
  for (  String key : metadatas.keySet()) {
    tranferFile(metadatas.get(key),jos,key,false);
  }
  for (  File classpath : classpaths) {
    if (classpath.isDirectory()) {
      transferDir(classpath,jos,"String_Node_Str");
    }
 else {
      tranferFile(classpath,jos,"String_Node_Str" + classpath.getName(),false);
    }
  }
  jos.close();
  return archive.toURI();
}

Fixed version (ground truth):
URI assembleWAR(String name,File rootDirectory,List<File> classpaths,Map<String,File> metadatas) throws IOException {
  File archive=new File(System.getProperty("String_Node_Str"),name + "String_Node_Str");
  archive.deleteOnExit();
  JarOutputStream jos=new JarOutputStream(new FileOutputStream(archive));
  transferDir(rootDirectory,jos,"String_Node_Str");
  for (  Map.Entry<String,File> me : metadatas.entrySet()) {
    tranferFile(me.getValue(),jos,me.getKey(),false);
  }
  for (  File classpath : classpaths) {
    if (classpath.isDirectory()) {
      transferDir(classpath,jos,"String_Node_Str");
    }
 else {
      tranferFile(classpath,jos,"String_Node_Str" + classpath.getName(),false);
    }
  }
  jos.close();
  return archive.toURI();
}
Program: 28661
Project: 28661
Buggy source:
URI assembleRAR(String name,File rootDirectory,List<File> classpaths,Map<String,File> metadatas) throws IOException {
  File rar=new File(System.getProperty("String_Node_Str"),name + "String_Node_Str");
  rar.deleteOnExit();
  JarOutputStream jos=new JarOutputStream(new FileOutputStream(rar));
  transferDir(rootDirectory,jos,"String_Node_Str");
  for (  String key : metadatas.keySet()) {
    tranferFile(metadatas.get(key),jos,key,false);
  }
  List<File> classpathDirs=new ArrayList();
  for (  File classpath : classpaths) {
    if (classpath.isDirectory()) {
      classpathDirs.add(classpath);
    }
  }
  if (!classpathDirs.isEmpty()) {
    String connectorJarName=name;
    List<String> topLevelFileNames=new ArrayList();
    topLevelFileNames.addAll(getFileNames(classpaths));
    topLevelFileNames.addAll(getFileNames(rootDirectory));
    int count=0;
    while (topLevelFileNames.contains(connectorJarName + "String_Node_Str")) {
      connectorJarName=name + "String_Node_Str" + count;
      ++count;
    }
    File connectorJar=new File(assembleJAR(connectorJarName,null,classpathDirs,Collections.EMPTY_MAP));
    tranferFile(connectorJar,jos,connectorJar.getName(),false);
  }
  for (  File classpath : classpaths) {
    if (!classpath.isDirectory()) {
      tranferFile(classpath,jos,classpath.getName(),false);
    }
  }
  jos.close();
  return rar.toURI();
}

Fixed version (ground truth):
URI assembleRAR(String name,File rootDirectory,List<File> classpaths,Map<String,File> metadatas) throws IOException {
  File rar=new File(System.getProperty("String_Node_Str"),name + "String_Node_Str");
  rar.deleteOnExit();
  JarOutputStream jos=new JarOutputStream(new FileOutputStream(rar));
  transferDir(rootDirectory,jos,"String_Node_Str");
  for (  Map.Entry<String,File> me : metadatas.entrySet()) {
    tranferFile(me.getValue(),jos,me.getKey(),false);
  }
  List<File> classpathDirs=new ArrayList();
  for (  File classpath : classpaths) {
    if (classpath.isDirectory()) {
      classpathDirs.add(classpath);
    }
  }
  if (!classpathDirs.isEmpty()) {
    String connectorJarName=name;
    List<String> topLevelFileNames=new ArrayList();
    topLevelFileNames.addAll(getFileNames(classpaths));
    topLevelFileNames.addAll(getFileNames(rootDirectory));
    int count=0;
    while (topLevelFileNames.contains(connectorJarName + "String_Node_Str")) {
      connectorJarName=name + "String_Node_Str" + count;
      ++count;
    }
    File connectorJar=new File(assembleJAR(connectorJarName,null,classpathDirs,Collections.EMPTY_MAP));
    tranferFile(connectorJar,jos,connectorJar.getName(),false);
  }
  for (  File classpath : classpaths) {
    if (!classpath.isDirectory()) {
      tranferFile(classpath,jos,classpath.getName(),false);
    }
  }
  jos.close();
  return rar.toURI();
}
Program: 28662
Project: 28662
Buggy source:
public EmbeddedMain(ClassLoader cl){
  classLoader=cl;
}

Fixed version (ground truth):
public EmbeddedMain(ClassLoader cl){
}
Program: 28663
Project: 28663
Buggy source:
private Properties makeProvisioningOptions(){
  Properties provisioningOptions=new Properties();
  URI installURI=new File(installRoot).toURI();
  String installLocations=getBundleContext().getProperty(AUTO_INSTALL_PROP);
  if (installLocations == null) {
    StringBuilder defaultInstallLocations=new StringBuilder();
    for (    String entry : DEFAULT_INSTALLATION_LOCATIONS_RELATIVE) {
      defaultInstallLocations.append(installURI.resolve(entry).toString()).append("String_Node_Str");
    }
    installLocations=defaultInstallLocations.toString();
  }
  provisioningOptions.setProperty(AUTO_INSTALL_PROP,installLocations);
  String startLocations=getBundleContext().getProperty(AUTO_START_PROP);
  if (startLocations == null) {
    StringBuilder deafultStartLocations=new StringBuilder();
    for (    String entry : DEFAULT_START_LOCATIONS_RELATIVE) {
      deafultStartLocations.append(installURI.resolve(entry).toString()).append("String_Node_Str");
    }
    startLocations=deafultStartLocations.toString();
  }
  provisioningOptions.setProperty(AUTO_START_PROP,startLocations);
  System.out.println("String_Node_Str" + provisioningOptions);
  return provisioningOptions;
}

Fixed version (ground truth):
private Properties makeProvisioningOptions(BundleContext context){
  Properties provisioningOptions=new Properties();
  URI installURI=new File(installRoot).toURI();
  String installLocations=context.getProperty(AUTO_INSTALL_PROP);
  if (installLocations == null) {
    StringBuilder defaultInstallLocations=new StringBuilder();
    for (    String entry : DEFAULT_INSTALLATION_LOCATIONS_RELATIVE) {
      defaultInstallLocations.append(installURI.resolve(entry).toString()).append("String_Node_Str");
    }
    installLocations=defaultInstallLocations.toString();
  }
  provisioningOptions.setProperty(AUTO_INSTALL_PROP,installLocations);
  String startLocations=context.getProperty(AUTO_START_PROP);
  if (startLocations == null) {
    StringBuilder deafultStartLocations=new StringBuilder();
    for (    String entry : DEFAULT_START_LOCATIONS_RELATIVE) {
      deafultStartLocations.append(installURI.resolve(entry).toString()).append("String_Node_Str");
    }
    startLocations=deafultStartLocations.toString();
  }
  provisioningOptions.setProperty(AUTO_START_PROP,startLocations);
  System.out.println("String_Node_Str" + provisioningOptions);
  return provisioningOptions;
}
Program: 28664
Project: 28664
Buggy source:
private Properties prepareStartupContext(final BundleContext context){
  Properties properties=new Properties();
  properties.putAll(System.getProperties());
  for (  String key : properties.stringPropertyNames()) {
    String value=context.getProperty(key);
    if (value != null && !value.equals(System.getProperty(key))) {
      properties.setProperty(key,value);
    }
  }
  installRoot=context.getProperty(Constants.INSTALL_ROOT_PROP_NAME);
  if (installRoot == null) {
    installRoot=guessInstallRoot(context);
    if (installRoot == null) {
      throw new RuntimeException("String_Node_Str" + Constants.INSTALL_ROOT_PROP_NAME + "String_Node_Str");
    }
 else {
      System.out.println("String_Node_Str" + installRoot + "String_Node_Str"+ "String_Node_Str"+ Constants.INSTALL_ROOT_PROP_NAME);
    }
  }
  if (!new File(installRoot).exists()) {
    throw new RuntimeException("String_Node_Str" + installRoot + "String_Node_Str");
  }
  properties.setProperty(Constants.INSTALL_ROOT_PROP_NAME,installRoot);
  String instanceRoot=context.getProperty(Constants.INSTANCE_ROOT_PROP_NAME);
  if (instanceRoot == null) {
    instanceRoot=new File(installRoot,"String_Node_Str").getAbsolutePath();
  }
  properties.setProperty(Constants.INSTANCE_ROOT_PROP_NAME,instanceRoot);
  properties.putAll(makeProvisioningOptions());
  properties.setProperty(Constants.BUILDER_NAME_PROPERTY,EmbeddedOSGiGlassFishRuntimeBuilder.class.getName());
  return properties;
}

Fixed version (ground truth):
private Properties prepareStartupContext(final BundleContext context){
  Properties properties=new Properties();
  properties.putAll(System.getProperties());
  for (  String key : properties.stringPropertyNames()) {
    String value=context.getProperty(key);
    if (value != null && !value.equals(System.getProperty(key))) {
      properties.setProperty(key,value);
    }
  }
  installRoot=context.getProperty(Constants.INSTALL_ROOT_PROP_NAME);
  if (installRoot == null) {
    installRoot=guessInstallRoot(context);
    if (installRoot == null) {
      throw new RuntimeException("String_Node_Str" + Constants.INSTALL_ROOT_PROP_NAME + "String_Node_Str");
    }
 else {
      System.out.println("String_Node_Str" + installRoot + "String_Node_Str"+ "String_Node_Str"+ Constants.INSTALL_ROOT_PROP_NAME);
    }
  }
  if (!new File(installRoot).exists()) {
    throw new RuntimeException("String_Node_Str" + installRoot + "String_Node_Str");
  }
  properties.setProperty(Constants.INSTALL_ROOT_PROP_NAME,installRoot);
  String instanceRoot=context.getProperty(Constants.INSTANCE_ROOT_PROP_NAME);
  if (instanceRoot == null) {
    instanceRoot=new File(installRoot,"String_Node_Str").getAbsolutePath();
  }
  properties.setProperty(Constants.INSTANCE_ROOT_PROP_NAME,instanceRoot);
  properties.putAll(makeProvisioningOptions(context));
  properties.setProperty(Constants.BUILDER_NAME_PROPERTY,EmbeddedOSGiGlassFishRuntimeBuilder.class.getName());
  return properties;
}
Program: 28665
Project: 28665
Buggy source:
public void start(BundleContext context) throws Exception {
  this.context=context;
  nonEmbedded=isNonEmbedded();
  if (nonEmbedded) {
    GlassFishRuntime embeddedGfr=new EmbeddedOSGiGlassFishRuntime(context);
    context.registerService(GlassFishRuntime.class.getName(),embeddedGfr,null);
    System.out.println("String_Node_Str" + embeddedGfr + "String_Node_Str");
  }
 else {
    Properties properties=prepareStartupContext(context);
    final BootstrapProperties bsProperties=new BootstrapProperties(properties);
    System.out.println(GlassFishRuntime.class + "String_Node_Str" + GlassFishRuntime.class.getClassLoader()+ "String_Node_Str");
    GlassFishRuntime existingGfr=lookupGfr();
    if (existingGfr == null) {
      System.out.println("String_Node_Str");
      gfr=GlassFishRuntime.bootstrap(bsProperties,getClass().getClassLoader());
      existingGfr=gfr;
    }
 else {
      System.out.println("String_Node_Str" + existingGfr + "String_Node_Str");
    }
    gf=existingGfr.newGlassFish(new GlassFishProperties(properties));
    gf.start();
  }
}

Fixed version (ground truth):
public void start(BundleContext context) throws Exception {
  nonEmbedded=context.getProperty(Constants.BUILDER_NAME_PROPERTY) != null;
  if (nonEmbedded) {
    GlassFishRuntime embeddedGfr=new EmbeddedOSGiGlassFishRuntime(context);
    context.registerService(GlassFishRuntime.class.getName(),embeddedGfr,null);
    System.out.println("String_Node_Str" + embeddedGfr + "String_Node_Str");
  }
 else {
    Properties properties=prepareStartupContext(context);
    final BootstrapProperties bsProperties=new BootstrapProperties(properties);
    System.out.println(GlassFishRuntime.class + "String_Node_Str" + GlassFishRuntime.class.getClassLoader()+ "String_Node_Str");
    GlassFishRuntime existingGfr=lookupGfr(context);
    if (existingGfr == null) {
      System.out.println("String_Node_Str");
      gfr=GlassFishRuntime.bootstrap(bsProperties,getClass().getClassLoader());
      existingGfr=gfr;
    }
 else {
      System.out.println("String_Node_Str" + existingGfr + "String_Node_Str");
    }
    gf=existingGfr.newGlassFish(new GlassFishProperties(properties));
    gf.start();
  }
}
Program: 28666
Project: 28666
Buggy source:
/** 
 * @return an already bootstrapped GlassFishRuntime or null if no such runtime is bootstrapped
 */
private GlassFishRuntime lookupGfr(){
  final ServiceReference serviceReference=context.getServiceReference(GlassFishRuntime.class.getName());
  return serviceReference != null ? (GlassFishRuntime)context.getService(serviceReference) : null;
}

Fixed version (ground truth):
/** 
 * @return an already bootstrapped GlassFishRuntime or null if no such runtime is bootstrapped
 */
private GlassFishRuntime lookupGfr(BundleContext context){
  if (context == null) {
    return null;
  }
  final ServiceReference serviceReference=context.getServiceReference(GlassFishRuntime.class.getName());
  return serviceReference != null ? (GlassFishRuntime)context.getService(serviceReference) : null;
}
Program: 28667
Project: 28667
Buggy source:
public <T>T getService(Class<T> type) throws Exception {
  final BundleContext context=framework.getBundleContext();
  ServiceTracker tracker=new ServiceTracker(context,type.getName(),null);
  try {
    tracker.open(true);
    return type.cast(tracker.waitForService(0));
  }
  finally {
    tracker.close();
  }
}

Fixed version (ground truth):
public <T>T getService(Class<T> type) throws Exception {
  if (framework == null) {
    throw new IllegalStateException("String_Node_Str");
  }
  final BundleContext context=framework.getBundleContext();
  ServiceTracker tracker=new ServiceTracker(context,type.getName(),null);
  try {
    tracker.open(true);
    return type.cast(tracker.waitForService(0));
  }
  finally {
    tracker.close();
  }
}
Program: 28669
Project: 28669
Buggy source:
/** 
 * Encode the session identifier associated with this response into the specified URL, if necessary.
 * @param url URL to be encoded
 */
public String encodeURL(String url){
  String absolute=toAbsolute(url);
  if (isEncodeable(absolute)) {
    if (url.equalsIgnoreCase("String_Node_Str")) {
      url=absolute;
    }
    String sessionVersion=null;
    Map<String,String> sessionVersions=request.getSessionVersionsRequestAttribute();
    if (sessionVersions != null) {
      sessionVersion=RequestUtil.createSessionVersionString(sessionVersions);
    }
    return toEncoded(url,request.getSessionInternal().getIdInternal(),sessionVersion);
  }
 else {
    return url;
  }
}

Fixed version (ground truth):
/** 
 * Encode the session identifier associated with this response into the specified URL, if necessary.
 * @param url URL to be encoded
 */
public String encodeURL(String url){
  String absolute=toAbsolute(url);
  if (isEncodeable(absolute)) {
    if (url.equalsIgnoreCase("String_Node_Str")) {
      url=absolute;
    }
 else     if (url.equals(absolute) && !hasPath(url)) {
      url+='/';
    }
    String sessionVersion=null;
    Map<String,String> sessionVersions=request.getSessionVersionsRequestAttribute();
    if (sessionVersions != null) {
      sessionVersion=RequestUtil.createSessionVersionString(sessionVersions);
    }
    return toEncoded(url,request.getSessionInternal().getIdInternal(),sessionVersion);
  }
 else {
    return url;
  }
}
Program: 28671
Project: 28671
Buggy source:
public static EventListenerProxy getEventListenerProxy(){
  if (eventProxy == null) {
    try {
      eventProxy=new EventListenerProxy();
      Naming.rebind(proxyAddress,eventProxy);
      if (debug)       System.out.println(rmiName + "String_Node_Str" + portnum);
    }
 catch (    RemoteException re) {
      if (debug)       System.out.println("String_Node_Str" + proxyAddress + "String_Node_Str"+ re);
      try {
        eventProxy=new EventListenerProxy();
        Registry r=LocateRegistry.createRegistry(portnum);
        r.bind(rmiName,eventProxy);
        if (debug)         System.out.println(rmiName + "String_Node_Str" + portnum);
      }
 catch (      Exception e) {
        eventProxy=null;
        if (debug)         e.printStackTrace();
      }
    }
catch (    Exception e) {
      if (debug)       e.printStackTrace();
    }
  }
  return eventProxy;
}

Fixed version (ground truth):
public synchronized static EventListenerProxy getEventListenerProxy(){
  if (eventProxy == null) {
    EventListenerProxy newProxy=null;
    try {
      newProxy=new EventListenerProxy();
      Naming.rebind(newProxy.proxyAddress,newProxy);
      eventProxy=newProxy;
      if (debug)       System.out.println(eventProxy.rmiName + "String_Node_Str" + portnum);
    }
 catch (    RemoteException re) {
      if (debug)       System.out.println("String_Node_Str" + (newProxy != null ? newProxy.proxyAddress : "String_Node_Str") + "String_Node_Str"+ re);
      try {
        newProxy=new EventListenerProxy();
        Registry r=LocateRegistry.createRegistry(portnum);
        r.bind(newProxy.rmiName,newProxy);
        eventProxy=newProxy;
        if (debug)         System.out.println(newProxy.rmiName + "String_Node_Str" + portnum);
      }
 catch (      Exception e) {
        eventProxy=null;
        if (debug)         e.printStackTrace();
      }
    }
catch (    Exception e) {
      if (debug)       e.printStackTrace();
    }
  }
  return eventProxy;
}
Program: 28672
Project: 28672
Buggy source:
/** 
 * Must not return null
 * @return TransactionManager
 */
public TransactionManager getTransactionManager(){
  if (testTransactionManager != null)   return testTransactionManager;
  if (transactionManager == null) {
    try {
      transactionManager=(TransactionManager)new InitialContext().lookup("String_Node_Str");
    }
 catch (    NamingException e) {
      e.printStackTrace();
    }
  }
  return transactionManager;
}

Fixed version (ground truth):
/** 
 * Must not return null
 * @return TransactionManager
 */
public TransactionManager getTransactionManager(){
  if (testTransactionManager != null)   return testTransactionManager;
  if (transactionManager == null) {
    try {
synchronized (TransactionalInterceptorBase.class) {
        if (transactionManager == null)         transactionManager=(TransactionManager)new InitialContext().lookup("String_Node_Str");
      }
    }
 catch (    NamingException e) {
      e.printStackTrace();
    }
  }
  return transactionManager;
}
Program: 28673
Project: 28673
Buggy source:
@AroundInvoke public Object transactional(InvocationContext ctx) throws Exception {
  Logger logger=Logger.getLogger(ctx.getTarget().getClass().getName());
  logger.info("String_Node_Str");
  Transaction transaction=null;
  if (getTransactionManager().getTransaction() != null) {
    logger.info("String_Node_Str" + "String_Node_Str");
    try {
      getTransactionManager().suspend();
    }
 catch (    Exception exception) {
      logger.info("String_Node_Str" + "String_Node_Str" + exception);
    }
  }
  Object proceed=null;
  try {
    proceed=proceed(ctx);
  }
  finally {
    if (transaction != null)     getTransactionManager().resume(transaction);
  }
  return proceed;
}

Fixed version (ground truth):
@AroundInvoke public Object transactional(InvocationContext ctx) throws Exception {
  Logger logger=Logger.getLogger(ctx.getTarget().getClass().getName());
  logger.info("String_Node_Str");
  Transaction transaction=null;
  if (getTransactionManager().getTransaction() != null) {
    logger.info("String_Node_Str" + "String_Node_Str");
    try {
      transaction=getTransactionManager().suspend();
    }
 catch (    Exception exception) {
      String messageString="String_Node_Str" + "String_Node_Str" + exception;
      logger.info(messageString);
      throw new TransactionalException(messageString,exception);
    }
  }
  Object proceed=null;
  try {
    proceed=proceed(ctx);
  }
  finally {
    if (transaction != null)     getTransactionManager().resume(transaction);
  }
  return proceed;
}
Program: 28674
Project: 28674
Buggy source:
private PortUnification getPortUnification(Protocol protocol){
  PortUnification pu=protocol.getPortUnification();
  if (pu == null) {
    report.setMessage(MessageFormat.format(rb.getString(DeleteProtocolFilter.NOT_FOUND),"String_Node_Str",protocol.getName()));
    report.setActionExitCode(ActionReport.ExitCode.FAILURE);
  }
  return pu;
}

Fixed version (ground truth):
private PortUnification getPortUnification(Protocol protocol){
  PortUnification pu=protocol.getPortUnification();
  if ((pu == null) && (report != null)) {
    report.setMessage(MessageFormat.format(rb.getString(DeleteProtocolFilter.NOT_FOUND),"String_Node_Str",protocol.getName()));
    report.setActionExitCode(ActionReport.ExitCode.FAILURE);
  }
  return pu;
}
Program: 28675
Project: 28675
Buggy source:
public void checkMe(){
  int jobValue=hk2Service.doAJob();
  if (jobValue != HK2Service.RETURN_VALUE) {
    throw new AssertionError("String_Node_Str" + HK2Service.RETURN_VALUE + "String_Node_Str"+ jobValue);
  }
}

Fixed version (ground truth):
public void checkMe(){
  int jobValue=hk2Service.doAJob();
  if (jobValue != HK2Service.RETURN_VALUE) {
    throw new AssertionError("String_Node_Str" + HK2Service.RETURN_VALUE + "String_Node_Str"+ jobValue);
  }
  if (!rumplestiltskin.getName().equals(HK2NamedServiceFactory.NAMED_SERVICE_NAME)) {
    throw new AssertionError("String_Node_Str" + rumplestiltskin.getName());
  }
  if (!carol.getName().equals(HK2NamedServiceFactory2.NAME)) {
    throw new AssertionError("String_Node_Str" + carol.getName());
  }
}
Program: 28676
Project: 28676
Buggy source:
private static Set<Annotation> getHK2Qualifiers(InjectionPoint injectionPoint){
  Set<Annotation> setQualifiers=injectionPoint.getQualifiers();
  Set<Annotation> retVal=new HashSet<Annotation>();
  for (  Annotation anno : setQualifiers) {
    if (anno.annotationType().equals(Default.class))     continue;
    retVal.add(anno);
  }
  return retVal;
}

Fixed version (ground truth):
private static Set<Annotation> getHK2Qualifiers(InjectionPoint injectionPoint){
  Set<Annotation> setQualifiers=injectionPoint.getQualifiers();
  Set<Annotation> retVal=new HashSet<Annotation>();
  for (  Annotation anno : setQualifiers) {
    if (anno.annotationType().equals(Default.class))     continue;
    if (anno.annotationType().equals(Named.class)) {
      Named named=(Named)anno;
      if ("String_Node_Str".equals(named.value())) {
        Annotated annotated=injectionPoint.getAnnotated();
        if (annotated instanceof AnnotatedField) {
          AnnotatedField<?> annotatedField=(AnnotatedField<?>)annotated;
          Field field=annotatedField.getJavaMember();
          anno=new NamedImpl(field.getName());
        }
      }
    }
    retVal.add(anno);
  }
  return retVal;
}
Program: 28677
Project: 28677
Buggy source:
@Override public void onProgress(RunLevelController controller){
  logger.log(level,"String_Node_Str",controller);
}

Fixed version (ground truth):
@Override public void onProgress(RunLevelController controller){
}
Program: 28678
Project: 28678
Buggy source:
public void run(){
  if (context == null) {
    System.err.println("String_Node_Str");
    return;
  }
  if (platform == null) {
    platform="String_Node_Str";
  }
  platformInitTime=System.currentTimeMillis();
  if (logger.isLoggable(level)) {
    logger.log(level,"String_Node_Str",getClass().getName());
  }
  DynamicConfigurationService dcs=locator.getService(DynamicConfigurationService.class);
  DynamicConfiguration config=dcs.createDynamicConfiguration();
  config.addActiveDescriptor(BuilderHelper.createConstantDescriptor(this));
  config.addActiveDescriptor(BuilderHelper.createConstantDescriptor(masterListener));
  config.addActiveDescriptor(BuilderHelper.createConstantDescriptor(logger));
  config.addUnbindFilter(BuilderHelper.createContractFilter(ProcessEnvironment.class.getName()));
  config.addActiveDescriptor(BuilderHelper.createConstantDescriptor(env.isEmbedded() ? new ProcessEnvironment(ProcessEnvironment.ProcessType.Embedded) : new ProcessEnvironment(ProcessEnvironment.ProcessType.Server)));
  config.commit();
  if (proceedTo(InitRunLevel.VAL,new InitActivator())) {
    if (proceedTo(StartupRunLevel.VAL,new StartupActivator())) {
      proceedTo(PostStartupRunLevel.VAL,new PostStartupActivator());
    }
  }
}

Fixed version (ground truth):
public void run(){
  if (context == null) {
    System.err.println("String_Node_Str");
    return;
  }
  if (platform == null) {
    platform="String_Node_Str";
  }
  platformInitTime=System.currentTimeMillis();
  if (logger.isLoggable(level)) {
    logger.log(level,"String_Node_Str",getClass().getName());
  }
  DynamicConfigurationService dcs=locator.getService(DynamicConfigurationService.class);
  DynamicConfiguration config=dcs.createDynamicConfiguration();
  config.addActiveDescriptor(BuilderHelper.createConstantDescriptor(this));
  config.addActiveDescriptor(BuilderHelper.createConstantDescriptor(masterListener));
  config.addActiveDescriptor(BuilderHelper.createConstantDescriptor(logger));
  config.addUnbindFilter(BuilderHelper.createContractFilter(ProcessEnvironment.class.getName()));
  config.addActiveDescriptor(BuilderHelper.createConstantDescriptor(env.isEmbedded() ? new ProcessEnvironment(ProcessEnvironment.ProcessType.Embedded) : new ProcessEnvironment(ProcessEnvironment.ProcessType.Server)));
  config.commit();
  LinkedHashMap<String,Long> recordedTimes=new LinkedHashMap<String,Long>();
  if (proceedTo(InitRunLevel.VAL,new InitActivator(recordedTimes))) {
    if (!logger.isLoggable(level))     recordedTimes=null;
    if (proceedTo(StartupRunLevel.VAL,new StartupActivator(recordedTimes))) {
      proceedTo(PostStartupRunLevel.VAL,new PostStartupActivator(recordedTimes));
    }
  }
}
Program: 28679
Project: 28679
Buggy source:
@SuppressWarnings({"String_Node_Str","String_Node_Str"}) public synchronized void stop(){
  if (env.getStatus() != ServerEnvironment.Status.started) {
    logger.fine("String_Node_Str");
    return;
  }
  env.setStatus(ServerEnvironment.Status.stopping);
  try {
    events.send(new Event(EventTypes.PREPARE_SHUTDOWN),false);
  }
 catch (  Exception e) {
    logger.log(Level.SEVERE,KernelLoggerInfo.exceptionDuringShutdown,e);
  }
  try {
    proceedTo(InitRunLevel.VAL,new AppServerActivator());
  }
 catch (  Exception e) {
    logger.log(Level.SEVERE,KernelLoggerInfo.exceptionDuringShutdown,e);
  }
  env.setStatus(ServerEnvironment.Status.stopped);
  try {
    events.send(new Event(EventTypes.SERVER_SHUTDOWN),false);
  }
 catch (  Exception e) {
    logger.log(Level.SEVERE,KernelLoggerInfo.exceptionDuringShutdown,e);
  }
  try {
    runLevelController.proceedTo(0);
  }
 catch (  Exception e) {
    logger.log(Level.SEVERE,KernelLoggerInfo.exceptionDuringShutdown,e);
  }
  logger.info(KernelLoggerInfo.shutdownFinished);
  if (serverThread != null) {
synchronized (serverThread) {
      shutdownSignal=true;
      serverThread.notify();
    }
    try {
      serverThread.join(0);
    }
 catch (    InterruptedException e) {
      throw new RuntimeException(e);
    }
  }
}

Fixed version (ground truth):
@SuppressWarnings({"String_Node_Str","String_Node_Str"}) public synchronized void stop(){
  if (env.getStatus() != ServerEnvironment.Status.started) {
    logger.fine("String_Node_Str");
    return;
  }
  env.setStatus(ServerEnvironment.Status.stopping);
  try {
    events.send(new Event(EventTypes.PREPARE_SHUTDOWN),false);
  }
 catch (  Exception e) {
    logger.log(Level.SEVERE,KernelLoggerInfo.exceptionDuringShutdown,e);
  }
  try {
    proceedTo(InitRunLevel.VAL,new AppServerActivator(null));
  }
 catch (  Exception e) {
    logger.log(Level.SEVERE,KernelLoggerInfo.exceptionDuringShutdown,e);
  }
  env.setStatus(ServerEnvironment.Status.stopped);
  try {
    events.send(new Event(EventTypes.SERVER_SHUTDOWN),false);
  }
 catch (  Exception e) {
    logger.log(Level.SEVERE,KernelLoggerInfo.exceptionDuringShutdown,e);
  }
  try {
    runLevelController.proceedTo(0);
  }
 catch (  Exception e) {
    logger.log(Level.SEVERE,KernelLoggerInfo.exceptionDuringShutdown,e);
  }
  logger.info(KernelLoggerInfo.shutdownFinished);
  if (serverThread != null) {
synchronized (serverThread) {
      shutdownSignal=true;
      serverThread.notify();
    }
    try {
      serverThread.join(0);
    }
 catch (    InterruptedException e) {
      throw new RuntimeException(e);
    }
  }
}
Program: 28680
Project: 28680
Buggy source:
@SuppressWarnings({"String_Node_Str","String_Node_Str"}) @Override public void activate(ActiveDescriptor<?> activeDescriptor){
  locator.reifyDescriptor(activeDescriptor);
  Class<?> type=activeDescriptor.getImplementationClass();
  long start=System.currentTimeMillis();
  try {
    if (logger.isLoggable(level)) {
      logger.log(level,"String_Node_Str" + type);
    }
    Object startup=locator.getServiceHandle(activeDescriptor).getService();
    if (logger.isLoggable(level)) {
      logger.log(level,"String_Node_Str" + startup);
    }
    if (startup instanceof FutureProvider) {
      futures.addAll(((FutureProvider)startup).getFutures());
    }
  }
 catch (  RuntimeException e) {
    logger.log(Level.SEVERE,KernelLoggerInfo.startupFailure,e);
    events.send(new Event(EventTypes.SERVER_SHUTDOWN),false);
    forceShutdown();
    return;
  }
  if (logger.isLoggable(level)) {
    servicesTiming.put(type,(System.currentTimeMillis() - start));
  }
}

Fixed version (ground truth):
/** 
 * List of   {@link Future futures} for {@link AppServerActivator#awaitCompletion}.
 */
@SuppressWarnings({"String_Node_Str","String_Node_Str"}) @Override public void activate(ActiveDescriptor<?> activeDescriptor){
  String type=activeDescriptor.getImplementation();
  long start=0L;
  if (recordedTimes != null) {
    start=System.currentTimeMillis();
  }
  try {
    if (recordedTimes != null) {
      logger.log(level,"String_Node_Str" + type);
    }
    Object startup=locator.getServiceHandle(activeDescriptor).getService();
    if (recordedTimes != null) {
      logger.log(level,"String_Node_Str" + startup);
    }
    if (startup instanceof FutureProvider) {
      futures.addAll(((FutureProvider)startup).getFutures());
    }
  }
 catch (  RuntimeException e) {
    logger.log(Level.SEVERE,KernelLoggerInfo.startupFailure,e);
    events.send(new Event(EventTypes.SERVER_SHUTDOWN),false);
    forceShutdown();
    return;
  }
  if (recordedTimes != null) {
    recordedTimes.put(type,(System.currentTimeMillis() - start));
  }
}
Program: 28681
Project: 28681
Buggy source:
@Override public void awaitCompletion() throws ExecutionException, InterruptedException, TimeoutException {
  if (runLevelController.getCurrentRunLevel() < PostStartupRunLevel.VAL - 1 || isShutdown()) {
    return;
  }
  printModuleStatus(systemRegistry,level);
}

Fixed version (ground truth):
@Override public void awaitCompletion() throws ExecutionException, InterruptedException, TimeoutException {
  if (runLevelController.getCurrentRunLevel() < PostStartupRunLevel.VAL - 1 || isShutdown()) {
    return;
  }
  printModuleStatus(systemRegistry,level);
  if (recordedTimes != null) {
    for (    Map.Entry<String,Long> service : recordedTimes.entrySet()) {
      logger.log(level,"String_Node_Str" + service.getKey() + "String_Node_Str"+ service.getValue()+ "String_Node_Str");
    }
    long finish=System.currentTimeMillis();
    logger.log(level,"String_Node_Str" + (finish - startupTime) + "String_Node_Str");
  }
}
Program: 28682
Project: 28682
Buggy source:
@Override public void run(){
  try {
    commandInvocation.execute();
  }
 catch (  Throwable thr) {
    RestLogging.restLogger.log(Level.WARNING,RestLogging.UNEXPECTED_EXCEPTION,thr.toString());
    ActionReport actionReport=new PropsFileActionReporter();
    actionReport.setFailureCause(thr);
    actionReport.setActionExitCode(ActionReport.ExitCode.FAILURE);
    AdminCommandState acs=new AdminCommandStateImpl(AdminCommandState.State.COMPLETED,actionReport,true,"String_Node_Str");
    onAdminCommandEvent(AdminCommandStateImpl.EVENT_STATE_CHANGED,acs);
  }
 finally {
    try {
      eventOuptut.close();
    }
 catch (    IOException ex) {
      RestLogging.restLogger.log(Level.WARNING,null,ex);
    }
  }
}

Fixed version (ground truth):
@Override public void run(){
  try {
    commandInvocation.execute();
  }
 catch (  Throwable thr) {
    RestLogging.restLogger.log(Level.WARNING,RestLogging.UNEXPECTED_EXCEPTION,thr);
    ActionReport actionReport=new PropsFileActionReporter();
    actionReport.setFailureCause(thr);
    actionReport.setActionExitCode(ActionReport.ExitCode.FAILURE);
    AdminCommandState acs=new AdminCommandStateImpl(AdminCommandState.State.COMPLETED,actionReport,true,"String_Node_Str");
    onAdminCommandEvent(AdminCommandStateImpl.EVENT_STATE_CHANGED,acs);
  }
 finally {
    try {
      eventOuptut.close();
    }
 catch (    IOException ex) {
      RestLogging.restLogger.log(Level.WARNING,null,ex);
    }
  }
}
Program: 28683
Project: 28683
Buggy source:
/** 
 * This will get the list of jobs from the job registry which have completed
 * @return the details of all completed jobs using JobInfos
 */
public JobInfos getCompletedJobs();

Fixed version (ground truth):
/** 
 * This will get the list of jobs from the job registry which have completed
 * @return the details of all completed jobs using JobInfos
 */
public JobInfos getCompletedJobs(File jobs);
Program: 28685
Project: 28685
Buggy source:
@Override public void describeAuthorization(Subject subject,String resourceName,String action,AdminCommand command,Map<String,Object> context,Map<String,String> subjectAttributes,Map<String,String> resourceAttributes,Map<String,String> actionAttributes){
  final Matcher m=JOB_PATTERN.matcher(resourceName);
  if (!m.matches()) {
    return;
  }
  if (m.groupCount() == 0) {
    return;
  }
  final String jobID=m.group(1);
  final Job job=jobManager.get(jobID);
  String userID=null;
  if (job != null) {
    userID=SubjectUtil.getUsernamesFromSubject(job.getSubject()).get(0);
  }
 else {
    if (jobManager.getCompletedJobs() != null) {
      final JobInfo jobInfo=(JobInfo)jobManager.getCompletedJobForId(jobID);
      if (jobInfo != null) {
        userID=jobInfo.user;
      }
    }
  }
  if (userID != null) {
    resourceAttributes.put(USER_ATTRIBUTE_NAME,userID);
  }
}

Fixed version (ground truth):
@Override public void describeAuthorization(Subject subject,String resourceName,String action,AdminCommand command,Map<String,Object> context,Map<String,String> subjectAttributes,Map<String,String> resourceAttributes,Map<String,String> actionAttributes){
  final Matcher m=JOB_PATTERN.matcher(resourceName);
  if (!m.matches()) {
    return;
  }
  if (m.groupCount() == 0) {
    return;
  }
  final String jobID=m.group(1);
  final Job job=jobManager.get(jobID);
  String userID=null;
  if (job != null) {
    userID=SubjectUtil.getUsernamesFromSubject(job.getSubject()).get(0);
  }
 else {
    if (jobManager.getCompletedJobs(jobManager.getJobsFile()) != null) {
      final JobInfo jobInfo=(JobInfo)jobManager.getCompletedJobForId(jobID);
      if (jobInfo != null) {
        userID=jobInfo.user;
      }
    }
  }
  if (userID != null) {
    resourceAttributes.put(USER_ATTRIBUTE_NAME,userID);
  }
}
Program: 28686
Project: 28686
Buggy source:
/** 
 * This will periodically purge expired jobs
 */
private void cleanUpExpiredJobs(){
  ArrayList<JobInfo> expiredJobs=jobManagerService.getExpiredJobs();
  if (expiredJobs.size() > 0) {
    for (    JobInfo job : expiredJobs) {
      jobManagerService.purgeJob(job.jobId);
      jobManagerService.purgeCompletedJobForId(job.jobId);
      logger.fine(adminStrings.getLocalString("String_Node_Str","String_Node_Str",job.jobId));
    }
  }
}

Fixed version (ground truth):
/** 
 * This will periodically purge expired jobs
 */
private void cleanUpExpiredJobs(){
  ArrayList<JobInfo> expiredJobs=jobManagerService.getExpiredJobs();
  if (expiredJobs.size() > 0) {
    for (    JobInfo job : expiredJobs) {
      jobManagerService.purgeJob(job.jobId);
      jobManagerService.purgeCompletedJobForId(job.jobId);
      jobManagerService.removeFromCompletedJobs(job.jobId);
      logger.fine(adminStrings.getLocalString("String_Node_Str","String_Node_Str",job.jobId));
    }
  }
}
Program: 28687
Project: 28687
Buggy source:
protected boolean isProcessAnnotation(T descriptor){
  boolean isFull=false;
  if (processAnnotationForOldDD) {
    isFull=descriptor.isFullAttribute();
  }
 else {
    isFull=descriptor.isFullFlag();
  }
  return (!isFull && annotationProcessingRequested && classLoader != null);
}

Fixed version (ground truth):
protected boolean isProcessAnnotation(BundleDescriptor descriptor){
  boolean isFull=false;
  if (processAnnotationForOldDD) {
    isFull=descriptor.isFullAttribute();
  }
 else {
    isFull=descriptor.isFullFlag();
  }
  return (!isFull && annotationProcessingRequested && classLoader != null);
}