nus-yam/ex-repair huggingface dataset:
Program: 29706
Project: 29706
Buggy source:
/** 
 * Add the field to the class, adding the @XmlAttribute annotation for marshalling purposes.
 */
protected static void createField(ClassWriter cw,String name,Class<?> type){
  String internalType=getInternalTypeString(type);
  FieldVisitor field=cw.visitField(ACC_PRIVATE,name,internalType,null,null);
  field.visitAnnotation("String_Node_Str",true).visitEnd();
  field.visitEnd();
}

Fixed version (ground truth):
/** 
 * Add the field to the class, adding the @XmlAttribute annotation for marshalling purposes.
 */
protected static void createField(ClassWriter cw,String name,Class<?> type){
  String internalType=getInternalTypeString(type);
  FieldVisitor field=cw.visitField(ACC_PRIVATE,getPropertyName(name),internalType,null,null);
  field.visitAnnotation("String_Node_Str",true).visitEnd();
  field.visitEnd();
}
Program: 29707
Project: 29707
Buggy source:
private String getPropertyName(String name){
  return name.substring(0,1).toLowerCase() + name.substring(1);
}

Fixed version (ground truth):
private static String getPropertyName(String name){
  return name.substring(0,1).toLowerCase() + name.substring(1);
}
Program: 29709
Project: 29709
Buggy source:
public static <P extends ConfigBeanProxy>boolean checkIfConfigExists(Config c,Class<P> configBeanType){
  P configExtension=null;
  for (  Container extension : c.getContainers()) {
    try {
      configExtension=configBeanType.cast(extension);
      return true;
    }
 catch (    Exception e) {
    }
  }
  return false;
}

Fixed version (ground truth):
public static <P extends ConfigBeanProxy>boolean checkIfConfigExists(Config c,Class<P> configBeanType){
  for (  Container extension : c.getContainers()) {
    try {
      configBeanType.cast(extension);
      return true;
    }
 catch (    Exception e) {
    }
  }
  return false;
}
Program: 29710
Project: 29710
Buggy source:
public static <T extends ConfigExtension>T getExtensionByType(Config c,Class<T> type) throws ClassNotFoundException, TransactionFailure {
  T configExtension=null;
  for (  Container extension : c.getContainers()) {
    try {
      configExtension=type.cast(extension);
      return configExtension;
    }
 catch (    Exception e) {
    }
  }
  if (configExtension == null) {
    ConfigSnippetLoader loader=new ConfigSnippetLoader(c,type);
    return loader.createConfigBeanForType(type);
  }
  return null;
}

Fixed version (ground truth):
public static <T extends ConfigExtension>T getExtensionByType(Config c,Class<T> type) throws ClassNotFoundException, TransactionFailure {
  T configExtension=null;
  for (  Container extension : c.getContainers()) {
    try {
      configExtension=type.cast(extension);
      return configExtension;
    }
 catch (    Exception e) {
    }
  }
  ConfigSnippetLoader loader=new ConfigSnippetLoader(c,type);
  return loader.createConfigBeanForType(type);
}
Program: 29711
Project: 29711
Buggy source:
@Override public <U extends ConfigExtension>U createConfigBeanForType(Class<U> configExtensionType) throws TransactionFailure {
  if (isConfigSnippetPresent(configExtensionType)) {
    final ConfigExtension configBeanFromSnippet=addConfigBeanFor(configExtensionType,configLoader);
  }
 else {
    final Class<U> parentElem=configExtensionType;
    ConfigSupport.apply(new SingleConfigCode<Config>(){
      @Override public Object run(      Config parent) throws PropertyVetoException, TransactionFailure {
        U child=parent.createChild(parentElem);
        Dom.unwrap(child).addDefaultChildren();
        parent.getContainers().add((Container)child);
        return child;
      }
    }
,configLoader);
  }
  Method m=getMatchingGetterMethod(configLoader,configExtensionType);
  if (m != null) {
    try {
      return (U)m.invoke(configLoader);
    }
 catch (    Exception ex) {
      LOG.log(Level.SEVERE,"String_Node_Str",ex);
      return null;
    }
  }
 else {
    return configLoader.getExtensionByType(configExtensionType);
  }
}

Fixed version (ground truth):
@Override public <U extends ConfigExtension>U createConfigBeanForType(Class<U> configExtensionType) throws TransactionFailure {
  if (isConfigSnippetPresent(configExtensionType)) {
    addConfigBeanFor(configExtensionType,configLoader);
  }
 else {
    final Class<U> parentElem=configExtensionType;
    ConfigSupport.apply(new SingleConfigCode<Config>(){
      @Override public Object run(      Config parent) throws PropertyVetoException, TransactionFailure {
        U child=parent.createChild(parentElem);
        Dom.unwrap(child).addDefaultChildren();
        parent.getContainers().add((Container)child);
        return child;
      }
    }
,configLoader);
  }
  Method m=getMatchingGetterMethod(configLoader,configExtensionType);
  if (m != null) {
    try {
      return (U)m.invoke(configLoader);
    }
 catch (    Exception ex) {
      LOG.log(Level.SEVERE,"String_Node_Str",ex);
      return null;
    }
  }
 else {
    return configLoader.getExtensionByType(configExtensionType);
  }
}
Program: 29712
Project: 29712
Buggy source:
public void run(org.jvnet.hk2.config.ConfigParser parser){
  if (snippetUrl != null) {
    try {
      DomDocument newElement=parser.parse(snippetUrl,doc,Dom.unwrap(loader));
    }
 catch (    Exception e) {
      e.printStackTrace();
    }
  }
}

Fixed version (ground truth):
public void run(org.jvnet.hk2.config.ConfigParser parser){
  if (snippetUrl != null) {
    try {
      parser.parse(snippetUrl,doc,Dom.unwrap(loader));
    }
 catch (    Exception e) {
      e.printStackTrace();
    }
  }
}
Program: 29713
Project: 29713
Buggy source:
/** 
 * Get the availability-enabled for the bean from sun-ejb-jar.xml. return defaultValue if not found
 */
public boolean getAvailabilityEnabledFromEjbDescriptor(boolean inheritedValue){
  _logger.finest("String_Node_Str");
  IASEjbExtraDescriptors extraDescriptors=_ejbDescriptor.getIASEjbExtraDescriptors();
  if (extraDescriptors == null) {
    return inheritedValue;
  }
  String availabilityEnabledString=extraDescriptors.getAttributeValue(IASEjbExtraDescriptors.AVAILABILITY_ENABLED);
  Boolean bool=this.toBoolean(availabilityEnabledString);
  if (bool == null) {
    return inheritedValue;
  }
 else {
    return bool.booleanValue();
  }
}

Fixed version (ground truth):
/** 
 * Get the availability-enabled for the bean from sun-ejb-jar.xml. return defaultValue if not found
 */
public boolean getAvailabilityEnabledFromEjbDescriptor(boolean inheritedValue){
  _logger.finest("String_Node_Str");
  IASEjbExtraDescriptors extraDescriptors=_ejbDescriptor.getIASEjbExtraDescriptors();
  if (extraDescriptors == null) {
    return inheritedValue;
  }
  String availabilityEnabledString=extraDescriptors.getAttributeValue(IASEjbExtraDescriptors.AVAILABILITY_ENABLED);
  if (availabilityEnabledString == null) {
    return inheritedValue;
  }
 else {
    return toBoolean(availabilityEnabledString);
  }
}
Program: 29714
Project: 29714
Buggy source:
/** 
 * convert the input value to the appropriate Boolean value if input value is null, return null
 */
protected Boolean toBoolean(String value){
  if (value == null)   return null;
  if (value.equalsIgnoreCase("String_Node_Str"))   return Boolean.TRUE;
  if (value.equalsIgnoreCase("String_Node_Str"))   return Boolean.TRUE;
  if (value.equalsIgnoreCase("String_Node_Str"))   return Boolean.TRUE;
  if (value.equalsIgnoreCase("String_Node_Str"))   return Boolean.TRUE;
  return Boolean.FALSE;
}

Fixed version (ground truth):
/** 
 * convert the input value to the appropriate boolean value
 */
private boolean toBoolean(String value){
  if (value.equalsIgnoreCase("String_Node_Str"))   return true;
  if (value.equalsIgnoreCase("String_Node_Str"))   return true;
  if (value.equalsIgnoreCase("String_Node_Str"))   return true;
  if (value.equalsIgnoreCase("String_Node_Str"))   return true;
  return false;
}
Program: 29715
Project: 29715
Buggy source:
/** 
 * Get the availability-enabled for the ejb container from domain.xml. return inherited global availability-enabled if not found
 */
public boolean getEjbContainerAvailabilityEnabledFromConfig(boolean inheritedValue){
  _logger.finest("String_Node_Str");
  EjbContainerAvailability eas=this.getEjbContainerAvailability();
  if (eas == null) {
    _logger.fine("String_Node_Str");
    return inheritedValue;
  }
  String easString=eas.getAvailabilityEnabled();
  Boolean bool=this.toBoolean(easString);
  if (bool == null) {
    return inheritedValue;
  }
 else {
    return bool.booleanValue();
  }
}

Fixed version (ground truth):
/** 
 * Get the availability-enabled for the ejb container from domain.xml. return inherited global availability-enabled if not found
 */
public boolean getEjbContainerAvailabilityEnabledFromConfig(boolean inheritedValue){
  _logger.finest("String_Node_Str");
  EjbContainerAvailability eas=this.getEjbContainerAvailability();
  if (eas == null) {
    _logger.fine("String_Node_Str");
    return inheritedValue;
  }
  String easString=eas.getAvailabilityEnabled();
  if (easString == null) {
    return inheritedValue;
  }
 else {
    return toBoolean(easString);
  }
}
Program: 29716
Project: 29716
Buggy source:
/** 
 * This method creates an Application object from reading the  standard deployment descriptor.
 * @param archive the archive for the application
 */
public Application createApplicationFromStandardDD(ReadableArchive archive,String archiveType) throws IOException, SAXParseException {
  Archivist archivist=archivistFactory.getArchivist(archiveType,null);
  String xmlValidationLevel=dasConfig.getDeployXmlValidation();
  archivist.setXMLValidationLevel(xmlValidationLevel);
  if (xmlValidationLevel.equals("String_Node_Str")) {
    archivist.setXMLValidation(false);
  }
  RootDeploymentDescriptor desc=archivist.readStandardDeploymentDescriptor(archive);
  Application application=null;
  if (desc instanceof Application) {
    application=(Application)desc;
  }
 else   if (desc instanceof BundleDescriptor) {
    BundleDescriptor aBundle=(BundleDescriptor)desc;
    ModuleDescriptor newModule=archivist.createModuleDescriptor(aBundle);
    newModule.setArchiveUri(archive.getURI().getSchemeSpecificPart());
    String moduleName=newModule.getModuleName();
    application=Application.createVirtualApplication(moduleName,newModule);
  }
  return application;
}

Fixed version (ground truth):
/** 
 * This method creates an Application object from reading the  standard deployment descriptor.
 * @param archive the archive for the application
 */
public Application createApplicationFromStandardDD(ReadableArchive archive,String archiveType) throws IOException, SAXParseException {
  Archivist archivist=archivistFactory.getArchivist(archiveType,null);
  String xmlValidationLevel=dasConfig.getDeployXmlValidation();
  archivist.setXMLValidationLevel(xmlValidationLevel);
  if (xmlValidationLevel.equals("String_Node_Str")) {
    archivist.setXMLValidation(false);
  }
  BundleDescriptor desc=archivist.readStandardDeploymentDescriptor(archive);
  Application application=null;
  if (desc instanceof Application) {
    application=(Application)desc;
  }
 else {
    ModuleDescriptor newModule=archivist.createModuleDescriptor(desc);
    newModule.setArchiveUri(archive.getURI().getSchemeSpecificPart());
    String moduleName=newModule.getModuleName();
    application=Application.createVirtualApplication(moduleName,newModule);
  }
  return application;
}
Program: 29717
Project: 29717
Buggy source:
public WLSWebServicesDeploymentDescriptorFile(RootDeploymentDescriptor desc){
  descriptorPath=(((WebServicesDescriptor)desc).getBundleDescriptor().getModuleType().equals(DOLUtils.warType())) ? WLDescriptorConstants.WL_WEB_WEBSERVICES_JAR_ENTRY : WLDescriptorConstants.WL_EJB_WEBSERVICES_JAR_ENTRY;
}

Fixed version (ground truth):
public WLSWebServicesDeploymentDescriptorFile(RootDeploymentDescriptor desc){
  if (desc instanceof WebServicesDescriptor) {
    descriptorPath=(((WebServicesDescriptor)desc).getBundleDescriptor().getModuleType().equals(DOLUtils.warType())) ? WLDescriptorConstants.WL_WEB_WEBSERVICES_JAR_ENTRY : WLDescriptorConstants.WL_EJB_WEBSERVICES_JAR_ENTRY;
  }
}
Program: 29719
Project: 29719
Buggy source:
private boolean isRARCL(ClassLoader loader){
  DelegatingClassLoader connectorCL=(DelegatingClassLoader)this.getParent();
  return connectorCL.getDelegates().contains(loader);
}

Fixed version (ground truth):
private boolean isRARCL(ClassLoader loader){
  DelegatingClassLoader connectorCL=(DelegatingClassLoader)this.getParent();
  if (!(loader instanceof DelegatingClassLoader.ClassFinder)) {
    return false;
  }
  return connectorCL.getDelegates().contains((DelegatingClassLoader.ClassFinder)loader);
}
Program: 29720
Project: 29720
Buggy source:
public void visit(int version,int access,String name,String signature,String superName,String[] interfaces){
  this.className=name;
  this.signature=signature;
}

Fixed version (ground truth):
public void visit(int version,int access,String name,String signature,String superName,String[] interfaces){
  this.className=name;
}
Program: 29721
Project: 29721
Buggy source:
public ConnectionDefDescriptor getConnectionDefinitionByCFType(String type,boolean useDefault){
  Iterator it=this.outboundRA.getConnectionDefs().iterator();
  while (it.hasNext()) {
    ConnectionDefDescriptor desc=(ConnectionDefDescriptor)it.next();
    if (type == null) {
      if (useDefault && this.outboundRA.getConnectionDefs().size() == 1)       return desc;
 else       return null;
    }
    if (desc.getConnectionFactoryIntf().equals(type))     return desc;
  }
  return null;
}

Fixed version (ground truth):
public ConnectionDefDescriptor getConnectionDefinitionByCFType(String type,boolean useDefault){
  if (this.outboundRA == null) {
    return null;
  }
  Iterator it=this.outboundRA.getConnectionDefs().iterator();
  while (it.hasNext()) {
    ConnectionDefDescriptor desc=(ConnectionDefDescriptor)it.next();
    if (type == null) {
      if (useDefault && this.outboundRA.getConnectionDefs().size() == 1)       return desc;
 else       return null;
    }
    if (desc.getConnectionFactoryIntf().equals(type))     return desc;
  }
  return null;
}
Program: 29722
Project: 29722
Buggy source:
public int getNumOfSupportedCFs(){
  return outboundRA.getConnectionDefs().size();
}

Fixed version (ground truth):
public int getNumOfSupportedCFs(){
  if (outboundRA == null) {
    return 0;
  }
  return outboundRA.getConnectionDefs().size();
}
Program: 29725
Project: 29725
Buggy source:
private int changeAdminPasswordLocally(String domainDir,String domainName) throws CommandException {
  if (!isLocalHost(programOpts.getHost())) {
    throw new CommandException(strings.get("String_Node_Str"));
  }
  GFLauncher launcher=null;
  try {
    launcher=GFLauncherFactory.getInstance(RuntimeType.DAS);
    GFLauncherInfo info=launcher.getInfo();
    info.setDomainName(domainName);
    info.setDomainParentDir(domainDir);
    launcher.setup();
    if (launcher.isSecureAdminEnabled()) {
      String newPassword=(String)passwords.get(newpwName);
      if ((newPassword == null) || (newPassword.isEmpty())) {
        throw new CommandException(strings.get("String_Node_Str"));
      }
    }
    String adminKeyFile=launcher.getAdminRealmKeyFile();
    if (adminKeyFile != null) {
      FileRealmHelper helper=new FileRealmHelper(adminKeyFile);
      String[] groups=helper.authenticate(programOpts.getUser(),((String)passwords.get(oldpwName)).toCharArray());
      if (groups == null) {
        throw new CommandException(strings.get("String_Node_Str",programOpts.getUser()));
      }
      helper.updateUser(programOpts.getUser(),programOpts.getUser(),((String)passwords.get(newpwName)).toCharArray(),null);
      helper.persist();
      return SUCCESS;
    }
 else {
      throw new CommandException(strings.get("String_Node_Str"));
    }
  }
 catch (  MiniXmlParserException ex) {
    throw new CommandException(ex);
  }
catch (  GFLauncherException ex) {
    throw new CommandException(ex);
  }
catch (  IOException ex) {
    throw new CommandException(ex);
  }
}

Fixed version (ground truth):
private int changeAdminPasswordLocally(String domainDir,String domainName) throws CommandException {
  if (!isLocalHost(programOpts.getHost())) {
    throw new CommandException(strings.get("String_Node_Str"));
  }
  GFLauncher launcher=null;
  try {
    launcher=GFLauncherFactory.getInstance(RuntimeType.DAS);
    GFLauncherInfo info=launcher.getInfo();
    info.setDomainName(domainName);
    info.setDomainParentDir(domainDir);
    launcher.setup();
    if (launcher.isSecureAdminEnabled()) {
      if ((newpassword == null) || (newpassword.isEmpty())) {
        throw new CommandException(strings.get("String_Node_Str"));
      }
    }
    String adminKeyFile=launcher.getAdminRealmKeyFile();
    if (adminKeyFile != null) {
      FileRealmHelper helper=new FileRealmHelper(adminKeyFile);
      String[] groups=helper.authenticate(programOpts.getUser(),password.toCharArray());
      if (groups == null) {
        throw new CommandException(strings.get("String_Node_Str",programOpts.getUser()));
      }
      helper.updateUser(programOpts.getUser(),programOpts.getUser(),newpassword.toCharArray(),null);
      helper.persist();
      return SUCCESS;
    }
 else {
      throw new CommandException(strings.get("String_Node_Str"));
    }
  }
 catch (  MiniXmlParserException ex) {
    throw new CommandException(ex);
  }
catch (  GFLauncherException ex) {
    throw new CommandException(ex);
  }
catch (  IOException ex) {
    throw new CommandException(ex);
  }
}
Program: 29726
Project: 29726
Buggy source:
/** 
 * Require the user to actually type the passwords unless they are in the file specified by the --passwordfile option.
 */
@Override protected void validate() throws CommandException, CommandValidationException {
  setDomainName(userArgDomainName);
  super.validate();
  if (programOpts.getUser() == null) {
    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       programOpts.setUser(SystemPropertyConstants.DEFAULT_ADMIN_USER);
    }
 else {
      throw new CommandValidationException(strings.get("String_Node_Str"));
    }
  }
  try {
    String password=getPasswords();
    programOpts.setPassword(password,ProgramOptions.PasswordLocation.USER);
  }
 catch (  CommandValidationException cve) {
    throw new CommandException(cve);
  }
  params=new ParameterMap();
  params.set("String_Node_Str",programOpts.getUser());
  params.set(oldpwName,passwords.get(oldpwName));
  params.set(newpwName,passwords.get(newpwName));
}

Fixed version (ground truth):
/** 
 * Require the user to actually type the passwords unless they are in the file specified by the --passwordfile option.
 */
@Override protected void validate() throws CommandException, CommandValidationException {
  setDomainName(userArgDomainName);
  super.validate();
  if (programOpts.getUser() == null) {
    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       programOpts.setUser(SystemPropertyConstants.DEFAULT_ADMIN_USER);
    }
 else {
      throw new CommandValidationException(strings.get("String_Node_Str"));
    }
  }
  if (password == null) {
    password=getPassword("String_Node_Str",strings.get("String_Node_Str"),false);
    if (password == null) {
      throw new CommandValidationException(strings.get("String_Node_Str"));
    }
  }
  if (newpassword == null) {
    newpassword=getPassword("String_Node_Str",strings.get("String_Node_Str"),true);
    if (newpassword == null) {
      throw new CommandValidationException(strings.get("String_Node_Str"));
    }
  }
  params=new ParameterMap();
  params.set("String_Node_Str",programOpts.getUser());
  params.set("String_Node_Str",password);
  params.set("String_Node_Str",newpassword);
}
Program: 29727
Project: 29727
Buggy source:
@Override protected int executeCommand() throws CommandException {
  try {
    HostAndPort adminAddress=getAdminAddress();
    if (isRunning(adminAddress.getHost(),adminAddress.getPort()))     throw new CommandException(strings.get("String_Node_Str",getDomainName(),getDomainRootDir()));
    DomainConfig domainConfig=new DomainConfig(getDomainName(),getDomainsDir().getAbsolutePath());
    PEDomainsManager manager=new PEDomainsManager();
    String mp=super.readFromMasterPasswordFile();
    if (mp == null) {
      mp=passwords.get("String_Node_Str");
      if (mp == null) {
        mp=super.readPassword(strings.get("String_Node_Str"));
      }
    }
    if (mp == null)     throw new CommandException(strings.get("String_Node_Str"));
    if (!super.verifyMasterPassword(mp))     throw new CommandException(strings.get("String_Node_Str"));
    ParamModelData nmpo=new ParamModelData("String_Node_Str",String.class,false,null);
    nmpo.description=strings.get("String_Node_Str");
    nmpo.param._password=true;
    String nmp=super.getPassword(nmpo,null,true);
    if (nmp == null)     throw new CommandException(strings.get("String_Node_Str"));
    domainConfig.put(DomainConfig.K_MASTER_PASSWORD,mp);
    domainConfig.put(DomainConfig.K_NEW_MASTER_PASSWORD,nmp);
    domainConfig.put(DomainConfig.K_SAVE_MASTER_PASSWORD,savemp);
    manager.changeMasterPassword(domainConfig);
    return 0;
  }
 catch (  Exception e) {
    throw new CommandException(e.getMessage(),e);
  }
}

Fixed version (ground truth):
@Override protected int executeCommand() throws CommandException {
  try {
    HostAndPort adminAddress=getAdminAddress();
    if (isRunning(adminAddress.getHost(),adminAddress.getPort()))     throw new CommandException(strings.get("String_Node_Str",getDomainName(),getDomainRootDir()));
    DomainConfig domainConfig=new DomainConfig(getDomainName(),getDomainsDir().getAbsolutePath());
    PEDomainsManager manager=new PEDomainsManager();
    String mp=super.readFromMasterPasswordFile();
    if (mp == null) {
      mp=passwords.get("String_Node_Str");
      if (mp == null) {
        mp=super.readPassword(strings.get("String_Node_Str"));
      }
    }
    if (mp == null)     throw new CommandException(strings.get("String_Node_Str"));
    if (!super.verifyMasterPassword(mp))     throw new CommandException(strings.get("String_Node_Str"));
    String nmp=getPassword("String_Node_Str",strings.get("String_Node_Str"),true);
    if (nmp == null)     throw new CommandException(strings.get("String_Node_Str"));
    domainConfig.put(DomainConfig.K_MASTER_PASSWORD,mp);
    domainConfig.put(DomainConfig.K_NEW_MASTER_PASSWORD,nmp);
    domainConfig.put(DomainConfig.K_SAVE_MASTER_PASSWORD,savemp);
    manager.changeMasterPassword(domainConfig);
    return 0;
  }
 catch (  Exception e) {
    throw new CommandException(e.getMessage(),e);
  }
}
Program: 29729
Project: 29729
Buggy source:
/** 
 * Set the work directory for this Context.
 * @param workDir The new work directory
 */
public void setWorkDir(String workDir){
synchronized (this) {
    this.workDir=workDir;
  }
  if (started) {
    postWorkDirectory();
  }
}

Fixed version (ground truth):
/** 
 * Set the work directory for this Context.
 * @param workDir The new work directory
 */
public void setWorkDir(String workDir){
synchronized (this) {
    this.workDir=workDir;
    if (started) {
      postWorkDirectory();
    }
  }
}
Program: 29730
Project: 29730
Buggy source:
/** 
 * Cast to a StandardContext right away, as it will be needed later.
 * @see org.apache.catalina.Contained#setContainer(org.apache.catalina.Container)
 */
public void setContainer(Container container){
  super.setContainer(container);
  context=(StandardContext)container;
}

Fixed version (ground truth):
/** 
 * Cast to a StandardContext right away, as it will be needed later.
 * @see org.apache.catalina.Contained#setContainer(org.apache.catalina.Container)
 */
public void setContainer(Container container){
  super.setContainer(container);
  if (container instanceof StandardContext) {
    context=(StandardContext)container;
  }
}
Program: 29731
Project: 29731
Buggy source:
public ObjectName preRegister(MBeanServer server,ObjectName name) throws Exception {
  oname=name;
  mserver=server;
  domain=name.getDomain();
  type=name.getKeyProperty("String_Node_Str");
  if (type == null) {
    type=name.getKeyProperty("String_Node_Str");
  }
  String j2eeApp=name.getKeyProperty("String_Node_Str");
  String j2eeServer=name.getKeyProperty("String_Node_Str");
  if (j2eeApp == null) {
    j2eeApp="String_Node_Str";
  }
  if (j2eeServer == null) {
    j2eeServer="String_Node_Str";
  }
  suffix="String_Node_Str" + j2eeApp + "String_Node_Str"+ j2eeServer;
  return name;
}

Fixed version (ground truth):
public ObjectName preRegister(MBeanServer server,ObjectName name) throws Exception {
  oname=name;
  domain=name.getDomain();
  type=name.getKeyProperty("String_Node_Str");
  if (type == null) {
    type=name.getKeyProperty("String_Node_Str");
  }
  String j2eeApp=name.getKeyProperty("String_Node_Str");
  String j2eeServer=name.getKeyProperty("String_Node_Str");
  if (j2eeApp == null) {
    j2eeApp="String_Node_Str";
  }
  if (j2eeServer == null) {
    j2eeServer="String_Node_Str";
  }
  suffix="String_Node_Str" + j2eeApp + "String_Node_Str"+ j2eeServer;
  return name;
}
Program: 29732
Project: 29732
Buggy source:
/** 
 * Delegate a request to add a child Context to our associated Host.
 * @param child The child Context to be added
 */
public void addChild(Container child){
  Context context=(Context)child;
  String contextPath=context.getPath();
  if (contextPath == null)   throw new IllegalArgumentException(sm.getString("String_Node_Str"));
 else   if (!contextPath.equals("String_Node_Str") && !contextPath.startsWith("String_Node_Str"))   throw new IllegalArgumentException(sm.getString("String_Node_Str",contextPath));
  if (host.findChild(contextPath) != null)   throw new IllegalStateException(sm.getString("String_Node_Str",contextPath));
  if (this.overrideDocBase != null)   context.setDocBase(this.overrideDocBase);
  if (this.overrideConfigFile != null)   context.setConfigFile(this.overrideConfigFile);
  host.fireContainerEvent(PRE_INSTALL_EVENT,context);
  host.addChild(child);
  host.fireContainerEvent(INSTALL_EVENT,context);
}

Fixed version (ground truth):
/** 
 * Delegate a request to add a child Context to our associated Host.
 * @param child The child Context to be added
 */
public void addChild(Container child){
  Context context=null;
  String contextPath=null;
  if (child instanceof Context) {
    context=(Context)child;
    contextPath=context.getPath();
  }
  if (contextPath == null)   throw new IllegalArgumentException(sm.getString("String_Node_Str"));
 else   if (!contextPath.equals("String_Node_Str") && !contextPath.startsWith("String_Node_Str"))   throw new IllegalArgumentException(sm.getString("String_Node_Str",contextPath));
  if (host.findChild(contextPath) != null)   throw new IllegalStateException(sm.getString("String_Node_Str",contextPath));
  if (this.overrideDocBase != null)   context.setDocBase(this.overrideDocBase);
  if (this.overrideConfigFile != null)   context.setConfigFile(this.overrideConfigFile);
  host.fireContainerEvent(PRE_INSTALL_EVENT,context);
  host.addChild(child);
  host.fireContainerEvent(INSTALL_EVENT,context);
}
Program: 29733
Project: 29733
Buggy source:
/** 
 * Set the <code>Container</code> that handles requests for all <code>Connectors</code> associated with this Service.
 * @param container The new Container
 */
public void setContainer(Container container){
  Container oldContainer=this.container;
  if ((oldContainer != null) && (oldContainer instanceof Engine))   ((Engine)oldContainer).setService(null);
  this.container=container;
  if ((this.container != null) && (this.container instanceof Engine))   ((Engine)this.container).setService(this);
  if (started && (this.container != null) && (this.container instanceof Lifecycle)) {
    try {
      ((Lifecycle)this.container).start();
    }
 catch (    LifecycleException e) {
    }
  }
synchronized (connectorsMonitor) {
    for (int i=0; i < connectors.length; i++)     connectors[i].setContainer(this.container);
  }
  if (started && (oldContainer != null) && (oldContainer instanceof Lifecycle)) {
    try {
      ((Lifecycle)oldContainer).stop();
    }
 catch (    LifecycleException e) {
    }
  }
  support.firePropertyChange("String_Node_Str",oldContainer,this.container);
}

Fixed version (ground truth):
/** 
 * Set the <code>Container</code> that handles requests for all <code>Connectors</code> associated with this Service.
 * @param container The new Container
 */
public void setContainer(Container container){
  Container oldContainer=this.container;
  if ((oldContainer != null) && (oldContainer instanceof Engine))   ((Engine)oldContainer).setService(null);
  this.container=container;
  if (this.container instanceof Engine)   ((Engine)this.container).setService(this);
  if (started && (this.container != null) && (this.container instanceof Lifecycle)) {
    try {
      ((Lifecycle)this.container).start();
    }
 catch (    LifecycleException e) {
    }
  }
synchronized (connectorsMonitor) {
    for (int i=0; i < connectors.length; i++)     connectors[i].setContainer(this.container);
  }
  if (started && (oldContainer != null) && (oldContainer instanceof Lifecycle)) {
    try {
      ((Lifecycle)oldContainer).stop();
    }
 catch (    LifecycleException e) {
    }
  }
  support.firePropertyChange("String_Node_Str",oldContainer,this.container);
}
Program: 29734
Project: 29734
Buggy source:
/** 
 * Set the Container with which this Logger has been associated.
 * @param container The associated Container
 */
public void setContainer(Container container){
  if ((this.container != null) && (this.container instanceof Context))   ((Context)this.container).removePropertyChangeListener(this);
  Container oldContainer=this.container;
  this.container=container;
  support.firePropertyChange("String_Node_Str",oldContainer,this.container);
  if ((this.container != null) && (this.container instanceof Context)) {
    setReloadable(((Context)this.container).getReloadable());
    ((Context)this.container).addPropertyChangeListener(this);
  }
}

Fixed version (ground truth):
/** 
 * Set the Container with which this Logger has been associated.
 * @param container The associated Container
 */
public void setContainer(Container container){
  if ((this.container != null) && (this.container instanceof Context))   ((Context)this.container).removePropertyChangeListener(this);
  Container oldContainer=this.container;
  this.container=container;
  support.firePropertyChange("String_Node_Str",oldContainer,this.container);
  if (this.container instanceof Context) {
    setReloadable(((Context)this.container).getReloadable());
    ((Context)this.container).addPropertyChangeListener(this);
  }
}
Program: 29735
Project: 29735
Buggy source:
/** 
 * Check if sendfile can be used.
 */
protected boolean checkSendfile(HttpServletRequest request,HttpServletResponse response,CacheEntry entry,long length,Range range){
  if ((sendfileSize > 0) && (entry.resource != null) && ((length > sendfileSize) || (entry.resource.getContent() == null))&& (entry.attributes.getCanonicalPath() != null)&& (Boolean.TRUE == request.getAttribute("String_Node_Str"))&& (request.getClass().getName().equals("String_Node_Str"))&& (response.getClass().getName().equals("String_Node_Str"))) {
    request.setAttribute("String_Node_Str",entry.attributes.getCanonicalPath());
    if (range == null) {
      request.setAttribute("String_Node_Str",Long.valueOf(0L));
      request.setAttribute("String_Node_Str",Long.valueOf(length));
    }
 else {
      request.setAttribute("String_Node_Str",Long.valueOf(range.start));
      request.setAttribute("String_Node_Str",Long.valueOf(range.end + 1));
    }
    request.setAttribute("String_Node_Str",this);
    return true;
  }
 else {
    return false;
  }
}

Fixed version (ground truth):
/** 
 * Check if sendfile can be used.
 */
protected boolean checkSendfile(HttpServletRequest request,HttpServletResponse response,CacheEntry entry,long length,Range range){
  if ((sendfileSize > 0) && (entry.resource != null) && ((length > sendfileSize) || (entry.resource.getContent() == null))&& (entry.attributes.getCanonicalPath() != null)&& (Boolean.TRUE.equals(request.getAttribute("String_Node_Str")))&& (request.getClass().getName().equals("String_Node_Str"))&& (response.getClass().getName().equals("String_Node_Str"))) {
    request.setAttribute("String_Node_Str",entry.attributes.getCanonicalPath());
    if (range == null) {
      request.setAttribute("String_Node_Str",Long.valueOf(0L));
      request.setAttribute("String_Node_Str",Long.valueOf(length));
    }
 else {
      request.setAttribute("String_Node_Str",Long.valueOf(range.start));
      request.setAttribute("String_Node_Str",Long.valueOf(range.end + 1));
    }
    request.setAttribute("String_Node_Str",this);
    return true;
  }
 else {
    return false;
  }
}
Program: 29736
Project: 29736
Buggy source:
public SSIMediator(SSIExternalResolver ssiExternalResolver,long lastModifiedDate,int debug){
  this.ssiExternalResolver=ssiExternalResolver;
  this.lastModifiedDate=lastModifiedDate;
  this.debug=debug;
  setConfigTimeFmt(DEFAULT_CONFIG_TIME_FMT,true);
}

Fixed version (ground truth):
public SSIMediator(SSIExternalResolver ssiExternalResolver,long lastModifiedDate,int debug){
  this.ssiExternalResolver=ssiExternalResolver;
  this.lastModifiedDate=lastModifiedDate;
  setConfigTimeFmt(DEFAULT_CONFIG_TIME_FMT,true);
}
Program: 29738
Project: 29738
Buggy source:
/** 
 * Construct an instance of this <code>RuleSet</code> with the specified matching pattern prefix.
 * @param prefix Prefix for matching pattern rules (including thetrailing slash character)
 */
public ContextRuleSet(String prefix,boolean create){
  super();
  this.namespaceURI=null;
  this.prefix=prefix;
  this.create=create;
}

Fixed version (ground truth):
/** 
 * Construct an instance of this <code>RuleSet</code> with the specified matching pattern prefix.
 * @param prefix Prefix for matching pattern rules (including thetrailing slash character)
 */
public ContextRuleSet(String prefix,boolean create){
  super();
  this.prefix=prefix;
  this.create=create;
}
Program: 29739
Project: 29739
Buggy source:
/** 
 * Resolve the requested external entity.
 * @param publicId The public identifier of the entity being referenced
 * @param systemId The system identifier of the entity being referenced
 * @exception SAXException if a parsing exception occurs
 */
public InputSource resolveEntity(String publicId,String systemId) throws SAXException {
  if (publicId != null) {
    this.publicId=publicId;
    digester.setPublicId(publicId);
  }
  String entityURL=null;
  if (publicId != null) {
    entityURL=entityValidator.get(publicId);
  }
  String key=null;
  if (entityURL == null && systemId != null) {
    key=systemId.substring(systemId.lastIndexOf('/') + 1);
    entityURL=entityValidator.get(key);
  }
  if (entityURL == null) {
    if (forceLocalSchema) {
      URI u;
      try {
        u=new URI(systemId);
      }
 catch (      URISyntaxException e) {
        throw new SAXException(e);
      }
      String scheme=u.getScheme();
      if (scheme != null && (scheme.equals("String_Node_Str") || scheme.equals("String_Node_Str"))) {
        return (null);
      }
 else {
        throw new SAXException("String_Node_Str" + key);
      }
    }
 else {
      return (null);
    }
  }
  try {
    return (new InputSource(entityURL));
  }
 catch (  Exception e) {
    throw new SAXException(e);
  }
}

Fixed version (ground truth):
/** 
 * Resolve the requested external entity.
 * @param publicId The public identifier of the entity being referenced
 * @param systemId The system identifier of the entity being referenced
 * @exception SAXException if a parsing exception occurs
 */
public InputSource resolveEntity(String publicId,String systemId) throws SAXException {
  if (publicId != null) {
    digester.setPublicId(publicId);
  }
  String entityURL=null;
  if (publicId != null) {
    entityURL=entityValidator.get(publicId);
  }
  String key=null;
  if (entityURL == null && systemId != null) {
    key=systemId.substring(systemId.lastIndexOf('/') + 1);
    entityURL=entityValidator.get(key);
  }
  if (entityURL == null) {
    if (forceLocalSchema) {
      URI u;
      try {
        u=new URI(systemId);
      }
 catch (      URISyntaxException e) {
        throw new SAXException(e);
      }
      String scheme=u.getScheme();
      if (scheme != null && (scheme.equals("String_Node_Str") || scheme.equals("String_Node_Str"))) {
        return (null);
      }
 else {
        throw new SAXException("String_Node_Str" + key);
      }
    }
 else {
      return (null);
    }
  }
  try {
    return (new InputSource(entityURL));
  }
 catch (  Exception e) {
    throw new SAXException(e);
  }
}
Program: 29743
Project: 29743
Buggy source:
static public URI getStaticURI(){
  if (uri == null) {
    try {
      uri=new URI(COOKIE_URI);
    }
 catch (    URISyntaxException e) {
    }
  }
  return uri;
}

Fixed version (ground truth):
public URI getStaticURI(){
  if (uri == null) {
    try {
      uri=new URI(COOKIE_URI);
    }
 catch (    URISyntaxException e) {
    }
  }
  return uri;
}
Program: 29744
Project: 29744
Buggy source:
private void addCookieHeaders(final URLConnection urlConnection){
  long modifiedTime=sessionCache.lastModified();
  if (modifiedTime == 0) {
    return;
  }
  ((CookieManager)CookieHandler.getDefault()).getCookieStore().removeAll();
  cookieManager=new CookieManager(new ClientCookieStore(new CookieManager().getCookieStore(),sessionCache),CookiePolicy.ACCEPT_ALL);
  try {
    ((ClientCookieStore)cookieManager.getCookieStore()).load();
  }
 catch (  IOException e) {
    logger.fine("String_Node_Str" + e.toString());
    return;
  }
  if (isSessionCookieExpired(cookieManager,modifiedTime)) {
    logger.fine("String_Node_Str");
    sessionCache.delete();
    return;
  }
  StringBuilder sb=new StringBuilder("String_Node_Str");
  boolean hasCookies=false;
  for (  HttpCookie cookie : cookieManager.getCookieStore().getCookies()) {
    hasCookies=true;
    sb.append("String_Node_Str").append(cookie.toString());
  }
  if (hasCookies) {
    urlConnection.setRequestProperty(COOKIE_HEADER,sb.toString());
  }
}

Fixed version (ground truth):
private void addCookieHeaders(final URLConnection urlConnection){
  long modifiedTime=sessionCache.lastModified();
  if (modifiedTime == 0) {
    return;
  }
  ((CookieManager)CookieHandler.getDefault()).getCookieStore().removeAll();
  cookieManager=new CookieManager(new ClientCookieStore(new CookieManager().getCookieStore(),sessionCache),CookiePolicy.ACCEPT_ALL);
  try {
    ((ClientCookieStore)cookieManager.getCookieStore()).load();
  }
 catch (  IOException e) {
    logger.fine("String_Node_Str" + e.toString());
    return;
  }
  if (isSessionCookieExpired(cookieManager,modifiedTime)) {
    logger.fine("String_Node_Str");
    if (!sessionCache.delete()) {
      logger.fine("String_Node_Str");
    }
    return;
  }
  StringBuilder sb=new StringBuilder("String_Node_Str");
  boolean hasCookies=false;
  for (  HttpCookie cookie : cookieManager.getCookieStore().getCookies()) {
    hasCookies=true;
    sb.append("String_Node_Str").append(cookie.toString());
  }
  if (hasCookies) {
    urlConnection.setRequestProperty(COOKIE_HEADER,sb.toString());
  }
}
Program: 29747
Project: 29747
Buggy source:
/** 
 * Delete the specified directory, including all of its contents and subdirectories recursively.
 * @param dir File object representing the directory to be deleted
 */
protected void deleteDir(File dir){
  String files[]=dir.list();
  if (files == null) {
    files=new String[0];
  }
  for (int i=0; i < files.length; i++) {
    File file=new File(dir,files[i]);
    if (file.isDirectory()) {
      deleteDir(file);
    }
 else {
      file.delete();
    }
  }
  dir.delete();
}

Fixed version (ground truth):
/** 
 * Delete the specified directory, including all of its contents and subdirectories recursively.
 * @param dir File object representing the directory to be deleted
 */
protected void deleteDir(File dir){
  String files[]=dir.list();
  if (files == null) {
    files=new String[0];
  }
  for (int i=0; i < files.length; i++) {
    File file=new File(dir,files[i]);
    if (file.isDirectory()) {
      deleteDir(file);
    }
 else {
      deleteFile(file);
    }
  }
  deleteFile(dir);
}
Program: 29748
Project: 29748
Buggy source:
public void removeValues(String[] values){
  this.values.remove(Arrays.asList(values));
}

Fixed version (ground truth):
public void removeValues(String[] values){
  this.values.removeAll(Arrays.asList(values));
}
Program: 29749
Project: 29749
Buggy source:
/** 
 * This method checks if the request has a Cookie header and if the instance name serving the request is the same as the jvmRoute information
 * @param req Request to examine the Cookie header
 * @return true if the Cookie header is set and the jvmRoute information is correct
 */
public boolean hasCookieHeaders(Request req){
  for (  String header : req.getHeaders("String_Node_Str")) {
    if (header.contains(SESSION_COOKIE_NAME) && (header.substring(header.lastIndexOf("String_Node_Str") + 1).equals(server.getName()))) {
      return true;
    }
  }
  return false;
}

Fixed version (ground truth):
/** 
 * This method checks if the request has a Cookie header and if the instance name serving the request is the same as the jvmRoute information
 * @param req Request to examine the Cookie header
 * @return true if the Cookie header is set and the jvmRoute information is correct
 */
public boolean hasCookieHeaders(Request req){
  for (  String header : req.getHeaders("String_Node_Str")) {
    int index=header.lastIndexOf('"');
    if (header.contains(SESSION_COOKIE_NAME) && (header.substring((index + 1),header.indexOf(';') - 1).equals(server.getName()))) {
      return true;
    }
  }
  return false;
}
Program: 29750
Project: 29750
Buggy source:
/** 
 * Set the work directory for this Context.
 * @param workDir The new work directory
 */
public void setWorkDir(String workDir){
  this.workDir=workDir;
  if (started) {
    postWorkDirectory();
  }
}

Fixed version (ground truth):
/** 
 * Set the work directory for this Context.
 * @param workDir The new work directory
 */
public void setWorkDir(String workDir){
synchronized (this) {
    this.workDir=workDir;
  }
  if (started) {
    postWorkDirectory();
  }
}
Program: 29751
Project: 29751
Buggy source:
/** 
 * Set the document root for this Context.  This can be an absolute pathname, a relative pathname, or a URL.
 * @param docBase The new document root
 */
@Override public void setDocBase(String docBase){
  this.docBase=docBase;
}

Fixed version (ground truth):
/** 
 * Set the document root for this Context.  This can be an absolute pathname, a relative pathname, or a URL.
 * @param docBase The new document root
 */
@Override public void setDocBase(String docBase){
synchronized (this) {
    this.docBase=docBase;
  }
}
Program: 29752
Project: 29752
Buggy source:
/** 
 * Sets a new pipeline
 */
public void restrictedSetPipeline(Pipeline pl){
  pl.setBasic(new StandardContextValve());
  pipeline=pl;
  hasCustomPipeline=true;
}

Fixed version (ground truth):
/** 
 * Sets a new pipeline
 */
public void restrictedSetPipeline(Pipeline pl){
synchronized (this) {
    pl.setBasic(new StandardContextValve());
    pipeline=pl;
    hasCustomPipeline=true;
  }
}
Program: 29753
Project: 29753
Buggy source:
/** 
 * Returns true if the internal naming support is used.
 */
public boolean isUseNaming(){
  return useNaming;
}

Fixed version (ground truth):
/** 
 * Returns true if the internal naming support is used.
 */
public boolean isUseNaming(){
synchronized (this) {
    return useNaming;
  }
}
Program: 29755
Project: 29755
Buggy source:
/** 
 * <p>Set the Valve instance that has been distinguished as the basic Valve for this Pipeline (if any).  Prior to setting the basic Valve, the Valve's <code>setContainer()</code> will be called, if it implements <code>Contained</code>, with the owning Container as an argument.  The method may throw an <code>IllegalArgumentException</code> if this Valve chooses not to be associated with this Container, or <code>IllegalStateException</code> if it is already associated with a different Container.</p>
 * @param valve Valve to be distinguished as the basic Valve
 */
public void setBasic(GlassFishValve valve){
  GlassFishValve oldBasic=this.basic;
  if (oldBasic == valve) {
    return;
  }
  if (oldBasic != null) {
    if (started && (oldBasic instanceof Lifecycle)) {
      try {
        ((Lifecycle)oldBasic).stop();
      }
 catch (      LifecycleException e) {
        log.log(Level.SEVERE,"String_Node_Str",e);
      }
    }
    if (oldBasic instanceof Contained) {
      try {
        ((Contained)oldBasic).setContainer(null);
      }
 catch (      Throwable t) {
      }
    }
  }
  if (valve == null) {
    return;
  }
  if (valve instanceof Contained) {
    ((Contained)valve).setContainer(this.container);
  }
  if (started && (valve instanceof Lifecycle)) {
    try {
      ((Lifecycle)valve).start();
    }
 catch (    LifecycleException e) {
      log.log(Level.SEVERE,"String_Node_Str",e);
      return;
    }
  }
  this.basic=valve;
}

Fixed version (ground truth):
/** 
 * <p>Set the Valve instance that has been distinguished as the basic Valve for this Pipeline (if any).  Prior to setting the basic Valve, the Valve's <code>setContainer()</code> will be called, if it implements <code>Contained</code>, with the owning Container as an argument.  The method may throw an <code>IllegalArgumentException</code> if this Valve chooses not to be associated with this Container, or <code>IllegalStateException</code> if it is already associated with a different Container.</p>
 * @param valve Valve to be distinguished as the basic Valve
 */
public void setBasic(GlassFishValve valve){
  GlassFishValve oldBasic=null;
synchronized (this) {
    oldBasic=this.basic;
  }
  if (oldBasic == valve) {
    return;
  }
  if (oldBasic != null) {
synchronized (this) {
      if (started && (oldBasic instanceof Lifecycle)) {
        try {
          ((Lifecycle)oldBasic).stop();
        }
 catch (        LifecycleException e) {
          log.log(Level.SEVERE,"String_Node_Str",e);
        }
      }
    }
    if (oldBasic instanceof Contained) {
      try {
        ((Contained)oldBasic).setContainer(null);
      }
 catch (      Throwable t) {
      }
    }
  }
  if (valve == null) {
    return;
  }
  if (valve instanceof Contained) {
    ((Contained)valve).setContainer(this.container);
  }
  if (started && (valve instanceof Lifecycle)) {
    try {
      ((Lifecycle)valve).start();
    }
 catch (    LifecycleException e) {
      log.log(Level.SEVERE,"String_Node_Str",e);
      return;
    }
  }
  this.basic=valve;
}
Program: 29758
Project: 29758
Buggy source:
public static String getURL(String urlstr){
  try {
    URL u=new URL(urlstr);
    URLConnection urlc=u.openConnection();
    BufferedReader ir=new BufferedReader(new InputStreamReader(urlc.getInputStream(),"String_Node_Str"));
    StringWriter ow=new StringWriter();
    String line;
    while ((line=ir.readLine()) != null) {
      ow.write(line);
      ow.write("String_Node_Str");
    }
    ir.close();
    ow.close();
    return ow.getBuffer().toString();
  }
 catch (  IOException ex) {
    System.out.println("String_Node_Str" + urlstr + "String_Node_Str"+ ex.getMessage());
    return "String_Node_Str";
  }
}

Fixed version (ground truth):
public static String getURL(String urlstr){
  StringWriter ow=null;
  BufferedReader ir=null;
  try {
    URL u=new URL(urlstr);
    URLConnection urlc=u.openConnection();
    ir=new BufferedReader(new InputStreamReader(urlc.getInputStream(),"String_Node_Str"));
    try {
      ow=new StringWriter();
      String line;
      while ((line=ir.readLine()) != null) {
        ow.write(line);
        ow.write("String_Node_Str");
      }
      return ow.getBuffer().toString();
    }
  finally {
      if (ow != null) {
        ow.close();
      }
    }
  }
 catch (  IOException ex) {
    System.out.println("String_Node_Str" + urlstr + "String_Node_Str"+ ex.getMessage());
    return "String_Node_Str";
  }
 finally {
    if (ir != null) {
      try {
        ir.close();
      }
 catch (      IOException ex) {
        Logger.getLogger(NucleusTestUtils.class.getName()).log(Level.SEVERE,null,ex);
      }
    }
  }
}