Skip to content

I20210423-0140

tagged this 22 Apr 19:02
Replace Short wrapper object by short primitive type when an object is
not necessary:
 - The variable must be not null,
 - The result should not make more autoboxing/unboxing than the original
code.

Given:
        Short shouldBeAPrimitiveShort = Short.MIN_VALUE;
        aShort &= shouldBeAPrimitiveShort;
        anotherShort += shouldBeAPrimitiveShort;
        yetAnotherShort ^= shouldBeAPrimitiveShort;

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

Then:
        short shouldBeAPrimitiveLong = Short.MIN_VALUE;
        aShort &= shouldBeAPrimitiveShort;
        anotherShort += shouldBeAPrimitiveShort;
        yetAnotherShort ^= shouldBeAPrimitiveShort;

Change-Id: Id10a676531c92e04f17b052f6fbc7455c476ed23
Signed-off-by: Fabrice Tiercelin <fabrice.tiercelin@yahoo.fr>
Reviewed-on: https://git.eclipse.org/r/c/jdt/eclipse.jdt.ui/+/179464
Tested-by: JDT Bot <jdt-bot@eclipse.org>
Reviewed-by: Jörg Kubitz <jkubitz-eclipse@gmx.de>
Assets 2
Loading