nus-yam/ex-repair huggingface dataset:
Program: 29806
Project: 29806
Buggy source:
/** 
 * Get the usage text for the subcommand. This method shows the details for the subcommand options but does not provide details about the command  options.
 * @return usage text
 */
public String getUsage(){
  String usage;
  if (commandModel != null && ok(usage=commandModel.getUsageText())) {
    StringBuffer usageText=new StringBuffer();
    usageText.append(strings.get("String_Node_Str",strings.get("String_Node_Str")));
    usageText.append("String_Node_Str");
    usageText.append(usage);
    return usageText.toString();
  }
 else {
    return generateUsageText();
  }
}

Fixed version (ground truth):
/** 
 * Get the usage text for the subcommand. This method shows the details for the subcommand options but does not provide details about the command  options.
 * @return usage text
 */
public String getUsage(){
  String usage;
  if (commandModel != null && ok(usage=commandModel.getUsageText())) {
    StringBuffer usageText=new StringBuffer();
    usageText.append(strings.get("String_Node_Str",strings.get("String_Node_Str",programOpts.getCommandName())));
    usageText.append("String_Node_Str");
    usageText.append(usage);
    return usageText.toString();
  }
 else {
    return generateUsageText();
  }
}
Program: 29808
Project: 29808
Buggy source:
@Override public String executeOn(String[] args) throws IOException, InterruptedException {
  SSHLauncher sshLauncher=new SSHLauncher();
  File home=new File(System.getProperty("String_Node_Str"));
  String keyFile=new File(home,"String_Node_Str").getAbsolutePath();
  sshLauncher.init(getUser().getName(),address.getHostAddress(),22,null,keyFile,null,Logger.getAnonymousLogger());
  ByteArrayOutputStream baos=new ByteArrayOutputStream();
  StringBuilder stringBuilder=new StringBuilder();
  for (  String arg : args) {
    stringBuilder.append(arg);
    stringBuilder.append("String_Node_Str");
  }
  sshLauncher.runCommand(stringBuilder.toString().trim(),baos);
  return baos.toString();
}

Fixed version (ground truth):
@Override public String executeOn(String[] args) throws IOException, InterruptedException {
  SSHLauncher sshLauncher=new SSHLauncher();
  File home=new File(System.getProperty("String_Node_Str"));
  String keyFile=new File(home,"String_Node_Str").getAbsolutePath();
  sshLauncher.init(getUser().getName(),getAddress().getHostAddress(),22,null,keyFile,null,Logger.getAnonymousLogger());
  ByteArrayOutputStream baos=new ByteArrayOutputStream();
  StringBuilder stringBuilder=new StringBuilder();
  for (  String arg : args) {
    stringBuilder.append(arg);
    stringBuilder.append("String_Node_Str");
  }
  sshLauncher.runCommand(stringBuilder.toString().trim(),baos);
  return baos.toString();
}
Program: 29809
Project: 29809
Buggy source:
/** 
 * Gets the deployment context of this web application.
 */
public DeploymentContext getDeploymentContext(){
  return deploymentContext;
}

Fixed version (ground truth):
/** 
 * Gets the deployment context of this web application.
 */
public DeploymentContext getDeploymentContext(){
synchronized (this) {
    return deploymentContext;
  }
}
Program: 29810
Project: 29810
Buggy source:
public void setLogger(Logger logger){
  this.logger=logger;
}

Fixed version (ground truth):
public void setLogger(Logger logger){
synchronized (this) {
    this.logger=logger;
  }
}
Program: 29812
Project: 29812
Buggy source:
private void processDescriptorForRAReferences(com.sun.enterprise.deployment.Application app,String moduleName,Descriptor descriptor){
  if (descriptor instanceof JndiNameEnvironment) {
    JndiNameEnvironment jndiEnv=(JndiNameEnvironment)descriptor;
    for (    Object resourceRef : jndiEnv.getResourceReferenceDescriptors()) {
      ResourceReferenceDescriptor resRefDesc=(ResourceReferenceDescriptor)resourceRef;
      String jndiName=resRefDesc.getJndiName();
      if (jndiName != null) {
        detectResourceInRA(app,moduleName,jndiName);
      }
    }
    for (    Object jmsDestRef : jndiEnv.getJmsDestinationReferenceDescriptors()) {
      JmsDestinationReferenceDescriptor jmsDestRefDesc=(JmsDestinationReferenceDescriptor)jmsDestRef;
      String jndiName=jmsDestRefDesc.getJndiName();
      if (jndiName != null) {
        detectResourceInRA(app,moduleName,jndiName);
      }
    }
  }
}

Fixed version (ground truth):
private void processDescriptorForRAReferences(com.sun.enterprise.deployment.Application app,String moduleName,Descriptor descriptor){
  if (descriptor instanceof JndiNameEnvironment) {
    JndiNameEnvironment jndiEnv=(JndiNameEnvironment)descriptor;
    for (    Object resourceRef : jndiEnv.getResourceReferenceDescriptors()) {
      ResourceReferenceDescriptor resRefDesc=(ResourceReferenceDescriptor)resourceRef;
      String jndiName=resRefDesc.getJndiName();
      if (jndiName != null) {
        detectResourceInRA(app,moduleName,jndiName);
      }
    }
    for (    Object resourceEnvRef : jndiEnv.getResourceEnvReferenceDescriptors()) {
      ResourceEnvReferenceDescriptor resourceEnvRefDesc=(ResourceEnvReferenceDescriptor)resourceEnvRef;
      String jndiName=resourceEnvRefDesc.getJndiName();
      if (jndiName != null) {
        detectResourceInRA(app,moduleName,jndiName);
      }
    }
  }
}
Program: 29813
Project: 29813
Buggy source:
public void print(StringBuffer toStringBuffer){
  toStringBuffer.append("String_Node_Str");
  toStringBuffer.append("String_Node_Str");
  super.print(toStringBuffer);
  toStringBuffer.append("String_Node_Str").append(environmentProperties);
  toStringBuffer.append("String_Node_Str");
  if (ejbReferences != null)   printDescriptorSet(ejbReferences,toStringBuffer);
  toStringBuffer.append("String_Node_Str");
  if (jmsDestReferences != null)   printDescriptorSet(jmsDestReferences,toStringBuffer);
  toStringBuffer.append("String_Node_Str");
  if (messageDestReferences != null)   printDescriptorSet(messageDestReferences,toStringBuffer);
  toStringBuffer.append("String_Node_Str");
  if (resourceReferences != null)   printDescriptorSet(resourceReferences,toStringBuffer);
  toStringBuffer.append("String_Node_Str");
  if (serviceReferences != null)   printDescriptorSet(serviceReferences,toStringBuffer);
  toStringBuffer.append("String_Node_Str").append(mainClassName);
}

Fixed version (ground truth):
public void print(StringBuffer toStringBuffer){
  toStringBuffer.append("String_Node_Str");
  toStringBuffer.append("String_Node_Str");
  super.print(toStringBuffer);
  toStringBuffer.append("String_Node_Str").append(environmentProperties);
  toStringBuffer.append("String_Node_Str");
  if (ejbReferences != null)   printDescriptorSet(ejbReferences,toStringBuffer);
  toStringBuffer.append("String_Node_Str");
  if (resourceEnvReferences != null)   printDescriptorSet(resourceEnvReferences,toStringBuffer);
  toStringBuffer.append("String_Node_Str");
  if (messageDestReferences != null)   printDescriptorSet(messageDestReferences,toStringBuffer);
  toStringBuffer.append("String_Node_Str");
  if (resourceReferences != null)   printDescriptorSet(resourceReferences,toStringBuffer);
  toStringBuffer.append("String_Node_Str");
  if (serviceReferences != null)   printDescriptorSet(serviceReferences,toStringBuffer);
  toStringBuffer.append("String_Node_Str").append(mainClassName);
}
Program: 29814
Project: 29814
Buggy source:
/** 
 * Utility method for iterating the set of named descriptors in the supplied nameEnvironment
 */
protected Collection getNamedDescriptorsFrom(JndiNameEnvironment nameEnvironment){
  Collection namedDescriptors=new Vector();
  for (Iterator itr=nameEnvironment.getResourceReferenceDescriptors().iterator(); itr.hasNext(); ) {
    ResourceReferenceDescriptor resourceReference=(ResourceReferenceDescriptor)itr.next();
    namedDescriptors.add(resourceReference);
  }
  for (Iterator itr=nameEnvironment.getEjbReferenceDescriptors().iterator(); itr.hasNext(); ) {
    EjbReferenceDescriptor ejbReference=(EjbReferenceDescriptor)itr.next();
    namedDescriptors.add(ejbReference);
  }
  for (Iterator itr=nameEnvironment.getJmsDestinationReferenceDescriptors().iterator(); itr.hasNext(); ) {
    JmsDestinationReferenceDescriptor resourceEnvRef=(JmsDestinationReferenceDescriptor)itr.next();
    namedDescriptors.add(resourceEnvRef);
  }
  return namedDescriptors;
}

Fixed version (ground truth):
/** 
 * Utility method for iterating the set of named descriptors in the supplied nameEnvironment
 */
protected Collection getNamedDescriptorsFrom(JndiNameEnvironment nameEnvironment){
  Collection namedDescriptors=new Vector();
  for (Iterator itr=nameEnvironment.getResourceReferenceDescriptors().iterator(); itr.hasNext(); ) {
    ResourceReferenceDescriptor resourceReference=(ResourceReferenceDescriptor)itr.next();
    namedDescriptors.add(resourceReference);
  }
  for (Iterator itr=nameEnvironment.getEjbReferenceDescriptors().iterator(); itr.hasNext(); ) {
    EjbReferenceDescriptor ejbReference=(EjbReferenceDescriptor)itr.next();
    namedDescriptors.add(ejbReference);
  }
  for (Iterator itr=nameEnvironment.getResourceEnvReferenceDescriptors().iterator(); itr.hasNext(); ) {
    ResourceEnvReferenceDescriptor resourceEnvRef=(ResourceEnvReferenceDescriptor)itr.next();
    namedDescriptors.add(resourceEnvRef);
  }
  return namedDescriptors;
}
Program: 29815
Project: 29815
Buggy source:
/** 
 * Utility method for iterating the set of NameReference pairs in the supplied nameEnvironment
 */
protected Vector<NamedReferencePair> getNamedReferencePairsFrom(JndiNameEnvironment nameEnvironment){
  Vector<NamedReferencePair> pairs=new Vector<NamedReferencePair>();
  for (Iterator itr=nameEnvironment.getResourceReferenceDescriptors().iterator(); itr.hasNext(); ) {
    ResourceReferenceDescriptor resourceReference=(ResourceReferenceDescriptor)itr.next();
    pairs.add(NamedReferencePair.createResourceRefPair((Descriptor)nameEnvironment,resourceReference));
  }
  for (Iterator itr=nameEnvironment.getEjbReferenceDescriptors().iterator(); itr.hasNext(); ) {
    EjbReferenceDescriptor ejbReference=(EjbReferenceDescriptor)itr.next();
    pairs.add(NamedReferencePair.createEjbRefPair((Descriptor)nameEnvironment,ejbReference));
  }
  for (Iterator itr=nameEnvironment.getJmsDestinationReferenceDescriptors().iterator(); itr.hasNext(); ) {
    JmsDestinationReferenceDescriptor resourceEnvRef=(JmsDestinationReferenceDescriptor)itr.next();
    pairs.add(NamedReferencePair.createResourceEnvRefPair((Descriptor)nameEnvironment,resourceEnvRef));
  }
  return pairs;
}

Fixed version (ground truth):
/** 
 * Utility method for iterating the set of NameReference pairs in the supplied nameEnvironment
 */
protected Vector<NamedReferencePair> getNamedReferencePairsFrom(JndiNameEnvironment nameEnvironment){
  Vector<NamedReferencePair> pairs=new Vector<NamedReferencePair>();
  for (Iterator itr=nameEnvironment.getResourceReferenceDescriptors().iterator(); itr.hasNext(); ) {
    ResourceReferenceDescriptor resourceReference=(ResourceReferenceDescriptor)itr.next();
    pairs.add(NamedReferencePair.createResourceRefPair((Descriptor)nameEnvironment,resourceReference));
  }
  for (Iterator itr=nameEnvironment.getEjbReferenceDescriptors().iterator(); itr.hasNext(); ) {
    EjbReferenceDescriptor ejbReference=(EjbReferenceDescriptor)itr.next();
    pairs.add(NamedReferencePair.createEjbRefPair((Descriptor)nameEnvironment,ejbReference));
  }
  for (Iterator itr=nameEnvironment.getResourceEnvReferenceDescriptors().iterator(); itr.hasNext(); ) {
    ResourceEnvReferenceDescriptor resourceEnvRef=(ResourceEnvReferenceDescriptor)itr.next();
    pairs.add(NamedReferencePair.createResourceEnvRefPair((Descriptor)nameEnvironment,resourceEnvRef));
  }
  return pairs;
}
Program: 29816
Project: 29816
Buggy source:
private void addJndiNameEnvironmentInjectables(JndiNameEnvironment jndiNameEnv,List<InjectionCapable> injectables){
  Collection allEnvProps=new HashSet();
  for (Iterator envEntryItr=jndiNameEnv.getEnvironmentProperties().iterator(); envEntryItr.hasNext(); ) {
    EnvironmentProperty envEntry=(EnvironmentProperty)envEntryItr.next();
    if (envEntry.hasAValue()) {
      allEnvProps.add(envEntry);
    }
  }
  allEnvProps.addAll(jndiNameEnv.getEjbReferenceDescriptors());
  allEnvProps.addAll(jndiNameEnv.getServiceReferenceDescriptors());
  allEnvProps.addAll(jndiNameEnv.getResourceReferenceDescriptors());
  allEnvProps.addAll(jndiNameEnv.getJmsDestinationReferenceDescriptors());
  allEnvProps.addAll(jndiNameEnv.getMessageDestinationReferenceDescriptors());
  allEnvProps.addAll(jndiNameEnv.getEntityManagerFactoryReferenceDescriptors());
  allEnvProps.addAll(jndiNameEnv.getEntityManagerReferenceDescriptors());
  for (Iterator envItr=allEnvProps.iterator(); envItr.hasNext(); ) {
    InjectionCapable next=(InjectionCapable)envItr.next();
    if (next.isInjectable()) {
      injectables.add(next);
    }
  }
}

Fixed version (ground truth):
private void addJndiNameEnvironmentInjectables(JndiNameEnvironment jndiNameEnv,List<InjectionCapable> injectables){
  Collection allEnvProps=new HashSet();
  for (Iterator envEntryItr=jndiNameEnv.getEnvironmentProperties().iterator(); envEntryItr.hasNext(); ) {
    EnvironmentProperty envEntry=(EnvironmentProperty)envEntryItr.next();
    if (envEntry.hasAValue()) {
      allEnvProps.add(envEntry);
    }
  }
  allEnvProps.addAll(jndiNameEnv.getEjbReferenceDescriptors());
  allEnvProps.addAll(jndiNameEnv.getServiceReferenceDescriptors());
  allEnvProps.addAll(jndiNameEnv.getResourceReferenceDescriptors());
  allEnvProps.addAll(jndiNameEnv.getResourceEnvReferenceDescriptors());
  allEnvProps.addAll(jndiNameEnv.getMessageDestinationReferenceDescriptors());
  allEnvProps.addAll(jndiNameEnv.getEntityManagerFactoryReferenceDescriptors());
  allEnvProps.addAll(jndiNameEnv.getEntityManagerReferenceDescriptors());
  for (Iterator envItr=allEnvProps.iterator(); envItr.hasNext(); ) {
    InjectionCapable next=(InjectionCapable)envItr.next();
    if (next.isInjectable()) {
      injectables.add(next);
    }
  }
}
Program: 29817
Project: 29817
Buggy source:
private static void debugMessage(String s){
  if (DEBUG_MESSAGES_ON)   CLIUtil.writeCommandToDebugLog(new Environment(),new String[]{"String_Node_Str",s},99999);
}

Fixed version (ground truth):
private static void debugMessage(String s){
  if (DEBUG_MESSAGES_ON) {
    Environment env=new Environment();
    try {
      CLIUtil.writeCommandToDebugLog(new ProgramOptions(env),env,new String[]{"String_Node_Str",s},99999);
    }
 catch (    CommandException ce) {
    }
  }
}
Program: 29818
Project: 29818
Buggy source:
@Override protected int executeCommand() throws CommandException {
  if (appName == null && serviceName == null) {
    validationSuccess=false;
    System.out.println("String_Node_Str");
  }
  if (appName != null && serviceName != null) {
    validationSuccess=false;
    System.out.println("String_Node_Str");
  }
  if (validationSuccess) {
    Date date=new Date();
    long milliseconds=date.getTime();
    origin=String.valueOf(milliseconds);
    while (true) {
      RemoteCommand cmd=new RemoteCommand(commandName,programOpts,env);
      Map<String,String> attr=cmd.executeAndReturnAttributes(getParams());
      String fileData=attr.get("String_Node_Str");
      String filePointer=attr.get("String_Node_Str");
      String origin=attr.get("String_Node_Str");
      if (fileData != null && fileData.trim().length() > 0) {
        System.out.println(fileData);
      }
      this.filepointer=filePointer;
      this.origin=origin;
    }
  }
  return 0;
}

Fixed version (ground truth):
@Override protected int executeCommand() throws CommandException {
  if (appName == null && serviceName == null) {
    validationSuccess=false;
    System.out.println("String_Node_Str");
  }
  if (appName != null && serviceName != null) {
    validationSuccess=false;
    System.out.println("String_Node_Str");
  }
  if (validationSuccess) {
    Date date=new Date();
    long milliseconds=date.getTime();
    origin=String.valueOf(milliseconds);
    while (true) {
      RemoteCommand cmd=new RemoteCommand(commandName,programOpts,env);
      Map<String,String> attr=cmd.executeAndReturnAttributes(getParams());
      String fileData=attr.get("String_Node_Str");
      String filePointer=attr.get("String_Node_Str");
      String origin=attr.get("String_Node_Str");
      if (fileData != null && fileData.trim().length() > 0) {
        System.out.println(fileData);
      }
      this.filepointer=filePointer;
      this.origin=origin;
      try {
        Thread.currentThread().sleep(Long.parseLong(pollIntervalInSeconds) * 1000);
      }
 catch (      InterruptedException e) {
      }
    }
  }
  return 0;
}
Program: 29819
Project: 29819
Buggy source:
private boolean addDirectory(ZipOutputStream zout,File fileSource) throws IOException {
  boolean zipDone=false;
  File[] files=fileSource.listFiles();
  for (int i=0; i < files.length; i++) {
    if (files[i].isDirectory()) {
      addDirectory(zout,files[i]);
      continue;
    }
    if (files[i].getAbsolutePath().contains("String_Node_Str")) {
      continue;
    }
    try {
      byte[] buffer=new byte[1024];
      FileInputStream fin=new FileInputStream(files[i].getAbsolutePath());
      zout.putNextEntry(new ZipEntry(files[i].getAbsolutePath()));
      int length;
      while ((length=fin.read(buffer)) > 0) {
        zout.write(buffer,0,length);
      }
      zout.closeEntry();
      fin.close();
      zipDone=true;
    }
 catch (    IOException ioe) {
      Logger.getAnonymousLogger().log(Level.SEVERE,"String_Node_Str",ioe);
      throw ioe;
    }
  }
  return zipDone;
}

Fixed version (ground truth):
private boolean addDirectory(ZipOutputStream zout,File fileSource,int ignoreLength) throws IOException {
  boolean zipDone=false;
  File[] files=fileSource.listFiles();
  for (int i=0; i < files.length; i++) {
    if (files[i].isDirectory()) {
      addDirectory(zout,files[i],ignoreLength);
      continue;
    }
    if (files[i].getAbsolutePath().contains("String_Node_Str")) {
      continue;
    }
    try {
      byte[] buffer=new byte[1024];
      FileInputStream fin=new FileInputStream(files[i].getAbsolutePath());
      zout.putNextEntry(new ZipEntry(ignoreLength > -1 ? files[i].getAbsolutePath().substring(ignoreLength) : files[i].getAbsolutePath()));
      int length;
      while ((length=fin.read(buffer)) > 0) {
        zout.write(buffer,0,length);
      }
      zout.closeEntry();
      fin.close();
      zipDone=true;
    }
 catch (    IOException ioe) {
      Logger.getAnonymousLogger().log(Level.SEVERE,"String_Node_Str",ioe);
      throw ioe;
    }
  }
  return zipDone;
}
Program: 29820
Project: 29820
Buggy source:
public String createZipFile(String sourceDir,String zipFileName) throws IOException {
  String zipFile=getZipFileName(sourceDir,zipFileName);
  boolean zipDone=false;
  try {
    FileOutputStream fout=new FileOutputStream(zipFile);
    ZipOutputStream zout=new ZipOutputStream(fout);
    File fileSource=new File(sourceDir);
    zipDone=addDirectory(zout,fileSource);
    zout.close();
  }
 catch (  IOException ioe) {
    Logger.getAnonymousLogger().log(Level.SEVERE,"String_Node_Str",ioe);
    throw ioe;
  }
  return zipFile;
}

Fixed version (ground truth):
public String createZipFile(String sourceDir,String zipFileName) throws IOException {
  String zipFile=getZipFileName(sourceDir,zipFileName);
  boolean zipDone=false;
  try {
    FileOutputStream fout=new FileOutputStream(zipFile);
    ZipOutputStream zout=new ZipOutputStream(fout);
    File fileSource=new File(sourceDir);
    zipDone=addDirectory(zout,fileSource,fileSource.getAbsolutePath().length() + 1);
    zout.close();
  }
 catch (  IOException ioe) {
    Logger.getAnonymousLogger().log(Level.SEVERE,"String_Node_Str",ioe);
    throw ioe;
  }
  return zipFile;
}
Program: 29821
Project: 29821
Buggy source:
@Override public void execute(AdminCommandContext context){
  report=context.getActionReport();
  report.setActionExitCode(ActionReport.ExitCode.SUCCESS);
  if (tenantId == null) {
    String msg=localStrings.getLocalString("String_Node_Str","String_Node_Str");
    report.setActionExitCode(ActionReport.ExitCode.FAILURE);
    report.setMessage(msg);
    return;
  }
  logger.fine("String_Node_Str" + tenantId + "String_Node_Str"+ "String_Node_Str");
  securityStore.create(tenantId + "String_Node_Str" + "String_Node_Str",password.toCharArray());
  logger.fine("String_Node_Str" + tenantId);
  tm.create(tenantId,"String_Node_Str");
}

Fixed version (ground truth):
@Override public void execute(AdminCommandContext context){
  report=context.getActionReport();
  report.setActionExitCode(ActionReport.ExitCode.SUCCESS);
  if (tenantId == null) {
    String msg=localStrings.getLocalString("String_Node_Str","String_Node_Str");
    report.setActionExitCode(ActionReport.ExitCode.FAILURE);
    report.setMessage(msg);
    return;
  }
  logger.log(Level.INFO,"String_Node_Str",tenantId + "String_Node_Str");
  securityStore.create(tenantId + "String_Node_Str",password.toCharArray());
  logger.log(Level.INFO,"String_Node_Str",tenantId);
  logger.fine("String_Node_Str" + tenantId);
  tm.create(tenantId,"String_Node_Str");
}
Program: 29822
Project: 29822
Buggy source:
/** 
 * Creates file-user in default realm.
 */
@Override public void create(String name,char[] password){
  CommandInvocation cmd=commandRunner.getCommandInvocation("String_Node_Str",actionReport);
  ParameterMap map=new ParameterMap();
  map.add("String_Node_Str",password.toString());
  map.add("String_Node_Str",name);
  cmd.parameters(map);
  cmd.execute();
  if (actionReport.getActionExitCode() == ActionReport.ExitCode.FAILURE) {
    Throwable cause=actionReport.getFailureCause();
    if (cause instanceof IllegalArgumentException) {
      throw (IllegalArgumentException)cause;
    }
 else {
      throw new RuntimeException(cause);
    }
  }
 else   if (actionReport.getActionExitCode() == ActionReport.ExitCode.FAILURE) {
    logger.fine(actionReport.getMessage());
  }
}

Fixed version (ground truth):
/** 
 * Creates file-user in default realm.
 */
@Override public void create(String name,char[] password){
  CommandInvocation cmd=commandRunner.getCommandInvocation("String_Node_Str",actionReport);
  ParameterMap map=new ParameterMap();
  map.add("String_Node_Str",String.valueOf(password));
  map.add("String_Node_Str",name);
  cmd.parameters(map);
  cmd.execute();
  if (actionReport.getActionExitCode() == ActionReport.ExitCode.FAILURE) {
    Throwable cause=actionReport.getFailureCause();
    if (cause instanceof IllegalArgumentException) {
      throw (IllegalArgumentException)cause;
    }
 else {
      throw new RuntimeException(cause);
    }
  }
 else   if (actionReport.getActionExitCode() == ActionReport.ExitCode.FAILURE) {
    logger.fine(actionReport.getMessage());
  }
}
Program: 29825
Project: 29825
Buggy source:
/** 
 * Create and return a temporary loader with the same visibility as this loader. The temporary loader may be used to load resources or any other application classes for the purposes of introspecting them for annotations. The persistence provider should not maintain any references to the temporary loader, or any objects loaded by it.
 * @return A temporary classloader with the same classpath as this loader
 */
public ClassLoader copy(){
  logger.entering("String_Node_Str","String_Node_Str");
  return new URLClassLoader(getURLs(),getParent());
}

Fixed version (ground truth):
/** 
 * Create and return a temporary loader with the same visibility as this loader. The temporary loader may be used to load resources or any other application classes for the purposes of introspecting them for annotations. The persistence provider should not maintain any references to the temporary loader, or any objects loaded by it.
 * @return A temporary classloader with the same classpath as this loader
 */
public ClassLoader copy(){
  logger.entering("String_Node_Str","String_Node_Str");
  return AccessController.doPrivileged(new PrivilegedAction<URLClassLoader>(){
    @Override public URLClassLoader run(){
      return new URLClassLoader(getURLs(),getParent());
    }
  }
);
}
Program: 29826
Project: 29826
Buggy source:
public void updateObjectName(){
  try {
    StandardHost host=(StandardHost)getParent();
    oname=createObjectName(host.getDomain(),host.getJmxName());
    controller=oname;
    for (    Container wrapper : findChildren()) {
      ((StandardWrapper)wrapper).registerJMX(this);
    }
  }
 catch (  Exception ex) {
    if (log.isLoggable(Level.INFO)) {
      log.log(Level.INFO,"String_Node_Str" + this + "String_Node_Str"+ oname+ "String_Node_Str"+ ex.toString(),ex);
    }
  }
}

Fixed version (ground truth):
public void updateObjectName(){
  try {
    StandardHost host=(StandardHost)getParent();
synchronized (this) {
      oname=createObjectName(host.getDomain(),host.getJmxName());
      controller=oname;
    }
    for (    Container wrapper : findChildren()) {
      ((StandardWrapper)wrapper).registerJMX(this);
    }
  }
 catch (  Exception ex) {
    if (log.isLoggable(Level.INFO)) {
      log.log(Level.INFO,"String_Node_Str" + this + "String_Node_Str"+ oname+ "String_Node_Str"+ ex.toString(),ex);
    }
  }
}
Program: 29828
Project: 29828
Buggy source:
private void handleError(Request request,Response response,int statusCode) throws IOException {
  ServletRequest sreq=request.getRequest();
  ServletResponse sres=response.getResponse();
  HttpServletResponse hres=(HttpServletResponse)sres;
  ErrorPage errorPage=((StandardHost)getContainer()).findErrorPage(statusCode);
  if (errorPage != null) {
    try {
      hres.setStatus(statusCode);
      ServletContext servletContext=request.getContext().getServletContext();
      ApplicationDispatcher dispatcher=(ApplicationDispatcher)servletContext.getRequestDispatcher(errorPage.getLocation());
      if (hres.isCommitted()) {
        dispatcher.include(sreq,sres);
      }
 else {
        response.resetBuffer(true);
        dispatcher.dispatch(sreq,sres,DispatcherType.ERROR);
        response.setSuspended(false);
      }
      sres.flushBuffer();
    }
 catch (    Throwable t) {
      if (log.isLoggable(Level.INFO)) {
        String message=sm.getString("String_Node_Str",errorPage.getLocation());
        log.log(Level.INFO,message,t);
      }
    }
  }
 else {
    hres.sendError(statusCode);
  }
}

Fixed version (ground truth):
private void handleError(Request request,Response response,int statusCode) throws IOException {
  ServletRequest sreq=request.getRequest();
  ServletResponse sres=response.getResponse();
  HttpServletResponse hres=(HttpServletResponse)sres;
  ErrorPage errorPage=null;
  if (getContainer() instanceof StandardHost) {
    errorPage=((StandardHost)getContainer()).findErrorPage(statusCode);
  }
 else   if (getContainer() instanceof StandardContext) {
    errorPage=((StandardContext)getContainer()).findErrorPage(statusCode);
  }
  if (errorPage != null) {
    try {
      hres.setStatus(statusCode);
      ServletContext servletContext=request.getContext().getServletContext();
      ApplicationDispatcher dispatcher=(ApplicationDispatcher)servletContext.getRequestDispatcher(errorPage.getLocation());
      if (hres.isCommitted()) {
        dispatcher.include(sreq,sres);
      }
 else {
        response.resetBuffer(true);
        dispatcher.dispatch(sreq,sres,DispatcherType.ERROR);
        response.setSuspended(false);
      }
      sres.flushBuffer();
    }
 catch (    Throwable t) {
      if (log.isLoggable(Level.INFO)) {
        String message=sm.getString("String_Node_Str",errorPage.getLocation());
        log.log(Level.INFO,message,t);
      }
    }
  }
 else {
    hres.sendError(statusCode);
  }
}
Program: 29829
Project: 29829
Buggy source:
/** 
 * Create, configure, and return an Engine that will process all HTTP requests received from one of the associated Connectors, based on the specified properties. Do not create the JAAS default realm since all children will have their own.
 */
@Override public Engine createEngine(){
  StandardEngine engine=new WebEngine(webContainer);
  engine.setDebug(debug);
  engine.setLogger(logger);
  engine.setRealm(null);
  return (engine);
}

Fixed version (ground truth):
/** 
 * Create, configure, and return an Engine that will process all HTTP requests received from one of the associated Connectors, based on the specified properties. Do not create the JAAS default realm since all children will have their own.
 */
@Override public Engine createEngine(){
  StandardEngine engine=new StandardEngine();
  engine.setDebug(debug);
  engine.setLogger(logger);
  engine.setRealm(null);
  return (engine);
}
Program: 29830
Project: 29830
Buggy source:
protected WebModuleConfig getDefaultWebModule(Domain domain,WebArchivist webArchivist,ApplicationRegistry appRegistry){
  WebModuleConfig wmInfo=null;
  String wmID=getDefaultWebModuleID();
  if (wmID != null) {
    Applications appsBean=domain.getApplications();
    wmInfo=findWebModuleInJ2eeApp(appsBean,wmID,appRegistry);
    if (wmInfo == null) {
      String contextRoot=ConfigBeansUtilities.getContextRoot(wmID);
      String location=ConfigBeansUtilities.getLocation(wmID);
      if (contextRoot != null && location != null) {
        File docroot=new File(location);
        WebBundleDescriptor wbd=webArchivist.getDefaultWebXmlBundleDescriptor();
        wmInfo=new WebModuleConfig();
        wbd.setName(Constants.DEFAULT_WEB_MODULE_NAME);
        wbd.setContextRoot(contextRoot);
        wmInfo.setLocation(docroot);
        wmInfo.setDescriptor(wbd);
        wmInfo.setParentLoader(EmbeddedWebContainer.class.getClassLoader());
        wmInfo.setAppClassLoader(new WebappClassLoader(wmInfo.getParentLoader()));
      }
    }
    if (wmInfo == null) {
      _logger.log(Level.SEVERE,"String_Node_Str",new Object[]{wmID,getID()});
    }
  }
  return wmInfo;
}

Fixed version (ground truth):
protected WebModuleConfig getDefaultWebModule(Domain domain,WebArchivist webArchivist,ApplicationRegistry appRegistry){
  WebModuleConfig wmInfo=null;
  String wmID=getDefaultWebModuleID();
  if (wmID != null) {
    Applications appsBean=domain.getApplications();
    wmInfo=findWebModuleInJ2eeApp(appsBean,wmID,appRegistry);
    if (wmInfo == null) {
      String contextRoot=ConfigBeansUtilities.getContextRoot(wmID);
      String location=ConfigBeansUtilities.getLocation(wmID);
      if (contextRoot != null && location != null) {
        File docroot=new File(location);
        WebBundleDescriptor wbd=webArchivist.getDefaultWebXmlBundleDescriptor();
        wmInfo=new WebModuleConfig();
        wbd.setName(Constants.DEFAULT_WEB_MODULE_NAME);
        wbd.setContextRoot(contextRoot);
        wmInfo.setLocation(docroot);
        wmInfo.setDescriptor(wbd);
        wmInfo.setParentLoader(EmbeddedWebContainer.class.getClassLoader());
        WebappClassLoader cloader=AccessController.doPrivileged(new PrivilegedAction<WebappClassLoader>(){
          @Override public WebappClassLoader run(){
            return new WebappClassLoader(EmbeddedWebContainer.class.getClassLoader());
          }
        }
);
        wmInfo.setAppClassLoader(cloader);
      }
    }
    if (wmInfo == null) {
      _logger.log(Level.SEVERE,"String_Node_Str",new Object[]{wmID,getID()});
    }
  }
  return wmInfo;
}
Program: 29833
Project: 29833
Buggy source:
/** 
 * Sets the deployment context for this web application.
 */
public void setDeploymentContext(DeploymentContext deploymentContext){
  this.deploymentContext=deploymentContext;
}

Fixed version (ground truth):
/** 
 * Sets the deployment context for this web application.
 */
public void setDeploymentContext(DeploymentContext deploymentContext){
synchronized (this) {
    this.deploymentContext=deploymentContext;
  }
}
Program: 29834
Project: 29834
Buggy source:
/** 
 * Sets the parent of the work directory for this web application. The actual work directory is a subdirectory named after the web application.
 * @param baseDir The new base directory under which the actual workdirectory will be created
 */
public void setWorkDirBase(String baseDir){
  _baseDir=baseDir;
}

Fixed version (ground truth):
/** 
 * Sets the parent of the work directory for this web application. The actual work directory is a subdirectory named after the web application.
 * @param baseDir The new base directory under which the actual workdirectory will be created
 */
public void setWorkDirBase(String baseDir){
synchronized (this) {
    _baseDir=baseDir;
  }
}
Program: 29835
Project: 29835
Buggy source:
/** 
 * Set the DOL object associated with this class.
 */
public void setServices(Services services){
  this.services=services;
}

Fixed version (ground truth):
/** 
 * Set the DOL object associated with this class.
 */
public void setServices(Services services){
synchronized (this) {
    this.services=services;
  }
}
Program: 29836
Project: 29836
Buggy source:
/** 
 * Fires probe event related to the fact that the given request is about to exit from the web container.
 * @param request the request object
 * @param host the virtual server to which the request was mapped
 * @param context the Context to which the request was mapped
 * @param statusCode the response status code
 */
@Override public void requestEndEvent(HttpServletRequest request,Host host,Context context,int statusCode){
  if (requestProbeProvider != null) {
    String appName=null;
    if (context != null) {
      appName=((WebModule)context).getMonitoringNodeName();
    }
    String hostName=null;
    if (host != null) {
      hostName=host.getName();
    }
    requestProbeProvider.requestEndEvent(appName,hostName,request.getServerName(),request.getServerPort(),request.getContextPath(),request.getServletPath(),statusCode,request.getMethod(),request.getRequestURI());
  }
}

Fixed version (ground truth):
/** 
 * Fires probe event related to the fact that the given request is about to exit from the web container.
 * @param request the request object
 * @param host the virtual server to which the request was mapped
 * @param context the Context to which the request was mapped
 * @param statusCode the response status code
 */
@Override public void requestEndEvent(HttpServletRequest request,Host host,Context context,int statusCode){
  if (requestProbeProvider != null) {
    String appName=null;
    if (context instanceof WebModule) {
      appName=((WebModule)context).getMonitoringNodeName();
    }
    String hostName=null;
    if (host != null) {
      hostName=host.getName();
    }
    requestProbeProvider.requestEndEvent(appName,hostName,request.getServerName(),request.getServerPort(),request.getContextPath(),request.getServletPath(),statusCode,request.getMethod(),request.getRequestURI());
  }
}
Program: 29837
Project: 29837
Buggy source:
/** 
 * Fires probe event related to the fact that the given request has been entered the web container.
 * @param request the request object
 * @param host the virtual server to which the request was mapped
 * @param context the Context to which the request was mapped
 */
@Override public void requestStartEvent(HttpServletRequest request,Host host,Context context){
  if (requestProbeProvider != null) {
    String appName=null;
    if (context != null) {
      appName=((WebModule)context).getMonitoringNodeName();
    }
    String hostName=null;
    if (host != null) {
      hostName=host.getName();
    }
    requestProbeProvider.requestStartEvent(appName,hostName,request.getServerName(),request.getServerPort(),request.getContextPath(),request.getServletPath());
  }
}

Fixed version (ground truth):
/** 
 * Fires probe event related to the fact that the given request has been entered the web container.
 * @param request the request object
 * @param host the virtual server to which the request was mapped
 * @param context the Context to which the request was mapped
 */
@Override public void requestStartEvent(HttpServletRequest request,Host host,Context context){
  if (requestProbeProvider != null) {
    String appName=null;
    if (context instanceof WebModule) {
      appName=((WebModule)context).getMonitoringNodeName();
    }
    String hostName=null;
    if (host != null) {
      hostName=host.getName();
    }
    requestProbeProvider.requestStartEvent(appName,hostName,request.getServerName(),request.getServerPort(),request.getContextPath(),request.getServletPath());
  }
}
Program: 29838
Project: 29838
Buggy source:
@Override public void setContext(Context ctx){
  if (ctx == null) {
    return;
  }
  super.setContext(ctx);
  Response response=(Response)getResponse();
  if (response != null) {
    String[] cacheControls=((PwcWebModule)ctx).getCacheControls();
    for (int i=0; cacheControls != null && i < cacheControls.length; i++) {
      response.addHeader("String_Node_Str",cacheControls[i]);
    }
  }
  sunWebXmlChecked=false;
}

Fixed version (ground truth):
@Override public void setContext(Context ctx){
  if (ctx == null) {
    return;
  }
  super.setContext(ctx);
  Response response=(Response)getResponse();
  if ((response != null) && (ctx instanceof PwcWebModule)) {
    String[] cacheControls=((PwcWebModule)ctx).getCacheControls();
    for (int i=0; cacheControls != null && i < cacheControls.length; i++) {
      response.addHeader("String_Node_Str",cacheControls[i]);
    }
  }
  sunWebXmlChecked=false;
}
Program: 29839
Project: 29839
Buggy source:
public void createESElement() throws TransactionFailure {
  try {
    ConfigSupport.apply(new SingleConfigCode<Tenant>(){
      @Override public Object run(      Tenant tenant) throws TransactionFailure {
        Elastic es=tenant.createChild(Elastic.class);
        tenant.getExtensions().add(es);
        return es;
      }
    }
,tenant);
  }
 catch (  TransactionFailure e) {
    e.printStackTrace();
  }
}

Fixed version (ground truth):
public void createESElement() throws TransactionFailure {
  try {
    ConfigSupport.apply(new SingleConfigCode<Tenant>(){
      @Override public Object run(      Tenant tenant) throws TransactionFailure {
        return null;
      }
    }
,tenant);
  }
 catch (  TransactionFailure e) {
    e.printStackTrace();
  }
}
Program: 29840
Project: 29840
Buggy source:
@Override public Object run(Tenant tenant) throws TransactionFailure {
  Elastic es=tenant.createChild(Elastic.class);
  tenant.getExtensions().add(es);
  return es;
}

Fixed version (ground truth):
@Override public Object run(Tenant tenant) throws TransactionFailure {
  return null;
}
Program: 29842
Project: 29842
Buggy source:
@After public void tearDown() throws TransactionFailure {
  ConfigSupport.apply(new SingleConfigCode<Resources>(){
    public Object run(    Resources param) throws PropertyVetoException, TransactionFailure {
      Resource target=null;
      for (      Resource resource : param.getResources()) {
        if (resource instanceof org.glassfish.resources.config.CustomResource) {
          CustomResource r=(CustomResource)resource;
          if (r.getJndiName().equals("String_Node_Str") || r.getJndiName().equals("String_Node_Str")) {
            target=resource;
            break;
          }
        }
      }
      if (target != null) {
        param.getResources().remove(target);
      }
      return null;
    }
  }
,resources);
}

Fixed version (ground truth):
@After public void tearDown() throws TransactionFailure {
  org.glassfish.resources.admin.cli.DeleteCustomResource deleteCommand=habitat.getComponent(org.glassfish.resources.admin.cli.DeleteCustomResource.class);
  parameters=new ParameterMap();
  parameters.set("String_Node_Str","String_Node_Str");
  cr.getCommandInvocation("String_Node_Str",context.getActionReport()).parameters(parameters).execute(deleteCommand);
  parameters=new ParameterMap();
  parameters.set("String_Node_Str","String_Node_Str");
  cr.getCommandInvocation("String_Node_Str",context.getActionReport()).parameters(parameters).execute(deleteCommand);
}
Program: 29843
Project: 29843
Buggy source:
@After public void tearDown() throws TransactionFailure {
  ConfigSupport.apply(new SingleConfigCode<Resources>(){
    public Object run(    Resources param) throws PropertyVetoException, TransactionFailure {
      Resource target=null;
      for (      Resource resource : param.getResources()) {
        if (resource instanceof MailResource) {
          MailResource r=(MailResource)resource;
          if (r.getJndiName().equals("String_Node_Str") || r.getJndiName().equals("String_Node_Str")) {
            target=resource;
            break;
          }
        }
      }
      if (target != null) {
        param.getResources().remove(target);
      }
      return null;
    }
  }
,resources);
}

Fixed version (ground truth):
@After public void tearDown() throws TransactionFailure {
  org.glassfish.resources.javamail.admin.cli.DeleteJavaMailResource deleteCommand=habitat.getComponent(org.glassfish.resources.javamail.admin.cli.DeleteJavaMailResource.class);
  parameters=new ParameterMap();
  parameters.set("String_Node_Str","String_Node_Str");
  cr.getCommandInvocation("String_Node_Str",context.getActionReport()).parameters(parameters).execute(deleteCommand);
  parameters=new ParameterMap();
  parameters.set("String_Node_Str","String_Node_Str");
  cr.getCommandInvocation("String_Node_Str",context.getActionReport()).parameters(parameters).execute(deleteCommand);
}
Program: 29844
Project: 29844
Buggy source:
public void setCoyoteResponse(Response coyoteResponse){
  this.response=coyoteResponse;
  this.grizzlyResponse=coyoteResponse.getCoyoteResponse();
  this.grizzlyOutputBuffer=grizzlyResponse.getOutputBuffer();
  grizzlyOutputBuffer.setBufferSize(size);
  grizzlyOutputBuffer.registerLifeCycleListener(sessionCookieChecker);
}

Fixed version (ground truth):
public void setCoyoteResponse(Response coyoteResponse){
  this.response=coyoteResponse;
  this.grizzlyResponse=coyoteResponse.getCoyoteResponse();
  this.grizzlyOutputBuffer=grizzlyResponse.getOutputBuffer();
  grizzlyOutputBuffer.setBufferSize(size);
  grizzlyOutputBuffer.registerLifeCycleListener(sessionCookieChecker);
  grizzlyOutputBuffer.setAsyncEnabled(false);
}
Program: 29845
Project: 29845
Buggy source:
/** 
 * Add a filter to the set of filters that will be executed in this chain.
 * @param filterConfig The FilterConfig for the servlet to be executed
 */
void addFilter(ApplicationFilterConfig filterConfig){
  if (n == filters.length) {
    ApplicationFilterConfig[] newFilters=new ApplicationFilterConfig[n + INCREMENT];
    System.arraycopy(filters,0,newFilters,0,n);
    filters=newFilters;
  }
  filters[n++]=filterConfig;
}

Fixed version (ground truth):
/** 
 * Add a filter to the set of filters that will be executed in this chain.
 * @param filterConfig The FilterConfig for the servlet to be executed
 */
void addFilter(ApplicationFilterConfig filterConfig){
  boolean add=true;
  String filterName=filterConfig.getFilterName();
  for (int i=0; i < n; i++) {
    ApplicationFilterConfig afc=filters[i];
    if (afc != null && filterName.equals(afc.getFilterName())) {
      add=false;
      break;
    }
  }
  if (add) {
    if (n == filters.length) {
      ApplicationFilterConfig[] newFilters=new ApplicationFilterConfig[n + INCREMENT];
      System.arraycopy(filters,0,newFilters,0,n);
      filters=newFilters;
    }
    filters[n++]=filterConfig;
  }
}
Program: 29846
Project: 29846
Buggy source:
/** 
 * Adds the filter with the given name and class type to this servlet context.
 */
@Override public FilterRegistration.Dynamic addFilter(String filterName,Class<? extends Filter> filterClass){
  if (isContextInitializedCalled) {
    throw new IllegalStateException(sm.getString("String_Node_Str","String_Node_Str",getName()));
  }
synchronized (filterDefs) {
    if (findFilterDef(filterName) != null) {
      return null;
    }
    DynamicFilterRegistrationImpl regis=(DynamicFilterRegistrationImpl)filterRegisMap.get(filterName);
    FilterDef filterDef=null;
    if (null == regis) {
      filterDef=new FilterDef();
    }
 else {
      filterDef=regis.getFilterDefinition();
    }
    filterDef.setFilterName(filterName);
    filterDef.setFilterClass(filterClass);
    addFilterDef(filterDef,true,(regis == null));
    if (null == regis) {
      regis=(DynamicFilterRegistrationImpl)filterRegisMap.get(filterName);
    }
    return regis;
  }
}

Fixed version (ground truth):
/** 
 * Adds the filter with the given name and class type to this servlet context.
 */
@Override public FilterRegistration.Dynamic addFilter(String filterName,Class<? extends Filter> filterClass){
  if (isContextInitializedCalled) {
    throw new IllegalStateException(sm.getString("String_Node_Str","String_Node_Str",getName()));
  }
  if (filterName == null) {
    throw new IllegalArgumentException(sm.getString("String_Node_Str"));
  }
synchronized (filterDefs) {
    if (findFilterDef(filterName) != null) {
      return null;
    }
    DynamicFilterRegistrationImpl regis=(DynamicFilterRegistrationImpl)filterRegisMap.get(filterName);
    FilterDef filterDef=null;
    if (null == regis) {
      filterDef=new FilterDef();
    }
 else {
      filterDef=regis.getFilterDefinition();
    }
    filterDef.setFilterName(filterName);
    filterDef.setFilterClass(filterClass);
    addFilterDef(filterDef,true,(regis == null));
    if (null == regis) {
      regis=(DynamicFilterRegistrationImpl)filterRegisMap.get(filterName);
    }
    return regis;
  }
}
Program: 29847
Project: 29847
Buggy source:
/** 
 * Add a new MIME mapping, replacing any existing mapping for the specified extension.
 * @param extension Filename extension being mapped
 * @param mimeType Corresponding MIME type
 */
public void addMimeMapping(String extension,String mimeType){
synchronized (mimeMappings) {
    mimeMappings.put(extension,mimeType);
  }
  if (notifyContainerListeners) {
    fireContainerEvent("String_Node_Str",extension);
  }
}

Fixed version (ground truth):
/** 
 * Add a new MIME mapping, replacing any existing mapping for the specified extension.
 * @param extension Filename extension being mapped
 * @param mimeType Corresponding MIME type
 */
public void addMimeMapping(String extension,String mimeType){
  mimeMappings.put(extension.toLowerCase(Locale.ENGLISH),mimeType);
  if (notifyContainerListeners) {
    fireContainerEvent("String_Node_Str",extension);
  }
}
Program: 29848
Project: 29848
Buggy source:
/** 
 * Return the MIME type to which the specified extension is mapped, if any; otherwise return <code>null</code>.
 * @param extension Extension to map to a MIME type
 */
@Override public String findMimeMapping(String extension){
  String mimeType=mimeMappings.get(extension);
  if (mimeType == null) {
synchronized (mimeMappings) {
      for (      String ext : mimeMappings.keySet()) {
        if (ext.equalsIgnoreCase(extension)) {
          mimeType=mimeMappings.get(ext);
          mimeMappings.put(extension,mimeType);
          break;
        }
      }
    }
  }
  return mimeType;
}

Fixed version (ground truth):
/** 
 * Return the MIME type to which the specified extension is mapped, if any; otherwise return <code>null</code>.
 * @param extension Extension to map to a MIME type
 */
@Override public String findMimeMapping(String extension){
  return mimeMappings.get(extension.toLowerCase(Locale.ENGLISH));
}
Program: 29849
Project: 29849
Buggy source:
/** 
 * Remove the MIME mapping for the specified extension, if it exists; otherwise, no action is taken.
 * @param extension Extension to remove the mapping for
 */
@Override public void removeMimeMapping(String extension){
synchronized (mimeMappings) {
    mimeMappings.remove(extension);
  }
  if (notifyContainerListeners) {
    fireContainerEvent("String_Node_Str",extension);
  }
}

Fixed version (ground truth):
/** 
 * Remove the MIME mapping for the specified extension, if it exists; otherwise, no action is taken.
 * @param extension Extension to remove the mapping for
 */
@Override public void removeMimeMapping(String extension){
  mimeMappings.remove(extension.toLowerCase(Locale.ENGLISH));
  if (notifyContainerListeners) {
    fireContainerEvent("String_Node_Str",extension);
  }
}
Program: 29850
Project: 29850
Buggy source:
/** 
 * Return the extensions for which MIME mappings are defined.  If there are none, a zero-length array is returned.
 */
@Override public String[] findMimeMappings(){
synchronized (mimeMappings) {
    return mimeMappings.keySet().toArray(new String[mimeMappings.size()]);
  }
}

Fixed version (ground truth):
/** 
 * Return the extensions for which MIME mappings are defined.  If there are none, a zero-length array is returned.
 */
@Override public String[] findMimeMappings(){
  return mimeMappings.keySet().toArray(new String[mimeMappings.size()]);
}