Bug 572763 - [AutoRefactor #73/153] long primitive rather than wrapper

Replace Long wrapper object by long primitive type when an object is not
 - The variable must be not null,
 - The result should not make more autoboxing/unboxing than the original

        Long shouldBeAPrimitiveLong = Long.MIN_VALUE;
        aLong &= shouldBeAPrimitiveLong;
        anotherLong += shouldBeAPrimitiveLong;
        yetAnotherLong ^= shouldBeAPrimitiveLong;

Applying "Primitive rather than wrapper" clean up...

        long shouldBeAPrimitiveLong = Long.MIN_VALUE;
        aLong &= shouldBeAPrimitiveLong;
        anotherLong += shouldBeAPrimitiveLong;
        yetAnotherLong ^= shouldBeAPrimitiveLong;

Also add tests for int primitives.

Change-Id: I63971c8154d4b1a2baa50704147d000e44882b11
Signed-off-by: Fabrice Tiercelin <fabrice.tiercelin@yahoo.fr>
Reviewed-on: https://git.eclipse.org/r/c/jdt/eclipse.jdt.ui/+/179166
11 files changed
tree: 8f3473ef9d32fd32defe03de3003c7122f39edc6
  1. .gitignore
  5. README.md
  6. org.eclipse.jdt.astview.feature/
  7. org.eclipse.jdt.astview/
  8. org.eclipse.jdt.core.manipulation/
  9. org.eclipse.jdt.jeview.feature/
  10. org.eclipse.jdt.jeview/
  11. org.eclipse.jdt.junit.core/
  12. org.eclipse.jdt.junit.runtime/
  13. org.eclipse.jdt.junit/
  14. org.eclipse.jdt.junit4.runtime/
  15. org.eclipse.jdt.junit5.runtime/
  16. org.eclipse.jdt.text.tests/
  17. org.eclipse.jdt.ui.examples.javafamily/
  18. org.eclipse.jdt.ui.examples.projects/
  19. org.eclipse.jdt.ui.junit.sampleproject/
  20. org.eclipse.jdt.ui.tests.refactoring/
  21. org.eclipse.jdt.ui.tests/
  22. org.eclipse.jdt.ui.unittest.junit.feature/
  23. org.eclipse.jdt.ui.unittest.junit/
  24. org.eclipse.jdt.ui/
  25. org.eclipse.ltk.core.refactoring.tests/
  26. org.eclipse.ltk.core.refactoring/
  27. org.eclipse.ltk.ui.refactoring.tests/
  28. org.eclipse.ltk.ui.refactoring/
  29. pom.xml
  30. tests-pom/

Contributing to JDT UI - Java development tools UI

Thanks for your interest in this project.

Project description:

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/

How to contribute:

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.

Developer resources:

Information regarding source code management, builds, coding standards, and more.

Contributor License Agreement:

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.

Search for bugs:

This project uses Bugzilla to track ongoing development and issues.

Create a new bug:

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.


Eclipse Public License (EPL) v2.0