Community
Participate
Working Groups
Add a warning when auto boxing primitives using generics on Methods that have both an object and primitive version. Example: List<Integer> list = new ArrayList<Integer>(); list.add(7); list.remove(7); For this example there would be a warning for the line with the remove since there is both a .remove(Integer) and a .remove(int). There would also possibly be a suppress warning annotation for this. I was having some unbelievably strange behavior in a program I was moving to 1.5 when I came across this.
(After thinking about this I think this enhancement is more suited for a project like FindBugs)
Interesting. We do have some warnings for autoboxing situations (with appropriate @SuppressWarning). This is an interesting situation. Will think about it.
Here is an example that is closer to what I actually ran into, the integer example is kind of easy to catch. List<Character> list = new ArrayList<Character>(); char c = 0xff; list.add(c); list.remove(c);