Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 349181 - Unboxing warning is not reported when using enhanced 'for' (foreach) on Iterable
Summary: Unboxing warning is not reported when using enhanced 'for' (foreach) on Iterable
Status: RESOLVED DUPLICATE of bug 322553
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.7   Edit
Hardware: PC Windows Vista
: P3 minor (vote)
Target Milestone: ---   Edit
Assignee: Srikanth Sankaran CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-06-13 08:13 EDT by Ben Davis CLA
Modified: 2011-06-13 10:45 EDT (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Ben Davis CLA 2011-06-13 08:13:12 EDT
Build Identifier: I20100129-1300

for (int i:new HashSet<Integer>()) {} //Should warn but doesn't
for (int i:new Integer[10]) {} //Warns as expected
for (Integer i:new int[10]) {} //Warns as expected

I'd expect an unboxing warning on the first line.

Reproducible: Always

Steps to Reproduce:
1. Make sure unboxing warnings are enabled.
2. Put the above code in a function in an editor.
3. Observe where the warnings are and aren't. (I didn't save the code for my test.)
Comment 1 Srikanth Sankaran CLA 2011-06-13 08:39:56 EDT
Same as bug 322553

*** This bug has been marked as a duplicate of bug 322553 ***
Comment 2 Ben Davis CLA 2011-06-13 10:45:56 EDT
Ah, sorry. I searched for 'unboxing' but not 'boxing'. Hopefully anyone else who does the same will find this bug :)