immutables/immutables

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

bhamiltoncx opened this issue · 4 comments

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

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

fixed in 5f8cd95

Released 1.0.1 where it should be fixed. Thanks!

Looks good, confirmed fix!