Buggy code:
public class NamingContext implements EventContext { private static NamingStore ACTIVE_NAMING_STORE = new InMemoryNamingStore ( ) ; public static void setActiveNamingStore ( final NamingStore namingStore ) { } private static final String PACKAGE_PREFIXES = "org.jboss.as.naming.interfaces" ; public static void initializeNamingManager ( ) { } private final NamingStore namingStore ; private final Name prefix ; private final Hashtable < String , Object > environment ; public NamingContext ( final Hashtable < String , Object > environment ) { } public NamingContext ( final Name prefix , final Hashtable < String , Object > environment ) throws NamingException { } public NamingContext ( final Name prefix , final NamingStore namingStore , final Hashtable < String , Object > environment ) { } public NamingContext ( final NamingStore namingStore , final Hashtable < String , Object > environment ) { } public Object lookup ( final Name name ) throws NamingException { } public Object lookup ( final String name ) throws NamingException { } public Object lookup ( final String name , boolean dereference ) throws NamingException { } public Object lookup ( final Name name , boolean dereference ) throws NamingException { } public void bind ( final Name name , Object object ) throws NamingException { } public void bind ( final String name , final Object obj ) throws NamingException { } public void rebind ( final Name name , Object object ) throws NamingException { } public void rebind ( final String name , final Object object ) throws NamingException { } public void unbind ( final Name name ) throws NamingException { } public void unbind ( final String name ) throws NamingException { } public void rename ( final Name oldName , final Name newName ) throws NamingException { } public void rename ( final String oldName , final String newName ) throws NamingException { } public NamingEnumeration < NameClassPair > list ( final Name name ) throws NamingException { } public NamingEnumeration < NameClassPair > list ( final String name ) throws NamingException { } public NamingEnumeration < Binding > listBindings ( final Name name ) throws NamingException { } public NamingEnumeration < Binding > listBindings ( final String name ) throws NamingException { } public void destroySubcontext ( final Name name ) throws NamingException { } public void destroySubcontext ( String name ) throws NamingException { } public Context createSubcontext ( Name name ) throws NamingException { } public Context createSubcontext ( String name ) throws NamingException { } public Object lookupLink ( Name name ) throws NamingException { } public Object lookupLink ( String name ) throws NamingException { <START_BUG> return lookup ( parseName ( name ) ) ; <END_BUG> } public NameParser getNameParser ( Name name ) throws NamingException { } public NameParser getNameParser ( String name ) throws NamingException { } public Name composeName ( Name name , Name prefix ) throws NamingException { } public String composeName ( String name , String prefix ) throws NamingException { } public Object addToEnvironment ( String propName , Object propVal ) throws NamingException { } public Object removeFromEnvironment ( String propName ) throws NamingException { } public Hashtable < ? , ? > getEnvironment ( ) throws NamingException { } public void close ( ) throws NamingException { } public String getNameInNamespace ( ) throws NamingException { } public void addNamingListener ( final Name target , final int scope , final NamingListener listener ) throws NamingException { } public void addNamingListener ( final String target , final int scope , final NamingListener listener ) throws NamingException { } public void removeNamingListener ( final NamingListener listener ) throws NamingException { } public boolean targetMustExist ( ) throws NamingException { } private Name parseName ( final String name ) throws NamingException { } private Name getAbsoluteName ( final Name name ) throws NamingException { } private Object getObjectInstance ( final Object object , final Name name , final Hashtable < ? , ? > environment ) throws NamingException { } private Object resolveLink ( Object result , boolean dereference ) throws NamingException { } Name getPrefix ( ) { } NamingStore getNamingStore ( ) { } WritableNamingStore getWritableNamingStore ( ) { } }

Fix:
return lookupLink ( parseName ( name ) ) ;