You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is not really a defect as such, and only affects a few scenarios, but just wanted to capture the use-case.
When dealing with legacy code you may encounter interfaces with misplaced annotations (such as @Singleton). They might use this as a kind of extension-point documentation, or as a way to generate bindings at runtime.
Currently any use of such an interface in Guice will cause the injector to throw a configuration error - the only way to avoid this is to use a different interface or get the interface changed upstream. However sometimes an upstream change is not possible, and it would be useful if instead the injector could be configured to log such errors as warnings.
While this particular use-case is narrow, there may be other errors which are technically not fatal and could be logged as warnings when running in some sort of "non-strict"/"legacy" mode or stage.
Just for reference, attached is our current hack to turn off strict misplaced annotation checks for specific isolated legacy applications. A better approach would be to expose a non-strict setting via some kind of binder option or perhaps a new stage. Although ideally such applications would eventually be fixed and no such change would be required.
From mcculls on July 29, 2012 20:54:43
This is not really a defect as such, and only affects a few scenarios, but just wanted to capture the use-case.
When dealing with legacy code you may encounter interfaces with misplaced annotations (such as
@
Singleton). They might use this as a kind of extension-point documentation, or as a way to generate bindings at runtime.Currently any use of such an interface in Guice will cause the injector to throw a configuration error - the only way to avoid this is to use a different interface or get the interface changed upstream. However sometimes an upstream change is not possible, and it would be useful if instead the injector could be configured to log such errors as warnings.
While this particular use-case is narrow, there may be other errors which are technically not fatal and could be logged as warnings when running in some sort of "non-strict"/"legacy" mode or stage.
Original issue: http://code.google.com/p/google-guice/issues/detail?id=718
The text was updated successfully, but these errors were encountered: