Program: 28723
Project: 28723
Buggy source:
private void initORB(Properties props){
  try {
    if (logger.isLoggable(Level.FINE)) {
      logger.log(Level.FINE,"String_Node_Str");
    }
    setORBSystemProperties();
    Properties orbInitProperties=new Properties();
    orbInitProperties.putAll(props);
    orbInitProperties.put(ORBConstants.APPSERVER_MODE,"String_Node_Str");
    orbInitProperties.put(ORBConstants.USER_CONFIGURATOR_PREFIX + PEORB_CONFIG_CLASS,"String_Node_Str");
    setFOLBProperties(orbInitProperties);
    String orbDefaultServerId=DEFAULT_SERVER_ID;
    if (!processType.isServer()) {
      orbDefaultServerId=ACC_DEFAULT_SERVER_ID;
    }
    orbDefaultServerId=System.getProperty(USER_DEFINED_ORB_SERVER_ID_PROPERTY,orbDefaultServerId);
    orbInitProperties.put(ORBConstants.ORB_SERVER_ID_PROPERTY,orbDefaultServerId);
    orbInitProperties.put(OMG_ORB_CLASS_PROPERTY,ORB_CLASS);
    orbInitProperties.put(ORBConstants.PI_ORB_INITIALIZER_CLASS_PREFIX + GLASSFISH_INITIALIZER,"String_Node_Str");
    orbInitProperties.put(ORBConstants.ALLOW_LOCAL_OPTIMIZATION,"String_Node_Str");
    orbInitProperties.put(ORBConstants.GET_SERVICE_CONTEXT_RETURNS_NULL,"String_Node_Str");
    orbInitProperties.put(ORBConstants.ORB_ID_PROPERTY,S1AS_ORB_ID);
    orbInitProperties.put(ORBConstants.SHOW_INFO_MESSAGES,"String_Node_Str");
    String initialPort=checkORBInitialPort(orbInitProperties);
    String orbInitialHost=checkORBInitialHost(orbInitProperties);
    String[] orbInitRefArgs;
    if (System.getProperty(IIOP_ENDPOINTS_PROPERTY) != null && !System.getProperty(IIOP_ENDPOINTS_PROPERTY).isEmpty()) {
      orbInitRefArgs=getORBInitRef(System.getProperty(IIOP_ENDPOINTS_PROPERTY));
    }
 else {
      orbInitRefArgs=getORBInitRef(orbInitialHost,initialPort);
    }
    if (processType.isServer()) {
      validateIiopListeners();
      orbInitProperties.put(ORBConstants.NO_DEFAULT_ACCEPTORS,"String_Node_Str");
    }
    checkConnectionSettings(orbInitProperties);
    checkMessageFragmentSize(orbInitProperties);
    checkServerSSLOutboundSettings(orbInitProperties);
    checkForOrbPropertyValues(orbInitProperties);
    Collection<GlassFishORBLifeCycleListener> lcListeners=iiopUtils.getGlassFishORBLifeCycleListeners();
    List<String> argsList=new ArrayList<String>();
    argsList.addAll(Arrays.asList(orbInitRefArgs));
    for (    GlassFishORBLifeCycleListener listener : lcListeners) {
      listener.initializeORBInitProperties(argsList,orbInitProperties);
    }
    String[] args=argsList.toArray(new String[argsList.size()]);
    if (processType.isServer()) {
      PEORBConfigurator.setThreadPoolManager();
    }
    boolean useOSGI=false;
    final ClassLoader prevCL=Utility.getClassLoader();
    try {
      Utility.setContextClassLoader(GlassFishORBManager.class.getClassLoader());
      if (processType.isServer()) {
        Module corbaOrbModule=null;
        ModulesRegistry modulesRegistry=services.getService(ModulesRegistry.class);
        for (        Module m : modulesRegistry.getModules()) {
          if (m.getName().equals("String_Node_Str")) {
            corbaOrbModule=m;
            break;
          }
        }
        if (corbaOrbModule != null) {
          useOSGI=true;
          corbaOrbModule.start();
        }
      }
    }
  finally {
      Utility.setContextClassLoader(prevCL);
    }
    orb=ORBFactory.create();
    ORBFactory.initialize(orb,args,orbInitProperties,useOSGI);
    try {
      org.omg.CORBA.Object obj=orb.resolve_initial_references("String_Node_Str");
    }
 catch (    org.omg.CORBA.ORBPackage.InvalidName in) {
      logger.log(Level.SEVERE,"String_Node_Str",in);
    }
    if (processType.isServer()) {
      gmsClient.setORB(orb);
      orbInitialPort=getORBInitialPort();
      for (      GlassFishORBLifeCycleListener listener : lcListeners) {
        listener.orbCreated(orb);
      }
      rfm=(ReferenceFactoryManager)orb.resolve_initial_references(ORBConstants.REFERENCE_FACTORY_MANAGER);
      new InitialGroupInfoService(orb);
      iiopUtils.setORB(orb);
    }
    orb.getFVDCodeBaseIOR();
  }
 catch (  Exception ex) {
    logger.log(Level.SEVERE,"String_Node_Str",ex);
    throw new RuntimeException(ex);
  }
 finally {
    if (logger.isLoggable(Level.FINE)) {
      logger.log(Level.FINE,"String_Node_Str");
    }
  }
}

Fixed version (ground truth):
private void initORB(Properties props){
  try {
    if (logger.isLoggable(Level.FINE)) {
      logger.log(Level.FINE,"String_Node_Str");
    }
    setORBSystemProperties();
    Properties orbInitProperties=new Properties();
    orbInitProperties.putAll(props);
    orbInitProperties.put(ORBConstants.APPSERVER_MODE,"String_Node_Str");
    orbInitProperties.put(ORBConstants.USER_CONFIGURATOR_PREFIX + PEORB_CONFIG_CLASS,"String_Node_Str");
    setFOLBProperties(orbInitProperties);
    String orbDefaultServerId=DEFAULT_SERVER_ID;
    if (!processType.isServer()) {
      orbDefaultServerId=ACC_DEFAULT_SERVER_ID;
    }
    orbDefaultServerId=System.getProperty(USER_DEFINED_ORB_SERVER_ID_PROPERTY,orbDefaultServerId);
    orbInitProperties.put(ORBConstants.ORB_SERVER_ID_PROPERTY,orbDefaultServerId);
    orbInitProperties.put(OMG_ORB_CLASS_PROPERTY,ORB_CLASS);
    orbInitProperties.put(ORBConstants.PI_ORB_INITIALIZER_CLASS_PREFIX + GLASSFISH_INITIALIZER,"String_Node_Str");
    orbInitProperties.put(ORBConstants.ALLOW_LOCAL_OPTIMIZATION,"String_Node_Str");
    orbInitProperties.put(ORBConstants.GET_SERVICE_CONTEXT_RETURNS_NULL,"String_Node_Str");
    orbInitProperties.put(ORBConstants.ORB_ID_PROPERTY,S1AS_ORB_ID);
    orbInitProperties.put(ORBConstants.SHOW_INFO_MESSAGES,"String_Node_Str");
    String initialPort=checkORBInitialPort(orbInitProperties);
    String orbInitialHost=checkORBInitialHost(orbInitProperties);
    String[] orbInitRefArgs;
    if (System.getProperty(IIOP_ENDPOINTS_PROPERTY) != null && !System.getProperty(IIOP_ENDPOINTS_PROPERTY).isEmpty()) {
      orbInitRefArgs=getORBInitRef(System.getProperty(IIOP_ENDPOINTS_PROPERTY));
    }
 else {
      orbInitRefArgs=getORBInitRef(orbInitialHost,initialPort);
    }
    if (processType.isServer()) {
      validateIiopListeners();
      orbInitProperties.put(ORBConstants.NO_DEFAULT_ACCEPTORS,"String_Node_Str");
      checkORBServerHost(orbInitProperties);
    }
    checkConnectionSettings(orbInitProperties);
    checkMessageFragmentSize(orbInitProperties);
    checkServerSSLOutboundSettings(orbInitProperties);
    checkForOrbPropertyValues(orbInitProperties);
    Collection<GlassFishORBLifeCycleListener> lcListeners=iiopUtils.getGlassFishORBLifeCycleListeners();
    List<String> argsList=new ArrayList<String>();
    argsList.addAll(Arrays.asList(orbInitRefArgs));
    for (    GlassFishORBLifeCycleListener listener : lcListeners) {
      listener.initializeORBInitProperties(argsList,orbInitProperties);
    }
    String[] args=argsList.toArray(new String[argsList.size()]);
    if (processType.isServer()) {
      PEORBConfigurator.setThreadPoolManager();
    }
    boolean useOSGI=false;
    final ClassLoader prevCL=Utility.getClassLoader();
    try {
      Utility.setContextClassLoader(GlassFishORBManager.class.getClassLoader());
      if (processType.isServer()) {
        Module corbaOrbModule=null;
        ModulesRegistry modulesRegistry=services.getService(ModulesRegistry.class);
        for (        Module m : modulesRegistry.getModules()) {
          if (m.getName().equals("String_Node_Str")) {
            corbaOrbModule=m;
            break;
          }
        }
        if (corbaOrbModule != null) {
          useOSGI=true;
          corbaOrbModule.start();
        }
      }
    }
  finally {
      Utility.setContextClassLoader(prevCL);
    }
    orb=ORBFactory.create();
    ORBFactory.initialize(orb,args,orbInitProperties,useOSGI);
    try {
      org.omg.CORBA.Object obj=orb.resolve_initial_references("String_Node_Str");
    }
 catch (    org.omg.CORBA.ORBPackage.InvalidName in) {
      logger.log(Level.SEVERE,"String_Node_Str",in);
    }
    if (processType.isServer()) {
      gmsClient.setORB(orb);
      orbInitialPort=getORBInitialPort();
      for (      GlassFishORBLifeCycleListener listener : lcListeners) {
        listener.orbCreated(orb);
      }
      rfm=(ReferenceFactoryManager)orb.resolve_initial_references(ORBConstants.REFERENCE_FACTORY_MANAGER);
      new InitialGroupInfoService(orb);
      iiopUtils.setORB(orb);
    }
    orb.getFVDCodeBaseIOR();
  }
 catch (  Exception ex) {
    logger.log(Level.SEVERE,"String_Node_Str",ex);
    throw new RuntimeException(ex);
  }
 finally {
    if (logger.isLoggable(Level.FINE)) {
      logger.log(Level.FINE,"String_Node_Str");
    }
  }
}