commit | 591c489465555590455cc09935fb25aa1d94c3d8 | [log] [tgz] |
---|---|---|
author | Carsten Hammer <carsten.hammer@t-online.de> | Sat Oct 24 14:56:19 2020 +0200 |
committer | Jeff Johnston <jjohnstn@redhat.com> | Tue Oct 27 14:50:43 2020 -0400 |
tree | 1c2001d18d966362d3685fe50958d6978203e7f1 | |
parent | 10d4ec67649ed96e0f214228fb9b3525a8c8fab4 [diff] |
Bug 568197 - Using .equals to compare two org.eclipse.jdt.core.IJavaElement[]'s, (equivalent to ==) in org.eclipse.jdt.internal.ui.typehierarchy.TypeHierarchyViewPart.updateInput(IJavaElement[]) and org.eclipse.jdt.internal.ui.typehierarchy.TypeHierarchyViewPart.setInputElements(IJavaElement[]) This method invokes the .equals(Object o) method on an array. Since arrays do not override the equals method of Object, calling equals on an array is the same as comparing their addresses. To compare the contents of the arrays, use java.util.Arrays.equals(Object[], Object[]). To compare the addresses of the arrays, it would be less confusing to explicitly check pointer equality using ==. Rank: Scariest (3), confidence: Normal Pattern: EC_BAD_ARRAY_COMPARE Type: EC, Category: CORRECTNESS (Correctness) Change-Id: I3075ce4e36a525d51f46d8652246525f6523b7a6 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.