Skip to content

Commit

Permalink
Minor adjustments
Browse files Browse the repository at this point in the history
  • Loading branch information
manovotn committed Sep 6, 2023
1 parent 36408f3 commit b8fa638
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,10 @@ public Collection<AnnotatedMethod<? super Object>> getInvokableMethods() {
@Override
public InvokerBuilder<Invoker<Object, ?>> createInvoker(AnnotatedMethod<? super Object> annotatedMethod) {
checkWithinObserverNotification();
if (!getBean().getInvokableMethods().contains(annotatedMethod)) {
// TODO better exception
throw new IllegalArgumentException("Not an invokable method: " + annotatedMethod);
}
return new InvokerBuilderImpl<>(getBean().getEjbDescriptor().getBeanClass(), annotatedMethod.getJavaMember(), getBeanManager());
}
}
6 changes: 3 additions & 3 deletions impl/src/main/java/org/jboss/weld/invokable/InvokerImpl.java
Original file line number Diff line number Diff line change
Expand Up @@ -150,10 +150,10 @@ private InvokerImpl(MethodHandle beanMethodHandle, Annotation[] instanceLookupQu
{
MethodHandle cleanupMethod;
try {
//String runName = "run"; // to appease a silly checkstyle rule
String runName = "run"; // to appease a silly checkstyle rule
cleanupMethod = finalMethodHandle.type().returnType() == void.class
? MethodHandleUtils.createMethodHandle(CleanupActions.class.getMethod("run", Throwable.class, CleanupActions.class))
: MethodHandleUtils.createMethodHandle(CleanupActions.class.getMethod("run", Throwable.class, Object.class, CleanupActions.class));
? MethodHandleUtils.createMethodHandle(CleanupActions.class.getMethod(runName, Throwable.class, CleanupActions.class))
: MethodHandleUtils.createMethodHandle(CleanupActions.class.getMethod(runName, Throwable.class, Object.class, CleanupActions.class));
} catch (NoSuchMethodException e) {
// should never happen
throw new IllegalStateException("Unable to locate Weld internal helper method");
Expand Down

0 comments on commit b8fa638

Please sign in to comment.