Community
Participate
Working Groups
Build id: I20091210-1301 1. In a 1.5 project, enter the following code: List<?> obj = new ArrayList<Object>(); obj.add(0, new Object()); 2. The 'add' method will have an error, hit Ctrl+1, it will suggest to 'Change to 'addAll(...)''. Do so. 3. The code is changed. Save. Now there's an error for 'addAll'. :( 4. Hit Ctrl+1, now it's suggesting 'Cast argument 'new Object()' to 'Collection<? extends ?>' and 'Change to 'add(...)''. 5. Try both. Neither of them will get the code to compile. :((
There's no free lunch ;-). Quick fix just makes some guesses and then lets you decide whether they could be useful. In this case, it looks like we should not propose other methods or to cast arguments, but better concentrate on the type of the target variable 'obj' and suggest to turn it into List<Object> or List<? super Object>.
*** Bug 352429 has been marked as a duplicate of this bug. ***
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet. If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant. -- The automated Eclipse Genie.