Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Misplaced annotation check may be overly strict when dealing with legacy code #718

Open
gissuebot opened this issue Jul 7, 2014 · 1 comment
Labels

Comments

@gissuebot
Copy link

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

@gissuebot
Copy link
Author

From mcculls on July 29, 2012 18:00:30

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.

Attachment: gist
   GUICE_718_20120729.txt

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant