Skip to content

Commit

Permalink
Fixed problem with NoSuchMethodException
Browse files Browse the repository at this point in the history
  • Loading branch information
drallen committed Nov 30, 2009
1 parent 6b62aea commit e5625c7
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions impl/src/main/java/org/jboss/weld/util/Reflections.java
Expand Up @@ -57,6 +57,8 @@
import org.slf4j.ext.XLogger;
import org.slf4j.ext.XLogger.Level;

import ch.qos.cal10n.IMessageConveyor;

/**
* Utility class for static reflection-type operations
*
Expand All @@ -69,6 +71,9 @@ public class Reflections
private static final LocLogger log = loggerFactory().getLogger(UTIL);
private static final XLogger xLog = loggerFactory().getXLogger(UTIL);

// Exception messages
private static final IMessageConveyor messageConveyer = loggerFactory().getMessageConveyor();

public static final Type[] EMPTY_TYPES = {};

public static final Annotation[] EMPTY_ANNOTATIONS = {};
Expand Down Expand Up @@ -563,7 +568,7 @@ public static Object invokeAndWrap(String methodName, Object instance, Object...
{
throw new WeldException(ERROR_INVOKING_METHOD, e, methodName, instance.getClass());
}
catch (NoSuchMethodException e)
catch (java.lang.NoSuchMethodException e)
{
throw new WeldException(ERROR_INVOKING_METHOD, e, methodName, instance.getClass());
}
Expand Down Expand Up @@ -670,7 +675,7 @@ private static Method lookupMethod(String methodName, Class<?>[] parameterTypes,
// Expected, nothing to see here.
}
}
throw new WeldException(NO_SUCH_METHOD, methodName + Arrays.asList(parameterTypes).toString().replace("[", "(").replace("]", ")"), c.getName());
throw new NoSuchMethodException(messageConveyer.getMessage(NO_SUCH_METHOD, methodName + Arrays.asList(parameterTypes).toString().replace("[", "(").replace("]", ")"), c.getName()));
}

/**
Expand Down

0 comments on commit e5625c7

Please sign in to comment.