Skip to content

Commit

Permalink
WELD-2623 Add suppress annotations to log messages clashing due to pa…
Browse files Browse the repository at this point in the history
…ckage changes.
  • Loading branch information
manovotn committed May 11, 2020
1 parent 409d591 commit 19b1679
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ public interface CommonLogger extends WeldEnvironmentLogger {
@Message(id = 16, value = "Missing beans.xml file in META-INF", format = Format.MESSAGE_FORMAT)
IllegalStateException missingBeansXml();

@SuppressWarnings({ "weldlog:method-retType" })
@Message(id = 18, value = "Unable to resolve a bean for {0} with bindings {1}", format = Format.MESSAGE_FORMAT)
UnsatisfiedResolutionException unableToResolveBean(Object param1, Object param2);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,7 @@ public interface BootstrapLogger extends WeldLogger {
@Message(id = 140, value = "Calling Bootstrap method after container has already been initialized. For correct order, see CDI11Bootstrap's documentation.")
IllegalStateException callingBootstrapMethodAfterContainerHasBeenInitialized();

@SuppressWarnings({ "weldlog:method-sig" })
@LogMessage(level = Logger.Level.INFO)
@Message(id = 141, value = "Falling back to the default observer method resolver due to {0}", format = Format.MESSAGE_FORMAT)
void notUsingFastResolver(ObserverMethod<?> observer);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,7 @@ public interface ContextLogger extends WeldLogger {
@Message(id = 225, value = "Bean store leak detected during {0} association: {1}", format = Format.MESSAGE_FORMAT)
void beanStoreLeakDuringAssociation(Object context, Object info);

@SuppressWarnings({ "weldlog:method-sig" })
@Message(id = 226, value = "Cannot register additional context for scope: {0}, {1}", format = Format.MESSAGE_FORMAT)
DeploymentException cannotRegisterContext(Class<? extends Annotation> scope, Context context);

Expand Down
3 changes: 3 additions & 0 deletions impl/src/main/java/org/jboss/weld/logging/EventLogger.java
Original file line number Diff line number Diff line change
Expand Up @@ -80,9 +80,11 @@ public interface EventLogger extends WeldLogger {
@Message(id = 412, value = "ObserverMethod.{0}() returned null for {1}", format = Format.MESSAGE_FORMAT)
DefinitionException observerMethodsMethodReturnsNull(Object param1, Object param2);

@SuppressWarnings({ "weldlog:method-sig" })
@Message(id = 413, value = "{0} cannot be replaced by an observer method with a different bean class {1}", format = Format.MESSAGE_FORMAT)
DefinitionException beanClassMismatch(ObserverMethod<?> originalObserverMethod, ObserverMethod<?> observerMethod);

@SuppressWarnings({ "weldlog:method-sig" })
@Message(id = 414, value = "Observer method for container lifecycle event cannot be asynchronous. {0}\n\tat {1}\n StackTrace:", format = Format.MESSAGE_FORMAT)
DefinitionException asyncContainerLifecycleEventObserver(ObserverMethod<?> observer, Object stackElement);

Expand All @@ -96,6 +98,7 @@ public interface EventLogger extends WeldLogger {
@Message(id = 417, value = "The original observed type {0} is not assignable from {1} set by extension {2} - the observer method invocation may result in runtime exception!", format = Format.MESSAGE_FORMAT)
void originalObservedTypeIsNotAssignableFrom(Object originalObservedType, Object observedType, Object extension);

@SuppressWarnings({ "weldlog:method-sig" })
@Message(id = 418, value = "Observer method for container lifecycle event cannot be static. {0}\n\tat {1}\n StackTrace:", format = Format.MESSAGE_FORMAT)
DefinitionException staticContainerLifecycleEventObserver(ObserverMethod<?> observer, Object stackElement);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,7 @@ public interface ValidatorLogger extends WeldLogger {
@Message(id = 1449, value = "Method {0} defined on class {1} is not defined according to the specification. It is annotated with @{2} but its single parameter is not a {3}\n\tat {4}\n StackTrace", format = Format.MESSAGE_FORMAT)
DefinitionException interceptorMethodDoesNotHaveCorrectTypeOfParameter(Object param1, Object param2, Object param3, Object param4, Object stackElement);

@SuppressWarnings({ "weldlog:msg-value" })
@Message(id = 1451, value = "jakarta.transaction.UserTransaction cannot be injected into an enterprise bean with container-managed transactions: {0}\n\tat {1}\n StackTrace", format = Format.MESSAGE_FORMAT)
DefinitionException userTransactionInjectionIntoBeanWithContainerManagedTransactions(Object param1, Object stackElement);

Expand Down Expand Up @@ -244,6 +245,7 @@ public interface ValidatorLogger extends WeldLogger {
@Message(id = 1472, value = "EventMetadata can only be injected into an observer method: {0}\n\tat {1}\n StackTrace", format = Format.MESSAGE_FORMAT)
DefinitionException eventMetadataInjectedOutsideOfObserver(Object param1, Object stackElement);

@SuppressWarnings({ "weldlog:msg-value" })
@LogMessage(level = Level.WARN)
@Message(id = 1473, value = "jakarta.enterprise.inject.spi.Bean implementation {0} declared a normal scope but does not implementjakarta.enterprise.inject.spi.PassivationCapable. It won'''t be possible to inject this bean into a bean with a passivating scope (@SessionScoped, @ConversationScoped). This can be fixed by assigning the Bean implementation a unique id by implementing the PassivationCapable interface.", format = Format.MESSAGE_FORMAT)
void beanNotPassivationCapable(Object param1);
Expand Down

0 comments on commit 19b1679

Please sign in to comment.