nus-yam/ex-repair huggingface dataset:
Program: 29893
Project: 29893
Buggy source:
protected synchronized List<StorageVol> prepare(final TemplateInstance templateInstance,final String name,final VirtualCluster cluster) throws VirtException, IOException {
}

Fixed version (ground truth):
protected synchronized List<StorageVol> prepare(final TemplateInstance templateInstance,final String name,final VirtualCluster cluster) throws VirtException, IOException {
  final Template template=templateInstance.getConfig();
  execute(new MachineOperations<Object>(){
    @Override public Object run(    FileOperations fileOperations) throws IOException {
      fileOperations.mkdir(config.getDisksLocation());
      fileOperations.delete(config.getDisksLocation() + "String_Node_Str" + name+ "String_Node_Str");
      fileOperations.delete(config.getDisksLocation() + "String_Node_Str" + name+ "String_Node_Str");
      return null;
    }
  }
);
  final File sourceFile=templateInstance.getFileByExtension("String_Node_Str");
  final StoragePool pool=(getStoragePools().get("String_Node_Str") != null ? getStoragePools().get("String_Node_Str") : addStoragePool("String_Node_Str",136112211968L));
  List<StorageVol> volumes=new ArrayList<StorageVol>();
  Future<StorageVol> diskFuture=null;
  final String diskLocation=config.getDisksLocation();
  final Machine target=this;
  try {
    diskFuture=habitat.getComponent(ExecutorService.class).submit(new Callable<StorageVol>(){
      @Override public StorageVol call() throws Exception {
        VMTemplate vmTemplate=getVMTemplateFor(template);
        vmTemplate.copyTo(target,diskLocation);
        for (        StorageVol volume : pool.volumes()) {
          RuntimeContext.logger.info("String_Node_Str" + volume.getName());
        }
        StorageVol volume=pool.byName(name);
        if (volume != null) {
          RuntimeContext.logger.warning("String_Node_Str" + name + "String_Node_Str");
          volume.delete();
        }
        volume=pool.allocate(name,vmTemplate.getSize());
        execute(new MachineOperations<Object>(){
          @Override public Object run(          FileOperations fileOperations) throws IOException {
            fileOperations.delete(diskLocation + "String_Node_Str" + name+ "String_Node_Str");
            fileOperations.mv(diskLocation + "String_Node_Str" + sourceFile.getName(),diskLocation + "String_Node_Str" + name+ "String_Node_Str");
            return null;
          }
        }
);
        return volume;
      }
    }
);
  }
 catch (  Exception e) {
    e.printStackTrace();
    for (    StorageVol vol : volumes) {
      try {
        vol.delete();
      }
 catch (      Exception ex) {
        ex.printStackTrace();
      }
    }
    throw new VirtException(e);
  }
  try {
    volumes.add(0,diskFuture.get());
  }
 catch (  Exception e) {
    e.printStackTrace();
    try {
      List<StorageVol> copy=new ArrayList<StorageVol>();
      for (      StorageVol volume : pool.volumes()) {
        copy.add(volume);
      }
      for (      StorageVol volume : copy) {
        volume.delete();
      }
    }
 catch (    Exception ex) {
      ex.printStackTrace();
    }
    throw new VirtException(e);
  }
  return volumes;
}
Program: 29894
Project: 29894
Buggy source:
@Override public void run(){
  try {
    localTemplate.copyTo(AbstractMachine.this,getConfig().getTemplatesLocation());
  }
 catch (  Exception e) {
    RuntimeContext.logger.log(Level.SEVERE,e.getMessage(),e);
  }
  RemoteTemplate remoteTemplate=new RemoteTemplate(AbstractMachine.this,template);
  installedTemplates.put(template.getConfig().getName(),remoteTemplate);
  TemplateCaching.register(remoteTemplate);
}

Fixed version (ground truth):
@Override public Object run(FileOperations fileOperations) throws IOException {
  fileOperations.delete(diskLocation + "String_Node_Str" + name+ "String_Node_Str");
  fileOperations.mv(diskLocation + "String_Node_Str" + sourceFile.getName(),diskLocation + "String_Node_Str" + name+ "String_Node_Str");
  return null;
}
Program: 29896
Project: 29896
Buggy source:
@Override public Collection<? extends VirtualMachine> getVMs() throws VirtException {
  try {
    VirtualBoxManager mgr=ConnectionManager.connection(getIpAddress());
    List<IMachine> machs=mgr.getVBox().getMachines();
    for (    IMachine m : machs) {
      try {
        String domainName=m.getName();
        String type=m.getOSTypeId();
        if (!domains.containsKey(domainName)) {
          for (          Cluster cluster : domain.getClusters().getCluster()) {
            for (            VirtualMachineConfig vmc : cluster.getExtensionsByType(VirtualMachineConfig.class)) {
              if (vmc.getName().equals(domainName)) {
                VBoxVirtualMachine gfVM=new VBoxVirtualMachine(vmc,vmc.getTemplate().getUser(),this,domainName);
                domains.put(domainName,gfVM);
              }
            }
          }
        }
      }
 catch (      Exception e) {
      }
    }
    mgr.disconnect();
    mgr.cleanup();
  }
 catch (  Exception e) {
    RuntimeContext.logger.log(Level.SEVERE,"String_Node_Str",e);
    throw new VirtException(e);
  }
  return domains.values();
}

Fixed version (ground truth):
@Override public Collection<? extends VirtualMachine> getVMs() throws VirtException {
  try {
    VirtualBoxManager mgr=ConnectionManager.connection(getIpAddress());
    List<IMachine> machs=mgr.getVBox().getMachines();
    for (    IMachine m : machs) {
      try {
        String domainName=m.getName();
        if (!domains.containsKey(domainName)) {
          for (          Cluster cluster : domain.getClusters().getCluster()) {
            for (            VirtualMachineConfig vmc : cluster.getExtensionsByType(VirtualMachineConfig.class)) {
              if (vmc.getName().equals(domainName)) {
                VBoxVirtualMachine gfVM=new VBoxVirtualMachine(vmc,vmc.getTemplate().getUser(),this,domainName);
                domains.put(domainName,gfVM);
              }
            }
          }
        }
      }
 catch (      Exception e) {
      }
    }
    mgr.disconnect();
    mgr.cleanup();
  }
 catch (  Exception e) {
    RuntimeContext.logger.log(Level.SEVERE,"String_Node_Str",e);
    throw new VirtException(e);
  }
  return domains.values();
}
Program: 29898
Project: 29898
Buggy source:
@Override public boolean isUp(){
  if (State.READY.equals(getState()))   return true;
  if (ipAddress == null)   return false;
  try {
    ping();
  }
 catch (  Exception e) {
    RuntimeContext.logger.log(Level.SEVERE,"String_Node_Str" + config.getName() + "String_Node_Str"+ e.getMessage());
    RuntimeContext.logger.log(Level.FINE,"String_Node_Str" + config.getName(),e);
    return false;
  }
  try {
    connection();
  }
 catch (  VirtException e) {
    RuntimeContext.logger.log(Level.SEVERE,"String_Node_Str" + config.getName() + "String_Node_Str"+ serverPool.getConfig().getUser().getName(),e);
    return false;
  }
  return true;
}

Fixed version (ground truth):
@Override public boolean isUp(){
  if (State.READY.equals(getState()))   return true;
  if (getIpAddress() == null)   return false;
  try {
    ping();
  }
 catch (  Exception e) {
    RuntimeContext.logger.log(Level.SEVERE,"String_Node_Str" + config.getName() + "String_Node_Str"+ e.getMessage());
    RuntimeContext.logger.log(Level.FINE,"String_Node_Str" + config.getName(),e);
    return false;
  }
  try {
    connection();
  }
 catch (  VirtException e) {
    RuntimeContext.logger.log(Level.SEVERE,"String_Node_Str" + config.getName() + "String_Node_Str"+ serverPool.getConfig().getUser().getName(),e);
    return false;
  }
  return true;
}
Program: 29899
Project: 29899
Buggy source:
/** 
 * Used to parse log line based on starting sequence, ending sequence and delimiter.
 * @param line
 * @return
 */
private ServiceLogRecord parse(String line){
  ServiceLogRecord record=new ServiceLogRecord(level,"String_Node_Str");
  if (startSequence != null || !startSequence.trim().equals("String_Node_Str"))   line=line.substring(startSequence.length());
  if (endSequence != null || !endSequence.trim().equals("String_Node_Str"))   line=line.substring(0,line.indexOf(endSequence));
  StringTokenizer tokenizer=new StringTokenizer(line,delimiter);
  for (int i=0; tokenizer.hasMoreTokens(); i++) {
    String nextToken=tokenizer.nextToken();
    set(parameters[i],nextToken,record);
  }
  return record;
}

Fixed version (ground truth):
/** 
 * Used to parse log line based on starting sequence, ending sequence and delimiter.
 * @param line
 * @return
 */
private ServiceLogRecord parse(String line){
  ServiceLogRecord record=new ServiceLogRecord(level,"String_Node_Str");
  if (startSequence != null && !startSequence.trim().equals("String_Node_Str"))   line=line.substring(startSequence.length());
  if (endSequence != null && !endSequence.trim().equals("String_Node_Str"))   line=line.substring(0,line.indexOf(endSequence));
  StringTokenizer tokenizer=new StringTokenizer(line,delimiter);
  for (int i=0; tokenizer.hasMoreTokens(); i++) {
    String nextToken=tokenizer.nextToken();
    set(parameters[i],nextToken,record);
  }
  return record;
}
Program: 29900
Project: 29900
Buggy source:
private int bootstrapSecureAdminFiles() throws CommandException {
  RemoteCommand rc=new RemoteCommand("String_Node_Str",this.programOpts,this.env);
  rc.setFileOutputDirectory(instanceDir);
  logger.finest("String_Node_Str" + instanceDir.getAbsolutePath());
  final int result=rc.execute(new String[]{"String_Node_Str"});
  return result;
}

Fixed version (ground truth):
private int bootstrapSecureAdminFiles() throws CommandException {
  RemoteCommand rc=new RemoteCommand("String_Node_Str",this.programOpts,this.env);
  rc.setFileOutputDirectory(instanceDir);
  final int result=rc.execute(new String[]{"String_Node_Str"});
  return result;
}
Program: 29902
Project: 29902
Buggy source:
public String getApplicationId(){
  if (applicationId != null)   return applicationId;
  Container container=manager.getContainer();
  StringBuffer sb=new StringBuffer(50);
  sb.append(this.getClusterId());
  ArrayList list=new ArrayList();
  while (container != null) {
    if (container.getName() != null) {
      list.add("String_Node_Str" + container.getName());
    }
    container=container.getParent();
  }
  for (int i=(list.size() - 1); i > -1; i--) {
    String nextString=(String)list.get(i);
    sb.append(nextString);
  }
  applicationId=sb.toString();
  return applicationId;
}

Fixed version (ground truth):
public String getApplicationId(){
  if (applicationId != null)   return applicationId;
  Container container=manager.getContainer();
  StringBuffer sb=new StringBuffer(50);
  sb.append(this.getClusterId());
  List<String> list=new ArrayList<String>();
  while (container != null) {
    if (container.getName() != null) {
      list.add("String_Node_Str" + container.getName());
    }
    container=container.getParent();
  }
  for (int i=(list.size() - 1); i > -1; i--) {
    String nextString=(String)list.get(i);
    sb.append(nextString);
  }
  applicationId=sb.toString();
  return applicationId;
}
Program: 29903
Project: 29903
Buggy source:
/** 
 * return an ArrayList of Strings whose elements are the names of the added attributes
 */
public ArrayList getAddedAttributes(){
  ArrayList resultList=new ArrayList();
  Set entries=_attributeStates.entrySet();
  Iterator it=entries.iterator();
  while (it.hasNext()) {
    Map.Entry entry=(Map.Entry)it.next();
    SessionAttributeState nextAttrState=(SessionAttributeState)entry.getValue();
    String nextAttrName=(String)entry.getKey();
    if (!nextAttrState.isPersistent() && !nextAttrState.isDirty()) {
      resultList.add(nextAttrName);
    }
  }
  return resultList;
}

Fixed version (ground truth):
/** 
 * return an ArrayList of Strings whose elements are the names of the added attributes
 */
public List<String> getAddedAttributes(){
  List<String> resultList=new ArrayList<String>();
  for (  Map.Entry<String,SessionAttributeState> entry : _attributeStates.entrySet()) {
    SessionAttributeState nextAttrState=entry.getValue();
    String nextAttrName=entry.getKey();
    if (!nextAttrState.isPersistent() && !nextAttrState.isDirty()) {
      resultList.add(nextAttrName);
    }
  }
  return resultList;
}
Program: 29904
Project: 29904
Buggy source:
/** 
 * return an ArrayList of Strings whose elements are the names of the added attributes
 */
public ArrayList getAddedAttributesPrevious(){
  ArrayList resultList=new ArrayList();
  Set entries=_attributeStates.entrySet();
  Iterator it=entries.iterator();
  while (it.hasNext()) {
    Map.Entry entry=(Map.Entry)it.next();
    SessionAttributeState nextAttrState=(SessionAttributeState)entry.getValue();
    String nextAttrName=(String)entry.getKey();
    if (!nextAttrState.isPersistent()) {
      resultList.add(nextAttrName);
    }
  }
  return resultList;
}

Fixed version (ground truth):
/** 
 * return an ArrayList of Strings whose elements are the names of the added attributes
 */
public List<String> getAddedAttributesPrevious(){
  List<String> resultList=new ArrayList<String>();
  for (  Map.Entry<String,SessionAttributeState> entry : _attributeStates.entrySet()) {
    SessionAttributeState nextAttrState=entry.getValue();
    String nextAttrName=entry.getKey();
    if (!nextAttrState.isPersistent()) {
      resultList.add(nextAttrName);
    }
  }
  return resultList;
}
Program: 29905
Project: 29905
Buggy source:
Enumeration privateGetAttributeList(){
  return (new Enumerator(new ArrayList(attributes.keySet())));
}

Fixed version (ground truth):
Enumeration<String> privateGetAttributeList(){
  return (new Enumerator<String>(new ArrayList<String>(attributes.keySet())));
}
Program: 29906
Project: 29906
Buggy source:
/** 
 * set the SessionAttributeState for attributeName based on persistent value
 * @param attributeName
 * @param persistent
 */
void setAttributeStatePersistent(String attributeName,boolean persistent){
  SessionAttributeState attrState=(SessionAttributeState)_attributeStates.get(attributeName);
  if (attrState == null) {
    attrState=new SessionAttributeState();
    attrState.setPersistent(persistent);
    _attributeStates.put(attributeName,attrState);
  }
 else {
    attrState.setPersistent(persistent);
  }
}

Fixed version (ground truth):
/** 
 * set the SessionAttributeState for attributeName based on persistent value
 * @param attributeName
 * @param persistent
 */
void setAttributeStatePersistent(String attributeName,boolean persistent){
  SessionAttributeState attrState=_attributeStates.get(attributeName);
  if (attrState == null) {
    attrState=new SessionAttributeState();
    attrState.setPersistent(persistent);
    _attributeStates.put(attributeName,attrState);
  }
 else {
    attrState.setPersistent(persistent);
  }
}
Program: 29907
Project: 29907
Buggy source:
/** 
 * Creates a new instance of ModifiedAttributeHASession 
 */
public ModifiedAttributeHASession(Manager manager){
  super(manager);
  _attributeStates=new HashMap();
}

Fixed version (ground truth):
/** 
 * Creates a new instance of ModifiedAttributeHASession 
 */
public ModifiedAttributeHASession(Manager manager){
  super(manager);
}
Program: 29908
Project: 29908
Buggy source:
/** 
 * return an ArrayList of Strings whose elements are the names of the deleted attributes
 */
public ArrayList getDeletedAttributes(){
  ArrayList resultList=new ArrayList();
  Set entries=_attributeStates.entrySet();
  Iterator it=entries.iterator();
  while (it.hasNext()) {
    Map.Entry entry=(Map.Entry)it.next();
    SessionAttributeState nextAttrState=(SessionAttributeState)entry.getValue();
    String nextAttrName=(String)entry.getKey();
    if (nextAttrState.isDeleted() && nextAttrState.isPersistent()) {
      resultList.add(nextAttrName);
    }
  }
  return resultList;
}

Fixed version (ground truth):
/** 
 * return an ArrayList of Strings whose elements are the names of the deleted attributes
 */
public List<String> getDeletedAttributes(){
  List<String> resultList=new ArrayList<String>();
  for (  Map.Entry<String,SessionAttributeState> entry : _attributeStates.entrySet()) {
    SessionAttributeState nextAttrState=entry.getValue();
    String nextAttrName=entry.getKey();
    if (nextAttrState.isDeleted() && nextAttrState.isPersistent()) {
      resultList.add(nextAttrName);
    }
  }
  return resultList;
}
Program: 29909
Project: 29909
Buggy source:
/** 
 * return the SessionAttributeState for attributeName
 * @param attributeName
 */
SessionAttributeState getAttributeState(String attributeName){
  return (SessionAttributeState)_attributeStates.get(attributeName);
}

Fixed version (ground truth):
/** 
 * return the SessionAttributeState for attributeName
 * @param attributeName
 */
SessionAttributeState getAttributeState(String attributeName){
  return _attributeStates.get(attributeName);
}
Program: 29910
Project: 29910
Buggy source:
/** 
 * this method called when session is loaded from persistent store or after session state was stored note: pre-condition is that the removed attributes have been removed from _attributeStates; this is taken care of by removeAttribute method
 */
void resetAttributeState(){
  clearAttributeStates();
  Enumeration attrNames=getAttributeNames();
  while (attrNames.hasMoreElements()) {
    String nextAttrName=(String)attrNames.nextElement();
    SessionAttributeState nextAttrState=SessionAttributeState.createPersistentAttribute();
    _attributeStates.put(nextAttrName,nextAttrState);
  }
  setDirty(false);
}

Fixed version (ground truth):
/** 
 * this method called when session is loaded from persistent store or after session state was stored note: pre-condition is that the removed attributes have been removed from _attributeStates; this is taken care of by removeAttribute method
 */
void resetAttributeState(){
  clearAttributeStates();
  Enumeration<String> attrNames=getAttributeNames();
  while (attrNames.hasMoreElements()) {
    String nextAttrName=attrNames.nextElement();
    SessionAttributeState nextAttrState=SessionAttributeState.createPersistentAttribute();
    _attributeStates.put(nextAttrName,nextAttrState);
  }
  setDirty(false);
}
Program: 29911
Project: 29911
Buggy source:
/** 
 * return an ArrayList of Strings whose elements are the names of the modified attributes attributes must dirty, persistent and not deleted
 */
public ArrayList getModifiedAttributes(){
  ArrayList resultList=new ArrayList();
  Set entries=_attributeStates.entrySet();
  Iterator it=entries.iterator();
  while (it.hasNext()) {
    Map.Entry entry=(Map.Entry)it.next();
    SessionAttributeState nextAttrState=(SessionAttributeState)entry.getValue();
    String nextAttrName=(String)entry.getKey();
    if (nextAttrState.isDirty() && nextAttrState.isPersistent() && (!nextAttrState.isDeleted())) {
      resultList.add(nextAttrName);
    }
  }
  return resultList;
}

Fixed version (ground truth):
/** 
 * return an ArrayList of Strings whose elements are the names of the modified attributes attributes must dirty, persistent and not deleted
 */
public List<String> getModifiedAttributes(){
  List<String> resultList=new ArrayList<String>();
  for (  Map.Entry<String,SessionAttributeState> entry : _attributeStates.entrySet()) {
    SessionAttributeState nextAttrState=entry.getValue();
    String nextAttrName=entry.getKey();
    if (nextAttrState.isDirty() && nextAttrState.isPersistent() && (!nextAttrState.isDeleted())) {
      resultList.add(nextAttrName);
    }
  }
  return resultList;
}
Program: 29912
Project: 29912
Buggy source:
/** 
 * set the SessionAttributeState for attributeName based on dirty value
 * @param attributeName
 * @param dirty
 */
void setAttributeStateDirty(String attributeName,boolean dirty){
  SessionAttributeState attrState=(SessionAttributeState)_attributeStates.get(attributeName);
  if (attrState == null) {
    attrState=new SessionAttributeState();
    attrState.setDirty(dirty);
    _attributeStates.put(attributeName,attrState);
  }
 else {
    attrState.setDirty(dirty);
  }
}

Fixed version (ground truth):
/** 
 * set the SessionAttributeState for attributeName based on dirty value
 * @param attributeName
 * @param dirty
 */
void setAttributeStateDirty(String attributeName,boolean dirty){
  SessionAttributeState attrState=_attributeStates.get(attributeName);
  if (attrState == null) {
    attrState=new SessionAttributeState();
    attrState.setDirty(dirty);
    _attributeStates.put(attributeName,attrState);
  }
 else {
    attrState.setDirty(dirty);
  }
}
Program: 29913
Project: 29913
Buggy source:
/** 
 * clear (empty) the attributeStates
 */
void clearAttributeStates(){
  if (_attributeStates == null) {
    _attributeStates=new HashMap();
  }
  _attributeStates.clear();
}

Fixed version (ground truth):
/** 
 * clear (empty) the attributeStates
 */
void clearAttributeStates(){
  if (_attributeStates == null) {
    _attributeStates=new HashMap<String,SessionAttributeState>();
  }
  _attributeStates.clear();
}
Program: 29914
Project: 29914
Buggy source:
private void postSaveUpdate(ModifiedAttributeHASession modAttrSession){
  if (_logger.isLoggable(Level.FINE)) {
    _logger.fine("String_Node_Str");
  }
  ArrayList addedAttrs=modAttrSession.getAddedAttributes();
  ArrayList modifiedAttrs=modAttrSession.getModifiedAttributes();
  ArrayList deletedAttrs=modAttrSession.getDeletedAttributes();
  printAttrList("String_Node_Str",addedAttrs);
  printAttrList("String_Node_Str",modifiedAttrs);
  printAttrList("String_Node_Str",deletedAttrs);
  postProcessSetAttrStates(modAttrSession,addedAttrs);
  postProcessSetAttrStates(modAttrSession,modifiedAttrs);
}

Fixed version (ground truth):
private void postSaveUpdate(ModifiedAttributeHASession modAttrSession){
  if (_logger.isLoggable(Level.FINE)) {
    _logger.fine("String_Node_Str");
  }
  List<String> addedAttrs=modAttrSession.getAddedAttributes();
  List<String> modifiedAttrs=modAttrSession.getModifiedAttributes();
  List<String> deletedAttrs=modAttrSession.getDeletedAttributes();
  printAttrList("String_Node_Str",addedAttrs);
  printAttrList("String_Node_Str",modifiedAttrs);
  printAttrList("String_Node_Str",deletedAttrs);
  postProcessSetAttrStates(modAttrSession,addedAttrs);
  postProcessSetAttrStates(modAttrSession,modifiedAttrs);
}
Program: 29915
Project: 29915
Buggy source:
private CompositeMetadata createCompositeMetadata(ModifiedAttributeHASession modAttrSession){
  byte[] trunkState=null;
  if (modAttrSession.isNew()) {
    try {
      trunkState=this.getByteArray(modAttrSession);
    }
 catch (    IOException ex) {
    }
  }
  if (_logger.isLoggable(Level.FINE)) {
    _logger.fine("String_Node_Str" + trunkState);
  }
  ArrayList entries=new ArrayList();
  ArrayList addedAttrs=modAttrSession.getAddedAttributes();
  ArrayList modifiedAttrs=modAttrSession.getModifiedAttributes();
  ArrayList deletedAttrs=modAttrSession.getDeletedAttributes();
  printAttrList("String_Node_Str",addedAttrs);
  printAttrList("String_Node_Str",modifiedAttrs);
  printAttrList("String_Node_Str",deletedAttrs);
  addToEntries(modAttrSession,entries,SessionAttributeMetadata.Operation.ADD,addedAttrs);
  addToEntries(modAttrSession,entries,SessionAttributeMetadata.Operation.UPDATE,modifiedAttrs);
  entries=addToEntries(modAttrSession,entries,SessionAttributeMetadata.Operation.DELETE,deletedAttrs);
  CompositeMetadata result=new CompositeMetadata(modAttrSession.getVersion(),modAttrSession.getLastAccessedTimeInternal(),modAttrSession.getMaxInactiveInterval() * 1000L,entries,trunkState,null);
  return result;
}

Fixed version (ground truth):
private CompositeMetadata createCompositeMetadata(ModifiedAttributeHASession modAttrSession){
  byte[] trunkState=null;
  if (modAttrSession.isNew()) {
    try {
      trunkState=this.getByteArray(modAttrSession);
    }
 catch (    IOException ex) {
    }
  }
  if (_logger.isLoggable(Level.FINE)) {
    _logger.fine("String_Node_Str" + trunkState);
  }
  List<SessionAttributeMetadata> entries=new ArrayList<SessionAttributeMetadata>();
  List<String> addedAttrs=modAttrSession.getAddedAttributes();
  List<String> modifiedAttrs=modAttrSession.getModifiedAttributes();
  List<String> deletedAttrs=modAttrSession.getDeletedAttributes();
  printAttrList("String_Node_Str",addedAttrs);
  printAttrList("String_Node_Str",modifiedAttrs);
  printAttrList("String_Node_Str",deletedAttrs);
  addToEntries(modAttrSession,entries,SessionAttributeMetadata.Operation.ADD,addedAttrs);
  addToEntries(modAttrSession,entries,SessionAttributeMetadata.Operation.UPDATE,modifiedAttrs);
  addToEntries(modAttrSession,entries,SessionAttributeMetadata.Operation.DELETE,deletedAttrs);
  CompositeMetadata result=new CompositeMetadata(modAttrSession.getVersion(),modAttrSession.getLastAccessedTimeInternal(),modAttrSession.getMaxInactiveInterval() * 1000L,entries,trunkState,null);
  return result;
}
Program: 29916
Project: 29916
Buggy source:
private ArrayList addToEntries(ModifiedAttributeHASession modAttrSession,ArrayList entries,SessionAttributeMetadata.Operation op,ArrayList attrList){
  String nextAttrName=null;
  Object nextAttrValue=null;
  byte[] nextValue=null;
  for (int i=0; i < attrList.size(); i++) {
    nextAttrName=(String)attrList.get(i);
    nextAttrValue=((StandardSession)modAttrSession).getAttribute(nextAttrName);
    nextValue=null;
    try {
      nextValue=getByteArray(nextAttrValue);
    }
 catch (    IOException ex) {
    }
    SessionAttributeMetadata nextAttrMetadata=new SessionAttributeMetadata(nextAttrName,op,nextValue);
    entries.add(nextAttrMetadata);
  }
  return entries;
}

Fixed version (ground truth):
private void addToEntries(ModifiedAttributeHASession modAttrSession,List<SessionAttributeMetadata> entries,SessionAttributeMetadata.Operation op,List<String> attrList){
  String nextAttrName=null;
  Object nextAttrValue=null;
  byte[] nextValue=null;
  for (int i=0; i < attrList.size(); i++) {
    nextAttrName=attrList.get(i);
    nextAttrValue=((StandardSession)modAttrSession).getAttribute(nextAttrName);
    nextValue=null;
    try {
      nextValue=getByteArray(nextAttrValue);
    }
 catch (    IOException ex) {
    }
    SessionAttributeMetadata nextAttrMetadata=new SessionAttributeMetadata(nextAttrName,op,nextValue);
    entries.add(nextAttrMetadata);
  }
}
Program: 29917
Project: 29917
Buggy source:
private void printAttrList(String attrListType,ArrayList attrList){
  if (_logger.isLoggable(Level.FINE)) {
    _logger.fine("String_Node_Str" + attrListType);
    String nextAttrName=null;
    for (int i=0; i < attrList.size(); i++) {
      nextAttrName=(String)attrList.get(i);
      _logger.fine("String_Node_Str" + i + "String_Node_Str"+ nextAttrName);
    }
  }
}

Fixed version (ground truth):
private void printAttrList(String attrListType,List<String> attrList){
  if (_logger.isLoggable(Level.FINE)) {
    _logger.fine("String_Node_Str" + attrListType);
    String nextAttrName=null;
    for (int i=0; i < attrList.size(); i++) {
      nextAttrName=attrList.get(i);
      _logger.fine("String_Node_Str" + i + "String_Node_Str"+ nextAttrName);
    }
  }
}
Program: 29918
Project: 29918
Buggy source:
private void postProcessSetAttrStates(ModifiedAttributeHASession modAttrSession,ArrayList attrsList){
  for (int i=0; i < attrsList.size(); i++) {
    String nextStateName=(String)attrsList.get(i);
    modAttrSession.setAttributeStatePersistent(nextStateName,true);
    modAttrSession.setAttributeStateDirty(nextStateName,false);
  }
}

Fixed version (ground truth):
private void postProcessSetAttrStates(ModifiedAttributeHASession modAttrSession,List<String> attrsList){
  for (int i=0; i < attrsList.size(); i++) {
    String nextStateName=attrsList.get(i);
    modAttrSession.setAttributeStatePersistent(nextStateName,true);
    modAttrSession.setAttributeStateDirty(nextStateName,false);
  }
}
Program: 29920
Project: 29920
Buggy source:
private boolean checkEnvAndParams(){
  if (!env.isDas()) {
    return setFail(Strings.get("String_Node_Str"));
  }
  Cluster cluster=domain.getClusterNamed(clusterName);
  if (cluster == null) {
    return setFail(Strings.get("String_Node_Str",clusterName));
  }
  return true;
}

Fixed version (ground truth):
private boolean checkEnvAndParams(Logger logger,ActionReport report){
  if (!env.isDas()) {
    return setFail(logger,report,Strings.get("String_Node_Str"));
  }
  Cluster cluster=domain.getClusterNamed(clusterName);
  if (cluster == null) {
    return setFail(logger,report,Strings.get("String_Node_Str",clusterName));
  }
  return true;
}
Program: 29921
Project: 29921
Buggy source:
private boolean setFail(String message){
  logger.log(Level.WARNING,message);
  report.setMessage(message);
  report.setActionExitCode(ActionReport.ExitCode.FAILURE);
  return false;
}

Fixed version (ground truth):
private boolean setFail(Logger logger,ActionReport report,String message){
  logger.log(Level.WARNING,message);
  report.setMessage(message);
  report.setActionExitCode(ActionReport.ExitCode.FAILURE);
  return false;
}
Program: 29922
Project: 29922
Buggy source:
private void getHealthWithGMS(){
  StringBuilder result=new StringBuilder();
  HealthHistory history=gmsAdapter.getHealthHistory();
  if (history == null) {
    setFail(Strings.get("String_Node_Str"));
    return;
  }
  if (history.getInstances().isEmpty()) {
    report.setMessage(Strings.get("String_Node_Str",clusterName));
    return;
  }
  SortedSet<String> names=new TreeSet<String>(history.getInstances());
  List<Properties> statesAndTimes=new ArrayList<Properties>(names.size());
  for (  String name : names) {
    Properties instanceStateAndTime=new Properties();
    HealthHistory.InstanceHealth ih=history.getHealthByInstance(name);
    instanceStateAndTime.put("String_Node_Str",name);
    instanceStateAndTime.put("String_Node_Str",ih.state.name());
    if (HealthHistory.NOTIME == ih.time) {
      result.append(name + "String_Node_Str" + ih.state);
      instanceStateAndTime.put("String_Node_Str","String_Node_Str");
    }
 else {
      result.append(Strings.get("String_Node_Str",name,ih.state,new Date(ih.time).toString()));
      instanceStateAndTime.put("String_Node_Str",String.valueOf(ih.time));
    }
    result.append("String_Node_Str");
    statesAndTimes.add(instanceStateAndTime);
  }
  Properties instanceStateTimes=new Properties();
  instanceStateTimes.put("String_Node_Str",statesAndTimes);
  report.setExtraProperties(instanceStateTimes);
  String rawResult=result.toString();
  report.setMessage(rawResult.substring(0,rawResult.lastIndexOf("String_Node_Str")));
}

Fixed version (ground truth):
private void getHealthWithGMS(Logger logger,ActionReport report,GMSAdapter gmsAdapter){
  StringBuilder result=new StringBuilder();
  HealthHistory history=gmsAdapter.getHealthHistory();
  if (history == null) {
    setFail(logger,report,Strings.get("String_Node_Str"));
    return;
  }
  if (history.getInstances().isEmpty()) {
    report.setMessage(Strings.get("String_Node_Str",clusterName));
    return;
  }
  SortedSet<String> names=new TreeSet<String>(history.getInstances());
  List<Properties> statesAndTimes=new ArrayList<Properties>(names.size());
  for (  String name : names) {
    Properties instanceStateAndTime=new Properties();
    HealthHistory.InstanceHealth ih=history.getHealthByInstance(name);
    instanceStateAndTime.put("String_Node_Str",name);
    instanceStateAndTime.put("String_Node_Str",ih.state.name());
    if (HealthHistory.NOTIME == ih.time) {
      result.append(name + "String_Node_Str" + ih.state);
      instanceStateAndTime.put("String_Node_Str","String_Node_Str");
    }
 else {
      result.append(Strings.get("String_Node_Str",name,ih.state,new Date(ih.time).toString()));
      instanceStateAndTime.put("String_Node_Str",String.valueOf(ih.time));
    }
    result.append("String_Node_Str");
    statesAndTimes.add(instanceStateAndTime);
  }
  Properties instanceStateTimes=new Properties();
  instanceStateTimes.put("String_Node_Str",statesAndTimes);
  report.setExtraProperties(instanceStateTimes);
  String rawResult=result.toString();
  report.setMessage(rawResult.substring(0,rawResult.lastIndexOf("String_Node_Str")));
}
Program: 29923
Project: 29923
Buggy source:
@Override public void execute(AdminCommandContext context){
  report=context.getActionReport();
  logger=context.getLogger();
  logger.log(Level.INFO,Strings.get("String_Node_Str",clusterName));
  if (!checkEnvAndParams()) {
    return;
  }
  gmsAdapter=gmsAdapterService.getGMSAdapterByName(clusterName);
  if (gmsAdapter != null) {
    getHealthWithGMS();
  }
 else {
    setFail(Strings.get("String_Node_Str",clusterName));
  }
}

Fixed version (ground truth):
@Override public void execute(AdminCommandContext context){
  ActionReport report=context.getActionReport();
  Logger logger=context.getLogger();
  logger.log(Level.INFO,Strings.get("String_Node_Str",clusterName));
  if (!checkEnvAndParams(logger,report)) {
    return;
  }
  GMSAdapter gmsAdapter=gmsAdapterService.getGMSAdapterByName(clusterName);
  if (gmsAdapter != null) {
    getHealthWithGMS(logger,report,gmsAdapter);
  }
 else {
    setFail(logger,report,Strings.get("String_Node_Str",clusterName));
  }
}
Program: 29924
Project: 29924
Buggy source:
private boolean fail(String s){
  report.setActionExitCode(ActionReport.ExitCode.FAILURE);
  report.setMessage(s);
  return false;
}

Fixed version (ground truth):
private boolean fail(ActionReport report,String s){
  report.setActionExitCode(ActionReport.ExitCode.FAILURE);
  report.setMessage(s);
  return false;
}
Program: 29925
Project: 29925
Buggy source:
private boolean checkEnvAndParams(){
  if (containerType == null) {
    return fail(Strings.get("String_Node_Str"));
  }
  if (!containerType.equals("String_Node_Str") && !containerType.equals("String_Node_Str")) {
    return fail(Strings.get("String_Node_Str",containerType));
  }
  return true;
}

Fixed version (ground truth):
private boolean checkEnvAndParams(ActionReport report){
  if (containerType == null) {
    return fail(report,Strings.get("String_Node_Str"));
  }
  if (!containerType.equals("String_Node_Str") && !containerType.equals("String_Node_Str")) {
    return fail(report,Strings.get("String_Node_Str",containerType));
  }
  return true;
}
Program: 29926
Project: 29926
Buggy source:
@Override public void execute(AdminCommandContext context){
  report=context.getActionReport();
  logger=context.getLogger();
  if (!checkEnvAndParams()) {
    return;
  }
  if (logger.isLoggable(Level.FINE)) {
    logger.log(Level.FINE,Strings.get("String_Node_Str",containerType));
  }
  Set<String> allPersistenceTypes=BackingStoreFactoryRegistry.getRegisteredTypes();
  allPersistenceTypes.remove("String_Node_Str");
  if (containerType.equals("String_Node_Str")) {
    allPersistenceTypes.remove("String_Node_Str");
  }
  StringBuilder sb=new StringBuilder("String_Node_Str");
  boolean removeTrailingSeparator=false;
  for (  String type : allPersistenceTypes) {
    sb.append(type).append(SEPARATOR);
    removeTrailingSeparator=true;
  }
  String output=sb.toString();
  if (removeTrailingSeparator) {
    output=output.substring(0,output.length() - 1);
  }
  Properties extraProperties=new Properties();
  extraProperties.put("String_Node_Str",new ArrayList<String>(allPersistenceTypes));
  report.setExtraProperties(extraProperties);
  report.setMessage(output);
  report.setActionExitCode(ActionReport.ExitCode.SUCCESS);
}

Fixed version (ground truth):
@Override public void execute(AdminCommandContext context){
  ActionReport report=context.getActionReport();
  logger=context.getLogger();
  if (!checkEnvAndParams(report)) {
    return;
  }
  if (logger.isLoggable(Level.FINE)) {
    logger.log(Level.FINE,Strings.get("String_Node_Str",containerType));
  }
  Set<String> allPersistenceTypes=BackingStoreFactoryRegistry.getRegisteredTypes();
  allPersistenceTypes.remove("String_Node_Str");
  if (containerType.equals("String_Node_Str")) {
    allPersistenceTypes.remove("String_Node_Str");
  }
  StringBuilder sb=new StringBuilder("String_Node_Str");
  boolean removeTrailingSeparator=false;
  for (  String type : allPersistenceTypes) {
    sb.append(type).append(SEPARATOR);
    removeTrailingSeparator=true;
  }
  String output=sb.toString();
  if (removeTrailingSeparator) {
    output=output.substring(0,output.length() - 1);
  }
  Properties extraProperties=new Properties();
  extraProperties.put("String_Node_Str",new ArrayList<String>(allPersistenceTypes));
  report.setExtraProperties(extraProperties);
  report.setMessage(output);
  report.setActionExitCode(ActionReport.ExitCode.SUCCESS);
}
Program: 29927
Project: 29927
Buggy source:
protected void refresh(boolean force){
synchronized (refreshLock) {
    if (stateIs(INSERVICE_STATE) && (wasRefreshed == false || force || filesChanged())) {
      int i=0;
      String value=null;
      String urlKey=null;
      while (true) {
        urlKey=PROVIDER_URL + (++i);
        value=java.security.Security.getProperty(urlKey);
        if (value == null || value.equals("String_Node_Str")) {
          break;
        }
      }
      try {
        java.security.Security.setProperty(urlKey,policyUrlValue);
        if (fileChanged(false)) {
          excludedPermissions=loadExcludedPolicy();
        }
        captureFileTime(true);
        if (policy == null) {
          policy=getNewPolicy();
        }
 else {
          policy.refresh();
          if (logger.isLoggable(Level.FINE)) {
            logger.fine("String_Node_Str" + CONTEXT_ID + "String_Node_Str"+ policyUrlValue);
          }
        }
        wasRefreshed=true;
      }
  finally {
        java.security.Security.setProperty(urlKey,"String_Node_Str");
      }
    }
  }
}

Fixed version (ground truth):
protected void refresh(boolean force){
synchronized (refreshLock) {
    if (stateIs(INSERVICE_STATE) && (wasRefreshed == false || force || filesChanged())) {
      int i=0;
      String value=null;
      String urlKey=null;
      while (true) {
        urlKey=PROVIDER_URL + (++i);
        value=getSecurityProperty(urlKey);
        if (value == null || value.equals("String_Node_Str")) {
          break;
        }
      }
      try {
        setSecurityProperty(urlKey,policyUrlValue);
        if (fileChanged(false)) {
          excludedPermissions=loadExcludedPolicy();
        }
        captureFileTime(true);
        if (policy == null) {
          policy=getNewPolicy();
        }
 else {
          policy.refresh();
          if (logger.isLoggable(Level.FINE)) {
            logger.fine("String_Node_Str" + CONTEXT_ID + "String_Node_Str"+ policyUrlValue);
          }
        }
        wasRefreshed=true;
      }
  finally {
        setSecurityProperty(urlKey,"String_Node_Str");
      }
    }
  }
}
Program: 29928
Project: 29928
Buggy source:
/** 
 * Get list of password file entries
 * @return List
 */
@Override protected List<String> getPasswords(){
  List list=new ArrayList<String>();
  list.add("String_Node_Str" + nodeUtils.sshL.expandPasswordAlias(remotePassword));
  if (sshkeypassphrase != null) {
    list.add("String_Node_Str" + nodeUtils.sshL.expandPasswordAlias(sshkeypassphrase));
  }
  return list;
}

Fixed version (ground truth):
/** 
 * Get list of password file entries
 * @return List
 */
@Override protected List<String> getPasswords(){
  List list=new ArrayList<String>();
  NodeUtils nUtils=new NodeUtils(habitat,logger);
  list.add("String_Node_Str" + nUtils.sshL.expandPasswordAlias(remotePassword));
  if (sshkeypassphrase != null) {
    list.add("String_Node_Str" + nUtils.sshL.expandPasswordAlias(sshkeypassphrase));
  }
  return list;
}
Program: 29929
Project: 29929
Buggy source:
/** 
 * Check if we can connect using password auth
 * @return true|false
 */
public boolean checkPasswordAuth(){
  boolean status=false;
  Connection c=null;
  try {
    c=new Connection(host,port);
    c.connect();
    if (logger.isLoggable(Level.FINER)) {
      logger.finer("String_Node_Str");
    }
    status=c.authenticateWithPassword(userName,password);
    if (status) {
      logger.finer("String_Node_Str" + userName + "String_Node_Str"+ host+ "String_Node_Str");
    }
  }
 catch (  IOException ioe) {
    if (logger.isLoggable(Level.FINER)) {
      ioe.printStackTrace();
    }
  }
 finally {
    c.close();
  }
  return status;
}

Fixed version (ground truth):
/** 
 * Check if we can connect using password auth
 * @return true|false
 */
public boolean checkPasswordAuth(){
  boolean status=false;
  Connection c=null;
  try {
    c=new Connection(host,port);
    c.connect();
    if (logger.isLoggable(Level.FINER)) {
      logger.finer("String_Node_Str");
    }
    status=c.authenticateWithPassword(userName,password);
    if (status) {
      logger.finer("String_Node_Str" + userName + "String_Node_Str"+ host+ "String_Node_Str");
    }
  }
 catch (  IOException ioe) {
    if (logger.isLoggable(Level.FINER)) {
      ioe.printStackTrace();
    }
  }
 finally {
    if (c != null) {
      c.close();
    }
  }
  return status;
}
Program: 29933
Project: 29933
Buggy source:
private void handleResponse(ParameterMap params,InputStream in,int code) throws IOException, CommandException {
  RemoteResponseManager rrm=null;
  try {
    rrm=new RemoteResponseManager(in,code,logger);
    rrm.process();
  }
 catch (  RemoteSuccessException rse) {
    output=rse.getMessage();
    attrs=rrm.getMainAtts();
    return;
  }
catch (  RemoteException rfe) {
    if (rfe.getRemoteCause().indexOf("String_Node_Str") >= 0) {
      throw new InvalidCommandException(rfe.getMessage());
    }
    throw new CommandException("String_Node_Str" + rfe.getMessage(),rfe);
  }
}

Fixed version (ground truth):
private void handleResponse(ParameterMap params,InputStream in,int code) throws IOException, CommandException {
}
Program: 29934
Project: 29934
Buggy source:
/** 
 * Expand the archive to the specified directory. XXX - this doesn't handle all the cases required for a Java EE app, but it's good enough for now for some performance testing
 */
private static void expand(File dir,File archive) throws Exception {
  if (!dir.mkdir())   logger.warning(Strings.get("String_Node_Str",dir));
  long modtime=archive.lastModified();
  ZipFile zf=new ZipFile(archive);
  Enumeration<? extends ZipEntry> e=zf.entries();
  while (e.hasMoreElements()) {
    ZipEntry ze=e.nextElement();
    File entry=new File(dir,ze.getName());
    if (ze.isDirectory()) {
      if (!entry.mkdir())       logger.warning(Strings.get("String_Node_Str",dir));
    }
 else {
      FileUtils.copy(zf.getInputStream(ze),new FileOutputStream(entry),0);
    }
  }
  if (!dir.setLastModified(modtime))   logger.warning(Strings.get("String_Node_Str",dir));
}

Fixed version (ground truth):
/** 
 * Expand the archive to the specified directory. XXX - this doesn't handle all the cases required for a Java EE app, but it's good enough for now for some performance testing
 */
private static void expand(File dir,File archive) throws Exception {
  if (!dir.mkdir())   logger.warning(Strings.get("String_Node_Str",dir));
  long modtime=archive.lastModified();
  ZipFile zf=new ZipFile(archive);
  try {
    Enumeration<? extends ZipEntry> e=zf.entries();
    while (e.hasMoreElements()) {
      ZipEntry ze=e.nextElement();
      File entry=new File(dir,ze.getName());
      if (ze.isDirectory()) {
        if (!entry.mkdir())         logger.warning(Strings.get("String_Node_Str",dir));
      }
 else {
        FileUtils.copy(zf.getInputStream(ze),new FileOutputStream(entry),0);
      }
    }
  }
  finally {
    try {
      zf.close();
    }
 catch (    IOException ex) {
    }
  }
  if (!dir.setLastModified(modtime))   logger.warning(Strings.get("String_Node_Str",dir));
}
Program: 29935
Project: 29935
Buggy source:
@Override protected void contextListenerStart(){
  ServletContext servletContext=getServletContext();
  WebBundleDescriptor wbd=getWebBundleDescriptor();
  try {
    servletContext.setAttribute(Constants.DEPLOYMENT_CONTEXT_ATTRIBUTE,getWebModuleConfig().getDeploymentContext());
    if (wbd != null) {
      servletContext.setAttribute(Constants.IS_DISTRIBUTABLE_ATTRIBUTE,Boolean.valueOf(wbd.isDistributable()));
    }
    servletContext.setAttribute(Constants.ENABLE_HA_ATTRIBUTE,Boolean.valueOf(webContainer.getServerConfigLookup().calculateWebAvailabilityEnabledFromConfig(this)));
    super.contextListenerStart();
  }
  finally {
    servletContext.removeAttribute(Constants.DEPLOYMENT_CONTEXT_ATTRIBUTE);
    servletContext.removeAttribute(Constants.IS_DISTRIBUTABLE_ATTRIBUTE);
    servletContext.removeAttribute(Constants.ENABLE_HA_ATTRIBUTE);
  }
  for (  ServletRegistrationImpl srImpl : servletRegisMap.values()) {
    if (srImpl instanceof DynamicWebServletRegistrationImpl) {
      DynamicWebServletRegistrationImpl dwsrImpl=(DynamicWebServletRegistrationImpl)srImpl;
      dwsrImpl.postProcessAnnotations();
    }
  }
  webContainer.afterServletContextInitializedEvent(wbd);
}

Fixed version (ground truth):
@Override protected void contextListenerStart(){
  ServletContext servletContext=getServletContext();
  WebBundleDescriptor wbd=getWebBundleDescriptor();
  try {
    servletContext.setAttribute(Constants.DEPLOYMENT_CONTEXT_ATTRIBUTE,getWebModuleConfig().getDeploymentContext());
    if (wbd != null) {
      servletContext.setAttribute(Constants.IS_DISTRIBUTABLE_ATTRIBUTE,wbd.isDistributable());
    }
    servletContext.setAttribute(Constants.ENABLE_HA_ATTRIBUTE,Boolean.valueOf(webContainer.getServerConfigLookup().calculateWebAvailabilityEnabledFromConfig(this)));
    super.contextListenerStart();
  }
  finally {
    servletContext.removeAttribute(Constants.DEPLOYMENT_CONTEXT_ATTRIBUTE);
    servletContext.removeAttribute(Constants.IS_DISTRIBUTABLE_ATTRIBUTE);
    servletContext.removeAttribute(Constants.ENABLE_HA_ATTRIBUTE);
  }
  for (  ServletRegistrationImpl srImpl : servletRegisMap.values()) {
    if (srImpl instanceof DynamicWebServletRegistrationImpl) {
      DynamicWebServletRegistrationImpl dwsrImpl=(DynamicWebServletRegistrationImpl)srImpl;
      dwsrImpl.postProcessAnnotations();
    }
  }
  webContainer.afterServletContextInitializedEvent(wbd);
}
Program: 29937
Project: 29937
Buggy source:
static public File inputStreamToFile(InputStream inputStream,String origFileName) throws IOException {
  String tmpdir=System.getProperty("String_Node_Str");
  File tmpFile=new File(tmpdir,origFileName);
  if (tmpFile.exists()) {
    tmpFile.delete();
    tmpFile=new File(tmpdir,origFileName);
  }
  tmpFile.deleteOnExit();
  OutputStream out=new FileOutputStream(tmpFile);
  byte buf[]=new byte[4096];
  int len;
  while ((len=inputStream.read(buf)) > 0) {
    out.write(buf,0,len);
  }
  out.close();
  inputStream.close();
  System.out.println("String_Node_Str" + tmpFile.getAbsolutePath());
  return tmpFile;
}

Fixed version (ground truth):
static public File inputStreamToFile(InputStream inputStream,String origFileName) throws IOException {
  String tmpdir=System.getProperty("String_Node_Str");
  File tmpFile=new File(tmpdir,origFileName);
  if (tmpFile.exists()) {
    if (!tmpFile.delete()) {
      System.out.println("String_Node_Str" + tmpFile.getAbsolutePath());
    }
    tmpFile=new File(tmpdir,origFileName);
  }
  tmpFile.deleteOnExit();
  OutputStream out=new FileOutputStream(tmpFile);
  byte buf[]=new byte[4096];
  int len;
  while ((len=inputStream.read(buf)) > 0) {
    out.write(buf,0,len);
  }
  out.close();
  inputStream.close();
  System.out.println("String_Node_Str" + tmpFile.getAbsolutePath());
  return tmpFile;
}