nus-yam/ex-repair huggingface dataset:
Program: 29759
Project: 29759
Buggy source:
public static NadminReturn nadminWithOutput(final int timeout,final String... args){
  File cmd=new File(nucleusRoot,isWindows() ? "String_Node_Str" : "String_Node_Str");
  if (!cmd.canExecute()) {
    cmd=new File(nucleusRoot,isWindows() ? "String_Node_Str" : "String_Node_Str");
  }
  List<String> command=new ArrayList<String>();
  command.add(cmd.toString());
  command.add("String_Node_Str");
  command.addAll(Arrays.asList(args));
  ProcessManager pm=new ProcessManager(command);
  pm.setTimeoutMsec(timeout);
  pm.setEcho(false);
  int exit;
  String myErr="String_Node_Str";
  try {
    exit=pm.execute();
  }
 catch (  ProcessManagerTimeoutException tex) {
    myErr="String_Node_Str" + timeout + "String_Node_Str";
    exit=1;
  }
catch (  ProcessManagerException ex) {
    exit=1;
  }
  NadminReturn ret=new NadminReturn();
  ret.out=pm.getStdout();
  ret.err=pm.getStderr() + myErr;
  ret.outAndErr=ret.out + ret.err;
  ret.returnValue=exit == 0 && validResults(ret.out,String.format("String_Node_Str",args[0]));
  write(ret.out);
  write(ret.err);
  return ret;
}

Fixed version (ground truth):
public static NadminReturn nadminWithOutput(final int timeout,final String... args){
  File cmd=new File(nucleusRoot,isWindows() ? "String_Node_Str" : "String_Node_Str");
  if (!cmd.canExecute()) {
    cmd=new File(nucleusRoot,isWindows() ? "String_Node_Str" : "String_Node_Str");
  }
  List<String> command=new ArrayList<String>();
  command.add(cmd.toString());
  command.add("String_Node_Str");
  command.addAll(Arrays.asList(args));
  ProcessManager pm=new ProcessManager(command);
  pm.setTimeoutMsec(timeout);
  pm.setEcho(false);
  int exit;
  String myErr="String_Node_Str";
  try {
    exit=pm.execute();
  }
 catch (  ProcessManagerTimeoutException tex) {
    myErr="String_Node_Str" + timeout + "String_Node_Str";
    exit=1;
  }
catch (  ProcessManagerException ex) {
    exit=1;
  }
  NadminReturn ret=new NadminReturn(exit,pm.getStdout(),pm.getStderr() + myErr,args[0]);
  write(ret.outAndErr);
  return ret;
}
Program: 29760
Project: 29760
Buggy source:
private static boolean isWindows(){
  return System.getProperty("String_Node_Str").toLowerCase().contains("String_Node_Str");
}

Fixed version (ground truth):
private static boolean isWindows(){
  return System.getProperty("String_Node_Str").toLowerCase(Locale.ENGLISH).contains("String_Node_Str");
}
Program: 29761
Project: 29761
Buggy source:
/** 
 */
@Override protected int executeCommand() throws CommandException, CommandValidationException {
  try {
    DomainsManager manager=new PEDomainsManager();
    DomainConfig config=new DomainConfig(domainName,domainDir);
    manager.validateDomain(config,false);
    verifyPortBase();
  }
 catch (  DomainException e) {
    logger.fine(e.getLocalizedMessage());
    throw new CommandException(strings.get("String_Node_Str",domainName),e);
  }
  adminUser=programOpts.getUser();
  if (!ok(adminUser)) {
    adminUser=SystemPropertyConstants.DEFAULT_ADMIN_USER;
    adminPassword=SystemPropertyConstants.DEFAULT_ADMIN_PASSWORD;
  }
 else   if (noPassword) {
    adminPassword=SystemPropertyConstants.DEFAULT_ADMIN_PASSWORD;
  }
 else {
    boolean haveAdminPwd=false;
  }
  if (saveMasterPassword)   useMasterPassword=true;
  if (masterPassword == null)   masterPassword=DEFAULT_MASTER_PASSWORD;
  try {
    if (adminPort != null) {
      verifyPortIsValid(adminPort);
    }
    if (instancePort != null) {
      verifyPortIsValid(instancePort);
    }
    createTheDomain(domainDir,domainProperties);
  }
 catch (  CommandException ce) {
    logger.info(ce.getLocalizedMessage());
    throw new CommandException(strings.get("String_Node_Str",domainName),ce);
  }
catch (  Exception e) {
    logger.fine(e.getLocalizedMessage());
    throw new CommandException(strings.get("String_Node_Str",domainName),e);
  }
  return 0;
}

Fixed version (ground truth):
/** 
 */
@Override protected int executeCommand() throws CommandException, CommandValidationException {
  try {
    DomainsManager manager=new PEDomainsManager();
    DomainConfig config=new DomainConfig(domainName,domainDir);
    manager.validateDomain(config,false);
    verifyPortBase();
  }
 catch (  DomainException e) {
    logger.fine(e.getLocalizedMessage());
    throw new CommandException(strings.get("String_Node_Str",domainName),e);
  }
  adminUser=programOpts.getUser();
  if (!ok(adminUser)) {
    adminUser=SystemPropertyConstants.DEFAULT_ADMIN_USER;
    adminPassword=SystemPropertyConstants.DEFAULT_ADMIN_PASSWORD;
  }
 else   if (noPassword) {
    adminPassword=SystemPropertyConstants.DEFAULT_ADMIN_PASSWORD;
  }
 else {
    adminPassword=getAdminPassword();
    boolean haveAdminPwd=true;
  }
  if (saveMasterPassword)   useMasterPassword=true;
  if (masterPassword == null)   masterPassword=DEFAULT_MASTER_PASSWORD;
  try {
    if (adminPort != null) {
      verifyPortIsValid(adminPort);
    }
    if (instancePort != null) {
      verifyPortIsValid(instancePort);
    }
    createTheDomain(domainDir,domainProperties);
  }
 catch (  CommandException ce) {
    logger.info(ce.getLocalizedMessage());
    throw new CommandException(strings.get("String_Node_Str",domainName),ce);
  }
catch (  Exception e) {
    logger.fine(e.getLocalizedMessage());
    throw new CommandException(strings.get("String_Node_Str",domainName),e);
  }
  return 0;
}
Program: 29762
Project: 29762
Buggy source:
/** 
 */
@Override protected void validate() throws CommandException, CommandValidationException {
  if (domainDir == null) {
    domainDir=getSystemProperty(SystemPropertyConstants.DOMAINS_ROOT_PROPERTY);
  }
  if (domainDir == null) {
    throw new CommandValidationException(strings.get("String_Node_Str",domainDir));
  }
  if (programOpts.getUser() == null && !noPassword) {
    Console cons=System.console();
    if (cons != null && programOpts.isInteractive()) {
      cons.printf("String_Node_Str",strings.get("String_Node_Str",SystemPropertyConstants.DEFAULT_ADMIN_USER));
      String val=cons.readLine();
      if (ok(val)) {
        programOpts.setUser(val);
        if (adminPassword == null) {
          ParamModelData po=new ParamModelData(ADMIN_PASSWORD,String.class,false,null);
          po.description=strings.get("String_Node_Str");
          po.param._password=true;
          adminPassword=getPassword(po,SystemPropertyConstants.DEFAULT_ADMIN_PASSWORD,true);
        }
      }
    }
 else {
      throw new CommandValidationException(strings.get("String_Node_Str"));
    }
  }
  if (programOpts.getUser() != null) {
    try {
      FileRealmHelper.validateUserName(programOpts.getUser());
    }
 catch (    IllegalArgumentException ise) {
      throw new CommandValidationException(strings.get("String_Node_Str",programOpts.getUser()));
    }
  }
}

Fixed version (ground truth):
/** 
 */
@Override protected void validate() throws CommandException, CommandValidationException {
  if (domainDir == null) {
    domainDir=getSystemProperty(SystemPropertyConstants.DOMAINS_ROOT_PROPERTY);
  }
  if (domainDir == null) {
    throw new CommandValidationException(strings.get("String_Node_Str",domainDir));
  }
  if (programOpts.getUser() == null && !noPassword) {
    Console cons=System.console();
    if (cons != null && programOpts.isInteractive()) {
      cons.printf("String_Node_Str",strings.get("String_Node_Str",SystemPropertyConstants.DEFAULT_ADMIN_USER));
      String val=cons.readLine();
      if (ok(val)) {
        programOpts.setUser(val);
        if (adminPassword == null) {
          adminPassword=getAdminPassword();
        }
      }
    }
 else {
      throw new CommandValidationException(strings.get("String_Node_Str"));
    }
  }
  if (programOpts.getUser() != null) {
    try {
      FileRealmHelper.validateUserName(programOpts.getUser());
    }
 catch (    IllegalArgumentException ise) {
      throw new CommandValidationException(strings.get("String_Node_Str",programOpts.getUser()));
    }
  }
}
Program: 29763
Project: 29763
Buggy source:
@Override protected void read(InputStream input) throws XMLStreamException {
  parser=getXMLInputFactory().createXMLStreamReader(input);
  skipRoot("String_Node_Str");
  int event=0;
  while (parser.hasNext() && (event=parser.next()) != END_DOCUMENT) {
    if (event == START_ELEMENT) {
      String name=parser.getLocalName();
      if ("String_Node_Str".equals(name)) {
        delegate=!Boolean.parseBoolean(parser.getElementText());
        break;
      }
 else       if (!"String_Node_Str".equals(name)) {
        skipSubTree(name);
      }
    }
  }
}

Fixed version (ground truth):
/** 
 * This method will parse the input stream and set the XMLStreamReader object for latter use.
 * @param input InputStream
 * @exception XMLStreamException ;
 */
@Override protected void read(InputStream input) throws XMLStreamException {
  parser=getXMLInputFactory().createXMLStreamReader(input);
  int event=0;
  while (parser.hasNext() && (event=parser.next()) != END_DOCUMENT) {
    if (event == START_ELEMENT) {
      String name=parser.getLocalName();
      if ("String_Node_Str".equals(name)) {
        String path=null;
        Boolean crs=null;
        int count=parser.getAttributeCount();
        for (int i=0; i < count; i++) {
          String attrName=parser.getAttributeName(i).getLocalPart();
          if ("String_Node_Str".equals(attrName)) {
            crs=Boolean.valueOf(parser.getAttributeValue(i));
          }
 else           if ("String_Node_Str".equals(attrName)) {
            path=parser.getAttributeValue(i);
          }
        }
        if (path == null) {
          clearReferencesStatic=crs;
          break;
        }
      }
 else {
        skipSubTree(name);
      }
    }
  }
}
Program: 29765
Project: 29765
Buggy source:
WebXmlParser(String baseStr) throws XMLStreamException, FileNotFoundException {
  this.baseStr=baseStr;
  InputStream input=null;
  File f=new File(baseStr,getXmlFileName());
  if (f.exists()) {
    input=new FileInputStream(f);
    try {
      read(input);
    }
  finally {
      if (parser != null) {
        try {
          parser.close();
        }
 catch (        Exception ex) {
        }
      }
      if (input != null) {
        try {
          input.close();
        }
 catch (        Exception ex) {
        }
      }
    }
  }
}

Fixed version (ground truth):
WebXmlParser(String baseStr) throws XMLStreamException, FileNotFoundException {
  init(new File(baseStr,getXmlFileName()));
}
Program: 29767
Project: 29767
Buggy source:
/** 
 * Gets the <code>ServletRequest</code> for which this object is the facade. This method must be implemented by a subclass.
 * @param maskDefaultContextMapping true if the fact that a requestreceived at the root context was mapped to a default-web-module will be masked, false otherwise
 */
@Override public HttpServletRequest getRequest(boolean maskDefaultContextMapping){
  if (!maskDefaultContextMapping || !isDefaultContext) {
    if (facade == null) {
      facade=new RequestFacade(this);
      attributes.put(Globals.REQUEST_FACADE_HELPER,facade.getRequestFacadeHelper());
    }
    return facade;
  }
 else {
    if (defaultContextMaskingFacade == null) {
      defaultContextMaskingFacade=new RequestFacade(this,true);
      attributes.put(Globals.REQUEST_FACADE_HELPER,defaultContextMaskingFacade.getRequestFacadeHelper());
    }
    return defaultContextMaskingFacade;
  }
}

Fixed version (ground truth):
/** 
 * Gets the <code>ServletRequest</code> for which this object is the facade. This method must be implemented by a subclass.
 * @param maskDefaultContextMapping true if the fact that a requestreceived at the root context was mapped to a default-web-module will be masked, false otherwise
 */
@Override public HttpServletRequest getRequest(boolean maskDefaultContextMapping){
  if (!maskDefaultContextMapping || !isDefaultContext) {
    if (facade == null) {
      facade=new RequestFacade(this);
    }
    if (!initRequestFacadeHelper) {
      attributes.put(Globals.REQUEST_FACADE_HELPER,facade.getRequestFacadeHelper());
      initRequestFacadeHelper=true;
    }
    return facade;
  }
 else {
    if (defaultContextMaskingFacade == null) {
      defaultContextMaskingFacade=new RequestFacade(this,true);
    }
    if (!initRequestFacadeHelper) {
      attributes.put(Globals.REQUEST_FACADE_HELPER,defaultContextMaskingFacade.getRequestFacadeHelper());
      initRequestFacadeHelper=true;
    }
    return defaultContextMaskingFacade;
  }
}
Program: 29768
Project: 29768
Buggy source:
/** 
 * @return if exists the DeploymentDescriptorFile responsible forhandling the glassfish configuration deployment descriptors
 */
@Override public DeploymentDescriptorFile getGFConfigurationDDFile(){
  return gfEjbRuntimeDD.get();
}

Fixed version (ground truth):
/** 
 * @return if exists the DeploymentDescriptorFile responsible forhandling the glassfish configuration deployment descriptors
 */
@Override public DeploymentDescriptorFile getGFConfigurationDDFile(){
  if (gfEjbRuntimeDD == null) {
    gfEjbRuntimeDD=new GFEjbRuntimeDDFile();
  }
  return gfEjbRuntimeDD;
}
Program: 29769
Project: 29769
Buggy source:
/** 
 * @return if exists the DeploymentDescriptorFile responsible forhandling the Sun configuration deployment descriptors
 */
public DeploymentDescriptorFile getSunConfigurationDDFile(){
  return ejbRuntimeDD.get();
}

Fixed version (ground truth):
/** 
 * @return if exists the DeploymentDescriptorFile responsible forhandling the Sun configuration deployment descriptors
 */
public DeploymentDescriptorFile getSunConfigurationDDFile(){
  if (ejbRuntimeDD == null) {
    ejbRuntimeDD=new EjbRuntimeDDFile();
  }
  return ejbRuntimeDD;
}
Program: 29770
Project: 29770
Buggy source:
/** 
 * @return the DeploymentDescriptorFile responsible for handlingstandard deployment descriptor
 */
@Override public DeploymentDescriptorFile getStandardDDFile(){
  return standardDD.get();
}

Fixed version (ground truth):
/** 
 * @return the DeploymentDescriptorFile responsible for handlingstandard deployment descriptor
 */
@Override public DeploymentDescriptorFile getStandardDDFile(){
  if (standardDD == null) {
    standardDD=new EjbDeploymentDescriptorFile();
  }
  return standardDD;
}
Program: 29771
Project: 29771
Buggy source:
/** 
 * @return a RootXMLNode responsible for handling the deploymentdescriptors associated with this J2EE module
 * @param the descriptor for which we need the node
 */
public RootXMLNode getRootXMLNode(Descriptor descriptor){
  return new EjbBundleNode();
}

Fixed version (ground truth):
/** 
 * @return a RootXMLNode responsible for handling the deploymentdescriptors associated with this J2EE module
 * @param descriptor the descriptor for which we need the node
 */
public RootXMLNode getRootXMLNode(Descriptor descriptor){
  return new EjbBundleNode();
}
Program: 29773
Project: 29773
Buggy source:
public CreateDomainCommand(){
  masterPasswordOption=new ParamModelData(MASTER_PASSWORD,String.class,false,null);
  masterPasswordOption.description=strings.get("String_Node_Str");
  masterPasswordOption.param._password=true;
  adminPasswordOption=new ParamModelData(ADMIN_PASSWORD,String.class,false,null);
  adminPasswordOption.description=strings.get("String_Node_Str");
  adminPasswordOption.param._password=true;
}

Fixed version (ground truth):
public CreateDomainCommand(){
}
Program: 29774
Project: 29774
Buggy source:
/** 
 */
@Override protected void validate() throws CommandException, CommandValidationException {
  if (domainDir == null) {
    domainDir=getSystemProperty(SystemPropertyConstants.DOMAINS_ROOT_PROPERTY);
  }
  if (domainDir == null) {
    throw new CommandValidationException(strings.get("String_Node_Str",domainDir));
  }
  if (programOpts.getUser() == null && !noPassword) {
    Console cons=System.console();
    if (cons != null && programOpts.isInteractive()) {
      cons.printf("String_Node_Str",strings.get("String_Node_Str",SystemPropertyConstants.DEFAULT_ADMIN_USER));
      String val=cons.readLine();
      if (ok(val))       programOpts.setUser(val);
    }
 else {
      throw new CommandValidationException(strings.get("String_Node_Str"));
    }
  }
  if (programOpts.getUser() != null) {
    try {
      FileRealmHelper.validateUserName(programOpts.getUser());
    }
 catch (    IllegalArgumentException ise) {
      throw new CommandValidationException(strings.get("String_Node_Str",programOpts.getUser()));
    }
  }
}

Fixed version (ground truth):
/** 
 */
@Override protected void validate() throws CommandException, CommandValidationException {
  if (domainDir == null) {
    domainDir=getSystemProperty(SystemPropertyConstants.DOMAINS_ROOT_PROPERTY);
  }
  if (domainDir == null) {
    throw new CommandValidationException(strings.get("String_Node_Str",domainDir));
  }
  if (programOpts.getUser() == null && !noPassword) {
    Console cons=System.console();
    if (cons != null && programOpts.isInteractive()) {
      cons.printf("String_Node_Str",strings.get("String_Node_Str",SystemPropertyConstants.DEFAULT_ADMIN_USER));
      String val=cons.readLine();
      if (ok(val)) {
        programOpts.setUser(val);
        if (adminPassword == null) {
          ParamModelData po=new ParamModelData(ADMIN_PASSWORD,String.class,false,null);
          po.description=strings.get("String_Node_Str");
          po.param._password=true;
          adminPassword=getPassword(po,SystemPropertyConstants.DEFAULT_ADMIN_PASSWORD,true);
        }
      }
    }
 else {
      throw new CommandValidationException(strings.get("String_Node_Str"));
    }
  }
  if (programOpts.getUser() != null) {
    try {
      FileRealmHelper.validateUserName(programOpts.getUser());
    }
 catch (    IllegalArgumentException ise) {
      throw new CommandValidationException(strings.get("String_Node_Str",programOpts.getUser()));
    }
  }
}
Program: 29775
Project: 29775
Buggy source:
/** 
 * Override the <code>getParameter()</code> method of the wrapped request.
 * @param name Name of the requested parameter
 */
@Override public String getParameter(String name){
  parseParameters();
synchronized (parameters) {
    Object value=parameters.get(name);
    if (value == null)     return (null);
 else     if (value instanceof String[])     return (((String[])value)[0]);
 else     if (value instanceof String)     return ((String)value);
 else     return (value.toString());
  }
}

Fixed version (ground truth):
/** 
 * Override the <code>getParameter()</code> method of the wrapped request.
 * @param name Name of the requested parameter
 */
@Override public String getParameter(String name){
  parseParameters();
synchronized (parameters) {
    String[] value=parameters.get(name);
    return ((value != null) ? value[0] : null);
  }
}
Program: 29776
Project: 29776
Buggy source:
/** 
 * Override the <code>getParameterValues()</code> method of the wrapped request.
 * @param name Name of the requested parameter
 */
@Override public String[] getParameterValues(String name){
  parseParameters();
synchronized (parameters) {
    Object value=parameters.get(name);
    if (value == null)     return null;
 else     if (value instanceof String[])     return ((String[])value);
 else     if (value instanceof String) {
      String values[]=new String[1];
      values[0]=(String)value;
      return (values);
    }
 else {
      String values[]=new String[1];
      values[0]=value.toString();
      return (values);
    }
  }
}

Fixed version (ground truth):
/** 
 * Override the <code>getParameterValues()</code> method of the wrapped request.
 * @param name Name of the requested parameter
 */
@Override public String[] getParameterValues(String name){
  parseParameters();
synchronized (parameters) {
    String[] value=parameters.get(name);
    return value;
  }
}
Program: 29777
Project: 29777
Buggy source:
/** 
 * Gets the <code>ServletRequest</code> for which this object is the facade. This method must be implemented by a subclass.
 * @param maskDefaultContextMapping true if the fact that a requestreceived at the root context was mapped to a default-web-module will be masked, false otherwise
 */
@Override public HttpServletRequest getRequest(boolean maskDefaultContextMapping){
  if (!maskDefaultContextMapping || !isDefaultContext) {
    if (facade == null) {
      facade=new RequestFacade(this);
    }
    return facade;
  }
 else {
    if (defaultContextMaskingFacade == null) {
      defaultContextMaskingFacade=new RequestFacade(this,true);
    }
    return defaultContextMaskingFacade;
  }
}

Fixed version (ground truth):
/** 
 * Gets the <code>ServletRequest</code> for which this object is the facade. This method must be implemented by a subclass.
 * @param maskDefaultContextMapping true if the fact that a requestreceived at the root context was mapped to a default-web-module will be masked, false otherwise
 */
@Override public HttpServletRequest getRequest(boolean maskDefaultContextMapping){
  if (!maskDefaultContextMapping || !isDefaultContext) {
    if (facade == null) {
      facade=new RequestFacade(this);
      attributes.put(Globals.REQUEST_FACADE_HELPER,facade.getRequestFacadeHelper());
    }
    return facade;
  }
 else {
    if (defaultContextMaskingFacade == null) {
      defaultContextMaskingFacade=new RequestFacade(this,true);
      attributes.put(Globals.REQUEST_FACADE_HELPER,defaultContextMaskingFacade.getRequestFacadeHelper());
    }
    return defaultContextMaskingFacade;
  }
}
Program: 29778
Project: 29778
Buggy source:
/** 
 * Clear facade.
 */
public void clear(){
  request=null;
}

Fixed version (ground truth):
/** 
 * Clear facade.
 */
public void clear(){
  request=null;
  if (reqFacHelper != null) {
    reqFacHelper.clear();
  }
  reqFacHelper=null;
}
Program: 29779
Project: 29779
Buggy source:
/** 
 * Construct a wrapper for the specified request.
 * @param request The request to be wrapped
 * @param maskDefaultContextMapping true if the fact that a requestreceived at the root context was mapped to a default-web-module will be masked, false otherwise
 */
public RequestFacade(Request request,boolean maskDefaultContextMapping){
  this.request=request;
  this.maskDefaultContextMapping=maskDefaultContextMapping;
}

Fixed version (ground truth):
/** 
 * Construct a wrapper for the specified request.
 * @param request The request to be wrapped
 * @param maskDefaultContextMapping true if the fact that a requestreceived at the root context was mapped to a default-web-module will be masked, false otherwise
 */
public RequestFacade(Request request,boolean maskDefaultContextMapping){
  this.request=request;
  this.maskDefaultContextMapping=maskDefaultContextMapping;
  this.reqFacHelper=new RequestFacadeHelper(request);
}
Program: 29780
Project: 29780
Buggy source:
public void addAuthenticator(Authenticator authenticator,String loginMethod){
  if ((authenticator != null) && !(authenticator instanceof GlassFishValve)) {
    throw new IllegalArgumentException(sm.getString("String_Node_Str"));
  }
  if (authenticators == null) {
synchronized (this) {
      if (authenticators == null) {
        authenticators=new HashMap<String,Authenticator>();
      }
    }
  }
  authenticators.put(loginMethod,authenticator);
}

Fixed version (ground truth):
public synchronized void addAuthenticator(Authenticator authenticator,String loginMethod){
  if ((authenticator != null) && !(authenticator instanceof GlassFishValve)) {
    throw new IllegalArgumentException(sm.getString("String_Node_Str"));
  }
  if (authenticators == null) {
    authenticators=new HashMap<String,Authenticator>();
  }
  authenticators.put(loginMethod,authenticator);
}
Program: 29781
Project: 29781
Buggy source:
private static boolean status(HttpServletRequest request,HttpServletResponse response,Context context,Wrapper wrapper,int statusCode){
  RequestFacadeHelper reqFacHelper=RequestFacadeHelper.getInstance(request);
  if (!(reqFacHelper != null && reqFacHelper.isResponseError())) {
    return false;
  }
  boolean matchFound=false;
  ErrorPage errorPage=context.findErrorPage(statusCode);
  if (errorPage != null) {
    matchFound=true;
    String requestPath=(String)request.getAttribute(Globals.DISPATCHER_REQUEST_PATH_ATTR);
    if (requestPath == null || !requestPath.equals(errorPage.getLocation())) {
      String message=null;
      if (reqFacHelper != null) {
        message=RequestUtil.filter(reqFacHelper.getResponseMessage());
      }
      if (message == null) {
        message="String_Node_Str";
      }
      prepareRequestForDispatch(request,wrapper,errorPage.getLocation(),statusCode,message);
      custom(request,response,errorPage,context);
    }
  }
 else {
    errorPage=((StandardHost)context.getParent()).findErrorPage(statusCode);
    if (errorPage != null) {
      matchFound=true;
      try {
        serveErrorPage(response,errorPage,statusCode);
      }
 catch (      Exception e) {
        log.log(Level.WARNING,"String_Node_Str" + errorPage,e);
      }
    }
  }
  return matchFound;
}

Fixed version (ground truth):
private static boolean status(HttpServletRequest request,HttpServletResponse response,Context context,Wrapper wrapper,int statusCode){
  RequestFacadeHelper reqFacHelper=RequestFacadeHelper.getInstance(request);
  if (reqFacHelper == null || !reqFacHelper.isResponseError()) {
    return false;
  }
  boolean matchFound=false;
  ErrorPage errorPage=context.findErrorPage(statusCode);
  if (errorPage != null) {
    matchFound=true;
    String requestPath=(String)request.getAttribute(Globals.DISPATCHER_REQUEST_PATH_ATTR);
    if (requestPath == null || !requestPath.equals(errorPage.getLocation())) {
      String message=RequestUtil.filter(reqFacHelper.getResponseMessage());
      if (message == null) {
        message="String_Node_Str";
      }
      prepareRequestForDispatch(request,wrapper,errorPage.getLocation(),statusCode,message);
      custom(request,response,errorPage,context);
    }
  }
 else {
    errorPage=((StandardHost)context.getParent()).findErrorPage(statusCode);
    if (errorPage != null) {
      matchFound=true;
      try {
        serveErrorPage(response,errorPage,statusCode);
      }
 catch (      Exception e) {
        log.log(Level.WARNING,"String_Node_Str" + errorPage,e);
      }
    }
  }
  return matchFound;
}
Program: 29782
Project: 29782
Buggy source:
/** 
 * Clear references.
 */
protected void clearReferences(){
  clearReferencesJdbc();
  if (clearReferencesStatic) {
    clearReferencesStaticFinal();
  }
  java.beans.Introspector.flushCaches();
}

Fixed version (ground truth):
/** 
 * Clear references.
 */
protected void clearReferences(){
  clearReferencesJdbc();
  if (clearReferencesStatic) {
    clearReferencesStaticFinal();
  }
  IntrospectionUtils.clear();
  java.beans.Introspector.flushCaches();
}
Program: 29783
Project: 29783
Buggy source:
/** 
 * Initialize the passwords field based on the password file specified in the program options, and initialize the program option's password if available in the password file.
 */
protected void initializePasswords() throws CommandException {
  passwords=new HashMap<String,String>();
  String pwfile=programOpts.getPasswordFile();
  if (ok(pwfile)) {
    passwords=CLIUtil.readPasswordFileOptions(pwfile,true);
    logger.finer("String_Node_Str" + pwfile);
    String password=passwords.get(Environment.PREFIX + "String_Node_Str");
    if (password != null && programOpts.getPassword() == null)     programOpts.setPassword(password,ProgramOptions.PasswordLocation.PASSWORD_FILE);
  }
}

Fixed version (ground truth):
/** 
 * Initialize the passwords field based on the password file specified in the program options, and initialize the program option's password if available in the password file.
 */
protected void initializePasswords() throws CommandException {
  passwords=new HashMap<String,String>();
  String pwfile=programOpts.getPasswordFile();
  if (ok(pwfile)) {
    passwords=CLIUtil.readPasswordFileOptions(pwfile,true);
    logger.finer("String_Node_Str" + pwfile);
    String password=passwords.get(Environment.getPrefix() + "String_Node_Str");
    if (password != null && programOpts.getPassword() == null)     programOpts.setPassword(password,ProgramOptions.PasswordLocation.PASSWORD_FILE);
  }
}
Program: 29784
Project: 29784
Buggy source:
/** 
 * Return a man page for this command that has the tokens substituted
 */
public BufferedReader expandManPage(Reader r){
  manpageTokenValues[0]=programOpts.getCommandName();
  manpageTokenValues[1]=Environment.PREFIX;
  manpageTokenValues[2]=Version.getBriefProductName();
  TokenValueSet tvs=new TokenValueSet();
  for (int i=0; i < manpageTokens.length; i++) {
    tvs.add(new TokenValue(manpageTokens[i],manpageTokenValues[i],"String_Node_Str","String_Node_Str"));
  }
  return new BufferedReader(new LineTokenReplacer(tvs).getReader(r));
}

Fixed version (ground truth):
/** 
 * Return a man page for this command that has the tokens substituted
 */
public BufferedReader expandManPage(Reader r){
  manpageTokenValues[0]=programOpts.getCommandName();
  manpageTokenValues[1]=Environment.getPrefix();
  manpageTokenValues[2]=Version.getBriefProductName();
  TokenValueSet tvs=new TokenValueSet();
  for (int i=0; i < manpageTokens.length; i++) {
    tvs.add(new TokenValue(manpageTokens[i],manpageTokenValues[i],"String_Node_Str","String_Node_Str"));
  }
  return new BufferedReader(new LineTokenReplacer(tvs).getReader(r));
}
Program: 29785
Project: 29785
Buggy source:
/** 
 * Read passwords from the password file and save them in a java.util.Map.
 * @param passwordFileName  password file name
 * @param withPrefix decides whether prefix should be taken into account
 * @return Map of the password name and value
 */
public static Map<String,String> readPasswordFileOptions(final String passwordFileName,boolean withPrefix) throws CommandException {
  Map<String,String> passwordOptions=new HashMap<String,String>();
  boolean readStdin=passwordFileName.equals("String_Node_Str");
  InputStream is=null;
  try {
    is=new BufferedInputStream(readStdin ? System.in : new FileInputStream(passwordFileName));
    final Properties prop=new Properties();
    prop.load(is);
    for (    Object key : prop.keySet()) {
      final String entry=(String)key;
      if (entry.startsWith(Environment.PREFIX)) {
        final String optionName=withPrefix ? entry : entry.substring(Environment.PREFIX.length()).toLowerCase(Locale.ENGLISH);
        final String optionValue=prop.getProperty(entry);
        passwordOptions.put(optionName,optionValue);
      }
    }
  }
 catch (  final Exception e) {
    throw new CommandException(e);
  }
 finally {
    try {
      if (!readStdin && is != null)       is.close();
    }
 catch (    final Exception ignore) {
    }
  }
  return passwordOptions;
}

Fixed version (ground truth):
/** 
 * Read passwords from the password file and save them in a java.util.Map.
 * @param passwordFileName  password file name
 * @param withPrefix decides whether prefix should be taken into account
 * @return Map of the password name and value
 */
public static Map<String,String> readPasswordFileOptions(final String passwordFileName,boolean withPrefix) throws CommandException {
  Map<String,String> passwordOptions=new HashMap<String,String>();
  boolean readStdin=passwordFileName.equals("String_Node_Str");
  InputStream is=null;
  try {
    is=new BufferedInputStream(readStdin ? System.in : new FileInputStream(passwordFileName));
    final Properties prop=new Properties();
    prop.load(is);
    for (    Object key : prop.keySet()) {
      final String entry=(String)key;
      if (entry.startsWith(Environment.getPrefix())) {
        final String optionName=withPrefix ? entry : entry.substring(Environment.getPrefix().length()).toLowerCase(Locale.ENGLISH);
        final String optionValue=prop.getProperty(entry);
        passwordOptions.put(optionName,optionValue);
      }
    }
  }
 catch (  final Exception e) {
    throw new CommandException(e);
  }
 finally {
    try {
      if (!readStdin && is != null)       is.close();
    }
 catch (    final Exception ignore) {
    }
  }
  return passwordOptions;
}
Program: 29786
Project: 29786
Buggy source:
@Override public int executeCommand() throws CommandException, CommandValidationException {
  int ret=0;
  if (vars == null || vars.size() == 0) {
    for (    Map.Entry<String,String> e : env.entrySet())     logger.info(e.getKey() + "String_Node_Str" + quote(e.getValue()));
  }
 else {
    for (    String arg : vars) {
      String name, value;
      int eq=arg.indexOf('=');
      if (eq < 0) {
        name=arg;
        value=null;
      }
 else {
        name=arg.substring(0,eq);
        value=arg.substring(eq + 1);
      }
      if (!name.startsWith(Environment.PREFIX)) {
        logger.info(strings.get("String_Node_Str",name,Environment.PREFIX));
        ret=-1;
        continue;
      }
      if (value == null) {
        String v=env.get(name);
        if (v != null)         logger.info(name + "String_Node_Str" + v);
      }
 else       env.put(name,value);
    }
  }
  return ret;
}

Fixed version (ground truth):
@Override public int executeCommand() throws CommandException, CommandValidationException {
  int ret=0;
  if (vars == null || vars.size() == 0) {
    for (    Map.Entry<String,String> e : env.entrySet())     logger.info(e.getKey() + "String_Node_Str" + quote(e.getValue()));
  }
 else {
    for (    String arg : vars) {
      String name, value;
      int eq=arg.indexOf('=');
      if (eq < 0) {
        name=arg;
        value=null;
      }
 else {
        name=arg.substring(0,eq);
        value=arg.substring(eq + 1);
      }
      if (!name.startsWith(Environment.getPrefix())) {
        logger.info(strings.get("String_Node_Str",name,Environment.getPrefix()));
        ret=-1;
        continue;
      }
      if (value == null) {
        String v=env.get(name);
        if (v != null)         logger.info(name + "String_Node_Str" + v);
      }
 else       env.put(name,value);
    }
  }
  return ret;
}
Program: 29787
Project: 29787
Buggy source:
@Override public int executeCommand() throws CommandException, CommandValidationException {
  int ret=0;
  for (  String name : vars) {
    if (!name.startsWith(Environment.PREFIX)) {
      logger.info(strings.get("String_Node_Str",name,Environment.PREFIX));
      ret=-1;
      continue;
    }
    if (env.get(name) == null) {
      logger.info(strings.get("String_Node_Str",name));
      ret=-1;
    }
 else     env.remove(name);
  }
  return ret;
}

Fixed version (ground truth):
@Override public int executeCommand() throws CommandException, CommandValidationException {
  int ret=0;
  for (  String name : vars) {
    if (!name.startsWith(Environment.getPrefix())) {
      logger.info(strings.get("String_Node_Str",name,Environment.getPrefix()));
      ret=-1;
      continue;
    }
    if (env.get(name) == null) {
      logger.info(strings.get("String_Node_Str",name));
      ret=-1;
    }
 else     env.remove(name);
  }
  return ret;
}
Program: 29788
Project: 29788
Buggy source:
ParameterMap getParameters(String command,String[] args) throws CommandException {
  CommandModel commandModel=commandRunner.getModel(command,logger);
  if (command == null) {
    throw new CommandException("String_Node_Str" + command);
  }
  Parser parser=new Parser(args,0,ProgramOptions.getValidOptions(),true);
  ParameterMap globalOptions=parser.getOptions();
  List<String> operands=parser.getOperands();
  String argv[]=operands.toArray(new String[operands.size()]);
  parser=new Parser(argv,0,commandModel.getParameters(),false);
  ParameterMap options=parser.getOptions();
  operands=parser.getOperands();
  options.set("String_Node_Str",operands);
  if (commandModel.getModelFor("String_Node_Str") != null)   options.set("String_Node_Str",Boolean.toString(terse));
  if (globalOptions.size() > 0) {
    String pwfile=globalOptions.getOne(ProgramOptions.PASSWORDFILE);
    if (pwfile != null && pwfile.length() > 0) {
      Map<String,String> passwords=CLIUtil.readPasswordFileOptions(pwfile,true);
      for (      CommandModel.ParamModel opt : commandModel.getParameters()) {
        if (opt.getParam().password()) {
          String pwdname=opt.getName();
          String pwd=passwords.get(pwdname);
          if (pwd != null) {
            options.set(pwdname,pwd);
          }
        }
      }
    }
  }
  return options;
}

Fixed version (ground truth):
ParameterMap getParameters(String command,String[] args) throws CommandException {
  CommandModel commandModel=commandRunner.getModel(command,logger);
  if (commandModel == null) {
    throw new CommandException("String_Node_Str" + command);
  }
  Parser parser=new Parser(args,0,ProgramOptions.getValidOptions(),true);
  ParameterMap globalOptions=parser.getOptions();
  List<String> operands=parser.getOperands();
  String argv[]=operands.toArray(new String[operands.size()]);
  parser=new Parser(argv,0,commandModel.getParameters(),false);
  ParameterMap options=parser.getOptions();
  operands=parser.getOperands();
  options.set("String_Node_Str",operands);
  if (commandModel.getModelFor("String_Node_Str") != null)   options.set("String_Node_Str",Boolean.toString(terse));
  if (globalOptions.size() > 0) {
    String pwfile=globalOptions.getOne(ProgramOptions.PASSWORDFILE);
    if (pwfile != null && pwfile.length() > 0) {
      Map<String,String> passwords=CLIUtil.readPasswordFileOptions(pwfile,true);
      for (      CommandModel.ParamModel opt : commandModel.getParameters()) {
        if (opt.getParam().password()) {
          String pwdname=opt.getName();
          String pwd=passwords.get(pwdname);
          if (pwd != null) {
            options.set(pwdname,pwd);
          }
        }
      }
    }
  }
  return options;
}
Program: 29790
Project: 29790
Buggy source:
public void visitInnerClass(String name,String outerName,String innerName,int access){
}

Fixed version (ground truth):
@Override public void visitInnerClass(String name,String outerName,String innerName,int access){
}
Program: 29791
Project: 29791
Buggy source:
/** 
 * Visits the end of the class. This method, which is the last one to be called, is used to inform the visitor that all the fields and methods of the class have been visited.
 */
public void visitEnd(){
}

Fixed version (ground truth):
/** 
 * Visits the end of the class. This method, which is the last one to be called, is used to inform the visitor that all the fields and methods of the class have been visited.
 */
@Override public void visitEnd(){
}
Program: 29792
Project: 29792
Buggy source:
public void visitOuterClass(String owner,String name,String desc){
}

Fixed version (ground truth):
@Override public void visitOuterClass(String owner,String name,String desc){
}
Program: 29793
Project: 29793
Buggy source:
public void visitAttribute(Attribute attr){
}

Fixed version (ground truth):
@Override public void visitAttribute(Attribute attr){
}
Program: 29794
Project: 29794
Buggy source:
public AnnotationVisitor visitAnnotation(String desc,boolean visible){
  hasConfiguredAnnotation|="String_Node_Str".equals(desc);
  if ("String_Node_Str".equals(desc)) {
    classDef.setDeprecated(true);
  }
  return null;
}

Fixed version (ground truth):
@Override public AnnotationVisitor visitAnnotation(String desc,boolean visible){
  hasConfiguredAnnotation|="String_Node_Str".equals(desc);
  if ("String_Node_Str".equals(desc) && classDef != null) {
    classDef.setDeprecated(true);
  }
  return null;
}
Program: 29795
Project: 29795
Buggy source:
public MethodVisitor visitMethod(int access,String name,String desc,String signature,String[] exceptions){
  String type=null;
  try {
    if (showDeprecated || ((access & Opcodes.ACC_DEPRECATED) != Opcodes.ACC_DEPRECATED)) {
      if (hasConfiguredAnnotation) {
        if (signature != null) {
          type=GenerateDomainSchema.toClassName(signature.substring(signature.indexOf("String_Node_Str") + 1,signature.lastIndexOf("String_Node_Str") - 1));
        }
 else {
          type=GenerateDomainSchema.toClassName(desc);
        }
      }
    }
  }
 catch (  StringIndexOutOfBoundsException e) {
    throw new RuntimeException(e.getMessage());
  }
  return name.startsWith("String_Node_Str") && type != null ? new AttributeMethodVisitor(classDef,name,type) : null;
}

Fixed version (ground truth):
@Override public MethodVisitor visitMethod(int access,String name,String desc,String signature,String[] exceptions){
  String type=null;
  try {
    if (showDeprecated || ((access & Opcodes.ACC_DEPRECATED) != Opcodes.ACC_DEPRECATED)) {
      if (hasConfiguredAnnotation) {
        if (signature != null) {
          type=GenerateDomainSchema.toClassName(signature.substring(signature.indexOf("String_Node_Str") + 1,signature.lastIndexOf("String_Node_Str") - 1));
        }
 else {
          type=GenerateDomainSchema.toClassName(desc);
        }
      }
    }
  }
 catch (  StringIndexOutOfBoundsException e) {
    throw new RuntimeException(e.getMessage());
  }
  return name.startsWith("String_Node_Str") && type != null ? new AttributeMethodVisitor(classDef,name,type) : null;
}
Program: 29796
Project: 29796
Buggy source:
public void visitSource(String source,String debug){
}

Fixed version (ground truth):
@Override public void visitSource(String source,String debug){
}
Program: 29797
Project: 29797
Buggy source:
public FieldVisitor visitField(int access,String name,String desc,String signature,Object value){
  return null;
}

Fixed version (ground truth):
@Override public FieldVisitor visitField(int access,String name,String desc,String signature,Object value){
  return null;
}
Program: 29798
Project: 29798
Buggy source:
public void visit(int version,int access,String name,String signature,String superName,String[] intfs){
  className=GenerateDomainSchema.toClassName(name);
  interfaces=new ArrayList<String>();
  for (  String intf : intfs) {
    interfaces.add(GenerateDomainSchema.toClassName(intf));
  }
  classDef=new ClassDef(className,interfaces);
}

Fixed version (ground truth):
@Override public void visit(int version,int access,String name,String signature,String superName,String[] intfs){
  className=GenerateDomainSchema.toClassName(name);
  interfaces=new ArrayList<String>();
  for (  String intf : intfs) {
    interfaces.add(GenerateDomainSchema.toClassName(intf));
  }
  classDef=new ClassDef(className,interfaces);
}
Program: 29799
Project: 29799
Buggy source:
private List<JarFile> locateJarFiles(String modulesDir) throws IOException {
  List<JarFile> result=new ArrayList<JarFile>();
  final File[] files=new File(modulesDir).listFiles(new FilenameFilter(){
    public boolean accept(    File dir,    String name){
      return name.endsWith("String_Node_Str");
    }
  }
);
  for (  File f : files) {
    result.add(new JarFile(f));
  }
  return result;
}

Fixed version (ground truth):
private List<JarFile> locateJarFiles(String modulesDir) throws IOException {
  List<JarFile> result=new ArrayList<JarFile>();
  final File[] files=new File(modulesDir).listFiles(new FilenameFilter(){
    @Override public boolean accept(    File dir,    String name){
      return name.endsWith("String_Node_Str");
    }
  }
);
  for (  File f : files) {
    result.add(new JarFile(f));
  }
  return result;
}
Program: 29800
Project: 29800
Buggy source:
private ClassDef parse(InputStream is) throws IOException {
  DocClassVisitor visitor=new DocClassVisitor(Boolean.valueOf(showDeprecated));
  new ClassReader(is).accept(visitor,0);
  return visitor.isConfigured() ? visitor.getClassDef() : null;
}

Fixed version (ground truth):
private ClassDef parse(InputStream is) throws IOException {
  DocClassVisitor visitor=new DocClassVisitor(showDeprecated);
  new ClassReader(is).accept(visitor,0);
  return visitor.isConfigured() ? visitor.getClassDef() : null;
}
Program: 29801
Project: 29801
Buggy source:
public void execute(AdminCommandContext context){
  try {
    URI uri=new URI(System.getProperty("String_Node_Str"));
    docDir=new File(new File(uri),"String_Node_Str");
    findClasses(classDefs,locateJarFiles(System.getProperty("String_Node_Str") + "String_Node_Str"));
    getFormat().output(new Context(classDefs,docDir,showDeprecated,showSubclasses,Domain.class.getName()));
    context.getActionReport().setMessage("String_Node_Str" + format + "String_Node_Str"+ docDir);
  }
 catch (  Exception e) {
    e.printStackTrace();
    throw new RuntimeException(e.getMessage(),e);
  }
}

Fixed version (ground truth):
@Override public void execute(AdminCommandContext context){
  try {
    URI uri=new URI(System.getProperty("String_Node_Str"));
    docDir=new File(new File(uri),"String_Node_Str");
    findClasses(classDefs,locateJarFiles(System.getProperty("String_Node_Str") + "String_Node_Str"));
    getFormat().output(new Context(classDefs,docDir,showDeprecated,showSubclasses,Domain.class.getName()));
    context.getActionReport().setMessage("String_Node_Str" + format + "String_Node_Str"+ docDir);
  }
 catch (  Exception e) {
    e.printStackTrace();
    throw new RuntimeException(e.getMessage(),e);
  }
}
Program: 29802
Project: 29802
Buggy source:
public boolean accept(File dir,String name){
  return name.endsWith("String_Node_Str");
}

Fixed version (ground truth):
@Override public boolean accept(File dir,String name){
  return name.endsWith("String_Node_Str");
}
Program: 29803
Project: 29803
Buggy source:
private void buildToc(final ClassDef def) throws NoSuchMethodException, InvocationTargetException, IllegalAccessException {
  if (def != null) {
    if (!toc.contains(def)) {
      buildDetail(def);
    }
    toc.add(def);
    println(tocWriter,"String_Node_Str");
    println(tocWriter,"String_Node_Str" + link(def));
    for (    Entry<String,String> aggType : def.getAggregatedTypes().entrySet()) {
      if (!Property.class.getName().equals(aggType.getValue())) {
        buildToc(defs.get(aggType.getValue()));
      }
    }
    for (    ClassDef subclass : def.getSubclasses()) {
      buildToc(subclass);
    }
    println(tocWriter,"String_Node_Str");
  }
}

Fixed version (ground truth):
private void buildToc(final ClassDef def) throws NoSuchMethodException, InvocationTargetException, IllegalAccessException {
  if (def != null) {
    if (!toc.contains(def)) {
      buildDetail(def);
    }
    toc.add(def);
    println(tocWriter,"String_Node_Str");
    println(tocWriter,"String_Node_Str" + link(def));
    for (    Entry<String,String> aggType : def.getAggregatedTypes().entrySet()) {
      if (!Property.class.getName().equals(aggType.getValue()) && defs != null) {
        buildToc(defs.get(aggType.getValue()));
      }
    }
    for (    ClassDef subclass : def.getSubclasses()) {
      buildToc(subclass);
    }
    println(tocWriter,"String_Node_Str");
  }
}
Program: 29804
Project: 29804
Buggy source:
@SuppressWarnings({"String_Node_Str"}) private void copy(final String resource) throws IOException {
  InputStreamReader reader=null;
  PrintWriter writer=null;
  try {
    InputStream stream=getClass().getClassLoader().getResourceAsStream(resource);
    reader=new InputStreamReader(stream);
    writer=new PrintWriter(new File(dir,resource));
    char[] bytes=new char[8192];
    int read;
    while ((read=reader.read(bytes)) != -1) {
      writer.write(bytes,0,read);
    }
  }
  finally {
    if (reader != null) {
      reader.close();
    }
    if (writer != null) {
      writer.close();
    }
  }
}

Fixed version (ground truth):
private void copy(final String resource) throws IOException {
  InputStreamReader reader=null;
  PrintWriter writer=null;
  try {
    try {
      InputStream stream=getClass().getClassLoader().getResourceAsStream(resource);
      reader=new InputStreamReader(stream);
      writer=new PrintWriter(new File(dir,resource));
      char[] bytes=new char[8192];
      int read;
      while ((read=reader.read(bytes)) != -1) {
        writer.write(bytes,0,read);
      }
    }
  finally {
      if (reader != null) {
        reader.close();
      }
    }
  }
  finally {
    if (writer != null) {
      writer.close();
    }
  }
}