Program: 30159
Project: 30159
Buggy source:
private ReferenceFactory createReferenceFactory(String poaId,String repoid) throws Exception {
  try {
    if (logger.isLoggable(Level.FINE)) {
      logger.log(Level.FINE,"String_Node_Str",new Object[]{poaId,repoid});
    }
    ReferenceFactoryManager rfm=(ReferenceFactoryManager)orb.resolve_initial_references(ORBConstants.REFERENCE_FACTORY_MANAGER);
    List<Policy> policies=new ArrayList<Policy>();
    policies.add(ServantCachingPolicy.getPolicy());
    if (logger.isLoggable(Level.FINE)) {
      logger.log(Level.FINE,"String_Node_Str",new Object[]{poaId,repoid,ejbDescriptor});
    }
    policies.add(new CSIv2Policy(ejbDescriptor));
    IASEjbExtraDescriptors extraDesc=ejbDescriptor.getIASEjbExtraDescriptors();
    String threadPoolName=extraDesc.getUseThreadPoolId();
    int threadPoolNumericID=0;
    boolean usePassByReference=extraDesc.getPassByReference();
    if (usePassByReference) {
      policies.add(new CopyObjectPolicy(PASS_BY_REFERENCE_ID));
    }
    if (logger.isLoggable(Level.FINE)) {
      String jndiName=ejbDescriptor.getJndiName();
      logger.log(Level.FINE,"String_Node_Str",new Object[]{threadPoolName,threadPoolNumericID,jndiName});
      logger.log(Level.FINE,"String_Node_Str",new Object[]{usePassByReference,usePassByReference});
    }
    if (ejbDescriptor.allMechanismsRequireSSL()) {
      if (logger.isLoggable(Level.FINE)) {
        logger.log(Level.WARNING,"String_Node_Str",new Object[]{poaId,repoid});
      }
      policies.add(ZeroPortPolicy.getPolicy());
    }
    if (logger.isLoggable(Level.FINE)) {
      logger.log(Level.FINE,"String_Node_Str",new Object[]{poaId,repoid,policies});
    }
    ReferenceFactory rf=rfm.create(poaId,repoid,policies,this);
    return rf;
  }
  finally {
    if (logger.isLoggable(Level.FINE)) {
      logger.log(Level.WARNING,"String_Node_Str",new Object[]{poaId,repoid});
    }
  }
}

Fixed version (ground truth):
private ReferenceFactory createReferenceFactory(String poaId,String repoid) throws Exception {
  try {
    if (logger.isLoggable(Level.FINE)) {
      logger.log(Level.FINE,"String_Node_Str",new Object[]{poaId,repoid});
    }
    ReferenceFactoryManager rfm=(ReferenceFactoryManager)orb.resolve_initial_references(ORBConstants.REFERENCE_FACTORY_MANAGER);
    List<Policy> policies=new ArrayList<Policy>();
    policies.add(ServantCachingPolicy.getPolicy());
    policies.add(new OTSPolicyImpl());
    if (logger.isLoggable(Level.FINE)) {
      logger.log(Level.FINE,"String_Node_Str",new Object[]{poaId,repoid,ejbDescriptor});
    }
    policies.add(new CSIv2Policy(ejbDescriptor));
    IASEjbExtraDescriptors extraDesc=ejbDescriptor.getIASEjbExtraDescriptors();
    String threadPoolName=extraDesc.getUseThreadPoolId();
    int threadPoolNumericID=0;
    boolean usePassByReference=extraDesc.getPassByReference();
    if (usePassByReference) {
      policies.add(new CopyObjectPolicy(PASS_BY_REFERENCE_ID));
    }
    if (logger.isLoggable(Level.FINE)) {
      String jndiName=ejbDescriptor.getJndiName();
      logger.log(Level.FINE,"String_Node_Str",new Object[]{threadPoolName,threadPoolNumericID,jndiName});
      logger.log(Level.FINE,"String_Node_Str",new Object[]{usePassByReference,usePassByReference});
    }
    if (ejbDescriptor.allMechanismsRequireSSL()) {
      if (logger.isLoggable(Level.FINE)) {
        logger.log(Level.WARNING,"String_Node_Str",new Object[]{poaId,repoid});
      }
      policies.add(ZeroPortPolicy.getPolicy());
    }
    if (logger.isLoggable(Level.FINE)) {
      logger.log(Level.FINE,"String_Node_Str",new Object[]{poaId,repoid,policies});
    }
    ReferenceFactory rf=rfm.create(poaId,repoid,policies,this);
    return rf;
  }
  finally {
    if (logger.isLoggable(Level.FINE)) {
      logger.log(Level.WARNING,"String_Node_Str",new Object[]{poaId,repoid});
    }
  }
}