nus-yam/ex-repair huggingface dataset:
Program: 30017
Project: 30017
Buggy source:
public static Map maskOffPassword(Map<String,Object> attrs){
  Map masked=new HashMap();
  for (  String key : attrs.keySet()) {
    if (pswdAttrList.contains(key.toLowerCase())) {
      masked.put(key,"String_Node_Str");
    }
 else {
      masked.put(key,attrs.get(key));
    }
  }
  return masked;
}

Fixed version (ground truth):
public static Map maskOffPassword(Map<String,Object> attrs){
  Map masked=new HashMap();
  if (attrs == null) {
    return masked;
  }
  for (  String key : attrs.keySet()) {
    if (pswdAttrList.contains(key.toLowerCase())) {
      masked.put(key,"String_Node_Str");
    }
 else {
      masked.put(key,attrs.get(key));
    }
  }
  return masked;
}
Program: 30020
Project: 30020
Buggy source:
void logCommandLine(){
  StringBuilder sb=new StringBuilder();
  for (  String s : commandLine) {
    sb.append(NEWLINE);
    sb.append(s);
  }
  if (!isFakeLaunch()) {
    GFLauncherLogger.fine("String_Node_Str",sb.toString());
  }
}

Fixed version (ground truth):
void logCommandLine(){
  StringBuilder sb=new StringBuilder();
  for (  String s : jvmOptionsList) {
    sb.append(NEWLINE);
    sb.append(s);
  }
  if (!isFakeLaunch()) {
    GFLauncherLogger.info("String_Node_Str",sb.toString());
  }
}
Program: 30023
Project: 30023
Buggy source:
@Override public void onEntryAddedEvent(final FileCache fileCache,final FileCacheEntry entry){
  grizzlyMonitoring.getFileCacheProbeProvider().incOpenCacheEntriesEvent(monitoringId);
switch (entry.type) {
case HEAP:
{
      grizzlyMonitoring.getFileCacheProbeProvider().addHeapSizeEvent(monitoringId,entry.contentLength);
      break;
    }
case MAPPED:
{
    grizzlyMonitoring.getFileCacheProbeProvider().addMappedMemorySizeEvent(monitoringId,entry.contentLength);
    break;
  }
}
}

Fixed version (ground truth):
@Override public void onEntryAddedEvent(final FileCache fileCache,final FileCacheEntry entry){
  grizzlyMonitoring.getFileCacheProbeProvider().incOpenCacheEntriesEvent(monitoringId);
switch (entry.type) {
case HEAP:
{
      grizzlyMonitoring.getFileCacheProbeProvider().addHeapSizeEvent(monitoringId,entry.contentLength);
      break;
    }
case MAPPED:
{
    grizzlyMonitoring.getFileCacheProbeProvider().addMappedMemorySizeEvent(monitoringId,entry.contentLength);
    break;
  }
default :
{
  throw new IllegalStateException("String_Node_Str" + entry.type);
}
}
}
Program: 30024
Project: 30024
Buggy source:
@Override public void onEntryHitEvent(final FileCache fileCache,final FileCacheEntry entry){
  grizzlyMonitoring.getFileCacheProbeProvider().countHitEvent(monitoringId);
switch (entry.type) {
case HEAP:
{
      grizzlyMonitoring.getFileCacheProbeProvider().countInfoHitEvent(monitoringId);
      break;
    }
case MAPPED:
{
    grizzlyMonitoring.getFileCacheProbeProvider().countContentHitEvent(monitoringId);
    break;
  }
}
}

Fixed version (ground truth):
@Override public void onEntryHitEvent(final FileCache fileCache,final FileCacheEntry entry){
  grizzlyMonitoring.getFileCacheProbeProvider().countHitEvent(monitoringId);
switch (entry.type) {
case HEAP:
{
      grizzlyMonitoring.getFileCacheProbeProvider().countInfoHitEvent(monitoringId);
      break;
    }
case MAPPED:
{
    grizzlyMonitoring.getFileCacheProbeProvider().countContentHitEvent(monitoringId);
    break;
  }
default :
{
  throw new IllegalStateException("String_Node_Str" + entry.type);
}
}
}
Program: 30025
Project: 30025
Buggy source:
@Override public void onEntryRemovedEvent(final FileCache fileCache,final FileCacheEntry entry){
  grizzlyMonitoring.getFileCacheProbeProvider().decOpenCacheEntriesEvent(monitoringId);
switch (entry.type) {
case HEAP:
{
      grizzlyMonitoring.getFileCacheProbeProvider().subHeapSizeEvent(monitoringId,entry.contentLength);
      break;
    }
case MAPPED:
{
    grizzlyMonitoring.getFileCacheProbeProvider().subMappedMemorySizeEvent(monitoringId,entry.contentLength);
    break;
  }
}
}

Fixed version (ground truth):
@Override public void onEntryRemovedEvent(final FileCache fileCache,final FileCacheEntry entry){
  grizzlyMonitoring.getFileCacheProbeProvider().decOpenCacheEntriesEvent(monitoringId);
switch (entry.type) {
case HEAP:
{
      grizzlyMonitoring.getFileCacheProbeProvider().subHeapSizeEvent(monitoringId,entry.contentLength);
      break;
    }
case MAPPED:
{
    grizzlyMonitoring.getFileCacheProbeProvider().subMappedMemorySizeEvent(monitoringId,entry.contentLength);
    break;
  }
default :
{
  throw new IllegalStateException("String_Node_Str" + entry.type);
}
}
}
Program: 30026
Project: 30026
Buggy source:
public KeepAliveMonitor(GrizzlyMonitoring grizzlyMonitoring,String monitoringId,KeepAlive config){
  this.grizzlyMonitoring=grizzlyMonitoring;
  this.monitoringId=monitoringId;
  if (grizzlyMonitoring != null) {
    final KeepAliveStatsProvider statsProvider=grizzlyMonitoring.getKeepAliveStatsProvider(monitoringId);
    if (statsProvider != null) {
      statsProvider.setStatsObject(config);
    }
    statsProvider.reset();
  }
}

Fixed version (ground truth):
public KeepAliveMonitor(GrizzlyMonitoring grizzlyMonitoring,String monitoringId,KeepAlive config){
  this.grizzlyMonitoring=grizzlyMonitoring;
  this.monitoringId=monitoringId;
  if (grizzlyMonitoring != null) {
    final KeepAliveStatsProvider statsProvider=grizzlyMonitoring.getKeepAliveStatsProvider(monitoringId);
    statsProvider.setStatsObject(config);
    statsProvider.reset();
  }
}
Program: 30027
Project: 30027
Buggy source:
public PrintStream printf(String str,Object... args){
  StringBuilder sb=new StringBuilder();
  Formatter formatter=new Formatter(sb,Locale.getDefault());
  formatter.format(str,args);
  print(sb.toString());
  return null;
}

Fixed version (ground truth):
public PrintStream printf(Locale locale,String str,Object... args){
  StringBuilder sb=new StringBuilder();
  Formatter formatter=new Formatter(sb,locale);
  formatter.format(str,args);
  print(sb.toString());
  return null;
}
Program: 30028
Project: 30028
Buggy source:
private void addEnvironmentProperties(ScopeType scope,Iterator envItr,Collection<JNDIBinding> jndiBindings){
  while (envItr.hasNext()) {
    EnvironmentProperty next=(EnvironmentProperty)envItr.next();
    if (!dependencyAppliesToScope(next,scope)) {
      continue;
    }
    if (next.hasAValue()) {
      String name=descriptorToLogicalJndiName(next);
      Object value=next.hasLookupName() ? namingUtils.createLazyNamingObjectFactory(name,next.getLookupName(),true) : namingUtils.createSimpleNamingObjectFactory(name,next.getValueObject());
      jndiBindings.add(new CompEnvBinding(name,value));
    }
  }
}

Fixed version (ground truth):
private void addEnvironmentProperties(ScopeType scope,Iterator envItr,Collection<JNDIBinding> jndiBindings){
  while (envItr.hasNext()) {
    EnvironmentProperty next=(EnvironmentProperty)envItr.next();
    if (!dependencyAppliesToScope(next,scope)) {
      continue;
    }
    if (next.hasAValue()) {
      String name=descriptorToLogicalJndiName(next);
      Object value;
      if (next.hasLookupName()) {
        value=namingUtils.createLazyNamingObjectFactory(name,next.getLookupName(),true);
      }
 else       if (next.getMappedName().length() > 0) {
        value=namingUtils.createLazyNamingObjectFactory(name,next.getMappedName(),true);
      }
 else {
        value=namingUtils.createSimpleNamingObjectFactory(name,next.getValueObject());
      }
      jndiBindings.add(new CompEnvBinding(name,value));
    }
  }
}
Program: 30029
Project: 30029
Buggy source:
public boolean hasAValue(){
  return (setValueCalled || hasLookupName());
}

Fixed version (ground truth):
public boolean hasAValue(){
  return (setValueCalled || hasLookupName() || getMappedName().length() > 0);
}
Program: 30031
Project: 30031
Buggy source:
private Application getAppFromDescriptor(){
  Application app=null;
  if (descriptor instanceof BundleDescriptor) {
    BundleDescriptor bundle=(BundleDescriptor)descriptor;
    app=bundle.getApplication();
  }
 else   if (descriptor instanceof EjbDescriptor) {
    app=((EjbDescriptor)descriptor).getApplication();
  }
  return app;
}

Fixed version (ground truth):
public Application getAppFromDescriptor(){
  Application app=null;
  if (descriptor instanceof BundleDescriptor) {
    BundleDescriptor bundle=(BundleDescriptor)descriptor;
    app=bundle.getApplication();
  }
 else   if (descriptor instanceof EjbDescriptor) {
    app=((EjbDescriptor)descriptor).getApplication();
  }
  return app;
}
Program: 30035
Project: 30035
Buggy source:
private void parse(Document document){
  Element element=document.getDocumentElement();
  NodeList adapters=element.getElementsByTagName("String_Node_Str");
  for (int i=0; i < adapters.getLength(); i++) {
    Node adapter=adapters.item(i);
    NamedNodeMap attrs=adapter.getAttributes();
    NodeList properties=adapter.getChildNodes();
    ArrayList<GrizzlyProperty> list=new ArrayList<GrizzlyProperty>();
    for (int j=0; j < properties.getLength(); j++) {
      Node property=properties.item(j);
      NamedNodeMap values=property.getAttributes();
      if (values != null) {
        list.add(new GrizzlyProperty(values.getNamedItem("String_Node_Str").getNodeValue(),values.getNamedItem("String_Node_Str").getNodeValue()));
      }
    }
    adapterProperties.put(attrs.getNamedItem("String_Node_Str").getNodeValue(),list);
    if (attrs != null) {
      addAdapter(attrs.getNamedItem("String_Node_Str").getNodeValue(),attrs.getNamedItem("String_Node_Str").getNodeValue());
    }
  }
}

Fixed version (ground truth):
private void parse(Document document){
  Element element=document.getDocumentElement();
  NodeList adapters=element.getElementsByTagName("String_Node_Str");
  for (int i=0; i < adapters.getLength(); i++) {
    Node adapter=adapters.item(i);
    NamedNodeMap attrs=adapter.getAttributes();
    NodeList properties=adapter.getChildNodes();
    ArrayList<GrizzlyProperty> list=new ArrayList<GrizzlyProperty>();
    for (int j=0; j < properties.getLength(); j++) {
      Node property=properties.item(j);
      NamedNodeMap values=property.getAttributes();
      if (values != null) {
        list.add(new GrizzlyProperty(values.getNamedItem("String_Node_Str").getNodeValue(),values.getNamedItem("String_Node_Str").getNodeValue()));
      }
    }
    adapterProperties.put(attrs.getNamedItem("String_Node_Str").getNodeValue(),list);
    addAdapter(attrs.getNamedItem("String_Node_Str").getNodeValue(),attrs.getNamedItem("String_Node_Str").getNodeValue());
  }
}
Program: 30036
Project: 30036
Buggy source:
/** 
 * <p> This handler returns the requestParameter value based on the key. If it doesn't exists, then it will look at the request attribute.  If there is no request attribute, it will return the default, if specified.</p> <p> This method will "html escape" any &lt;, &gt;, or &amp; characters that appear in a String from the QUERY_STRING.  This is to help prevent XSS vulnerabilities.</p> <p> Input value: "key" -- Type: <code>String</code></p> <p> Output value: "value" -- Type: <code>String</code></p>
 */
@Handler(id="String_Node_Str",input={@HandlerInput(name="String_Node_Str",type=String.class,required=true),@HandlerInput(name="String_Node_Str",type=String.class)},output={@HandlerOutput(name="String_Node_Str",type=Object.class)}) public static void getRequestValue(HandlerContext handlerCtx){
  String key=(String)handlerCtx.getInputValue("String_Node_Str");
  Object defaultValue=handlerCtx.getInputValue("String_Node_Str");
  Object value=handlerCtx.getFacesContext().getExternalContext().getRequestParameterMap().get(key);
  if ((value == null) || "String_Node_Str".equals(value)) {
    value=handlerCtx.getFacesContext().getExternalContext().getRequestMap().get(key);
    if ((value == null) && (defaultValue != null)) {
      value=defaultValue;
    }
  }
 else {
    value=Util.htmlEscape((String)value);
  }
  handlerCtx.setOutputValue("String_Node_Str",value);
}

Fixed version (ground truth):
/** 
 * <p> This handler returns the requestParameter value based on the key. If it doesn't exists, then it will look at the request attribute.  If there is no request attribute, it will return the default, if specified.</p> <p> This method will "html escape" any &lt;, &gt;, or &amp; characters that appear in a String from the QUERY_STRING.  This is to help prevent XSS vulnerabilities.</p> <p> orig without escape is available, but be very cautious when using it. <p> Input value: "key" -- Type: <code>String</code></p> <p> Output value: "value" -- Type: <code>String</code></p> <p> Output value: "orig" -- Type: <code>String</code></p>
 */
@Handler(id="String_Node_Str",input={@HandlerInput(name="String_Node_Str",type=String.class,required=true),@HandlerInput(name="String_Node_Str",type=String.class)},output={@HandlerOutput(name="String_Node_Str",type=Object.class),@HandlerOutput(name="String_Node_Str",type=Object.class)}) public static void getRequestValue(HandlerContext handlerCtx){
  String key=(String)handlerCtx.getInputValue("String_Node_Str");
  Object defaultValue=handlerCtx.getInputValue("String_Node_Str");
  Object value=handlerCtx.getFacesContext().getExternalContext().getRequestParameterMap().get(key);
  Object orig=value;
  if ((value == null) || "String_Node_Str".equals(value)) {
    value=handlerCtx.getFacesContext().getExternalContext().getRequestMap().get(key);
    if ((value == null) && (defaultValue != null)) {
      value=defaultValue;
    }
  }
 else {
    value=Util.htmlEscape((String)value);
  }
  handlerCtx.setOutputValue("String_Node_Str",value);
  handlerCtx.setOutputValue("String_Node_Str",orig);
}
Program: 30038
Project: 30038
Buggy source:
public Object run(){
  thisInstance.flush();
  thisInstance.close();
  try {
    if (!absoluteFile.exists()) {
      File creatingDeletedLogFile=new File(absoluteFile.getAbsolutePath());
      creatingDeletedLogFile.createNewFile();
      absoluteFile=creatingDeletedLogFile;
    }
    File oldFile=absoluteFile;
    StringBuffer renamedFileName=new StringBuffer(absoluteFile + "String_Node_Str");
    logRotateDateFormatter.format(new Date(),renamedFileName,new FieldPosition(0));
    File rotatedFile=new File(renamedFileName.toString());
    boolean renameSuccess=oldFile.renameTo(rotatedFile);
    FileOutputStream oldFileFO=new FileOutputStream(oldFile);
    oldFileFO.close();
    if (!renameSuccess) {
      FileUtils.copy(absoluteFile,rotatedFile);
      File freshServerLogFile=getLogFileName();
      FileOutputStream fo=new FileOutputStream(freshServerLogFile);
      fo.close();
    }
    openFile(getLogFileName());
    absoluteFile=getLogFileName();
    if (dayBasedFileRotation) {
      LogRotationTimer.getInstance().restartTimerForDayBasedRotation();
    }
 else {
      LogRotationTimer.getInstance().restartTimer();
    }
    cleanUpHistoryLogFiles();
  }
 catch (  IOException ix) {
    publish(new LogRecord(Level.SEVERE,"String_Node_Str" + ix.getMessage()));
  }
  return null;
}

Fixed version (ground truth):
public Object run(){
  thisInstance.flush();
  thisInstance.close();
  try {
    if (!absoluteFile.exists()) {
      File creatingDeletedLogFile=new File(absoluteFile.getAbsolutePath());
      creatingDeletedLogFile.createNewFile();
      absoluteFile=creatingDeletedLogFile;
    }
    File oldFile=absoluteFile;
    StringBuffer renamedFileName=new StringBuffer(absoluteFile + "String_Node_Str");
    logRotateDateFormatter.format(new Date(),renamedFileName,new FieldPosition(0));
    File rotatedFile=new File(renamedFileName.toString());
    boolean renameSuccess=oldFile.renameTo(rotatedFile);
    if (!renameSuccess) {
      FileUtils.copy(absoluteFile,rotatedFile);
      File freshServerLogFile=getLogFileName();
      FileOutputStream fo=new FileOutputStream(freshServerLogFile);
      fo.close();
    }
    FileOutputStream oldFileFO=new FileOutputStream(oldFile);
    oldFileFO.close();
    openFile(getLogFileName());
    absoluteFile=getLogFileName();
    if (dayBasedFileRotation) {
      LogRotationTimer.getInstance().restartTimerForDayBasedRotation();
    }
 else {
      LogRotationTimer.getInstance().restartTimer();
    }
    cleanUpHistoryLogFiles();
  }
 catch (  IOException ix) {
    publish(new LogRecord(Level.SEVERE,"String_Node_Str" + ix.getMessage()));
  }
  return null;
}
Program: 30039
Project: 30039
Buggy source:
/** 
 * Reinitialize connections established in the connection pool and  bring the pool to steady pool size. 
 * @throws com.sun.appserv.connectors.internal.api.PoolingException
 */
public synchronized boolean flushConnectionPool() throws PoolingException {
  logFine("String_Node_Str");
  if (!poolInitialized) {
    _logger.log(Level.WARNING,"String_Node_Str",getPoolInfo());
    String exString=localStrings.getString("String_Node_Str",poolInfo.toString());
    throw new PoolingException(exString);
  }
  try {
    killExtraResources(ds.getResourcesSize());
    increaseSteadyPoolSize(steadyPoolSize);
  }
 catch (  PoolingException ex) {
    _logger.log(Level.WARNING,"String_Node_Str",new Object[]{getPoolInfo(),ex.getMessage()});
    throw ex;
  }
  logFine("String_Node_Str");
  return true;
}

Fixed version (ground truth):
/** 
 * Reinitialize connections established in the connection pool and  bring the pool to steady pool size. 
 * @throws com.sun.appserv.connectors.internal.api.PoolingException
 */
public synchronized boolean flushConnectionPool() throws PoolingException {
  logFine("String_Node_Str");
  if (!poolInitialized) {
    _logger.log(Level.WARNING,"String_Node_Str",getPoolInfo());
    String exString=localStrings.getString("String_Node_Str",poolInfo.toString());
    throw new PoolingException(exString);
  }
  try {
    cancelResizerTask();
    ds.removeAll();
    scheduleResizerTask();
    increaseSteadyPoolSize(steadyPoolSize);
  }
 catch (  PoolingException ex) {
    _logger.log(Level.WARNING,"String_Node_Str",new Object[]{getPoolInfo(),ex.getMessage()});
    throw ex;
  }
  logFine("String_Node_Str");
  return true;
}
Program: 30040
Project: 30040
Buggy source:
@Override protected AuthenticationInfo authenticationInfo(){
  AuthenticationInfo result=null;
  if (SecureAdmin.Util.isUsingUsernamePasswordAuth(secureAdmin)) {
    final SecureAdminInternalUser secureAdminInternalUser=SecureAdmin.Util.secureAdminInternalUser(secureAdmin);
    if (secureAdminInternalUser != null) {
      try {
        String pw=masterPassword().getMasterPasswordAdapter().getPasswordForAlias(secureAdminInternalUser.getPasswordAlias());
        result=new AuthenticationInfo(secureAdminInternalUser.getUsername(),pw);
        pw=null;
      }
 catch (      Exception ex) {
        throw new RuntimeException(ex);
      }
    }
  }
  return result;
}

Fixed version (ground truth):
@Override protected synchronized AuthenticationInfo authenticationInfo(){
  AuthenticationInfo result=null;
  if (SecureAdmin.Util.isUsingUsernamePasswordAuth(secureAdmin)) {
    final SecureAdminInternalUser secureAdminInternalUser=SecureAdmin.Util.secureAdminInternalUser(secureAdmin);
    if (secureAdminInternalUser != null) {
      try {
        result=new AuthenticationInfo(secureAdminInternalUser.getUsername(),masterPassword().getMasterPasswordAdapter().getPasswordForAlias(secureAdminInternalUser.getPasswordAlias()));
      }
 catch (      Exception ex) {
        throw new RuntimeException(ex);
      }
    }
  }
  return result;
}
Program: 30041
Project: 30041
Buggy source:
private boolean isPrincipalAuthorized(final Principal reqPrincipal){
  final String principalName=reqPrincipal.getName();
  for (  SecureAdminPrincipal configPrincipal : SecureAdmin.Util.secureAdminPrincipals(secureAdmin,habitat)) {
    if (configPrincipal.getDn().equals(principalName)) {
      return true;
    }
  }
  return false;
}

Fixed version (ground truth):
private synchronized boolean isPrincipalAuthorized(final Principal reqPrincipal){
  final String principalName=reqPrincipal.getName();
  for (  SecureAdminPrincipal configPrincipal : SecureAdmin.Util.secureAdminPrincipals(secureAdmin,habitat)) {
    if (configPrincipal.getDn().equals(principalName)) {
      return true;
    }
  }
  return false;
}
Program: 30042
Project: 30042
Buggy source:
/** 
 * Return the access to be granted, if the user turns out to be a valid admin user, based on whether the request is local or remote and whether this is the DAS or an instance. <p> If this is the DAS, then secure admin must be on to accept remote requests from users.  If this an instance, then it's possible that the DAS is using username/password authentication in its admin messages to the  instances.  In that case, we make sure that the admin indicator header was sent with the request and that its value matches the value in this server's config.
 * @return the access to be granted to the user if subsequently authorized
 */
private Access checkRemoteAccess(final String originHost,final boolean adminIndicatorCheckerMatched){
  Access grantedAccess;
  if (serverEnv.isDas()) {
    if (NetUtils.isThisHostLocal(originHost) || SecureAdmin.Util.isEnabled(secureAdmin)) {
      grantedAccess=Access.FULL;
    }
 else {
      logger.log(Level.FINE,"String_Node_Str");
      grantedAccess=Access.FORBIDDEN;
    }
  }
 else {
    if (adminIndicatorCheckerMatched) {
      grantedAccess=Access.FULL;
      logger.log(Level.FINE,"String_Node_Str");
    }
 else {
      grantedAccess=Access.NONE;
      logger.log(Level.FINE,"String_Node_Str");
    }
  }
  return grantedAccess;
}

Fixed version (ground truth):
/** 
 * Return the access to be granted, if the user turns out to be a valid admin user, based on whether the request is local or remote and whether this is the DAS or an instance. <p> If this is the DAS, then secure admin must be on to accept remote requests from users.  If this an instance, then it's possible that the DAS is using username/password authentication in its admin messages to the  instances.  In that case, we make sure that the admin indicator header was sent with the request and that its value matches the value in this server's config.
 * @return the access to be granted to the user if subsequently authorized
 */
private synchronized Access checkRemoteAccess(final String originHost,final boolean adminIndicatorCheckerMatched){
  Access grantedAccess;
  if (serverEnv.isDas()) {
    if (NetUtils.isThisHostLocal(originHost) || SecureAdmin.Util.isEnabled(secureAdmin)) {
      grantedAccess=Access.FULL;
    }
 else {
      logger.log(Level.FINE,"String_Node_Str");
      grantedAccess=Access.FORBIDDEN;
    }
  }
 else {
    if (adminIndicatorCheckerMatched) {
      grantedAccess=Access.FULL;
      logger.log(Level.FINE,"String_Node_Str");
    }
 else {
      grantedAccess=Access.NONE;
      logger.log(Level.FINE,"String_Node_Str");
    }
  }
  return grantedAccess;
}
Program: 30043
Project: 30043
Buggy source:
private boolean isAuthorizedInternalUser(final String username){
  for (  SecureAdminInternalUser u : SecureAdmin.Util.secureAdminInternalUsers(secureAdmin)) {
    if (u.getUsername().equals(username)) {
      return true;
    }
  }
  return false;
}

Fixed version (ground truth):
private synchronized boolean isAuthorizedInternalUser(final String username){
  for (  SecureAdminInternalUser u : SecureAdmin.Util.secureAdminInternalUsers(secureAdmin)) {
    if (u.getUsername().equals(username)) {
      return true;
    }
  }
  return false;
}
Program: 30044
Project: 30044
Buggy source:
@Override public void postConstruct(){
  secureAdmin=domain.getSecureAdmin();
  if (as.usesFileRealm()) {
    try {
      AuthRealm ar=as.getAssociatedAuthRealm();
      if (FileRealm.class.getName().equals(ar.getClassname())) {
        String adminKeyFilePath=ar.getPropertyValue("String_Node_Str");
        FileRealm fr=new FileRealm(adminKeyFilePath);
        if (!fr.hasAuthenticatableUser()) {
          String emsg=lsm.getLocalString("String_Node_Str","String_Node_Str");
          logger.log(Level.SEVERE,emsg);
          throw new IllegalStateException(emsg);
        }
      }
    }
 catch (    Exception ex) {
      logger.log(Level.SEVERE,ex.getMessage());
      throw new RuntimeException(ex);
    }
  }
}

Fixed version (ground truth):
@Override public synchronized void postConstruct(){
  secureAdmin=domain.getSecureAdmin();
  if (as.usesFileRealm()) {
    try {
      AuthRealm ar=as.getAssociatedAuthRealm();
      if (FileRealm.class.getName().equals(ar.getClassname())) {
        String adminKeyFilePath=ar.getPropertyValue("String_Node_Str");
        FileRealm fr=new FileRealm(adminKeyFilePath);
        if (!fr.hasAuthenticatableUser()) {
          String emsg=lsm.getLocalString("String_Node_Str","String_Node_Str");
          logger.log(Level.SEVERE,emsg);
          throw new IllegalStateException(emsg);
        }
      }
    }
 catch (    Exception ex) {
      logger.log(Level.SEVERE,ex.getMessage());
      throw new RuntimeException(ex);
    }
  }
}
Program: 30045
Project: 30045
Buggy source:
private void ensureConfigReady(final Config c,final String adminListenerProtocol) throws TransactionFailure, PropertyVetoException {
  final NetworkConfig nc=c.getNetworkConfig();
  final NetworkListener nl=nc.getNetworkListener(SecureAdminCommand.ADMIN_LISTENER_NAME);
  if (nl != null) {
    return;
  }
  final Config config_w=writableConfig(c);
  final NetworkListener nl_w=createAdminNetworkListener(transaction(),nc,adminListenerProtocol);
  final VirtualServer vs_w=createAdminVirtualServer(transaction(),config_w);
}

Fixed version (ground truth):
private void ensureConfigReady(final Config c,final String adminListenerProtocol) throws TransactionFailure, PropertyVetoException {
  final NetworkConfig nc=c.getNetworkConfig();
  final NetworkListener nl=nc.getNetworkListener(SecureAdminCommand.ADMIN_LISTENER_NAME);
  if (nl != null) {
    return;
  }
  final Config config_w=writableConfig(c);
  createAdminNetworkListener(transaction(),nc,adminListenerProtocol);
  createAdminVirtualServer(transaction(),config_w);
}
Program: 30047
Project: 30047
Buggy source:
/** 
 * Returns whether at least one admin user has an empty password.
 * @return true if at least one admin user has an empty password; false otherwise 
 * @throws BadRealmException
 * @throws NoSuchRealmException
 * @throws NoSuchUserException 
 */
@Override public boolean isAnyAdminUserWithoutPassword() throws Exception {
  final FileRealm adminRealm=adminRealm();
  for (final Enumeration<String> e=adminRealm.getUserNames(); e.hasMoreElements(); ) {
    final String username=e.nextElement();
    final FileRealmUser fru;
    try {
      fru=(FileRealmUser)adminRealm.getUser(username);
      final String[] groupNames=adminRealm.authenticate(username,emptyPassword);
      if (groupNames != null) {
        for (        String groupName : groupNames) {
          if (DOMAIN_ADMIN_GROUP_NAME.equals(groupName)) {
            return true;
          }
        }
      }
    }
 catch (    NoSuchUserException ex) {
    }
  }
  return false;
}

Fixed version (ground truth):
/** 
 * Returns whether at least one admin user has an empty password.
 * @return true if at least one admin user has an empty password; false otherwise 
 * @throws BadRealmException
 * @throws NoSuchRealmException
 * @throws NoSuchUserException 
 */
@Override public boolean isAnyAdminUserWithoutPassword() throws Exception {
  final FileRealm adminRealm=adminRealm();
  for (final Enumeration<String> e=adminRealm.getUserNames(); e.hasMoreElements(); ) {
    final String username=e.nextElement();
    final String[] groupNames=adminRealm.authenticate(username,emptyPassword);
    if (groupNames != null) {
      for (      String groupName : groupNames) {
        if (DOMAIN_ADMIN_GROUP_NAME.equals(groupName)) {
          return true;
        }
      }
    }
  }
  return false;
}
Program: 30048
Project: 30048
Buggy source:
private void validateUser(final String username) throws BadRealmException, NoSuchRealmException {
  final FileRealm fr=adminRealm();
  try {
    FileRealmUser fru=(FileRealmUser)fr.getUser(username);
    for (    String group : fru.getGroups()) {
      if (isInAdminGroup(fru)) {
        return;
      }
    }
    throw new RuntimeException(Strings.get("String_Node_Str",username));
  }
 catch (  NoSuchUserException ex) {
    throw new RuntimeException(Strings.get("String_Node_Str",username));
  }
}

Fixed version (ground truth):
private void validateUser(final String username) throws BadRealmException, NoSuchRealmException {
  final FileRealm fr=adminRealm();
  try {
    FileRealmUser fru=(FileRealmUser)fr.getUser(username);
    if (isInAdminGroup(fru)) {
      return;
    }
    throw new RuntimeException(Strings.get("String_Node_Str",username));
  }
 catch (  NoSuchUserException ex) {
    throw new RuntimeException(Strings.get("String_Node_Str",username));
  }
}
Program: 30049
Project: 30049
Buggy source:
final protected SecureAdmin secureAdmin() throws TransactionFailure {
  if (secureAdmin == null) {
    secureAdmin=domain.getSecureAdmin();
    if (secureAdmin == null) {
      secureAdmin=writableSecureAdmin();
      secureAdminWasCreated=true;
      secureAdmin.setSpecialAdminIndicator(specialAdminIndicator());
    }
  }
  return secureAdmin;
}

Fixed version (ground truth):
final protected SecureAdmin secureAdmin() throws TransactionFailure {
  if (secureAdmin == null) {
    secureAdmin=domain.getSecureAdmin();
    if (secureAdmin == null) {
      secureAdmin=writableSecureAdmin();
      secureAdmin.setSpecialAdminIndicator(specialAdminIndicator());
    }
  }
  return secureAdmin;
}
Program: 30050
Project: 30050
Buggy source:
public String[] generateOutputRow(String[] headings,int heading_count,String e,HashMap<String,HashMap> mapOfMaps){
  String[] outputRow=new String[heading_count];
  int count=0;
  HashMap<String,String> map=new HashMap<String,String>();
  for (  String s : headings) {
    map=mapOfMaps.get(s);
    outputRow[count]=map.get(e);
    count++;
  }
  return outputRow;
}

Fixed version (ground truth):
public String[] generateOutputRow(String[] headings,int heading_count,String e,HashMap<String,HashMap> mapOfMaps){
  String[] outputRow=new String[heading_count];
  int count=0;
  HashMap<String,String> map=null;
  for (  String s : headings) {
    map=mapOfMaps.get(s);
    outputRow[count]=map.get(e);
    count++;
  }
  return outputRow;
}
Program: 30056
Project: 30056
Buggy source:
/** 
 * Add a new ClassFileTransformer to the context. Once all the deployers potentially invalidating the application class loader (as indicated by the
 * @link {MetaData.invalidatesClassLoader()})the deployment backend will recreate the application's class loader registering all the ClassTransformers added by the deployers to this context.
 * @param transformer the new class file transformer to register to the new applicationclass loader
 * @throws UnsupportedOperationException if the class loader we use does not support theregistration of a ClassFileTransformer. In such case, the deployer should either fail deployment or revert to a mode without the byteocode enhancement feature.
 */
public void addTransformer(ClassFileTransformer transformer){
  transformers.add(transformer);
}

Fixed version (ground truth):
/** 
 * Add a new ClassFileTransformer to the context
 * @param transformer the new class file transformer to register to the new applicationclass loader
 * @throws UnsupportedOperationException if the class loader we use does not support theregistration of a ClassFileTransformer. In such case, the deployer should either fail deployment or revert to a mode without the byteocode enhancement feature.
 */
public void addTransformer(ClassFileTransformer transformer){
  InstrumentableClassLoader icl=InstrumentableClassLoader.class.cast(getFinalClassLoader());
  String isComposite=getAppProps().getProperty(ServerTags.IS_COMPOSITE);
  if (Boolean.valueOf(isComposite) && icl instanceof URLClassLoader) {
    URLClassLoader urlCl=(URLClassLoader)icl;
    boolean isAppLevel=(getParentContext() == null);
    if (isAppLevel) {
      icl=InstrumentableClassLoader.class.cast(urlCl.getParent().getParent());
    }
 else {
      ClassLoader libCl=urlCl.getParent().getParent();
      if (!(libCl instanceof URLClassLoader)) {
        libCl=libCl.getParent();
      }
      if (libCl instanceof URLClassLoader) {
        InstrumentableClassLoader libIcl=InstrumentableClassLoader.class.cast(libCl);
        libIcl.addTransformer(transformer);
      }
    }
  }
  icl.addTransformer(transformer);
}
Program: 30059
Project: 30059
Buggy source:
public String toString(){
  String beanClassesString=((getBeanClasses().size() > 0) ? getBeanClasses().toString() : "String_Node_Str");
  String val="String_Node_Str" + getId() + "String_Node_Str"+ bdaType+ "String_Node_Str"+ getBeanDeploymentArchives().size()+ "String_Node_Str"+ formatAccessibleBDAs(this)+ "String_Node_Str"+ getBeanClasses().size()+ "String_Node_Str"+ beanClassesString+ "String_Node_Str"+ getEjbs()+ "String_Node_Str";
  Collection<BeanDeploymentArchive> bdas=getBeanDeploymentArchives();
  Iterator<BeanDeploymentArchive> iter=bdas.iterator();
  while (iter.hasNext()) {
    BeanDeploymentArchive bda=(BeanDeploymentArchive)iter.next();
    BDAType embedBDAType=BDAType.UNKNOWN;
    if (bda instanceof BeanDeploymentArchiveImpl) {
      embedBDAType=((BeanDeploymentArchiveImpl)bda).getBDAType();
    }
    String embedBDABeanClasses=((bda.getBeanClasses().size() > 0) ? bda.getBeanClasses().toString() : "String_Node_Str");
    val+="String_Node_Str" + bda.getId() + "String_Node_Str"+ embedBDAType.toString()+ "String_Node_Str"+ bda.getBeanDeploymentArchives().size()+ "String_Node_Str"+ formatAccessibleBDAs(bda)+ "String_Node_Str"+ bda.getBeanClasses().size()+ "String_Node_Str"+ embedBDABeanClasses+ "String_Node_Str"+ bda.getEjbs()+ "String_Node_Str";
  }
  return val;
}

Fixed version (ground truth):
public String toString(){
  String beanClassesString=((getBeanClasses().size() > 0) ? getBeanClasses().toString() : "String_Node_Str");
  String initVal="String_Node_Str" + getId() + "String_Node_Str"+ bdaType+ "String_Node_Str"+ getBeanDeploymentArchives().size()+ "String_Node_Str"+ formatAccessibleBDAs(this)+ "String_Node_Str"+ getBeanClasses().size()+ "String_Node_Str"+ beanClassesString+ "String_Node_Str"+ getEjbs()+ "String_Node_Str";
  StringBuffer valBuff=new StringBuffer(initVal);
  Collection<BeanDeploymentArchive> bdas=getBeanDeploymentArchives();
  Iterator<BeanDeploymentArchive> iter=bdas.iterator();
  while (iter.hasNext()) {
    BeanDeploymentArchive bda=(BeanDeploymentArchive)iter.next();
    BDAType embedBDAType=BDAType.UNKNOWN;
    if (bda instanceof BeanDeploymentArchiveImpl) {
      embedBDAType=((BeanDeploymentArchiveImpl)bda).getBDAType();
    }
    String embedBDABeanClasses=((bda.getBeanClasses().size() > 0) ? bda.getBeanClasses().toString() : "String_Node_Str");
    String val="String_Node_Str" + bda.getId() + "String_Node_Str"+ embedBDAType.toString()+ "String_Node_Str"+ bda.getBeanDeploymentArchives().size()+ "String_Node_Str"+ formatAccessibleBDAs(bda)+ "String_Node_Str"+ bda.getBeanClasses().size()+ "String_Node_Str"+ embedBDABeanClasses+ "String_Node_Str"+ bda.getEjbs()+ "String_Node_Str";
    valBuff.append(val);
  }
  return valBuff.toString();
}
Program: 30060
Project: 30060
Buggy source:
/** 
 * Produce <code>BeanDeploymentArchive</code>s for this <code>Deployment</code> from information from the provided <code>ReadableArchive</code>. 
 */
public DeploymentImpl(ReadableArchive archive,Collection<EjbDescriptor> ejbs,DeploymentContext context){
  logger.log(FINE,"String_Node_Str" + archive.getName());
  this.beanDeploymentArchives=new ArrayList<BeanDeploymentArchive>();
  this.context=context;
  this.idToBeanDeploymentArchive=new HashMap<String,BeanDeploymentArchive>();
  if (libJarBDAs == null) {
    libJarBDAs=scanForLibJars(archive,ejbs,context);
    if ((libJarBDAs != null) && libJarBDAs.size() > 0) {
      return;
    }
  }
  BeanDeploymentArchive bda=new BeanDeploymentArchiveImpl(archive,ejbs,context);
  this.beanDeploymentArchives.add(bda);
  if (((BeanDeploymentArchiveImpl)bda).getBDAType().equals(BDAType.WAR)) {
    if (warBDAs == null) {
      warBDAs=new ArrayList<BeanDeploymentArchive>();
    }
    warBDAs.add(bda);
  }
 else   if (((BeanDeploymentArchiveImpl)bda).getBDAType().equals(BDAType.JAR)) {
    if (jarBDAs == null) {
      jarBDAs=new ArrayList<BeanDeploymentArchive>();
    }
    jarBDAs.add(bda);
  }
  this.idToBeanDeploymentArchive.put(bda.getId(),bda);
}

Fixed version (ground truth):
/** 
 * Produce <code>BeanDeploymentArchive</code>s for this <code>Deployment</code> from information from the provided <code>ReadableArchive</code>. 
 */
public DeploymentImpl(ReadableArchive archive,Collection<EjbDescriptor> ejbs,DeploymentContext context){
  logger.log(FINE,"String_Node_Str" + archive.getName());
  this.beanDeploymentArchives=new ArrayList<BeanDeploymentArchive>();
  this.context=context;
  this.idToBeanDeploymentArchive=new HashMap<String,BeanDeploymentArchive>();
  libJarBDAs=scanForLibJars(archive,ejbs,context);
  if ((libJarBDAs != null) && libJarBDAs.size() > 0) {
    return;
  }
  BeanDeploymentArchive bda=new BeanDeploymentArchiveImpl(archive,ejbs,context);
  this.beanDeploymentArchives.add(bda);
  if (((BeanDeploymentArchiveImpl)bda).getBDAType().equals(BDAType.WAR)) {
    if (warBDAs == null) {
      warBDAs=new ArrayList<BeanDeploymentArchive>();
    }
    warBDAs.add(bda);
  }
 else   if (((BeanDeploymentArchiveImpl)bda).getBDAType().equals(BDAType.JAR)) {
    if (jarBDAs == null) {
      jarBDAs=new ArrayList<BeanDeploymentArchive>();
    }
    jarBDAs.add(bda);
  }
  this.idToBeanDeploymentArchive.put(bda.getId(),bda);
}
Program: 30061
Project: 30061
Buggy source:
@Override public String toString(){
  String val=null;
  List<BeanDeploymentArchive> beanDeploymentArchives=getBeanDeploymentArchives();
  ListIterator<BeanDeploymentArchive> lIter=beanDeploymentArchives.listIterator();
  while (lIter.hasNext()) {
    BeanDeploymentArchive bda=lIter.next();
    val+=bda.toString();
  }
  return val;
}

Fixed version (ground truth):
@Override public String toString(){
  StringBuffer valBuff=new StringBuffer();
  List<BeanDeploymentArchive> beanDeploymentArchives=getBeanDeploymentArchives();
  ListIterator<BeanDeploymentArchive> lIter=beanDeploymentArchives.listIterator();
  while (lIter.hasNext()) {
    BeanDeploymentArchive bda=lIter.next();
    valBuff.append(bda.toString());
  }
  return valBuff.toString();
}
Program: 30062
Project: 30062
Buggy source:
/** 
 * Constructor. <P>The created FileRealmHelper instance is not registered in the Realm registry. This constructor can be used by admin tools to create a FileRealmHelper instance which can be edited by adding or removing users and then saved to disk, without affecting the installed realm instance. <P>The file provided should always exist. A default (empty) keyfile is installed with the server so this should always be the case unless the user has manually deleted this file.  If this file path provided does not point to an existing file this constructor will first attempt to create it. If this succeeds the constructor returns normally and an empty keyfile will have been created; otherwise an exception is thrown.
 * @param keyfile Full path to the keyfile to read for user data.
 * @exception IOException If the configuration parametersidentify a corrupt keyfile
 */
public FileRealmHelper(String keyfileName) throws IOException {
  this.keyfileName=keyfileName;
  keyfile=new File(keyfileName);
  if (!keyfile.exists()) {
    keyfile.createNewFile();
  }
  loadKeyFile();
}

Fixed version (ground truth):
/** 
 * Constructor. <P>The created FileRealmHelper instance is not registered in the Realm registry. This constructor can be used by admin tools to create a FileRealmHelper instance which can be edited by adding or removing users and then saved to disk, without affecting the installed realm instance. <P>The file provided should always exist. A default (empty) keyfile is installed with the server so this should always be the case unless the user has manually deleted this file.  If this file path provided does not point to an existing file this constructor will first attempt to create it. If this succeeds the constructor returns normally and an empty keyfile will have been created; otherwise an exception is thrown.
 * @param keyfile Full path to the keyfile to read for user data.
 * @exception IOException If the configuration parametersidentify a corrupt keyfile
 */
public FileRealmHelper(String keyfileName) throws IOException {
  this.keyfileName=keyfileName;
  keyfile=new File(keyfileName);
  if (!keyfile.exists()) {
    if (keyfile.createNewFile() == false) {
      throw new IOException(sm.getString("String_Node_Str",keyfileName));
    }
  }
  loadKeyFile();
}
Program: 30064
Project: 30064
Buggy source:
/** 
 * Load keyfile from config and populate internal cache.
 */
private void loadKeyFile() throws IOException {
  File filePath=keyfile;
  BufferedReader input=null;
  try {
    input=new BufferedReader(new FileReader(keyfile));
    while (input.ready()) {
      String line=input.readLine();
      if (!line.startsWith(COMMENT) && line.indexOf(FIELD_SEP) > 0) {
        User ud=decodeUser(line,groupSizeMap);
        userTable.put(ud.getName(),ud);
      }
    }
  }
 catch (  Exception e) {
    throw new IOException(e.toString());
  }
 finally {
    if (input != null) {
      try {
        input.close();
      }
 catch (      Exception ex) {
      }
    }
  }
}

Fixed version (ground truth):
/** 
 * Load keyfile from config and populate internal cache.
 */
private void loadKeyFile() throws IOException {
  BufferedReader input=null;
  try {
    input=new BufferedReader(new FileReader(keyfile));
    while (input.ready()) {
      String line=input.readLine();
      if (line != null && !line.startsWith(COMMENT) && line.indexOf(FIELD_SEP) >= 0) {
        User ud=decodeUser(line,groupSizeMap);
        userTable.put(ud.getName(),ud);
      }
    }
  }
 catch (  Exception e) {
    throw new IOException(e.toString());
  }
 finally {
    if (input != null) {
      try {
        input.close();
      }
 catch (      Exception ex) {
      }
    }
  }
}
Program: 30066
Project: 30066
Buggy source:
public void initializePersistenceStrategy(Context ctx,SessionManager smBean,ServerConfigLookup serverConfigLookup){
  setDefaultParams(ctx,smBean);
  readInstanceLevelParams(serverConfigLookup);
  readWebAppParams(ctx,smBean);
  ctx.setBackgroundProcessorDelay(reapInterval);
  StandardContext sctx=(StandardContext)ctx;
  sctx.restrictedSetPipeline(new PESessionLockingStandardPipeline(sctx));
}

Fixed version (ground truth):
public void initializePersistenceStrategy(Context ctx,SessionManager smBean,ServerConfigLookup serverConfigLookup){
  setDefaultParams(ctx,smBean);
  readInstanceLevelParams(serverConfigLookup);
  readWebAppParams(ctx,smBean);
  ctx.setBackgroundProcessorDelay(reapInterval);
}
Program: 30068
Project: 30068
Buggy source:
public void postConstruct(){
  if (callFlowAgent == null) {
    callFlowAgent=(Agent)Proxy.newProxyInstance(EjbContainerUtilImpl.class.getClassLoader(),new Class[]{Agent.class},new InvocationHandler(){
      public Object invoke(      Object proxy,      Method m,      Object[] args){
        return null;
      }
    }
);
  }
  defaultThreadPoolExecutor=createThreadPoolExecutor(DEFAULT_THREAD_POOL_NAME);
  if (!isDas()) {
    _doDBReadBeforeTimeout=true;
  }
  _me=this;
}

Fixed version (ground truth):
public void postConstruct(){
  ClassLoader ejbImplClassLoader=EjbContainerUtilImpl.class.getClassLoader();
  if (callFlowAgent == null) {
    callFlowAgent=(Agent)Proxy.newProxyInstance(ejbImplClassLoader,new Class[]{Agent.class},new InvocationHandler(){
      public Object invoke(      Object proxy,      Method m,      Object[] args){
        return null;
      }
    }
);
  }
  defaultThreadPoolExecutor=createThreadPoolExecutor(DEFAULT_THREAD_POOL_NAME);
  if (!isDas()) {
    _doDBReadBeforeTimeout=true;
  }
  ClassLoader originalClassLoader=null;
  try {
    originalClassLoader=Utility.setContextClassLoader(ejbImplClassLoader);
    _timer=new Timer(true);
  }
  finally {
    if (originalClassLoader != null) {
      Utility.setContextClassLoader(originalClassLoader);
    }
  }
  _me=this;
}
Program: 30070
Project: 30070
Buggy source:
private ResourceBundle initResourceBundle(){
  try {
    return ResourceBundle.getBundle(getLoggerResourceBundleName(name),Locale.getDefault(),cloader);
  }
 catch (  MissingResourceException e) {
    String root=clazz.getPackage().getName();
    try {
      return ResourceBundle.getBundle(root + "String_Node_Str" + RESOURCE_BUNDLE,Locale.getDefault(),cloader);
    }
 catch (    MissingResourceException me) {
      String p=root;
      while (p != null) {
        try {
          int i=p.lastIndexOf("String_Node_Str");
          if (i != -1) {
            p=p.substring(0,i);
            return ResourceBundle.getBundle(p + "String_Node_Str" + RESOURCE_BUNDLE,Locale.getDefault(),cloader);
          }
 else {
            p=null;
          }
        }
 catch (        MissingResourceException mre) {
        }
      }
    }
    try {
      return ResourceBundle.getBundle(getLoggerResourceBundleName(name),Locale.getDefault(),LogDomains.class.getClassLoader());
    }
 catch (    MissingResourceException me) {
    }
    if (!vectorClazz.contains(clazz.getName())) {
      Logger l=LogManager.getLogManager().getLogger(name);
      l.log(Level.FINE,"String_Node_Str" + "String_Node_Str" + clazz.getName());
      vectorClazz.add(clazz.getName());
    }
    return null;
  }
}

Fixed version (ground truth):
private ResourceBundle initResourceBundle(){
  try {
    return ResourceBundle.getBundle(getLoggerResourceBundleName(name),Locale.getDefault(),cloader);
  }
 catch (  MissingResourceException e) {
    String root=clazz.getPackage().getName();
    try {
      return ResourceBundle.getBundle(root + "String_Node_Str" + RESOURCE_BUNDLE,Locale.getDefault(),cloader);
    }
 catch (    MissingResourceException me) {
      String p=root;
      while (p != null) {
        try {
          int i=p.lastIndexOf("String_Node_Str");
          if (i != -1) {
            p=p.substring(0,i);
            return ResourceBundle.getBundle(p + "String_Node_Str" + RESOURCE_BUNDLE,Locale.getDefault(),cloader);
          }
 else {
            p=null;
          }
        }
 catch (        MissingResourceException mre) {
        }
      }
    }
    try {
      return ResourceBundle.getBundle(getLoggerResourceBundleName(name),Locale.getDefault(),LogDomains.class.getClassLoader());
    }
 catch (    MissingResourceException me) {
    }
    if (!vectorClazz.contains(clazz.getName())) {
      Logger l=LogManager.getLogManager().getLogger(name);
      if (l != null) {
        l.log(Level.FINE,"String_Node_Str" + "String_Node_Str" + clazz.getName());
      }
      vectorClazz.add(clazz.getName());
    }
    return null;
  }
}
Program: 30071
Project: 30071
Buggy source:
/** 
 * Enables access logging for this virtual server, by adding its accesslog valve to its pipeline, or starting its accesslog valve if it is already present in the pipeline.
 */
void enableAccessLogging(){
  if (!isAccessLogValveActivated()) {
    addValve((GlassFishValve)accessLogValve);
  }
 else {
    try {
      if (accessLogValve.isStarted()) {
        accessLogValve.stop();
      }
      accessLogValve.start();
    }
 catch (    LifecycleException le) {
      _logger.log(Level.SEVERE,"String_Node_Str",le);
    }
  }
}

Fixed version (ground truth):
/** 
 * Enables access logging for this virtual server, by adding its accesslog valve to its pipeline, or starting its accesslog valve if it is already present in the pipeline.
 */
void enableAccessLogging(){
  if (!isAccessLogValveActivated()) {
    addValve((GlassFishValve)accessLogValve);
  }
 else {
    try {
      if (accessLogValve.isStarted()) {
        accessLogValve.stop();
      }
      accessLogValve.start();
    }
 catch (    LifecycleException le) {
      _logger.log(Level.SEVERE,"String_Node_Str",le);
    }
  }
  addHttpProbes(false);
}
Program: 30072
Project: 30072
Buggy source:
/** 
 * Disables access logging for this virtual server, by removing its accesslog valve from its pipeline.
 */
void disableAccessLogging(){
  removeValve(accessLogValve);
}

Fixed version (ground truth):
/** 
 * Disables access logging for this virtual server, by removing its accesslog valve from its pipeline.
 */
void disableAccessLogging(){
  removeValve(accessLogValve);
  addHttpProbes(true);
}