ejb@glassfish.java.net

null handling in SessionContext.lookup(null)

From: Cheng Fang <Cheng.Fang_at_Sun.COM>
Date: Thu, 02 Mar 2006 14:16:21 -0500 (EST)

I happen to notice this in EJBContextImpl.java:

    public Object lookup(String name) {
        Object o = null;
        try {
            if( initialContext == null ) {
                initialContext = new InitialContext();
            }
            // name is relative to the private component namespace
            o = initialContext.lookup("java:comp/env/" + name);
        } catch(Exception e) {
            throw new IllegalArgumentException(e);
        }
        return o;
    }


It is possible that there exists a resource at name "java:comp/env/null"
and this is a valid resource name. Right now in glassfish
SessionContext.lookup(null) will return such a resource, rather than an
IllegalArgumentException.

Thanks.
-- Cheng