Summary: | [1.5][compiler] Autoboxing doesnt workt in switch-statement | ||||||
---|---|---|---|---|---|---|---|
Product: | [Eclipse Project] JDT | Reporter: | Jörg Schuberth <joerg.schuberth> | ||||
Component: | Core | Assignee: | Philipe Mulet <philippe_mulet> | ||||
Status: | VERIFIED FIXED | QA Contact: | |||||
Severity: | normal | ||||||
Priority: | P3 | ||||||
Version: | 3.2 | ||||||
Target Milestone: | 3.2.1 | ||||||
Hardware: | PC | ||||||
OS: | Linux | ||||||
Whiteboard: | |||||||
Attachments: |
|
Description
Jörg Schuberth
2006-09-04 07:52:41 EDT
The second error in "new Byte(127)" is legite; there is no narrowing conversion on message invocations (dixit JLS 5.3) There are indeed a few places where we do not allowing narrowing conversion before boxing (int (byte) cst assignmt compatible with Byte JLS5.2) Same issue for the following code which should be accepted. public class X { Byte foo() { final int i = -128; return i; } } Added AutoboxingTest#test121-122. Also there are autoboxing warnings emitted for case statement which aren't appropriate, since in the end no such conversion is performed. Should get rid of following line which is unnecessary in CaseStatement#resolveCase constantExpression.computeConversion(scope, caseType, switchExpressionType); Created attachment 49349 [details]
Proposed patch
patch for 3.2 maintenance
Released for 3.2.1 [R3_2_maintenance] Released for 3.3M2 [HEAD] Fixed Verified for 3.2.1 using build M20060908-1655 Verified for 3.3 M2 using build I20060918-0010. |