Bug 73081 - Inconsistant type cast warning.
Summary: Inconsistant type cast warning.
Status: VERIFIED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.0   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 3.1 M5   Edit
Assignee: Philipe Mulet CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-09-01 13:52 EDT by Gary Gregory CLA
Modified: 2005-02-15 05:25 EST (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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