Skip to content

Commit

Permalink
[WELD-821]; add additional location info
Browse files Browse the repository at this point in the history
  • Loading branch information
alesj committed Jan 11, 2011
1 parent 64556ac commit 5ef77ee
Showing 1 changed file with 15 additions and 2 deletions.
17 changes: 15 additions & 2 deletions impl/src/main/java/org/jboss/weld/manager/Enabled.java
Expand Up @@ -40,14 +40,15 @@
import org.jboss.weld.logging.messages.ValidatorMessage;
import org.jboss.weld.metadata.MetadataImpl;
import org.jboss.weld.resources.spi.ResourceLoader;
import org.jboss.weld.resources.spi.ResourceLoadingException;
import org.jboss.weld.util.reflection.Reflections;

import com.google.common.base.Function;

/**
*
* @author Nicklas Karlsson
*
* @author Ales Justin
*/
public class Enabled
{
Expand All @@ -64,7 +65,19 @@ public ClassLoader(ResourceLoader resourceLoader)

public Metadata<Class<? extends T>> apply(Metadata<String> from)
{
return new MetadataImpl<Class<? extends T>>(Reflections.<Class<? extends T>>cast(resourceLoader.classForName(from.getValue())), from.getLocation());
String location = from.getLocation();
try
{
return new MetadataImpl<Class<? extends T>>(Reflections.<Class<? extends T>>cast(resourceLoader.classForName(from.getValue())), location);
}
catch (ResourceLoadingException e)
{
throw new ResourceLoadingException(e.getMessage() + "; location: " + location, e.getCause());
}
catch (Exception e)
{
throw new ResourceLoadingException(e.getMessage() + "; location: " + location, e);
}
}

}
Expand Down

0 comments on commit 5ef77ee

Please sign in to comment.