Bug 250472 - [preferences] Add preference for new compiler warning: MissingHashCodeMethod
Summary: [preferences] Add preference for new compiler warning: MissingHashCodeMethod
Status: VERIFIED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 3.5   Edit
Hardware: All All
: P3 enhancement (vote)
Target Milestone: 3.5 M3   Edit
Assignee: Dani Megert CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-10-10 13:21 EDT by Kent Johnson CLA
Modified: 2008-10-28 07:18 EDT (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Kent Johnson CLA 2008-10-10 13:21:44 EDT
3.5

For bug 38751, some UI work is needed to surface the new warning.

fyi:
Added a new compiler warning to report a missing hashCode() method when overriding the equals() method from Object. 
This diagnosis is controlled by option: 
JavaCore.COMPILER_PB_MISSING_HASHCODE_METHOD and produces a problem marker which ID is
IProblem.MissingHashCodeMethod problem ID.

  Compiler option ID: Reporting Missing HashCode Method.
  When enabled, the compiler will issue an error or a warning if a type
  overrides Object.equals(Object) but does not override hashCode().
  Option id: "org.eclipse.jdt.core.compiler.problem.missingHashCodeMethod"
  Possible values: { "error", "warning", "ignore" }
  Default: "ignore"


This should appear in Potential Programming Problems section.
Comment 1 Dani Megert CLA 2008-10-13 10:15:03 EDT
Fixed in HEAD.
Available in builds > N20081012-2000.

Markus will add a quick fix.
Comment 2 Markus Keller CLA 2008-10-13 12:25:13 EDT
> Markus will add a quick fix.

Released to HEAD.
Comment 3 Dani Megert CLA 2008-10-28 07:18:02 EDT
Verified in I20081027-1800.
Filed bug 252331 for a small problem with the quick fix.