commit | 1f9e388d46af3da6bae7491592e3bd1a3f9f9136 | [log] [tgz] |
---|---|---|
author | Carsten Hammer <carsten.hammer@t-online.de> | Tue Sep 29 18:22:00 2020 +0200 |
committer | Jeff Johnston <jjohnstn@redhat.com> | Tue Sep 29 19:49:42 2020 -0400 |
tree | 257e992fa32bb117be2779f94f95f30b58b504b9 | |
parent | 2ff905e7f04366d1e52b1911f20a3576873e2f46 [diff] |
Bug - add note about class implementation weakness to javadoc org.eclipse.jdt.internal.ui.filters.FilterDescriptor defines compareTo(FilterDescriptor) and uses Object.equals() This class defines a compareTo(...) method but inherits its equals() method from java.lang.Object.Generally, the value of compareTo should return zero if and only ifequals returns true. If this is violated, weird and unpredictablefailures will occur in classes such as PriorityQueue.In Java 5 the PriorityQueue.remove method uses the compareTo method,while in Java 6 it uses the equals method. From the JavaDoc for the compareTo method in the Comparable interface: It is strongly recommended, but not strictly required that (x.compareTo(y)==0) == (x.equals(y)). Generally speaking, any class that implements the Comparable interface and violates this condition should clearly indicate this fact. The recommended language is "Note: this class has a natural ordering that is inconsistent with equals." Rank: Of Concern (16), confidence: Normal Pattern: EQ_COMPARETO_USE_OBJECT_EQUALS Type: Eq, Category: BAD_PRACTICE (Bad practice) Change-Id: I45533b59c3ac134ec22006832eade715e6742222 Signed-off-by: Carsten Hammer <carsten.hammer@t-online.de>
Thanks for your interest in this project.
The JDT UI implements the user interface for the Java IDE. This includes views like Package Explorer and JUnit, the Java and properties files editors, Java search, and refactorings. Website: http://www.eclipse.org/jdt/ui/
Contributions to JDT UI are most welcome. There are many ways to contribute, from entering high quality bug reports, to contributing code or documentation changes. For a complete guide, see the [How to Contribute] 1 page on the team wiki.
Information regarding source code management, builds, coding standards, and more.
Before your contribution can be accepted by the project, you need to create and electronically sign the Eclipse Foundation Contributor License Agreement (CLA).
Public forum for Eclipse JDT users.
This project uses Bugzilla to track ongoing development and issues.
Be sure to search for existing bugs before you create another one. Remember that contributions are always welcome!
Contact the project developers via the project's “dev” list.