nus-yam/ex-repair huggingface dataset:
Program: 30235
Project: 30235
Buggy source:
private void getClusterSizeMonitoringStats(){
  List<ClusterSizeStat> heapData=new ArrayList<ClusterSizeStat>();
  SortedMap<Long,Long> sortedMap=new TreeMap<Long,Long>();
  Map<String,Object> result=null;
  String clusterName=getEnvName();
  result=null;
  String endPoint="String_Node_Str" + clusterName + "String_Node_Str";
  result=(Map<String,Object>)RestUtil.restRequest(endPoint,null,"String_Node_Str",null,null,false,true).get("String_Node_Str");
  if (result != null) {
    Map<String,Object> heapResultExtraProps=(Map<String,Object>)result.get("String_Node_Str");
    if (heapResultExtraProps != null) {
      Map<String,Object> heapResultEntity=(Map<String,Object>)heapResultExtraProps.get("String_Node_Str");
      if (heapResultEntity != null && !heapResultEntity.isEmpty()) {
        Map<String,Map<String,Long>> heapResultProps=(Map<String,Map<String,Long>>)(heapResultEntity.get("String_Node_Str"));
        for (        String heapProp : heapResultProps.keySet()) {
          sortedMap.put(Long.valueOf(heapProp),heapResultProps.get(heapProp).get("String_Node_Str"));
        }
      }
    }
  }
  setClusterSizeMonitoringChartInfo(sortedMap);
}

Fixed version (ground truth):
private void getClusterSizeMonitoringStats(){
  SortedMap<Long,Long> sortedMap=new TreeMap<Long,Long>();
  Map<String,Object> result=null;
  String clusterName=getEnvName();
  result=null;
  String endPoint="String_Node_Str" + clusterName + "String_Node_Str";
  result=(Map<String,Object>)RestUtil.restRequest(endPoint,null,"String_Node_Str",null,null,false,true).get("String_Node_Str");
  if (result != null) {
    Map<String,Object> heapResultExtraProps=(Map<String,Object>)result.get("String_Node_Str");
    if (heapResultExtraProps != null) {
      Map<String,Object> heapResultEntity=(Map<String,Object>)heapResultExtraProps.get("String_Node_Str");
      if (heapResultEntity != null && !heapResultEntity.isEmpty()) {
        Map<String,Map<String,Long>> heapResultProps=(Map<String,Map<String,Long>>)(heapResultEntity.get("String_Node_Str"));
        for (        String heapProp : heapResultProps.keySet()) {
          sortedMap.put(Long.valueOf(heapProp),heapResultProps.get(heapProp).get("String_Node_Str"));
        }
      }
    }
  }
  setClusterSizeMonitoringChartInfo(sortedMap);
}
Program: 30237
Project: 30237
Buggy source:
/** 
 * Return the ASN.1 encoded representation of a GSS mechanism identifier. Currently only the GSSUP Mechanism is supported.
 */
public static byte[] getMechanism(){
  return mech;
}

Fixed version (ground truth):
/** 
 * Return the ASN.1 encoded representation of a GSS mechanism identifier. Currently only the GSSUP Mechanism is supported.
 */
public static byte[] getMechanism(){
  byte[] mechCopy=Arrays.copyOf(mech,mech.length);
  return mechCopy;
}
Program: 30238
Project: 30238
Buggy source:
private int getServerPort(String mech){
  IiopListener[] iiopListenerBeans=(IiopListener[])IIOPUtils.getInstance().getIiopService().getIiopListener().toArray(new IiopListener[0]);
  for (  IiopListener ilisten : iiopListenerBeans) {
    if (mech.equalsIgnoreCase("String_Node_Str")) {
      if (ilisten.getSecurityEnabled().equalsIgnoreCase("String_Node_Str") && ilisten.getSsl() != null && !ilisten.getSsl().getClientAuthEnabled().equalsIgnoreCase("String_Node_Str")) {
        return Integer.parseInt(ilisten.getPort());
      }
    }
 else     if (mech.equalsIgnoreCase("String_Node_Str")) {
      if (ilisten.getSecurityEnabled().equalsIgnoreCase("String_Node_Str") && ilisten.getSsl() != null && ilisten.getSsl().getClientAuthEnabled().equalsIgnoreCase("String_Node_Str")) {
        return Integer.parseInt(ilisten.getPort());
      }
    }
 else     if (!ilisten.getSecurityEnabled().equalsIgnoreCase("String_Node_Str")) {
      return Integer.parseInt(ilisten.getPort());
    }
  }
  return -1;
}

Fixed version (ground truth):
private int getServerPort(String mech){
  List<IiopListener> listenersList=IIOPUtils.getInstance().getIiopService().getIiopListener();
  IiopListener[] iiopListenerBeans=listenersList.toArray(new IiopListener[listenersList.size()]);
  for (  IiopListener ilisten : iiopListenerBeans) {
    if (mech.equalsIgnoreCase("String_Node_Str")) {
      if (ilisten.getSecurityEnabled().equalsIgnoreCase("String_Node_Str") && ilisten.getSsl() != null && !ilisten.getSsl().getClientAuthEnabled().equalsIgnoreCase("String_Node_Str")) {
        return Integer.parseInt(ilisten.getPort());
      }
    }
 else     if (mech.equalsIgnoreCase("String_Node_Str")) {
      if (ilisten.getSecurityEnabled().equalsIgnoreCase("String_Node_Str") && ilisten.getSsl() != null && ilisten.getSsl().getClientAuthEnabled().equalsIgnoreCase("String_Node_Str")) {
        return Integer.parseInt(ilisten.getPort());
      }
    }
 else     if (!ilisten.getSecurityEnabled().equalsIgnoreCase("String_Node_Str")) {
      return Integer.parseInt(ilisten.getPort());
    }
  }
  return -1;
}
Program: 30239
Project: 30239
Buggy source:
private boolean authorizeCORBA(byte[] object_id,String method) throws Exception {
  ProtocolManager protocolMgr=orbHelper.getProtocolManager();
  if (protocolMgr == null) {
    return true;
  }
  if (protocolMgr.getEjbDescriptor(object_id) != null) {
    return true;
  }
  CORBAObjectPermission perm=new CORBAObjectPermission("String_Node_Str",method);
  com.sun.enterprise.security.SecurityContext sc=com.sun.enterprise.security.SecurityContext.getCurrent();
  Set principalSet=sc.getPrincipalSet();
  Principal[] principals=(principalSet == null ? null : (Principal[])principalSet.toArray(new Principal[0]));
  CodeSource cs=new CodeSource(new java.net.URL("String_Node_Str"),(java.security.cert.Certificate[])null);
  ProtectionDomain prdm=new ProtectionDomain(cs,null,null,principals);
  boolean result=policy.implies(prdm,perm);
  if (_logger.isLoggable(Level.FINE)) {
    _logger.log(Level.FINE,"String_Node_Str" + result + "String_Node_Str"+ method);
  }
  return result;
}

Fixed version (ground truth):
private boolean authorizeCORBA(byte[] object_id,String method) throws Exception {
  ProtocolManager protocolMgr=orbHelper.getProtocolManager();
  if (protocolMgr == null) {
    return true;
  }
  if (protocolMgr.getEjbDescriptor(object_id) != null) {
    return true;
  }
  CORBAObjectPermission perm=new CORBAObjectPermission("String_Node_Str",method);
  com.sun.enterprise.security.SecurityContext sc=com.sun.enterprise.security.SecurityContext.getCurrent();
  Set principalSet=sc.getPrincipalSet();
  Principal[] principals=(principalSet == null ? null : (Principal[])principalSet.toArray(new Principal[principalSet.size()]));
  CodeSource cs=new CodeSource(new java.net.URL("String_Node_Str"),(java.security.cert.Certificate[])null);
  ProtectionDomain prdm=new ProtectionDomain(cs,null,null,principals);
  boolean result=policy.implies(prdm,perm);
  if (_logger.isLoggable(Level.FINE)) {
    _logger.log(Level.FINE,"String_Node_Str" + result + "String_Node_Str"+ method);
  }
  return result;
}
Program: 30240
Project: 30240
Buggy source:
private boolean evaluate_client_conformance_ascontext(SecurityContext ctx,EjbIORConfigurationDescriptor iordesc,String realmName){
  boolean client_authenticated=false;
  AS_ContextSec ascontext=null;
  try {
    ascontext=this.getCtc().createASContextSec(iordesc,realmName);
  }
 catch (  Exception e) {
    _logger.log(Level.SEVERE,"String_Node_Str",e);
    return false;
  }
  if (ascontext == null)   return false;
  if ((ctx != null) && (ctx.authcls != null) && (ctx.subject != null))   client_authenticated=true;
 else   client_authenticated=false;
  if (client_authenticated) {
    if (!(isSet(ascontext.target_requires,EstablishTrustInClient.value) || isSet(ascontext.target_supports,EstablishTrustInClient.value))) {
      return false;
    }
    byte[] client_tgtname=getTargetName(ctx.subject);
    if (ascontext.target_name.length != client_tgtname.length) {
      return false;
    }
    for (int i=0; i < ascontext.target_name.length; i++)     if (ascontext.target_name[i] != client_tgtname[i]) {
      return false;
    }
  }
 else {
    if (isSet(ascontext.target_requires,EstablishTrustInClient.value)) {
      return false;
    }
  }
  return true;
}

Fixed version (ground truth):
private boolean evaluate_client_conformance_ascontext(SecurityContext ctx,EjbIORConfigurationDescriptor iordesc,String realmName){
  boolean client_authenticated=false;
  AS_ContextSec ascontext=null;
  try {
    ascontext=this.getCtc().createASContextSec(iordesc,realmName);
  }
 catch (  Exception e) {
    _logger.log(Level.SEVERE,"String_Node_Str",e);
    return false;
  }
  if ((ctx != null) && (ctx.authcls != null) && (ctx.subject != null))   client_authenticated=true;
 else   client_authenticated=false;
  if (client_authenticated) {
    if (!(isSet(ascontext.target_requires,EstablishTrustInClient.value) || isSet(ascontext.target_supports,EstablishTrustInClient.value))) {
      return false;
    }
    byte[] client_tgtname=getTargetName(ctx.subject);
    if (ascontext.target_name.length != client_tgtname.length) {
      return false;
    }
    for (int i=0; i < ascontext.target_name.length; i++)     if (ascontext.target_name[i] != client_tgtname[i]) {
      return false;
    }
  }
 else {
    if (isSet(ascontext.target_requires,EstablishTrustInClient.value)) {
      return false;
    }
  }
  return true;
}
Program: 30242
Project: 30242
Buggy source:
private boolean evaluate_client_conformance_sascontext(SecurityContext ctx,EjbIORConfigurationDescriptor iordesc){
  boolean caller_propagated=false;
  SAS_ContextSec sascontext=null;
  try {
    sascontext=this.getCtc().createSASContextSec(iordesc);
  }
 catch (  Exception e) {
    _logger.log(Level.SEVERE,"String_Node_Str",e);
    return false;
  }
  if (sascontext == null)   return false;
  if ((ctx != null) && (ctx.identcls != null) && (ctx.subject != null))   caller_propagated=true;
 else   caller_propagated=false;
  if (caller_propagated) {
    if (!isSet(sascontext.target_supports,IdentityAssertion.value))     return false;
    return true;
  }
  return true;
}

Fixed version (ground truth):
private boolean evaluate_client_conformance_sascontext(SecurityContext ctx,EjbIORConfigurationDescriptor iordesc){
  boolean caller_propagated=false;
  SAS_ContextSec sascontext=null;
  try {
    sascontext=this.getCtc().createSASContextSec(iordesc);
  }
 catch (  Exception e) {
    _logger.log(Level.SEVERE,"String_Node_Str",e);
    return false;
  }
  if ((ctx != null) && (ctx.identcls != null) && (ctx.subject != null))   caller_propagated=true;
 else   caller_propagated=false;
  if (caller_propagated) {
    if (!isSet(sascontext.target_supports,IdentityAssertion.value))     return false;
    return true;
  }
  return true;
}
Program: 30243
Project: 30243
Buggy source:
private boolean isMechanismSupported(SAS_ContextSec sas){
  byte[][] mechanisms=sas.supported_naming_mechanisms;
  byte[] mechSupported=GSSUtils.getMechanism();
  if (mechSupported == null) {
    return false;
  }
  if (mechanisms == null) {
    return false;
  }
  for (int i=0; i < mechanisms.length; i++) {
    if (Arrays.equals(mechSupported,mechanisms[i])) {
      return true;
    }
  }
  return false;
}

Fixed version (ground truth):
private boolean isMechanismSupported(SAS_ContextSec sas){
  byte[][] mechanisms=sas.supported_naming_mechanisms;
  byte[] mechSupported=GSSUtils.getMechanism();
  if (mechanisms == null) {
    return false;
  }
  for (int i=0; i < mechanisms.length; i++) {
    if (Arrays.equals(mechSupported,mechanisms[i])) {
      return true;
    }
  }
  return false;
}
Program: 30244
Project: 30244
Buggy source:
private boolean isMechanismSupportedAS(AS_ContextSec as){
  byte[] mechanism=as.client_authentication_mech;
  byte[] mechSupported=GSSUtils.getMechanism();
  if (mechSupported == null) {
    return false;
  }
  if (mechanism == null) {
    return false;
  }
  if (Arrays.equals(mechanism,mechSupported)) {
    return true;
  }
  return false;
}

Fixed version (ground truth):
private boolean isMechanismSupportedAS(AS_ContextSec as){
  byte[] mechanism=as.client_authentication_mech;
  byte[] mechSupported=GSSUtils.getMechanism();
  if (mechanism == null) {
    return false;
  }
  if (Arrays.equals(mechanism,mechSupported)) {
    return true;
  }
  return false;
}
Program: 30245
Project: 30245
Buggy source:
public BitSet getRolesOfPrincipals(String pcid,String[] roles,Principal[] principals) throws SecurityException, UnsupportedOperationException {
  BitSet roleSet=new BitSet(roles.length);
  if (principals == null || principals.length == 0 || roles == null || roles.length == 0) {
    return null;
  }
  SecurityRoleMapper srm=getInternalMapper(pcid);
  for (int i=0; i < roles.length; i++) {
    roleSet.set(i,arePrincipalsInRole(srm,principals,roles[i]));
  }
  return roleSet;
}

Fixed version (ground truth):
public BitSet getRolesOfPrincipals(String pcid,String[] roles,Principal[] principals) throws SecurityException, UnsupportedOperationException {
  BitSet roleSet=new BitSet(roles.length);
  if (principals.length == 0 || roles == null || roles.length == 0) {
    return null;
  }
  SecurityRoleMapper srm=getInternalMapper(pcid);
  for (int i=0; i < roles.length; i++) {
    roleSet.set(i,arePrincipalsInRole(srm,principals,roles[i]));
  }
  return roleSet;
}
Program: 30246
Project: 30246
Buggy source:
/** 
 * Causes all policy statements to be deleted from this PolicyConfiguration and sets its internal state such that calling any method, other than delete, getContextID, or inService on the PolicyConfiguration will be rejected and cause an UnsupportedOperationException to be thrown. <P> This operation has no affect on any linked PolicyConfigurations other than removing any links involving the deleted PolicyConfiguration.
 * @throws java.lang.SecurityException if called by an AccessControlContext that has not been granted the "setPolicy" SecurityPermission.
 * @throws javax.security.jacc.PolicyContextException if the implementation throws a checked exception that has not been accounted for by the delete method signature. The exception thrown by the implementation class will be encapsulated (during construction) in the thrown PolicyContextException.
 */
public void delete() throws javax.security.jacc.PolicyContextException {
  checkSetPolicyPermission();
  SharedState.removeLinks(id);
  pcwLock.lock();
  try {
    removePolicy();
  }
  finally {
    setState(DELETED_STATE);
    pcwLock.unlock();
  }
}

Fixed version (ground truth):
/** 
 * Causes all policy statements to be deleted from this PolicyConfiguration and sets its internal state such that calling any method, other than delete, getContextID, or inService on the PolicyConfiguration will be rejected and cause an UnsupportedOperationException to be thrown. <P> This operation has no affect on any linked PolicyConfigurations other than removing any links involving the deleted PolicyConfiguration.
 * @throws java.lang.SecurityException if called by an AccessControlContext that has not been granted the "setPolicy" SecurityPermission.
 * @throws javax.security.jacc.PolicyContextException if the implementation throws a checked exception that has not been accounted for by the delete method signature. The exception thrown by the implementation class will be encapsulated (during construction) in the thrown PolicyContextException.
 */
public void delete() throws javax.security.jacc.PolicyContextException {
  checkSetPolicyPermission();
  SharedState.removeLinks(id);
  pcwLock.lock();
  try {
    removePolicy();
  }
  finally {
    pcwLock.unlock();
    setState(DELETED_STATE);
  }
}
Program: 30247
Project: 30247
Buggy source:
private Role getRole(String roleName){
  int index=-1;
  Role rvalue=new Role(roleName);
  if (roleTable == null) {
    roleTable=new ArrayList<Role>();
  }
 else {
    index=roleTable.indexOf(rvalue);
  }
  if (index < 0) {
    roleTable.add(rvalue);
    index=roleTable.indexOf(rvalue);
  }
 else {
    rvalue=roleTable.get(index);
  }
  return rvalue;
}

Fixed version (ground truth):
private Role getRole(String roleName){
  int index=-1;
  Role rvalue=new Role(roleName);
  if (roleTable == null) {
    roleTable=new ArrayList<Role>();
  }
 else {
    index=roleTable.indexOf(rvalue);
  }
  if (index < 0) {
    roleTable.add(rvalue);
    roleTable.indexOf(rvalue);
  }
 else {
    rvalue=roleTable.get(index);
  }
  return rvalue;
}
Program: 30248
Project: 30248
Buggy source:
private static String _loadRegistration(AuthConfigProvider provider,String layer,String appContext,String description){
  RegistrationContext rc=new RegistrationContextImpl(layer,appContext,description,true);
  String regisID=getRegistrationID(layer,appContext);
  RegistrationContext prevRegisContext=id2RegisContextMap.get(regisID);
  AuthConfigProvider prevProvider=id2ProviderMap.get(regisID);
  boolean wasRegistered=id2ProviderMap.containsKey(regisID);
  if (wasRegistered) {
    List<String> prevRegisIDs=provider2IdsMap.get(prevProvider);
    prevRegisIDs.remove(regisID);
    if (prevRegisIDs.isEmpty()) {
      provider2IdsMap.remove(prevProvider);
    }
  }
  id2ProviderMap.put(regisID,provider);
  id2RegisContextMap.put(regisID,rc);
  List<String> regisIDs=provider2IdsMap.get(provider);
  if (regisIDs == null) {
    regisIDs=new ArrayList<String>();
    provider2IdsMap.put(provider,regisIDs);
  }
  if (!regisIDs.contains(regisID)) {
    regisIDs.add(regisID);
  }
  return regisID;
}

Fixed version (ground truth):
private static String _loadRegistration(AuthConfigProvider provider,String layer,String appContext,String description){
  RegistrationContext rc=new RegistrationContextImpl(layer,appContext,description,true);
  String regisID=getRegistrationID(layer,appContext);
  id2RegisContextMap.get(regisID);
  AuthConfigProvider prevProvider=id2ProviderMap.get(regisID);
  boolean wasRegistered=id2ProviderMap.containsKey(regisID);
  if (wasRegistered) {
    List<String> prevRegisIDs=provider2IdsMap.get(prevProvider);
    prevRegisIDs.remove(regisID);
    if (prevRegisIDs.isEmpty()) {
      provider2IdsMap.remove(prevProvider);
    }
  }
  id2ProviderMap.put(regisID,provider);
  id2RegisContextMap.put(regisID,rc);
  List<String> regisIDs=provider2IdsMap.get(provider);
  if (regisIDs == null) {
    regisIDs=new ArrayList<String>();
    provider2IdsMap.put(provider,regisIDs);
  }
  if (!regisIDs.contains(regisID)) {
    regisIDs.add(regisID);
  }
  return regisID;
}
Program: 30249
Project: 30249
Buggy source:
private EntryInfo readRegEntry(BufferedReader reader) throws IOException {
  String className=null;
  Map<String,String> properties=null;
  List<RegistrationContext> ctxs=new ArrayList<RegistrationContext>();
  String line=reader.readLine().trim();
  while (!line.equals("String_Node_Str")) {
    if (line.startsWith(CON_ENTRY)) {
      EntryInfo conEntry=readConEntry(reader);
      className=conEntry.getClassName();
      properties=conEntry.getProperties();
    }
 else     if (line.startsWith(REG_CTX)) {
      ctxs.add(readRegContext(reader));
    }
    line=reader.readLine().trim();
  }
  return new EntryInfo(className,properties,ctxs);
}

Fixed version (ground truth):
private EntryInfo readRegEntry(BufferedReader reader) throws IOException {
  String className=null;
  Map<String,String> properties=null;
  List<RegistrationContext> ctxs=new ArrayList<RegistrationContext>();
  String line=reader.readLine();
  if (line != null) {
    line=line.trim();
  }
  while (!"String_Node_Str".equals(line)) {
    if (line.startsWith(CON_ENTRY)) {
      EntryInfo conEntry=readConEntry(reader);
      className=conEntry.getClassName();
      properties=conEntry.getProperties();
    }
 else     if (line.startsWith(REG_CTX)) {
      ctxs.add(readRegContext(reader));
    }
    line=reader.readLine();
    if (line != null) {
      line=line.trim();
    }
  }
  return new EntryInfo(className,properties,ctxs);
}
Program: 30250
Project: 30250
Buggy source:
private void clearExistingFile() throws IOException {
  boolean newCreation=!confFile.exists();
  if (!newCreation) {
    confFile.delete();
  }
  if (newCreation) {
    logger.log(Level.INFO,"String_Node_Str",confFile.getPath());
  }
  confFile.createNewFile();
}

Fixed version (ground truth):
private void clearExistingFile() throws IOException {
  boolean newCreation=!confFile.exists();
  if (!newCreation) {
    if (!confFile.delete()) {
      throw new IOException();
    }
  }
  if (newCreation) {
    logger.log(Level.INFO,"String_Node_Str",confFile.getPath());
  }
  if (!confFile.createNewFile()) {
    throw new IOException();
  }
}
Program: 30251
Project: 30251
Buggy source:
private Map<String,String> readProperties(BufferedReader reader) throws IOException {
  String line=reader.readLine().trim();
  if (line.equals("String_Node_Str")) {
    return null;
  }
  Map<String,String> properties=new HashMap<String,String>();
  while (!line.equals("String_Node_Str")) {
    properties.put(line.substring(0,line.indexOf(SEP)),line.substring(line.indexOf(SEP) + 1,line.length()));
    line=reader.readLine().trim();
  }
  return properties;
}

Fixed version (ground truth):
private Map<String,String> readProperties(BufferedReader reader) throws IOException {
  String line=reader.readLine();
  if (line != null) {
    line=line.trim();
  }
  if ("String_Node_Str".equals(line)) {
    return null;
  }
  Map<String,String> properties=new HashMap<String,String>();
  while (!"String_Node_Str".equals(line)) {
    properties.put(line.substring(0,line.indexOf(SEP)),line.substring(line.indexOf(SEP) + 1,line.length()));
    line=reader.readLine();
    if (line != null) {
      line=line.trim();
    }
  }
  return properties;
}
Program: 30252
Project: 30252
Buggy source:
private RegistrationContext readRegContext(BufferedReader reader) throws IOException {
  String layer=null;
  String appCtx=null;
  String description=null;
  String line=reader.readLine().trim();
  while (!line.equals("String_Node_Str")) {
    String value=line.substring(line.indexOf(SEP) + 1,line.length());
    if (line.startsWith(LAYER)) {
      layer=value;
    }
 else     if (line.startsWith(APP_CTX)) {
      appCtx=value;
    }
 else     if (line.startsWith(DESCRIPTION)) {
      description=value;
    }
    line=reader.readLine().trim();
  }
  return new RegistrationContextImpl(layer,appCtx,description,true);
}

Fixed version (ground truth):
private RegistrationContext readRegContext(BufferedReader reader) throws IOException {
  String layer=null;
  String appCtx=null;
  String description=null;
  String line=reader.readLine();
  if (line != null) {
    line=line.trim();
  }
  while (!"String_Node_Str".equals(line)) {
    String value=line.substring(line.indexOf(SEP) + 1,line.length());
    if (line.startsWith(LAYER)) {
      layer=value;
    }
 else     if (line.startsWith(APP_CTX)) {
      appCtx=value;
    }
 else     if (line.startsWith(DESCRIPTION)) {
      description=value;
    }
    line=reader.readLine();
    if (line != null) {
      line=line.trim();
    }
  }
  return new RegistrationContextImpl(layer,appCtx,description,true);
}
Program: 30253
Project: 30253
Buggy source:
private EntryInfo readConEntry(BufferedReader reader) throws IOException {
  String className=reader.readLine().trim();
  Map<String,String> properties=readProperties(reader);
  return new EntryInfo(className,properties);
}

Fixed version (ground truth):
private EntryInfo readConEntry(BufferedReader reader) throws IOException {
  String className=reader.readLine();
  if (className != null) {
    className=className.trim();
  }
  Map<String,String> properties=readProperties(reader);
  return new EntryInfo(className,properties);
}
Program: 30254
Project: 30254
Buggy source:
private Integer getHashCode(Map properties){
  if (properties == null) {
    return new Integer(0);
  }
  return new Integer(properties.hashCode());
}

Fixed version (ground truth):
private Integer getHashCode(Map properties){
  if (properties == null) {
    return Integer.valueOf("String_Node_Str");
  }
  return Integer.valueOf(properties.hashCode());
}
Program: 30255
Project: 30255
Buggy source:
protected void logIfLevel(Level level,Throwable t,String... msgParts){
  Logger logger=Logger.getLogger(loggerName);
  if (logger.isLoggable(level)) {
    String msg=null;
    for (    String m : msgParts) {
      msg+=m;
    }
    if (msg != null && t != null) {
      logger.log(level,msg,t);
    }
 else     if (msg != null) {
      logger.log(level,msg);
    }
  }
}

Fixed version (ground truth):
protected void logIfLevel(Level level,Throwable t,String... msgParts){
  Logger logger=Logger.getLogger(loggerName);
  if (logger.isLoggable(level)) {
    StringBuffer msgB=new StringBuffer("String_Node_Str");
    for (    String m : msgParts) {
      msgB.append(m);
    }
    String msg=msgB.toString();
    if (!msg.isEmpty() && t != null) {
      logger.log(level,msg,t);
    }
 else     if (!msg.isEmpty()) {
      logger.log(level,msg);
    }
  }
}
Program: 30256
Project: 30256
Buggy source:
protected void logIfLevel(Level level,Throwable t,String... msgParts){
  Logger logger=Logger.getLogger(loggerName);
  if (logger.isLoggable(level)) {
    String msg=null;
    for (    String m : msgParts) {
      msg+=m;
    }
    if (msg != null && t != null) {
      logger.log(level,msg,t);
    }
 else     if (msg != null) {
      logger.log(level,msg);
    }
  }
}

Fixed version (ground truth):
protected void logIfLevel(Level level,Throwable t,String... msgParts){
  Logger logger=Logger.getLogger(loggerName);
  if (logger.isLoggable(level)) {
    StringBuffer msgB=new StringBuffer("String_Node_Str");
    for (    String m : msgParts) {
      msgB.append(m);
    }
    String msg=msgB.toString();
    if (!msg.isEmpty() && t != null) {
      logger.log(level,msg,t);
    }
 else     if (!msg.isEmpty()) {
      logger.log(level,msg);
    }
  }
}
Program: 30258
Project: 30258
Buggy source:
@Override public Object run() throws Exception {
  ClassLoader loader=Thread.currentThread().getContextClassLoader();
  String[] names=nameSet.toArray(new String[0]);
  for (  String id : names) {
    boolean hasAuthModule=false;
    AppConfigurationEntry[] entry=getAppConfigurationEntry(id);
    for (int i=0; i < entry.length && !hasAuthModule; i++) {
      String clazz=entry[i].getLoginModuleName();
      try {
        Class c=Class.forName(clazz,true,loader);
        for (        Class required : authModuleClass) {
          if (required.isAssignableFrom(c)) {
            hasAuthModule=true;
            break;
          }
        }
      }
 catch (      Throwable t) {
        String msg="String_Node_Str" + clazz + "String_Node_Str"+ id;
        logger.log(Level.WARNING,msg);
      }
    }
    if (!hasAuthModule) {
      nameSet.remove(id);
    }
  }
  return null;
}

Fixed version (ground truth):
@Override public Object run() throws Exception {
  ClassLoader loader=Thread.currentThread().getContextClassLoader();
  String[] names=nameSet.toArray(new String[nameSet.size()]);
  for (  String id : names) {
    boolean hasAuthModule=false;
    AppConfigurationEntry[] entry=getAppConfigurationEntry(id);
    for (int i=0; i < entry.length && !hasAuthModule; i++) {
      String clazz=entry[i].getLoginModuleName();
      try {
        Class c=Class.forName(clazz,true,loader);
        for (        Class required : authModuleClass) {
          if (required.isAssignableFrom(c)) {
            hasAuthModule=true;
            break;
          }
        }
      }
 catch (      Throwable t) {
        String msg="String_Node_Str" + clazz + "String_Node_Str"+ id;
        logger.log(Level.WARNING,msg);
      }
    }
    if (!hasAuthModule) {
      nameSet.remove(id);
    }
  }
  return null;
}
Program: 30259
Project: 30259
Buggy source:
public JAASAuthContextHelper(String loggerName,boolean returnNullContexts,ExtendedConfigFile jaasConfig,Map properties,String appContext) throws AuthException {
  super(loggerName,returnNullContexts);
  this.loggerName=loggerName;
  this.jaasConfig=jaasConfig;
  this.appContext=appContext;
  initialize();
}

Fixed version (ground truth):
public JAASAuthContextHelper(String loggerName,boolean returnNullContexts,ExtendedConfigFile jaasConfig,Map properties,String appContext) throws AuthException {
  super(loggerName,returnNullContexts);
  this.jaasConfig=jaasConfig;
  this.appContext=appContext;
  initialize();
}
Program: 30260
Project: 30260
Buggy source:
private void initJKS(){
  String keyStoreFileName=null;
  String trustStoreFileName=null;
  keyStoreFileName=System.getProperty(keyStoreProp);
  trustStoreFileName=System.getProperty(trustStoreProp);
  char[] keyStorePass=null;
  char[] trustStorePass=null;
  if (!isInstantiated()) {
    if (masterPasswordHelper == null && Globals.getDefaultHabitat() != null) {
      masterPasswordHelper=Globals.getDefaultHabitat().getByType(MasterPasswordImpl.class);
    }
    if (masterPasswordHelper instanceof MasterPasswordImpl) {
      keyStorePass=masterPasswordHelper.getMasterPassword();
      trustStorePass=keyStorePass;
    }
  }
  if (keyStorePass == null) {
    keyStorePass=System.getProperty(KEYSTORE_PASS_PROP,DEFAULT_KEYSTORE_PASS).toCharArray();
    trustStorePass=System.getProperty(TRUSTSTORE_PASS_PROP,DEFAULT_TRUSTSTORE_PASS).toCharArray();
  }
  if (!initialized) {
    loadStores(null,null,keyStoreFileName,keyStorePass,System.getProperty(KEYSTORE_TYPE_PROP,KeyStore.getDefaultType()),trustStoreFileName,trustStorePass,System.getProperty(TRUSTSTORE_TYPE_PROP,KeyStore.getDefaultType()));
    Arrays.fill(keyStorePass,' ');
    Arrays.fill(trustStorePass,' ');
    initialized=true;
  }
}

Fixed version (ground truth):
private void initJKS(){
  String keyStoreFileName=null;
  String trustStoreFileName=null;
  keyStoreFileName=System.getProperty(keyStoreProp);
  trustStoreFileName=System.getProperty(trustStoreProp);
  char[] keyStorePass=null;
  char[] trustStorePass=null;
  if (!isInstantiated()) {
    if (masterPasswordHelper == null && Globals.getDefaultHabitat() != null) {
      masterPasswordHelper=Globals.getDefaultHabitat().getByType(MasterPasswordImpl.class);
    }
    if (masterPasswordHelper != null) {
      keyStorePass=masterPasswordHelper.getMasterPassword();
      trustStorePass=keyStorePass;
    }
  }
  if (keyStorePass == null) {
    keyStorePass=System.getProperty(KEYSTORE_PASS_PROP,DEFAULT_KEYSTORE_PASS).toCharArray();
    trustStorePass=System.getProperty(TRUSTSTORE_PASS_PROP,DEFAULT_TRUSTSTORE_PASS).toCharArray();
  }
  if (!initialized) {
    loadStores(null,null,keyStoreFileName,keyStorePass,System.getProperty(KEYSTORE_TYPE_PROP,KeyStore.getDefaultType()),trustStoreFileName,trustStorePass,System.getProperty(TRUSTSTORE_TYPE_PROP,KeyStore.getDefaultType()));
    Arrays.fill(keyStorePass,' ');
    Arrays.fill(trustStorePass,' ');
    initialized=true;
  }
}
Program: 30261
Project: 30261
Buggy source:
/** 
 * Returns the directory for the selected instance that is on the local system.
 * @param instanceName name of the instance
 * @return File for the local file system location of the instance directory
 * @throws IOException
 */
protected File getLocalInstanceDir(String instance) throws IOException {
  String nodeDir=node.getNodeDirAbsolute();
  final File nodeDirFile=(nodeDir != null ? new File(nodeDir) : defaultLocalNodeDirFile());
  InstanceDirs instanceDirs=new InstanceDirs(nodeDirFile.toString(),node.getName(),instance);
  return instanceDirs.getInstanceDir();
}

Fixed version (ground truth):
/** 
 * Returns the directory for the selected instance that is on the local system.
 * @param instanceName name of the instance
 * @return File for the local file system location of the instance directory
 * @throws IOException
 */
File getLocalInstanceDir(String instance) throws IOException {
  String nodeDir=node.getNodeDirAbsolute();
  final File nodeDirFile=(nodeDir != null ? new File(nodeDir) : defaultLocalNodeDirFile());
  InstanceDirs instanceDirs=new InstanceDirs(nodeDirFile.toString(),node.getName(),instance);
  return instanceDirs.getInstanceDir();
}
Program: 30262
Project: 30262
Buggy source:
protected File defaultLocalNodeDirFile(){
  String installDir=node.getInstallDir();
  String nodeName=node.getName();
  final File nodeParentDir=(installDir == null ? serverContext.getInstallRoot() : new File(installDir,"String_Node_Str"));
  return new File(nodeParentDir,"String_Node_Str");
}

Fixed version (ground truth):
File defaultLocalNodeDirFile(){
  String installDir=node.getInstallDir();
  String nodeName=node.getName();
  final File nodeParentDir=(installDir == null ? serverContext.getInstallRoot() : new File(installDir,"String_Node_Str"));
  return new File(nodeParentDir,"String_Node_Str");
}
Program: 30263
Project: 30263
Buggy source:
public InstanceDirUtils(Node node,ServerContext serverContext){
  this.node=node;
  this.serverContext=serverContext;
}

Fixed version (ground truth):
InstanceDirUtils(Node node,ServerContext serverContext){
  this.node=node;
  this.serverContext=serverContext;
}
Program: 30264
Project: 30264
Buggy source:
@AfterClass public static void tearDown(){
  application.delete();
}

Fixed version (ground truth):
@AfterClass public static void tearDown(){
  if (application != null) {
    application.delete();
  }
}
Program: 30265
Project: 30265
Buggy source:
public void event(Event event){
  if (myTestEvents.contains(event.type())) {
    myTestEvents.remove(event.type());
  }
}

Fixed version (ground truth):
public void event(Event event){
  if (myTestEvents2.contains(event.type())) {
    myTestEvents2.remove(event.type());
  }
}
Program: 30266
Project: 30266
Buggy source:
public void setLoadBalancers(List<String> javaEEInstances){
  this.loadBalancers=loadBalancers;
}

Fixed version (ground truth):
public void setLoadBalancers(List<String> loadBalancers){
  this.loadBalancers=loadBalancers;
}
Program: 30267
Project: 30267
Buggy source:
private void validateRemoteConnection(ParameterMap map) throws CommandValidationException {
  RemoteType type=parseType(map);
  if (type == RemoteType.SSH)   validateSSHConnection(map);
 else   validateDcomConnection(map);
}

Fixed version (ground truth):
private void validateRemoteConnection(ParameterMap map) throws CommandValidationException {
  RemoteType type=parseType(map);
  if (type == RemoteType.SSH)   validateSSHConnection(map);
 else   if (type == RemoteType.DCOM)   validateDcomConnection(map);
}
Program: 30268
Project: 30268
Buggy source:
private String pollForRealDeath(String mode){
  int counter=0;
  while (++counter < 24) {
    try {
      if (mode.equals("String_Node_Str")) {
        if (!pidFile.exists()) {
          return null;
        }
      }
 else {
        if (!ftpClient.exists(pidFile.toString()))         return null;
      }
      Thread.sleep(5000);
    }
 catch (    Exception e) {
    }
  }
  return Strings.get("String_Node_Str",instanceName);
}

Fixed version (ground truth):
private String pollForRealDeath(String mode){
  int counter=0;
  while (++counter < 24) {
    try {
      if (mode.equals("String_Node_Str")) {
        if (!pidFile.exists()) {
          return null;
        }
      }
 else       if (mode.equals("String_Node_Str")) {
        if (!ftpClient.exists(pidFile.toString()))         return null;
      }
 else       if (mode.equals("String_Node_Str")) {
        if (wrf == null || !wrf.exists())         return null;
      }
      Thread.sleep(5000);
    }
 catch (    Exception e) {
    }
  }
  return Strings.get("String_Node_Str",instanceName);
}
Program: 30270
Project: 30270
Buggy source:
public final int runAdminCommandOnRemoteNode(Node thisNode,StringBuilder output,List<String> args,List<String> stdinLines) throws SSHCommandExecutionException, IllegalArgumentException, UnsupportedOperationException {
  String commandAsString=null;
  try {
    this.node=thisNode;
    dcomInfo=new DcomInfo(node);
    WindowsCredentials bonafides=dcomInfo.getCredentials();
    List<String> fullcommand=new ArrayList<String>();
    fullcommand.add(dcomInfo.getNadminPath());
    if (stdinLines != null && !stdinLines.isEmpty())     setupAuthTokenFile(fullcommand,stdinLines);
    fullcommand.addAll(args);
    commandAsString=commandListToString(fullcommand);
    WindowsRemoteScripter scripter=new WindowsRemoteScripter(bonafides);
    String out=scripter.run(commandAsString);
    logger.info(Strings.get("String_Node_Str",commandAsString,out));
    return 0;
  }
 catch (  WindowsException ex) {
    throw new SSHCommandExecutionException(Strings.get("String_Node_Str",ex.getMessage(),commandAsString),ex);
  }
 finally {
    teardownAuthTokenFile();
  }
}

Fixed version (ground truth):
public final int runAdminCommandOnRemoteNode(Node thisNode,StringBuilder output,List<String> args,List<String> stdinLines) throws SSHCommandExecutionException, IllegalArgumentException, UnsupportedOperationException {
  String humanreadable=null;
  try {
    this.node=thisNode;
    dcomInfo=new DcomInfo(node);
    List<String> fullcommand=new ArrayList<String>();
    WindowsRemoteAsadmin asadmin=dcomInfo.getAsadmin();
    if (stdinLines != null && !stdinLines.isEmpty())     setupAuthTokenFile(fullcommand,stdinLines);
    fullcommand.addAll(args);
    humanreadable=dcomInfo.getNadminPath() + "String_Node_Str" + commandListToString(fullcommand);
    String out=asadmin.run(fullcommand);
    logger.info(Strings.get("String_Node_Str",humanreadable,out));
    return 0;
  }
 catch (  WindowsException ex) {
    throw new SSHCommandExecutionException(Strings.get("String_Node_Str",ex.getMessage(),humanreadable),ex);
  }
 finally {
    teardownAuthTokenFile();
  }
}
Program: 30271
Project: 30271
Buggy source:
private void setupAuthTokenFile(List<String> cmd,List<String> stdin) throws WindowsException {
  WindowsRemoteFileSystem wrfs=new WindowsRemoteFileSystem(dcomInfo.getCredentials());
  authTokenFilePath=dcomInfo.getNadminParentPath() + "String_Node_Str";
  authTokenFile=new WindowsRemoteFile(wrfs,authTokenFilePath);
  authTokenFile.copyFrom(stdin);
  URI authTokenFileUri=new File(authTokenFilePath).toURI();
  cmd.add(AsadminInput.CLI_INPUT_OPTION);
  cmd.add(authTokenFileUri.toString());
}

Fixed version (ground truth):
private void setupAuthTokenFile(List<String> cmd,List<String> stdin) throws WindowsException {
  WindowsRemoteFileSystem wrfs=new WindowsRemoteFileSystem(dcomInfo.getCredentials());
  authTokenFilePath=dcomInfo.getNadminParentPath() + "String_Node_Str" + System.nanoTime()+ new Random().nextInt(1000);
  authTokenFilePath=createUniqueFilename(dcomInfo.getNadminParentPath());
  authTokenFile=new WindowsRemoteFile(wrfs,authTokenFilePath);
  authTokenFile.copyFrom(stdin);
  URI authTokenFileUri=new File(authTokenFilePath).toURI();
  cmd.add(AsadminInput.CLI_INPUT_OPTION);
  cmd.add(authTokenFileUri.toString());
}
Program: 30273
Project: 30273
Buggy source:
public WindowsRemoteAsadmin(String remoteInstallRoot,WindowsCredentials bonafides){
  super(bonafides);
  remoteInstallRoot.replace('/','\\');
  if (!remoteInstallRoot.endsWith("String_Node_Str"))   remoteInstallRoot+="String_Node_Str";
  asadminRemotePath=StringUtils.quotePathIfNecessary(remoteInstallRoot + "String_Node_Str");
}

Fixed version (ground truth):
public WindowsRemoteAsadmin(String remoteInstallRoot,WindowsCredentials bonafides){
  super(bonafides);
  remoteInstallRoot=remoteInstallRoot.replace('/','\\');
  if (!remoteInstallRoot.endsWith("String_Node_Str"))   remoteInstallRoot+="String_Node_Str";
  asadminRemotePath=StringUtils.quotePathIfNecessary(remoteInstallRoot + "String_Node_Str");
}
Program: 30274
Project: 30274
Buggy source:
/** 
 * Discover the dependencies of the application and provision the various  Services that are needed by the application.
 * @param appName Application Name
 * @param archive Application Archive
 * @param dc DeploymentContext associated with the current deployment operation
 */
private void provisionServicesForApplication(String appName,ReadableArchive archive,DeploymentContext dc){
  logger.entering(getClass().getName(),"String_Node_Str");
  Set<Plugin> installedPlugins=getPlugins();
  ServiceMetadata appServiceMetadata=serviceDependencyDiscovery(appName,archive,installedPlugins);
  Set<ProvisionedService> appProvisionedSvcs=provisionServices(installedPlugins,appServiceMetadata,dc);
  associateProvisionedServices(installedPlugins,appServiceMetadata,appProvisionedSvcs,true,dc);
  serviceMetadata.put(appName,appServiceMetadata);
  provisionedServices.put(appName,appProvisionedSvcs);
  logger.exiting(getClass().getName(),"String_Node_Str");
}

Fixed version (ground truth):
/** 
 * Discover the dependencies of the application and provision the various  Services that are needed by the application.
 * @param appName Application Name
 * @param archive Application Archive
 * @param dc DeploymentContext associated with the current deployment operation
 */
private void provisionServicesForApplication(String appName,ReadableArchive archive,DeploymentContext dc){
  logger.entering(getClass().getName(),"String_Node_Str");
  Set<Plugin> installedPlugins=getPlugins();
  ServiceMetadata appServiceMetadata=serviceDependencyDiscovery(appName,archive,installedPlugins);
  Set<ProvisionedService> appProvisionedSvcs=provisionServices(installedPlugins,appServiceMetadata,dc);
  logger.log(Level.FINE,"String_Node_Str" + appName + "String_Node_Str"+ appProvisionedSvcs);
  serviceMetadata.put(appName,appServiceMetadata);
  provisionedServices.put(appName,appProvisionedSvcs);
  associateProvisionedServices(installedPlugins,appServiceMetadata,appProvisionedSvcs,true,dc);
  logger.exiting(getClass().getName(),"String_Node_Str");
}
Program: 30275
Project: 30275
Buggy source:
/** 
 * Once the CPAS merges all discovered and explicit <code>ServiceDefinitions</code>s, it provisions the required Services through the <code>Plugin</code>.
 * @return a Set of <code>ProvisionedService</code>s
 */
public ProvisionedService provisionService(ServiceDescription serviceDescription,DeploymentContext dc);

Fixed version (ground truth):
/** 
 * Once the CPAS merges all discovered and explicit <code>ServiceDefinitions</code>s, it provisions the required Services through the <code>Plugin</code>. The <code>Plugin</code> is responsible for ensuring that the provisioning action is atomic. That is, the Service that is being provisioned must be completely provisioned or not at all.
 * @return a Set of <code>ProvisionedService</code>s
 */
public ProvisionedService provisionService(ServiceDescription serviceDescription,DeploymentContext dc);
Program: 30276
Project: 30276
Buggy source:
void processMetaData(File file){
  metaData=CommandUtil.getPreSelectedServices(file.getAbsolutePath());
  database="String_Node_Str";
  eeTemplate="String_Node_Str";
  loadBalancer="String_Node_Str";
  databasesMetaData.clear();
  eeTemplatesMetaData.clear();
  loadBalancersMetaData.clear();
  for (  Map oneService : metaData) {
    String serviceType=(String)oneService.get("String_Node_Str");
    String serviceName=(String)oneService.get("String_Node_Str");
    String templateId=(String)oneService.get("String_Node_Str");
    if (CommandUtil.SERVICE_TYPE_RDMBS.equals(serviceType)) {
      databasesMetaData.add(oneService);
      if (database.length() > 0) {
        database+="String_Node_Str";
      }
      database+=templateId != null ? templateId : serviceName;
    }
 else     if (CommandUtil.SERVICE_TYPE_JAVAEE.equals(serviceType)) {
      eeTemplatesMetaData.add(oneService);
      if (eeTemplate.length() > 0) {
        eeTemplate+="String_Node_Str";
      }
      eeTemplate+=templateId != null ? templateId : serviceName;
    }
 else     if (CommandUtil.SERVICE_TYPE_LB.equals(serviceType)) {
      loadBalancersMetaData.add(oneService);
      if (loadBalancer.length() > 0) {
        loadBalancer+="String_Node_Str";
      }
      loadBalancer+=templateId != null ? templateId : serviceName;
    }
  }
  if (databasesMetaData != null) {
    createSelectItems(CommandUtil.SERVICE_TYPE_RDMBS);
  }
  if (eeTemplatesMetaData != null) {
    createSelectItems(CommandUtil.SERVICE_TYPE_JAVAEE);
  }
  if (loadBalancersMetaData != null) {
    createSelectItems(CommandUtil.SERVICE_TYPE_LB);
  }
}

Fixed version (ground truth):
void processMetaData(File file){
  metaData=CommandUtil.getPreSelectedServices(file.getAbsolutePath());
  database="String_Node_Str";
  eeTemplate="String_Node_Str";
  loadBalancer="String_Node_Str";
  databasesMetaData.clear();
  eeTemplatesMetaData.clear();
  loadBalancersMetaData.clear();
  for (  Map oneService : metaData) {
    String serviceType=(String)oneService.get("String_Node_Str");
    String serviceName=(String)oneService.get("String_Node_Str");
    String templateId=(String)oneService.get("String_Node_Str");
    if (CommandUtil.SERVICE_TYPE_RDMBS.equals(serviceType)) {
      databasesMetaData.add(oneService);
      if (database.length() > 0) {
        database+="String_Node_Str";
      }
      database+=templateId != null ? templateId : serviceName;
    }
 else     if (CommandUtil.SERVICE_TYPE_JAVAEE.equals(serviceType)) {
      eeTemplatesMetaData.add(oneService);
      if (eeTemplate.length() > 0) {
        eeTemplate+="String_Node_Str";
      }
      eeTemplate+=templateId != null ? templateId : serviceName;
    }
 else     if (CommandUtil.SERVICE_TYPE_LB.equals(serviceType)) {
      loadBalancersMetaData.add(oneService);
      if (loadBalancer.length() > 0) {
        loadBalancer+="String_Node_Str";
      }
      loadBalancer+=templateId != null ? templateId : serviceName;
    }
  }
  createSelectItems(CommandUtil.SERVICE_TYPE_RDMBS);
  createSelectItems(CommandUtil.SERVICE_TYPE_JAVAEE);
  createSelectItems(CommandUtil.SERVICE_TYPE_LB);
}
Program: 30278
Project: 30278
Buggy source:
public String getProperty(String serviceName,String property){
  for (  Service service : serviceUtil.getServices().getServices()) {
    return service.getServiceName().equals(serviceName) ? service.getProperty(property).getValue() : null;
  }
  return null;
}

Fixed version (ground truth):
public String getProperty(String serviceName,String property){
  for (  Service service : serviceUtil.getServices().getServices()) {
    if (service.getServiceName().equals(serviceName)) {
      Property p=service.getProperty(property);
      if (p != null) {
        return p.getValue();
      }
 else {
        return null;
      }
    }
  }
  return null;
}
Program: 30281
Project: 30281
Buggy source:
public IAASImpl(@Inject(optional=true) Virtualizations virtualizations,@Inject Transactions transactions,@Inject ServerEnvironment env,@Inject Services services){
  this.services=services;
  transactions.addListenerForType(ServerPoolConfig.class,this);
  if (virtualizations == null || env.isInstance())   return;
  for (  Virtualization virt : virtualizations.getVirtualizations()) {
    for (    ServerPoolConfig groupConfig : virt.getServerPools()) {
      try {
        ServerPool group=addServerPool(groupConfig);
        System.out.println("String_Node_Str" + group.getName());
        if (group instanceof PhysicalServerPool) {
          for (          Machine machine : ((PhysicalServerPool)group).machines()) {
            System.out.println("String_Node_Str" + machine.getName() + "String_Node_Str"+ machine.getIpAddress()+ "String_Node_Str"+ machine.getState());
            if (machine.getState().equals(Machine.State.READY)) {
              try {
                System.out.println(machine.toString());
              }
 catch (              Exception e) {
                e.printStackTrace();
              }
            }
          }
        }
      }
 catch (      Exception e) {
        e.printStackTrace();
      }
    }
  }
}

Fixed version (ground truth):
public IAASImpl(@Inject(optional=true) Virtualizations virtualizations,@Inject Transactions transactions,@Inject ServerEnvironment env,@Inject final Services services){
  this.services=services;
  transactions.addListenerForType(Virtualization.class,this);
  if (virtualizations == null) {
    transactions.addListenerForType(Virtualizations.class,new ConfigListener(){
      @Override public UnprocessedChangeEvents changed(      PropertyChangeEvent[] propertyChangeEvents){
        Virtualizations virts=services.forContract(Virtualizations.class).get();
        for (        Virtualization virt : virts.getVirtualizations()) {
          processVirtualization(virt);
        }
        Dom.unwrap(virts).addListener(IAASImpl.this);
        return null;
      }
    }
);
  }
  if (virtualizations == null || env.isInstance())   return;
  for (  Virtualization virt : virtualizations.getVirtualizations()) {
    processVirtualization(virt);
  }
}