nus-yam/ex-repair huggingface dataset:
Program: 28225
Project: 28225
Buggy source:
private <T>T createContextualInstance(Contextual<T> contextual,Object contextualId,CreationalContext<T> creationalContext,TransactionSynchronizationRegistry transactionSynchronizationRegistry){
  TransactionScopedBean<T> transactionScopedBean=new TransactionScopedBean<T>(contextual,creationalContext,this);
  transactionSynchronizationRegistry.putResource(contextualId,transactionScopedBean);
  transactionSynchronizationRegistry.registerInterposedSynchronization(transactionScopedBean);
  Set<TransactionScopedBean> transactionScopedBeanSet;
  if (beansPerTransaction.get(transactionSynchronizationRegistry) != null) {
    transactionScopedBeanSet=Collections.synchronizedSet(beansPerTransaction.get(transactionSynchronizationRegistry));
  }
 else {
    transactionScopedBeanSet=Collections.synchronizedSet(new HashSet());
    TransactionScopedCDIUtil.fireEvent(TransactionScopedCDIUtil.INITIALIZED_EVENT);
  }
  transactionScopedBeanSet.add(transactionScopedBean);
  beansPerTransaction.put(transactionSynchronizationRegistry,transactionScopedBeanSet);
  return transactionScopedBean.getContextualInstance();
}

Fixed version (ground truth):
private <T>T createContextualInstance(Contextual<T> contextual,Object contextualId,CreationalContext<T> creationalContext,TransactionSynchronizationRegistry transactionSynchronizationRegistry){
  TransactionScopedBean<T> transactionScopedBean=new TransactionScopedBean<T>(contextual,creationalContext,this);
  transactionSynchronizationRegistry.putResource(contextualId,transactionScopedBean);
  transactionSynchronizationRegistry.registerInterposedSynchronization(transactionScopedBean);
  Set<TransactionScopedBean> transactionScopedBeanSet=beansPerTransaction.get(transactionSynchronizationRegistry);
  if (transactionScopedBeanSet != null) {
    transactionScopedBeanSet=Collections.synchronizedSet(transactionScopedBeanSet);
  }
 else {
    transactionScopedBeanSet=Collections.synchronizedSet(new HashSet());
    TransactionScopedCDIUtil.fireEvent(TransactionScopedCDIUtil.INITIALIZED_EVENT);
    beansPerTransaction.put(transactionSynchronizationRegistry,transactionScopedBeanSet);
  }
  transactionScopedBeanSet.add(transactionScopedBean);
  return transactionScopedBean.getContextualInstance();
}
Program: 28226
Project: 28226
Buggy source:
@Override public <T>T find(Class<T> entityClass,Object primaryKey,LockModeType lockMode,Map<String,Object> properties){
  T returnValue=null;
  try {
    if (callFlowAgent.isEnabled()) {
      callFlowAgent.entityManagerMethodStart(EntityManagerMethod.FIND_CLASS_OBJECT_LOCKMODETYPE_PROPERTIES);
    }
    EntityManager delegate=_getDelegate();
    returnValue=_getDelegate().find(entityClass,primaryKey,lockMode,properties);
    clearPersistenceContextIfNotInTransaction(delegate);
  }
  finally {
    if (callFlowAgent.isEnabled()) {
      callFlowAgent.entityManagerMethodEnd();
    }
  }
  return returnValue;
}

Fixed version (ground truth):
@Override public <T>T find(Class<T> entityClass,Object primaryKey,LockModeType lockMode,Map<String,Object> properties){
  T returnValue=null;
  try {
    if (callFlowAgent.isEnabled()) {
      callFlowAgent.entityManagerMethodStart(EntityManagerMethod.FIND_CLASS_OBJECT_LOCKMODETYPE_PROPERTIES);
    }
    EntityManager delegate=_getDelegate();
    returnValue=_getDelegate().find(entityClass,primaryKey,lockMode,properties);
    clearPersistenceContextPerhaps(delegate);
  }
  finally {
    if (callFlowAgent.isEnabled()) {
      callFlowAgent.entityManagerMethodEnd();
    }
  }
  return returnValue;
}
Program: 28228
Project: 28228
Buggy source:
@Override public void onAfterService(final org.glassfish.grizzly.http.server.Request request){
  final Request servletRequest=request.getNote(CATALINA_REQUEST_NOTE);
  final Response servletResponse=request.getNote(CATALINA_RESPONSE_NOTE);
  if (servletRequest != null) {
    try {
      if (!servletRequest.isUpgrade()) {
        servletResponse.finishResponse();
      }
 else {
        servletResponse.setUpgrade(servletRequest.isUpgrade());
      }
    }
 catch (    Exception e) {
      log.log(Level.SEVERE,REQUEST_PROCESSING_EXCEPTION,e);
    }
 finally {
      servletRequest.recycle();
      servletResponse.recycle();
    }
  }
}

Fixed version (ground truth):
@Override public void onAfterService(final org.glassfish.grizzly.http.server.Request request){
  final Request servletRequest=request.getNote(CATALINA_REQUEST_NOTE);
  final Response servletResponse=request.getNote(CATALINA_RESPONSE_NOTE);
  if (servletRequest != null) {
    try {
      if (!servletRequest.isUpgrade()) {
        servletResponse.finishResponse();
      }
 else {
        servletResponse.setUpgrade(servletRequest.isUpgrade());
      }
    }
 catch (    Exception e) {
      log.log(Level.SEVERE,REQUEST_PROCESSING_EXCEPTION,e);
    }
 finally {
      try {
        servletRequest.unlockSession();
      }
  finally {
        servletRequest.recycle();
        servletResponse.recycle();
      }
    }
  }
}
Program: 28230
Project: 28230
Buggy source:
@Override public CDI<Object> getCDI(){
  try {
    if (!singletonRetrieved) {
      new TestingEnhancedWeld();
    }
    singletonRetrieved=true;
    return new GlassFishEnhancedWeld();
  }
 catch (  Throwable throwable) {
    Throwable cause=throwable.getCause();
    if (cause instanceof IllegalStateException) {
      return null;
    }
    throw throwable;
  }
}

Fixed version (ground truth):
@Override public CDI<Object> getCDI(){
  try {
    return new GlassFishEnhancedWeld();
  }
 catch (  Throwable throwable) {
    Throwable cause=throwable.getCause();
    if (cause instanceof IllegalStateException) {
      return null;
    }
    throw throwable;
  }
}
Program: 28231
Project: 28231
Buggy source:
@Override public HashMap<String,String> readFrom(Class<HashMap<String,String>> type,Type genericType,Annotation[] annotations,MediaType mediaType,MultivaluedMap<String,String> headers,InputStream in) throws IOException {
  JSONObject obj;
  try {
    obj=new JSONObject(inputStreamAsString(in));
    Iterator iter=obj.keys();
    HashMap map=new HashMap();
    while (iter.hasNext()) {
      String k=(String)iter.next();
      map.put(k,"String_Node_Str" + obj.get(k));
    }
    return map;
  }
 catch (  Exception ex) {
    HashMap map=new HashMap();
    map.put("String_Node_Str","String_Node_Str" + ex.getMessage());
    return map;
  }
}

Fixed version (ground truth):
@Override public HashMap<String,String> readFrom(Class<HashMap<String,String>> type,Type genericType,Annotation[] annotations,MediaType mediaType,MultivaluedMap<String,String> headers,InputStream in) throws IOException {
  HashMap map=new HashMap();
  try {
    JSONObject obj=new JSONObject(inputStreamAsString(in));
    Iterator iter=obj.keys();
    while (iter.hasNext()) {
      String k=(String)iter.next();
      map.put(k,"String_Node_Str" + obj.get(k));
    }
    return map;
  }
 catch (  IOException|JSONException ex) {
    return map;
  }
}
Program: 28232
Project: 28232
Buggy source:
public void setParentAndTagName(Dom parent,String tagName){
  this.parent=parent;
  this.tagName=tagName;
  entity=parent.nodeElements(tagName);
}

Fixed version (ground truth):
public void setParentAndTagName(Dom parent,String tagName){
  this.parent=parent;
  this.tagName=tagName;
  if (parent != null) {
    entity=parent.nodeElements(tagName);
  }
}
Program: 28233
Project: 28233
Buggy source:
protected Map<String,Property> getExistingProperties(){
  Map<String,Property> properties=new HashMap<String,Property>();
  for (  Dom child : parent.nodeElements(tagName)) {
    Property property=child.createProxy();
    properties.put(property.getName(),property);
  }
  return properties;
}

Fixed version (ground truth):
protected Map<String,Property> getExistingProperties(){
  Map<String,Property> properties=new HashMap<>();
  if (parent != null) {
    for (    Dom child : parent.nodeElements(tagName)) {
      Property property=child.createProxy();
      properties.put(property.getName(),property);
    }
  }
  return properties;
}
Program: 28234
Project: 28234
Buggy source:
public void setParentAndTagName(Dom parent,String tagName){
  if (parent == null) {
    throw new WebApplicationException(Response.Status.NOT_FOUND);
  }
  this.parent=parent;
  this.tagName=tagName;
  entity=parent.nodeElement(tagName);
  if (entity == null) {
    String location=buildPath(parent) + "String_Node_Str" + tagName;
    if (location.startsWith("String_Node_Str")) {
      ConfigBeanProxy cbp=locatorBridge.getRemoteLocator().<ConfigModularityUtils>getService(ConfigModularityUtils.class).getOwningObject(location);
      if (cbp != null) {
        entity=Dom.unwrap(cbp);
        childModel=entity.model;
      }
    }
  }
 else {
    childModel=entity.model;
  }
}

Fixed version (ground truth):
public void setParentAndTagName(Dom parent,String tagName){
  if (parent == null) {
    throw new WebApplicationException(Response.Status.NOT_FOUND);
  }
  this.parent=parent;
  this.tagName=tagName;
  entity=parent.nodeElement(tagName);
  if (entity == null) {
    String location=buildPath(parent) + "String_Node_Str" + tagName;
    if (location.startsWith("String_Node_Str")) {
      final ConfigModularityUtils cmu=locatorBridge.getRemoteLocator().<ConfigModularityUtils>getService(ConfigModularityUtils.class);
      ConfigBeanProxy cbp=cmu.getOwningObject(location);
      if (cbp == null) {
        cbp=cmu.getConfigBeanInstanceFor(cmu.getOwningClassForLocation(location));
      }
      if (cbp != null) {
        entity=Dom.unwrap(cbp);
        childModel=entity.model;
      }
    }
  }
 else {
    childModel=entity.model;
  }
}
Program: 28235
Project: 28235
Buggy source:
/** 
 * upon flush() write the existing contents of the OutputStream to the logger as a log record.
 * @throws java.io.IOException in case of error
 */
public void flush() throws IOException {
  String logMessage=null;
synchronized (this) {
    super.flush();
    logMessage=this.toString();
    super.reset();
  }
  if (logMessage != null) {
    logMessage=logMessage.trim();
    if (logMessage.length() == 0 || logMessage.equals(lineSeparator)) {
      return;
    }
    LogRecord logRecord=new LogRecord(level,logMessage);
    pendingRecords.offer(logRecord);
  }
}

Fixed version (ground truth):
/** 
 * upon flush() write the existing contents of the OutputStream to the logger as a log record.
 * @throws java.io.IOException in case of error
 */
public void flush() throws IOException {
  String logMessage=null;
synchronized (this) {
    super.flush();
    logMessage=this.toString();
    super.reset();
  }
  logMessage=logMessage.trim();
  if (logMessage.length() == 0 || logMessage.equals(lineSeparator)) {
    return;
  }
  LogRecord logRecord=new LogRecord(level,logMessage);
  pendingRecords.offer(logRecord);
}
Program: 28238
Project: 28238
Buggy source:
/** 
 * Merge the context initialization parameters specified in the application deployment descriptor with the application parameters described in the server configuration, respecting the <code>override</code> property of the application parameters appropriately.
 */
private synchronized void mergeParameters(){
  if (parametersMerged) {
    return;
  }
  for (  String name : context.findParameters()) {
    parameters.put(name,context.findParameter(name));
  }
  List<ApplicationParameter> params=context.findApplicationParameters();
synchronized (params) {
    Iterator<ApplicationParameter> i=params.iterator();
    while (i.hasNext()) {
      ApplicationParameter param=i.next();
      if (param.getOverride()) {
        if (parameters.get(param.getName()) == null)         parameters.put(param.getName(),param.getValue());
      }
 else {
        parameters.put(param.getName(),param.getValue());
      }
    }
  }
  parametersMerged=true;
}

Fixed version (ground truth):
/** 
 * Merge the context initialization parameters specified in the application deployment descriptor with the application parameters described in the server configuration, respecting the <code>override</code> property of the application parameters appropriately.
 */
private synchronized void mergeParameters(){
  if (parametersMerged) {
    return;
  }
synchronized (this) {
    if (parametersMerged) {
      return;
    }
    for (    String name : context.findParameters()) {
      parameters.put(name,context.findParameter(name));
    }
    List<ApplicationParameter> params=context.findApplicationParameters();
synchronized (params) {
      Iterator<ApplicationParameter> i=params.iterator();
      while (i.hasNext()) {
        ApplicationParameter param=i.next();
        if (param.getOverride()) {
          if (parameters.get(param.getName()) == null)           parameters.put(param.getName(),param.getValue());
        }
 else {
          parameters.put(param.getName(),param.getValue());
        }
      }
    }
    parametersMerged=true;
  }
}
Program: 28239
Project: 28239
Buggy source:
HttpRequestWrapper(HttpRequest request,HttpServletRequest servletRequest){
  super(servletRequest);
  httpRequest=request;
}

Fixed version (ground truth):
HttpRequestWrapper(HttpRequest request,HttpServletRequest servletRequest){
  httpRequest=(Request)request;
  this.servletRequest=servletRequest;
  isDefaultContext=httpRequest.getMappingData().isDefaultContext;
}
Program: 28240
Project: 28240
Buggy source:
public ServletRequest getRequest(boolean maskDefaultContextMapping){
  return httpRequest.getRequest(maskDefaultContextMapping);
}

Fixed version (ground truth):
@Override public ServletRequest getRequest(boolean maskDefaultContextMapping){
  ServletRequest rvalue;
  boolean getMasked=maskDefaultContextMapping && isDefaultContext;
  rvalue=getMasked ? maskedFacade : facade;
  if (rvalue == null) {
    rvalue=new RequestFacadeWrapper(httpRequest,servletRequest,getMasked);
    if (getMasked) {
      maskedFacade=rvalue;
    }
 else {
      facade=rvalue;
    }
  }
  return rvalue;
}
Program: 28241
Project: 28241
Buggy source:
private Map<String,ClusterInstanceInfo> getAllClusterInstanceInfo(){
  final Cluster myCluster=myServer.getCluster();
  fineLog("String_Node_Str",myCluster);
  final Config myConfig=getConfigForServer(myServer);
  fineLog("String_Node_Str",myConfig);
  final Map<String,ClusterInstanceInfo> result=new HashMap<String,ClusterInstanceInfo>();
  for (  Server server : myCluster.getInstances()) {
    ClusterInstanceInfo cii=getClusterInstanceInfo(server,myConfig,false);
    if (cii != null) {
      result.put(server.getName(),cii);
    }
  }
  fineLog("String_Node_Str",result);
  return result;
}

Fixed version (ground truth):
private Map<String,ClusterInstanceInfo> getAllClusterInstanceInfo(){
  final Cluster myCluster=myServer.getCluster();
  fineLog("String_Node_Str",myCluster);
  final Config myConfig=getConfigForServer(myServer);
  fineLog("String_Node_Str",myConfig);
  final Map<String,ClusterInstanceInfo> result=new HashMap<String,ClusterInstanceInfo>();
  if (myCluster != null) {
    for (    Server server : myCluster.getInstances()) {
      ClusterInstanceInfo cii=getClusterInstanceInfo(server,myConfig,false);
      if (cii != null) {
        result.put(server.getName(),cii);
      }
    }
  }
  fineLog("String_Node_Str",result);
  return result;
}
Program: 28243
Project: 28243
Buggy source:
/** 
 * Stop the class loader.
 * @exception LifecycleException if a lifecycle error occurs
 */
public void stop() throws Exception {
  if (!started) {
    return;
  }
  purgeELBeanClasses();
  ClassLoader curCl=null;
  try {
    curCl=Thread.currentThread().getContextClassLoader();
    Thread.currentThread().setContextClassLoader(this);
    clearReferences();
  }
  finally {
    if (curCl != null) {
      Thread.currentThread().setContextClassLoader(curCl);
    }
  }
  ClassLoaderUtil.releaseLoader(this);
  started=false;
  int length=files.length;
  for (int i=0; i < length; i++) {
    files[i]=null;
  }
  length=jarFiles.length;
  for (int i=0; i < length; i++) {
    try {
      if (jarFiles[i] != null) {
        jarFiles[i].close();
      }
    }
 catch (    IOException e) {
    }
    jarFiles[i]=null;
  }
  try {
    Class<?> clazz=Class.forName("String_Node_Str");
    if (clazz != null) {
      Method m=clazz.getMethod("String_Node_Str",URLClassLoader.class);
      if (m != null) {
        m.invoke(null,this);
      }
    }
  }
 catch (  Exception e) {
  }
  notFoundResources.clear();
  resourceEntries.clear();
  resources=null;
  repositories=null;
  repositoryURLs=null;
  files=null;
  jarFiles=null;
  jarRealFiles=null;
  jarPath=null;
  jarNames.clear();
  lastModifiedDates=null;
  paths=null;
  hasExternalRepositories=false;
  parent=null;
  permissionList.clear();
  permissionsHolder=null;
  loaderPC.clear();
  if (loaderDir != null) {
    deleteDir(loaderDir);
  }
  DirContextURLStreamHandler.unbind(this);
}

Fixed version (ground truth):
/** 
 * Stop the class loader.
 * @exception LifecycleException if a lifecycle error occurs
 */
public void stop() throws Exception {
  if (!started) {
    return;
  }
  purgeELBeanClasses();
  ClassLoader curCl=null;
  try {
    curCl=Thread.currentThread().getContextClassLoader();
    Thread.currentThread().setContextClassLoader(this);
    clearReferences();
  }
  finally {
    if (curCl != null) {
      Thread.currentThread().setContextClassLoader(curCl);
    }
  }
  ClassLoaderUtil.releaseLoader(this);
  started=false;
  int length=files.length;
  for (int i=0; i < length; i++) {
    files[i]=null;
  }
  length=jarFiles.length;
  for (int i=0; i < length; i++) {
    try {
      if (jarFiles[i] != null) {
        jarFiles[i].close();
      }
    }
 catch (    IOException e) {
    }
    jarFiles[i]=null;
  }
  try {
    close();
  }
 catch (  Exception e) {
  }
  notFoundResources.clear();
  resourceEntries.clear();
  resources=null;
  repositories=null;
  repositoryURLs=null;
  files=null;
  jarFiles=null;
  jarRealFiles=null;
  jarPath=null;
  jarNames.clear();
  lastModifiedDates=null;
  paths=null;
  hasExternalRepositories=false;
  parent=null;
  permissionList.clear();
  permissionsHolder=null;
  loaderPC.clear();
  if (loaderDir != null) {
    deleteDir(loaderDir);
  }
  DirContextURLStreamHandler.unbind(this);
}
Program: 28244
Project: 28244
Buggy source:
private Map getNamespace(String logicalJndiName,JndiNameEnvironment env){
  String componentId=DOLUtils.getComponentEnvId(env);
  String appName=DOLUtils.getApplicationName(env);
  String moduleName=DOLUtils.getModuleName(env);
  Map namespace=null;
  if (logicalJndiName.startsWith(JAVA_COMP_PREFIX)) {
    namespace=(Map)componentNamespaces.get(componentId);
    if (namespace == null) {
      namespace=new HashMap<String,Map>();
      componentNamespaces.put(componentId,namespace);
    }
  }
 else   if (logicalJndiName.startsWith(JAVA_MODULE_PREFIX)) {
    AppModuleKey appModuleKey=new AppModuleKey(appName,moduleName);
    namespace=moduleNamespaces.get(appModuleKey);
    if (namespace == null) {
      namespace=new HashMap<AppModuleKey,Map>();
      moduleNamespaces.put(appModuleKey,namespace);
    }
  }
 else   if (logicalJndiName.startsWith(JAVA_APP_PREFIX)) {
    namespace=appNamespaces.get(appName);
    if (namespace == null) {
      namespace=new HashMap<String,Map>();
      appNamespaces.put(appName,namespace);
    }
  }
  return namespace;
}

Fixed version (ground truth):
private Map getNamespace(String logicalJndiName,JndiNameEnvironment env){
  String appName=DOLUtils.getApplicationName(env);
  Map namespace=null;
  if (logicalJndiName.startsWith(JAVA_COMP_PREFIX)) {
    String componentId=DOLUtils.getComponentEnvId(env);
    namespace=(Map)componentNamespaces.get(componentId);
    if (namespace == null) {
      namespace=new HashMap<String,Map>();
      componentNamespaces.put(componentId,namespace);
    }
  }
 else   if (logicalJndiName.startsWith(JAVA_MODULE_PREFIX)) {
    String moduleName=DOLUtils.getModuleName(env);
    AppModuleKey appModuleKey=new AppModuleKey(appName,moduleName);
    namespace=moduleNamespaces.get(appModuleKey);
    if (namespace == null) {
      namespace=new HashMap<AppModuleKey,Map>();
      moduleNamespaces.put(appModuleKey,namespace);
    }
  }
 else   if (logicalJndiName.startsWith(JAVA_APP_PREFIX)) {
    namespace=appNamespaces.get(appName);
    if (namespace == null) {
      namespace=new HashMap<String,Map>();
      appNamespaces.put(appName,namespace);
    }
  }
  return namespace;
}
Program: 28245
Project: 28245
Buggy source:
private void validateEnvEntries(Application application){
  Set<EnvironmentProperty> environmentProperties=null;
  EnvEntriesValidator envValidator=new EnvEntriesValidator();
  environmentProperties=application.getEnvironmentProperties();
  envValidator.validateEnvEntries(application,environmentProperties);
  Set<ApplicationClientDescriptor> appClientDescs=application.getBundleDescriptors(ApplicationClientDescriptor.class);
  for (  ApplicationClientDescriptor acd : appClientDescs) {
    environmentProperties=acd.getEnvironmentProperties();
    envValidator.validateEnvEntries(acd,environmentProperties);
  }
  Set<EjbBundleDescriptor> ejbBundleDescs=application.getBundleDescriptors(EjbBundleDescriptor.class);
  for (  EjbBundleDescriptor ebd : ejbBundleDescs) {
    Set<EjbDescriptor> ejbDescriptors=(Set<EjbDescriptor>)ebd.getEjbs();
    for (Iterator itr=ejbDescriptors.iterator(); itr.hasNext(); ) {
      EjbDescriptor ejbDescriptor=(EjbDescriptor)itr.next();
      environmentProperties=ejbDescriptor.getEnvironmentProperties();
      envValidator.validateEnvEntries(ebd,environmentProperties);
    }
  }
  Set<WebBundleDescriptor> webBundleDescs=application.getBundleDescriptors(WebBundleDescriptor.class);
  for (  WebBundleDescriptor wbd : webBundleDescs) {
    Enumeration<EnvironmentEntry> envEntries=wbd.getEnvironmentEntries();
    envValidator.validateEnvEntries(wbd,envEntries);
  }
}

Fixed version (ground truth):
private void validateEnvEntries(Application application){
  Set<EnvironmentProperty> environmentProperties=null;
  EnvEntriesValidator envValidator=new EnvEntriesValidator();
  environmentProperties=application.getEnvironmentProperties();
  envValidator.validateEnvEntries(application,environmentProperties);
  Set<ApplicationClientDescriptor> appClientDescs=application.getBundleDescriptors(ApplicationClientDescriptor.class);
  for (  ApplicationClientDescriptor acd : appClientDescs) {
    environmentProperties=acd.getEnvironmentProperties();
    envValidator.validateEnvEntries(acd,environmentProperties);
  }
  Set<EjbBundleDescriptor> ejbBundleDescs=application.getBundleDescriptors(EjbBundleDescriptor.class);
  for (  EjbBundleDescriptor ebd : ejbBundleDescs) {
    Set<EjbDescriptor> ejbDescriptors=(Set<EjbDescriptor>)ebd.getEjbs();
    for (Iterator itr=ejbDescriptors.iterator(); itr.hasNext(); ) {
      EjbDescriptor ejbDescriptor=(EjbDescriptor)itr.next();
      environmentProperties=ejbDescriptor.getEnvironmentProperties();
      envValidator.validateEnvEntries(ejbDescriptor,environmentProperties);
    }
  }
  Set<WebBundleDescriptor> webBundleDescs=application.getBundleDescriptors(WebBundleDescriptor.class);
  for (  WebBundleDescriptor wbd : webBundleDescs) {
    Enumeration<EnvironmentEntry> envEntries=wbd.getEnvironmentEntries();
    envValidator.validateEnvEntries(wbd,envEntries);
  }
}
Program: 28246
Project: 28246
Buggy source:
private Map getNamespace(String logicalJndiName,JndiNameEnvironment env){
  String appName=DOLUtils.getApplicationName(env);
  Map namespace=null;
  if (logicalJndiName.startsWith(JAVA_COMP_PREFIX)) {
    String componentId=DOLUtils.getComponentEnvId(env);
    namespace=(Map)componentNamespaces.get(componentId);
    if (namespace == null) {
      namespace=new HashMap<String,Map>();
      componentNamespaces.put(componentId,namespace);
    }
  }
 else   if (logicalJndiName.startsWith(JAVA_MODULE_PREFIX)) {
    String moduleName=DOLUtils.getModuleName(env);
    AppModuleKey appModuleKey=new AppModuleKey(appName,moduleName);
    namespace=moduleNamespaces.get(appModuleKey);
    if (namespace == null) {
      namespace=new HashMap<AppModuleKey,Map>();
      moduleNamespaces.put(appModuleKey,namespace);
    }
  }
 else   if (logicalJndiName.startsWith(JAVA_APP_PREFIX)) {
    namespace=appNamespaces.get(appName);
    if (namespace == null) {
      namespace=new HashMap<String,Map>();
      appNamespaces.put(appName,namespace);
    }
  }
  return namespace;
}

Fixed version (ground truth):
private Map getNamespace(String logicalJndiName,JndiNameEnvironment env){
  String appName=DOLUtils.getApplicationName(env);
  Map namespace=null;
  if (logicalJndiName.startsWith(JAVA_COMP_PREFIX)) {
    String componentId=DOLUtils.getComponentEnvId(env);
    namespace=(Map)componentNamespaces.get(componentId);
    if (namespace == null) {
      namespace=new HashMap<String,Map>();
      componentNamespaces.put(componentId,namespace);
    }
  }
 else   if (logicalJndiName.startsWith(JAVA_MODULE_PREFIX)) {
    String moduleName=DOLUtils.getModuleName(env);
    AppModuleKey appModuleKey=new AppModuleKey(appName,moduleName);
    namespace=moduleNamespaces.get(appModuleKey);
    if (namespace == null) {
      namespace=new HashMap<AppModuleKey,Map>();
      moduleNamespaces.put(appModuleKey,namespace);
    }
  }
 else   if (logicalJndiName.startsWith(JAVA_APP_PREFIX)) {
    namespace=appNamespaces.get(appName);
    if (namespace == null) {
      namespace=new HashMap<String,Map>();
      appNamespaces.put(appName,namespace);
    }
  }
 else {
    namespace=globalNameSpace;
  }
  return namespace;
}
Program: 28247
Project: 28247
Buggy source:
public EnvEntriesValidator(){
  componentNamespaces=new HashMap<String,Map>();
  appNamespaces=new HashMap<String,Map>();
  moduleNamespaces=new HashMap<AppModuleKey,Map>();
}

Fixed version (ground truth):
public EnvEntriesValidator(){
  componentNamespaces=new HashMap<String,Map>();
  appNamespaces=new HashMap<String,Map>();
  moduleNamespaces=new HashMap<AppModuleKey,Map>();
  globalNameSpace=new HashMap();
}
Program: 28248
Project: 28248
Buggy source:
private void enteringEjbContainer(){
  if (interceptors == null)   return;
  for (  EjbContainerInterceptor interceptor : interceptors) {
    try {
      interceptor.preInvoke(ejbDescriptor);
    }
 catch (    Throwable th) {
      internal_logger.log(Level.SEVERE,INTERNAL_ERROR,th);
    }
  }
}

Fixed version (ground truth):
private void enteringEjbContainer(){
  if (interceptors == null)   return;
  for (  EjbContainerInterceptor interceptor : interceptors) {
    try {
      interceptor.preInvoke(ejbDescriptor);
    }
 catch (    Throwable th) {
      _logger.log(Level.SEVERE,INTERNAL_ERROR,th);
    }
  }
}
Program: 28250
Project: 28250
Buggy source:
/** 
 * Called after all the components in the container's application have deployed successfully.
 */
public void startApplication(boolean deploy){
  _logger.log(Level.FINE,"String_Node_Str" + this);
  if (isTimedObject_) {
    EJBTimerService timerService=EJBTimerService.getEJBTimerService();
    if (timerService != null) {
      boolean deploy0=deploy;
      if (deploy0 && ejbDescriptor.getApplication().getKeepStateResolved()) {
        deploy0=false;
        _logger.log(Level.INFO,"String_Node_Str");
      }
      scheduleIds=timerService.recoverAndCreateSchedules(getContainerId(),getApplicationId(),schedules,deploy0);
    }
 else {
      throw new RuntimeException("String_Node_Str");
    }
  }
  setStartedState();
}

Fixed version (ground truth):
/** 
 * Called after all the components in the container's application have deployed successfully.
 */
public void startApplication(boolean deploy){
  _logger.log(Level.FINE,"String_Node_Str" + this);
  if (isTimedObject_) {
    EJBTimerService timerService=EJBTimerService.getEJBTimerService();
    if (timerService != null) {
      boolean deploy0=deploy;
      if (deploy0 && ejbDescriptor.getApplication().getKeepStateResolved()) {
        deploy0=false;
        _logger.log(Level.INFO,KEEPSTATE_IS_TRUE);
      }
      scheduleIds=timerService.recoverAndCreateSchedules(getContainerId(),getApplicationId(),schedules,deploy0);
    }
 else {
      throw new RuntimeException("String_Node_Str");
    }
  }
  setStartedState();
}
Program: 28251
Project: 28251
Buggy source:
private void setEJBObjectTargetMethodInfo(InvocationInfo invInfo,boolean isLocal,Class originalIntf) throws EJBException {
  Class ejbIntfClazz=isLocal ? javax.ejb.EJBLocalObject.class : javax.ejb.EJBObject.class;
  Class[] paramTypes=invInfo.method.getParameterTypes();
  String methodName=invInfo.method.getName();
  if (ejbIntfClazz.isAssignableFrom(originalIntf)) {
    try {
      Method m=ejbIntfClazz.getMethod(methodName,paramTypes);
      String[] params={m.toString(),invInfo.method.toString()};
      _logger.log(Level.WARNING,"String_Node_Str",params);
      invInfo.ejbIntfOverride=true;
      return;
    }
 catch (    NoSuchMethodException nsme) {
    }
  }
  try {
    invInfo.targetMethod1=ejbClass.getMethod(methodName,paramTypes);
    if (isSession && isStatefulSession) {
      MethodDescriptor methodDesc=new MethodDescriptor(invInfo.targetMethod1,MethodDescriptor.EJB_BEAN);
      invInfo.removalInfo=((EjbSessionDescriptor)ejbDescriptor).getRemovalInfo(methodDesc);
    }
  }
 catch (  NoSuchMethodException nsme) {
    Object[] params={logParams[0] + "String_Node_Str" + nsme.toString(),(isLocal ? "String_Node_Str" : "String_Node_Str"),invInfo.method.toString()};
    _logger.log(Level.WARNING,"String_Node_Str",params);
    invInfo.targetMethod1=null;
  }
}

Fixed version (ground truth):
private void setEJBObjectTargetMethodInfo(InvocationInfo invInfo,boolean isLocal,Class originalIntf) throws EJBException {
  Class ejbIntfClazz=isLocal ? javax.ejb.EJBLocalObject.class : javax.ejb.EJBObject.class;
  Class[] paramTypes=invInfo.method.getParameterTypes();
  String methodName=invInfo.method.getName();
  if (ejbIntfClazz.isAssignableFrom(originalIntf)) {
    try {
      Method m=ejbIntfClazz.getMethod(methodName,paramTypes);
      String[] params={m.toString(),invInfo.method.toString()};
      _logger.log(Level.WARNING,ILLEGAL_EJB_INTERFACE_OVERRIDE,params);
      invInfo.ejbIntfOverride=true;
      return;
    }
 catch (    NoSuchMethodException nsme) {
    }
  }
  try {
    invInfo.targetMethod1=ejbClass.getMethod(methodName,paramTypes);
    if (isSession && isStatefulSession) {
      MethodDescriptor methodDesc=new MethodDescriptor(invInfo.targetMethod1,MethodDescriptor.EJB_BEAN);
      invInfo.removalInfo=((EjbSessionDescriptor)ejbDescriptor).getRemovalInfo(methodDesc);
    }
  }
 catch (  NoSuchMethodException nsme) {
    Object[] params={logParams[0] + "String_Node_Str" + nsme.toString(),(isLocal ? "String_Node_Str" : "String_Node_Str"),invInfo.method.toString()};
    _logger.log(Level.WARNING,BEAN_CLASS_METHOD_NOT_FOUND,params);
    invInfo.targetMethod1=null;
  }
}
Program: 28252
Project: 28252
Buggy source:
/** 
 * Called-back from security implementation through EjbInvocation when a jacc policy provider wants an enterprise bean instance.
 */
public Object getJaccEjb(EjbInvocation inv){
  Object bean=null;
  if (((inv.invocationInfo != null) && inv.invocationInfo.isBusinessMethod) || inv.isWebService) {
    if (inv.context == null) {
      try {
        inv.context=getContext(inv);
        bean=inv.context.getEJB();
      }
 catch (      EJBException e) {
        _logger.log(Level.WARNING,"String_Node_Str",logParams[0]);
        _logger.log(Level.WARNING,"String_Node_Str",e);
      }
    }
 else {
      bean=inv.context.getEJB();
    }
  }
  return bean;
}

Fixed version (ground truth):
/** 
 * Called-back from security implementation through EjbInvocation when a jacc policy provider wants an enterprise bean instance.
 */
public Object getJaccEjb(EjbInvocation inv){
  Object bean=null;
  if (((inv.invocationInfo != null) && inv.invocationInfo.isBusinessMethod) || inv.isWebService) {
    if (inv.context == null) {
      try {
        inv.context=getContext(inv);
        bean=inv.context.getEJB();
      }
 catch (      EJBException e) {
        _logger.log(Level.WARNING,CONTEXT_FAILURE_JACC,logParams[0]);
        _logger.log(Level.WARNING,"String_Node_Str",e);
      }
    }
 else {
      bean=inv.context.getEJB();
    }
  }
  return bean;
}
Program: 28253
Project: 28253
Buggy source:
private void leavingEjbContainer(){
  if (interceptors == null)   return;
  for (  EjbContainerInterceptor interceptor : interceptors) {
    try {
      interceptor.postInvoke(ejbDescriptor);
    }
 catch (    Throwable th) {
      internal_logger.log(Level.SEVERE,INTERNAL_ERROR,th);
    }
  }
}

Fixed version (ground truth):
private void leavingEjbContainer(){
  if (interceptors == null)   return;
  for (  EjbContainerInterceptor interceptor : interceptors) {
    try {
      interceptor.postInvoke(ejbDescriptor);
    }
 catch (    Throwable th) {
      _logger.log(Level.SEVERE,INTERNAL_ERROR,th);
    }
  }
}
Program: 28255
Project: 28255
Buggy source:
private void warnIfNotFullProfile(String description){
  if (ejbContainerUtilImpl.isEJBLite()) {
    _logger.log(Level.WARNING,"String_Node_Str",description);
  }
}

Fixed version (ground truth):
private void warnIfNotFullProfile(String description){
  if (ejbContainerUtilImpl.isEJBLite()) {
    _logger.log(Level.WARNING,WARN_FEATURE_REQUIRES_FULL_PROFILE,description);
  }
}
Program: 28256
Project: 28256
Buggy source:
private void initEjbInterceptors(){
  try {
    ServiceLocator services=ejbContainerUtilImpl.getServices();
    interceptors=services.getAllServices(EjbContainerInterceptor.class);
  }
 catch (  Throwable th) {
    _logger.log(Level.SEVERE,"String_Node_Str",th);
  }
}

Fixed version (ground truth):
private void initEjbInterceptors(){
  try {
    ServiceLocator services=ejbContainerUtilImpl.getServices();
    interceptors=services.getAllServices(EjbContainerInterceptor.class);
  }
 catch (  Throwable th) {
    _logger.log(Level.SEVERE,FAILED_TO_INITIALIZE_INTERCEPTOR,th);
  }
}
Program: 28259
Project: 28259
Buggy source:
private void enteringEjbContainer(){
  if (interceptors == null)   return;
  for (  EjbContainerInterceptor interceptor : interceptors) {
    try {
      interceptor.preInvoke(ejbDescriptor);
    }
 catch (    Throwable th) {
      _logger.log(Level.SEVERE,"String_Node_Str",th);
    }
  }
}

Fixed version (ground truth):
private void enteringEjbContainer(){
  if (interceptors == null)   return;
  for (  EjbContainerInterceptor interceptor : interceptors) {
    try {
      interceptor.preInvoke(ejbDescriptor);
    }
 catch (    Throwable th) {
      internal_logger.log(Level.SEVERE,INTERNAL_ERROR,th);
    }
  }
}
Program: 28260
Project: 28260
Buggy source:
private void leavingEjbContainer(){
  if (interceptors == null)   return;
  for (  EjbContainerInterceptor interceptor : interceptors) {
    try {
      interceptor.postInvoke(ejbDescriptor);
    }
 catch (    Throwable th) {
      _logger.log(Level.SEVERE,"String_Node_Str",th);
    }
  }
}

Fixed version (ground truth):
private void leavingEjbContainer(){
  if (interceptors == null)   return;
  for (  EjbContainerInterceptor interceptor : interceptors) {
    try {
      interceptor.postInvoke(ejbDescriptor);
    }
 catch (    Throwable th) {
      internal_logger.log(Level.SEVERE,INTERNAL_ERROR,th);
    }
  }
}
Program: 28261
Project: 28261
Buggy source:
private void leavingServletContainer(Request req,Response res){
  if (interceptors == null)   return;
  for (  ServletContainerInterceptor interceptor : interceptors) {
    try {
      interceptor.postInvoke(req,res);
    }
 catch (    Throwable th) {
      log.log(Level.SEVERE,"String_Node_Str",th);
    }
  }
}

Fixed version (ground truth):
private void leavingServletContainer(Request req,Response res){
  if (interceptors == null)   return;
  for (  ServletContainerInterceptor interceptor : interceptors) {
    try {
      interceptor.postInvoke(req,res);
    }
 catch (    Throwable th) {
      log.log(Level.SEVERE,INTERNAL_ERROR,th);
    }
  }
}
Program: 28262
Project: 28262
Buggy source:
private void enteringServletContainer(Request req,Response res){
  if (interceptors == null)   return;
  for (  ServletContainerInterceptor interceptor : interceptors) {
    try {
      interceptor.preInvoke(req,res);
    }
 catch (    Throwable th) {
      log.log(Level.SEVERE,"String_Node_Str",th);
    }
  }
}

Fixed version (ground truth):
private void enteringServletContainer(Request req,Response res){
  if (interceptors == null)   return;
  for (  ServletContainerInterceptor interceptor : interceptors) {
    try {
      interceptor.preInvoke(req,res);
    }
 catch (    Throwable th) {
      log.log(Level.SEVERE,INTERNAL_ERROR,th);
    }
  }
}
Program: 28263
Project: 28263
Buggy source:
private void initServletInterceptors(){
  try {
    ServiceLocator services=org.glassfish.internal.api.Globals.getDefaultHabitat();
    interceptors=services.getAllServices(ServletContainerInterceptor.class);
  }
 catch (  Throwable th) {
    log.log(Level.SEVERE,"String_Node_Str",th);
  }
}

Fixed version (ground truth):
private void initServletInterceptors(){
  try {
    ServiceLocator services=org.glassfish.internal.api.Globals.getDefaultHabitat();
    interceptors=services.getAllServices(ServletContainerInterceptor.class);
  }
 catch (  Throwable th) {
    log.log(Level.SEVERE,FAILED_TO_INITIALIZE_THE_INTERCEPTOR,th);
  }
}
Program: 28265
Project: 28265
Buggy source:
public void createLBRef(LbConfigs lbconfigs,String target,String configName){
  logger.fine("String_Node_Str" + target);
  if (tgt.isCluster(target)) {
    addClusterToLbConfig(lbconfigs,configName,target);
    logger.info(localStrings.getLocalString("String_Node_Str","String_Node_Str",target,configName));
  }
 else   if (domain.isServer(target)) {
    addServerToLBConfig(lbconfigs,configName,target);
    logger.info(localStrings.getLocalString("String_Node_Str","String_Node_Str",target,configName));
  }
 else {
    String msg=localStrings.getLocalString("String_Node_Str","String_Node_Str",target);
    report.setActionExitCode(ActionReport.ExitCode.FAILURE);
    report.setMessage(msg);
    return;
  }
}

Fixed version (ground truth):
public void createLBRef(LbConfigs lbconfigs,String target,String configName){
  if (logger.isLoggable(Level.FINE)) {
    logger.fine("String_Node_Str" + target);
  }
  if (tgt.isCluster(target)) {
    addClusterToLbConfig(lbconfigs,configName,target);
    logger.info(localStrings.getLocalString("String_Node_Str","String_Node_Str",target,configName));
  }
 else   if (domain.isServer(target)) {
    addServerToLBConfig(lbconfigs,configName,target);
    logger.info(localStrings.getLocalString("String_Node_Str","String_Node_Str",target,configName));
  }
 else {
    String msg=localStrings.getLocalString("String_Node_Str","String_Node_Str",target);
    report.setActionExitCode(ActionReport.ExitCode.FAILURE);
    report.setMessage(msg);
    return;
  }
}
Program: 28267
Project: 28267
Buggy source:
private void deleteClusterFromLBConfig(LbConfigs lbconfigs,String configName,String clusterName){
  LbConfig lbConfig=lbconfigs.getLbConfig(configName);
  ClusterRef cRef=lbConfig.getRefByRef(ClusterRef.class,clusterName);
  if (cRef == null) {
    String msg=localStrings.getLocalString("String_Node_Str","String_Node_Str",target);
    logger.finest("String_Node_Str" + clusterName + "String_Node_Str");
    report.setActionExitCode(ActionReport.ExitCode.FAILURE);
    report.setMessage(msg);
    return;
  }
  if (!Boolean.parseBoolean(force)) {
    Cluster c=domain.getClusterNamed(clusterName);
    if (c == null) {
      String msg=localStrings.getLocalString("String_Node_Str","String_Node_Str",target);
      report.setActionExitCode(ActionReport.ExitCode.FAILURE);
      report.setMessage(msg);
      return;
    }
    List<ServerRef> sRefs=c.getServerRef();
    boolean refLbEnabled=false;
    for (    ServerRef ref : sRefs) {
      if (Boolean.parseBoolean(ref.getLbEnabled())) {
        refLbEnabled=true;
      }
    }
    if (refLbEnabled) {
      String msg=localStrings.getLocalString("String_Node_Str","String_Node_Str",target);
      report.setActionExitCode(ActionReport.ExitCode.FAILURE);
      report.setMessage(msg);
      return;
    }
  }
  removeClusterRef(lbConfig,cRef);
}

Fixed version (ground truth):
private void deleteClusterFromLBConfig(LbConfigs lbconfigs,String configName,String clusterName){
  LbConfig lbConfig=lbconfigs.getLbConfig(configName);
  ClusterRef cRef=lbConfig.getRefByRef(ClusterRef.class,clusterName);
  if (cRef == null) {
    String msg=localStrings.getLocalString("String_Node_Str","String_Node_Str",target);
    if (logger.isLoggable(Level.FINEST)) {
      logger.finest("String_Node_Str" + clusterName + "String_Node_Str");
    }
    report.setActionExitCode(ActionReport.ExitCode.FAILURE);
    report.setMessage(msg);
    return;
  }
  if (!Boolean.parseBoolean(force)) {
    Cluster c=domain.getClusterNamed(clusterName);
    if (c == null) {
      String msg=localStrings.getLocalString("String_Node_Str","String_Node_Str",target);
      report.setActionExitCode(ActionReport.ExitCode.FAILURE);
      report.setMessage(msg);
      return;
    }
    List<ServerRef> sRefs=c.getServerRef();
    boolean refLbEnabled=false;
    for (    ServerRef ref : sRefs) {
      if (Boolean.parseBoolean(ref.getLbEnabled())) {
        refLbEnabled=true;
      }
    }
    if (refLbEnabled) {
      String msg=localStrings.getLocalString("String_Node_Str","String_Node_Str",target);
      report.setActionExitCode(ActionReport.ExitCode.FAILURE);
      report.setMessage(msg);
      return;
    }
  }
  removeClusterRef(lbConfig,cRef);
}
Program: 28273
Project: 28273
Buggy source:
/** 
 * Check if we can connect using password auth
 * @return true|false
 */
public boolean checkPasswordAuth(){
  boolean status=false;
  Connection c=null;
  try {
    c=new Connection(host,port);
    c.connect();
    if (logger.isLoggable(Level.FINER)) {
      logger.finer("String_Node_Str");
    }
    status=c.authenticateWithPassword(userName,password);
    if (status) {
      logger.finer("String_Node_Str" + userName + "String_Node_Str"+ host+ "String_Node_Str");
    }
  }
 catch (  IOException ioe) {
    if (logger.isLoggable(Level.FINER)) {
      ioe.printStackTrace();
    }
  }
 finally {
    if (c != null) {
      c.close();
    }
  }
  return status;
}

Fixed version (ground truth):
/** 
 * Check if we can connect using password auth
 * @return true|false
 */
public boolean checkPasswordAuth(){
  boolean status=false;
  Connection c=null;
  try {
    c=new Connection(host,port);
    c.connect();
    if (logger.isLoggable(Level.FINER)) {
      logger.finer("String_Node_Str");
    }
    status=c.authenticateWithPassword(userName,password);
    if (status) {
      if (logger.isLoggable(Level.FINER)) {
        logger.finer("String_Node_Str" + userName + "String_Node_Str"+ host+ "String_Node_Str");
      }
    }
  }
 catch (  IOException ioe) {
    if (logger.isLoggable(Level.FINER)) {
      ioe.printStackTrace();
    }
  }
 finally {
    if (c != null) {
      c.close();
    }
  }
  return status;
}
Program: 28274
Project: 28274
Buggy source:
/** 
 */
@Override protected int executeCommand() throws CommandException, CommandValidationException {
  int exitCode=-1;
  if (node == null) {
    if (nodeDirChild == null)     throw new CommandException(Strings.get("String_Node_Str","String_Node_Str" + "String_Node_Str"));
    _node=nodeDirChild.getName();
    String nodeHost=getInstanceHostName(true);
    createNodeImplicit(_node,getProductRootPath(),nodeHost);
  }
 else {
    _node=node;
  }
  if (isRegisteredToDAS()) {
    if (!_rendezvousOccurred) {
      setRendezvousOccurred("String_Node_Str");
      _rendezvousOccurred=true;
    }
  }
 else {
    validateInstanceDirUnique();
    try {
      registerToDAS();
      _rendezvousOccurred=true;
    }
 catch (    CommandException ce) {
      FileUtils.deleteFileNowOrLater(instanceDir);
      throw ce;
    }
  }
  bootstrapSecureAdminFiles();
  try {
    exitCode=super.executeCommand();
    if (exitCode == SUCCESS) {
      saveMasterPassword();
    }
  }
 catch (  CommandException ce) {
    String msg="String_Node_Str" + instanceName;
    if (ce.getLocalizedMessage() != null) {
      msg=msg + "String_Node_Str" + ce.getLocalizedMessage();
    }
    logger.severe(msg);
    setRendezvousOccurred("String_Node_Str");
    _rendezvousOccurred=false;
    throw new CommandException(msg,ce);
  }
  return exitCode;
}

Fixed version (ground truth):
/** 
 */
@Override protected int executeCommand() throws CommandException, CommandValidationException {
  int exitCode=-1;
  if (node == null) {
    if (nodeDirChild == null)     throw new CommandException(Strings.get("String_Node_Str","String_Node_Str" + "String_Node_Str"));
    _node=nodeDirChild.getName();
    String nodeHost=getInstanceHostName(true);
    createNodeImplicit(_node,getProductRootPath(),nodeHost);
  }
 else {
    _node=node;
  }
  if (isRegisteredToDAS()) {
    if (!_rendezvousOccurred) {
      setRendezvousOccurred("String_Node_Str");
      _rendezvousOccurred=true;
    }
  }
 else {
    if (instanceName != null && instanceDir != null) {
      validateInstanceDirUnique();
    }
    try {
      registerToDAS();
      _rendezvousOccurred=true;
    }
 catch (    CommandException ce) {
      FileUtils.deleteFileNowOrLater(instanceDir);
      throw ce;
    }
  }
  bootstrapSecureAdminFiles();
  try {
    exitCode=super.executeCommand();
    if (exitCode == SUCCESS) {
      saveMasterPassword();
    }
  }
 catch (  CommandException ce) {
    String msg="String_Node_Str" + instanceName;
    if (ce.getLocalizedMessage() != null) {
      msg=msg + "String_Node_Str" + ce.getLocalizedMessage();
    }
    logger.severe(msg);
    setRendezvousOccurred("String_Node_Str");
    _rendezvousOccurred=false;
    throw new CommandException(msg,ce);
  }
  return exitCode;
}
Program: 28275
Project: 28275
Buggy source:
private void validateInstanceDirUnique() throws CommandException {
  RemoteCLICommand rc=new RemoteCLICommand("String_Node_Str",this.programOpts,this.env);
  String[] registeredInstanceNamesOnThisNode=rc.executeAndReturnOutput("String_Node_Str","String_Node_Str",_node).split("String_Node_Str");
  if (registeredInstanceNamesOnThisNode == null)   return;
  for (  String registeredInstanceName : registeredInstanceNamesOnThisNode) {
    File instanceListDir=new File(nodeDirChild,registeredInstanceName);
    if (instanceName.equalsIgnoreCase(registeredInstanceName) && instanceDir.equals(instanceListDir)) {
      throw new CommandException(Strings.get("String_Node_Str",instanceName,registeredInstanceName));
    }
  }
}

Fixed version (ground truth):
private void validateInstanceDirUnique() throws CommandException {
  RemoteCLICommand rc=new RemoteCLICommand("String_Node_Str",this.programOpts,this.env);
  String[] registeredInstanceNamesOnThisNode=rc.executeAndReturnOutput("String_Node_Str","String_Node_Str",_node).split("String_Node_Str");
  for (  String registeredInstanceName : registeredInstanceNamesOnThisNode) {
    File instanceListDir=new File(nodeDirChild,registeredInstanceName);
    if (instanceName.equalsIgnoreCase(registeredInstanceName) && instanceDir.equals(instanceListDir)) {
      throw new CommandException(Strings.get("String_Node_Str",instanceName,registeredInstanceName));
    }
  }
}