Bug 73081

Summary: Inconsistant type cast warning.
Product: [Eclipse Project] JDT Reporter: Gary Gregory <ggregory>
Component: CoreAssignee: Philipe Mulet <philippe_mulet>
Status: VERIFIED FIXED QA Contact:
Severity: normal    
Priority: P3    
Version: 3.0   
Target Milestone: 3.1 M5   
Hardware: PC   
OS: Windows XP   
Whiteboard:

Description Gary Gregory CLA 2004-09-01 13:52:36 EDT
"value" is declared as a short ivar in:

    public int hashCode() {
        return (int) value;
    }

Which warns: "Unnecessary cast to type int for expression of type short"

But here:

    public String toString() {
        return String.valueOf((int) value);
    }

I get: "Unnecessary cast to type int for expression of type short. It is already
compatible with the argument type int"

Shouldn't the messages be the same? If there is a subtle difference it should be
better explained. Thanks.

Version 3.1.M1
Comment 1 Philipe Mulet CLA 2005-01-05 08:43:56 EST
Merged to 2 problems in one as suggested. The extra message was indeed of little
value.
Fixed
Comment 2 Jerome Lanneluc CLA 2005-02-15 05:25:55 EST
Verified in I20050214