commit | 24640fbe368f150914fe19ac9546cdc8fe7bf765 | [log] [tgz] |
---|---|---|
author | Fabrice Tiercelin <fabrice.tiercelin@yahoo.fr> | Thu May 20 20:00:10 2021 +0200 |
committer | Noopur Gupta <noopur_gupta@in.ibm.com> | Mon May 24 08:46:31 2021 -0400 |
tree | 4bb2d28a6ac87a0aa3e388f46693cfd6f39d7124 | |
parent | 65e8c93efbb5e33494a2ce240be130bb43307df9 [diff] |
Bug 573672 - [cleanup & saveaction] "Unnecessary array creation" rule makes NPE on default package "Unnecessary array creation" cleanup rule makes a null pointer when the class is in the default package. Given: public class A { public class B { public void foo(Object elementsOrTreePaths, Integer obj, Integer obj2) { return; } } public class C extends B { public void foo(Object... elementsOrTreePaths) { return; } public void foo(Object elementsOrTreePaths, Integer obj) { foo(new Object[] {elementsOrTreePaths, obj}); foo(new Object[] {elementsOrTreePaths, elementsOrTreePaths}); foo(new Object[] {elementsOrTreePaths, obj, obj}); foo(new Object[] {elementsOrTreePaths, obj, elementsOrTreePaths}); } } } When: Applying "Unnecessary array creation" rule... Expected: public class A { public class B { public void foo(Object elementsOrTreePaths, Integer obj, Integer obj2) { return; } } public class C extends B { public void foo(Object... elementsOrTreePaths) { return; } public void foo(Object elementsOrTreePaths, Integer obj) { foo(elementsOrTreePaths, obj); foo(elementsOrTreePaths, elementsOrTreePaths); foo(elementsOrTreePaths, obj, obj); foo(elementsOrTreePaths, obj, elementsOrTreePaths); } } } Actual: NPE Change-Id: I821543924ea6437a3386b449b31199e2715b9d0c Signed-off-by: Fabrice Tiercelin <fabrice.tiercelin@yahoo.fr> Reviewed-on: https://git.eclipse.org/r/c/jdt/eclipse.jdt.ui/+/180819 Tested-by: JDT Bot <jdt-bot@eclipse.org> Reviewed-by: Noopur Gupta <noopur_gupta@in.ibm.com>
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.