Skip to content

Commit

Permalink
WELD-1871 Revised UtilLogger
Browse files Browse the repository at this point in the history
  • Loading branch information
mkouba authored and jharting committed Jul 22, 2015
1 parent fd6553b commit a772b9f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
10 changes: 5 additions & 5 deletions impl/src/main/java/org/jboss/weld/logging/UtilLogger.java
Original file line number Diff line number Diff line change
Expand Up @@ -54,11 +54,11 @@ public interface UtilLogger extends WeldLogger {
@Message(id = 806, value = "Cannot have more than one pre destroy method annotated @PreDestroy for {0}", format = Format.MESSAGE_FORMAT)
DefinitionException tooManyPreDestroyMethods(Object param1);

@Message(id = 807, value = "Initializer method {0} cannot be annotated @Produces on {1}", format = Format.MESSAGE_FORMAT)
DefinitionException initializerCannotBeProducer(Object param1, Object param2);
@Message(id = 807, value = "Initializer method cannot be annotated @Produces {0}\n\tat {1}\n StackTrace:", format = Format.MESSAGE_FORMAT)
DefinitionException initializerCannotBeProducer(Object param1, Object stackElement);

@Message(id = 808, value = "Initializer method {0} cannot have parameters annotated @Disposes on {1}", format = Format.MESSAGE_FORMAT)
DefinitionException initializerCannotBeDisposalMethod(Object param1, Object param2);
@Message(id = 808, value = "Initializer method cannot have parameters annotated @Disposes: {0}\n\tat {1}\n StackTrace:", format = Format.MESSAGE_FORMAT)
DefinitionException initializerCannotBeDisposalMethod(Object param1, Object stackElement);

@Message(id = 810, value = "Cannot place qualifiers on final fields: {0}", format = Format.MESSAGE_FORMAT)
DefinitionException qualifierOnFinalField(Object param1);
Expand Down Expand Up @@ -96,7 +96,7 @@ public interface UtilLogger extends WeldLogger {
@Message(id = 826, value = "Cannot access values() on annotation")
DeploymentException annotationValuesInaccessible(@Cause Throwable cause);

@Message(id = 827, value = "Initializer method {0} declared on {1} may not be a generic method", format = Format.MESSAGE_FORMAT)
@Message(id = 827, value = "Initializer method may not be a generic method: {0}\n\tat {1}\n StackTrace:", format = Format.MESSAGE_FORMAT)
DefinitionException initializerMethodIsGeneric(Object param1, Object param2);

@Message(id = 832, value = "Unable to load the cache value for the key {0}", format = Format.MESSAGE_FORMAT)
Expand Down
6 changes: 3 additions & 3 deletions impl/src/main/java/org/jboss/weld/util/BeanMethods.java
Original file line number Diff line number Diff line change
Expand Up @@ -220,13 +220,13 @@ public void levelStart(Class<? super T> clazz) {
public void processMethod(EnhancedAnnotatedMethod<?, ? super T> method) {
if (method.isAnnotationPresent(Inject.class)) {
if (method.getAnnotation(Produces.class) != null) {
throw UtilLogger.LOG.initializerCannotBeProducer(method, type);
throw UtilLogger.LOG.initializerCannotBeProducer(method, Formats.formatAsStackTraceElement(method.getJavaMember()));
} else if (method.getEnhancedParameters(Disposes.class).size() > 0) {
throw UtilLogger.LOG.initializerCannotBeDisposalMethod(method, type);
throw UtilLogger.LOG.initializerCannotBeDisposalMethod(method, Formats.formatAsStackTraceElement(method.getJavaMember()));
} else if (method.getEnhancedParameters(Observes.class).size() > 0) {
throw EventLogger.LOG.invalidInitializer(method, Formats.formatAsStackTraceElement(method.getJavaMember()));
} else if (method.isGeneric()) {
throw UtilLogger.LOG.initializerMethodIsGeneric(method, type);
throw UtilLogger.LOG.initializerMethodIsGeneric(method, Formats.formatAsStackTraceElement(method.getJavaMember()));
}
if (!method.isStatic()) {
currentLevel.add(InjectionPointFactory.instance().createMethodInjectionPoint(method, declaringBean,
Expand Down

0 comments on commit a772b9f

Please sign in to comment.