Program: 28720
Project: 28720
Buggy source:
/** 
 * create the object instance from the factory
 */
public Object getObjectInstance(Object obj,Name name,Context nameCtx,Hashtable environment) throws NamingException {
  String jndiLookupName="String_Node_Str";
  String jndiFactoryClass=null;
  ResourceInfo resourceInfo=null;
  Reference ref=(Reference)obj;
  Enumeration addrs=ref.getAll();
  while (addrs.hasMoreElements()) {
    RefAddr addr=(RefAddr)addrs.nextElement();
    String prop=addr.getType();
    if (prop.equals("String_Node_Str")) {
      resourceInfo=(ResourceInfo)addr.getContent();
    }
 else     if (prop.equals("String_Node_Str")) {
      jndiLookupName=(String)addr.getContent();
    }
 else     if (prop.equals("String_Node_Str")) {
      jndiFactoryClass=(String)addr.getContent();
    }
  }
  if (resourceInfo == null) {
    throw new NamingException("String_Node_Str");
  }
  ProxyRefAddr contextAddr=(ProxyRefAddr)ref.get(resourceInfo.getName());
  Hashtable env=null;
  if (contextAddr == null || jndiFactoryClass == null || (env=(Hashtable)(contextAddr.getContent())) == null) {
    throw new NamingException("String_Node_Str" + "String_Node_Str" + contextAddr + "String_Node_Str"+ "String_Node_Str"+ env+ "String_Node_Str"+ jndiFactoryClass);
  }
  Context context=contextMap.get(resourceInfo);
  if (context == null) {
synchronized (contextMap) {
      context=contextMap.get(resourceInfo);
      if (context == null) {
        context=loadInitialContext(jndiFactoryClass,env);
        contextMap.put(resourceInfo,context);
      }
    }
  }
  if (context == null)   throw new NamingException("String_Node_Str" + jndiFactoryClass);
  try {
    return context.lookup(jndiLookupName);
  }
 catch (  NameNotFoundException e) {
    throw new ExternalNameNotFoundException(e);
  }
}

Fixed version (ground truth):
/** 
 * create the object instance from the factory
 */
public Object getObjectInstance(Object obj,Name name,Context nameCtx,Hashtable environment) throws NamingException {
  String jndiLookupName="String_Node_Str";
  String jndiFactoryClass=null;
  ResourceInfo resourceInfo=null;
  Reference ref=(Reference)obj;
  Enumeration addrs=ref.getAll();
  while (addrs.hasMoreElements()) {
    RefAddr addr=(RefAddr)addrs.nextElement();
    String prop=addr.getType();
    if (prop.equals("String_Node_Str")) {
      resourceInfo=(ResourceInfo)addr.getContent();
    }
 else     if (prop.equals("String_Node_Str")) {
      jndiLookupName=(String)addr.getContent();
    }
 else     if (prop.equals("String_Node_Str")) {
      jndiFactoryClass=(String)addr.getContent();
    }
  }
  if (resourceInfo == null) {
    throw new NamingException("String_Node_Str");
  }
  ProxyRefAddr contextAddr=(ProxyRefAddr)ref.get(resourceInfo.getName());
  Hashtable env=null;
  if (contextAddr == null || jndiFactoryClass == null || (env=(Hashtable)(contextAddr.getContent())) == null) {
    throw new NamingException("String_Node_Str" + "String_Node_Str" + contextAddr + "String_Node_Str"+ "String_Node_Str"+ env+ "String_Node_Str"+ jndiFactoryClass);
  }
  Context context=contextMap.get(resourceInfo);
  if (context == null) {
synchronized (contextMap) {
      context=contextMap.get(resourceInfo);
      if (context == null) {
        context=loadInitialContext(jndiFactoryClass,env);
        contextMap.put(resourceInfo,context);
      }
    }
  }
  Object retObj=null;
  try {
    retObj=context.lookup(jndiLookupName);
  }
 catch (  NameNotFoundException e) {
    throw new ExternalNameNotFoundException(e);
  }
catch (  javax.naming.NamingException ne) {
    context=loadInitialContext(jndiFactoryClass,env);
    if (context == null) {
      throw new NamingException("String_Node_Str" + jndiFactoryClass);
    }
 else {
      contextMap.put(resourceInfo,context);
      try {
        retObj=context.lookup(jndiLookupName);
      }
 catch (      NameNotFoundException e) {
        throw new ExternalNameNotFoundException(e);
      }
    }
  }
  return retObj;
}