Project: JDT
Bug 100593 [quick fix] proposes wrong cast from Object to primitive int
Reported: 2005-06-17 11:27:04 | Status: resolved fixed

I20050617-0010 void m(Object obj) { int i= obj; } In a 5.0 project, a quick fix proposes 'Add cast to (int)', which is wrong. The right cast here would be to (Integer), which would then be autounboxed. In a 1.4 project, no 'Add cast ..' quick fix is proposed, which is correct.

Files changed in fix:
org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/quickfix/TypeMismatchQuickFixTests.java org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/correction/TypeMismatchSubProcessor.java org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/correction/proposals/CastCorrectionProposal.java