Skip to content

Commit

Permalink
WELD-1871 Revised BeanLogger.methodNotBusinessMethod()
Browse files Browse the repository at this point in the history
  • Loading branch information
mkouba authored and jharting committed Jul 20, 2015
1 parent 90fd158 commit 74f15f6
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
3 changes: 2 additions & 1 deletion impl/src/main/java/org/jboss/weld/bean/DisposalMethod.java
Expand Up @@ -121,7 +121,8 @@ private void checkDisposalMethod(EnhancedAnnotatedMethod<T, ? super X> enhancedA
SessionBean<?> sessionBean = (SessionBean<?>) declaringBean;
Set<MethodSignature> businessMethodSignatures = sessionBean.getBusinessMethodSignatures();
if (!businessMethodSignatures.contains(enhancedAnnotatedMethod.getSignature())) {
throw BeanLogger.LOG.methodNotBusinessMethod(enhancedAnnotatedMethod, declaringBean);
throw BeanLogger.LOG.methodNotBusinessMethod("Disposer", enhancedAnnotatedMethod, declaringBean,
Formats.formatAsStackTraceElement(enhancedAnnotatedMethod.getJavaMember()));
}
}
for (ParameterInjectionPoint<?, ?> ip : disposalMethodInjectionPoint.getParameterInjectionPoints()) {
Expand Down
Expand Up @@ -83,7 +83,7 @@ protected void checkProducerMethod(EnhancedAnnotatedMethod<T, ? super X> method)
}
}
if (!methodDeclaredOnTypes) {
throw BeanLogger.LOG.methodNotBusinessMethod(this, getDeclaringBean());
throw BeanLogger.LOG.methodNotBusinessMethod("Producer", this, getDeclaringBean(), Formats.formatAsStackTraceElement(method.getJavaMember()));
}
}
}
Expand Down
4 changes: 2 additions & 2 deletions impl/src/main/java/org/jboss/weld/logging/BeanLogger.java
Expand Up @@ -205,8 +205,8 @@ public interface BeanLogger extends WeldLogger {
@Message(id = 67, value = "{0} is not allowed on same method as {1}, see {2}\n\tat {3}\n StackTrace:", format = Format.MESSAGE_FORMAT)
DefinitionException inconsistentAnnotationsOnMethod(Object param1, Object param2, Object param3, Object stackElement);

@Message(id = 68, value = "Method {0} must be declared on a business interface of {1}", format = Format.MESSAGE_FORMAT)
DefinitionException methodNotBusinessMethod(Object param1, Object param2);
@Message(id = 68, value = "{0} method {1} is not a business method of {2}\n\tat {3}\n StackTrace:", format = Format.MESSAGE_FORMAT)
DefinitionException methodNotBusinessMethod(Object methodType, Object param1, Object param2, Object stackElement);

@Message(id = 70, value = "Simple bean {0} cannot be a non-static inner class", format = Format.MESSAGE_FORMAT)
DefinitionException simpleBeanAsNonStaticInnerClassNotAllowed(Object param1);
Expand Down

0 comments on commit 74f15f6

Please sign in to comment.