package biz.paluch.jee.commons;

import javax.naming.InitialContext;
import javax.naming.NamingException;

/**
 * Lookup strategy which performs lookups within the InitialContext. If a object is not found, a IllegalArgumentException (wraps
 * NamingException) is thrown.
 * 
 * @author <a href="mailto:mpaluch@paluch.biz">Mark Paluch</a>
 * @since 31.03.14 10:03
 */
public class JndiLookupStrategy implements NamingLookupStrategy {

    @Override
    public <T> T doLookup(String name) {
        try {
            return InitialContext.doLookup(name);
        } catch (NamingException e) {}
        return null;
    }
}

@@ -583,17 +583,16 @@
 ion e) %7B
-%7D
 %0A       
@@ -596,20 +596,60 @@
     
-return null;
+    throw new IllegalArgumentException(e);%0A        %7D
 %0A   

Revert JndiLookupStrategy to prevent incompatible API change