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

immutable: Generated class uses @SuppressWarnings("unchecked") unnecessarily #36

Closed
bhamiltoncx opened this issue Oct 31, 2014 · 4 comments
Labels

Comments

@bhamiltoncx
Copy link
Contributor

I'm testing the upgrade from 0.31-SNAPSHOT to 1.0 in the Buck repository.

We compile our code with ecj (the Eclipse Compiler for Java), and we found that the 1.0 release raises an error when compiling with ecj because the generated code uses @SuppressWarnings("unchecked") unnecessarily:

[javac] 1. ERROR in buck/build/immutables/com/facebook/buck/apple/ImmutableAppleSdkPaths.java (at line 18)
[javac]     @SuppressWarnings({"all", "unchecked"})
[javac]                               ^^^^^^^^^^^
[javac] Unnecessary @SuppressWarnings("unchecked")

I'm guessing this can be removed from the generated code (at least in the way we're using it).

Here's the source file:

http://pastebin.com/cpEprRZa

And here's the file it generates:

http://pastebin.com/rBed0978

@elucash
Copy link
Member

elucash commented Nov 1, 2014

Wow, I, probably, "outsmarted" myself with those suppressions ). I also like to use zero-warning policy on builds, It's just Maven was silent on this. Need to be fixed

@elucash elucash changed the title Generated class uses @SuppressWarnings("unchecked") unnecessarily immutable: Generated class uses @SuppressWarnings("unchecked") unnecessarily Nov 1, 2014
@elucash elucash added the bug label Nov 1, 2014
@elucash
Copy link
Member

elucash commented Nov 2, 2014

fixed in 5f8cd95

@elucash
Copy link
Member

elucash commented Nov 2, 2014

Released 1.0.1 where it should be fixed. Thanks!

@bhamiltoncx
Copy link
Contributor Author

Looks good, confirmed fix!

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

2 participants