Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,10 @@ public BigIntegerAddModification createCopy() {

@Override
protected BigInteger modifyImplementationHook(BigInteger input) {
return input == null ? summand : input.add(summand);
if (input == null) {
return null;
}
return input.add(summand);
}

public BigInteger getSummand() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public BigIntegerExplicitValueModification createCopy() {
@Override
protected BigInteger modifyImplementationHook(BigInteger input) {
if (input == null) {
throw new NullPointerException("original value must not be null");
return null;
}
return explicitValue;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,10 @@ public BigIntegerMultiplyModification createCopy() {

@Override
protected BigInteger modifyImplementationHook(BigInteger input) {
return input == null ? BigInteger.ZERO : input.multiply(factor);
if (input == null) {
return null;
}
return input.multiply(factor);
}

public BigInteger getFactor() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public BigIntegerShiftLeftModification createCopy() {
@Override
protected BigInteger modifyImplementationHook(BigInteger input) {
if (input == null) {
input = BigInteger.ZERO;
return null;
}
return input.shiftLeft(shift);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public BigIntegerShiftRightModification createCopy() {
@Override
protected BigInteger modifyImplementationHook(BigInteger input) {
if (input == null) {
input = BigInteger.ZERO;
return null;
}
return input.shiftRight(shift);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public BigIntegerSubtractModification createCopy() {
@Override
protected BigInteger modifyImplementationHook(BigInteger input) {
if (input == null) {
input = BigInteger.ZERO;
return null;
}
return input.subtract(subtrahend);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public BigIntegerXorModification createCopy() {
@Override
protected BigInteger modifyImplementationHook(BigInteger input) {
if (input == null) {
input = BigInteger.ZERO;
return null;
}
return input.xor(xor);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ public BooleanExplicitValueModification createCopy() {
@Override
protected Boolean modifyImplementationHook(Boolean input) {
if (input == null) {
throw new NullPointerException("original value must not be null");
return null;
}
return explicitValue;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@ public BooleanToggleModification createCopy() {

@Override
protected Boolean modifyImplementationHook(Boolean input) {
if (input == null) {
return null;
}
return !input;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,9 @@ public ByteArrayAppendValueModification createCopy() {

@Override
protected byte[] modifyImplementationHook(byte[] input) {
if (input == null) {
return null;
}
return ArrayConverter.concatenate(input, bytesToAppend);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,9 @@ public ByteArrayDeleteModification createCopy() {

@Override
protected byte[] modifyImplementationHook(byte[] input) {
if (input == null) {
return null;
}
if (input.length == 0) {
return input;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ public ByteArrayDuplicateModification createCopy() {
@Override
protected byte[] modifyImplementationHook(byte[] input) {
if (input == null) {
input = new byte[0];
return null;
}
return ArrayConverter.concatenate(input, input);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ public ByteArrayExplicitValueModification createCopy() {
@Override
protected byte[] modifyImplementationHook(byte[] input) {
if (input == null) {
throw new NullPointerException("original value must not be null");
return null;
}
return explicitValue.clone();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,8 @@ public ByteArrayInsertValueModification createCopy() {
@Override
protected byte[] modifyImplementationHook(byte[] input) {
if (input == null) {
input = new byte[0];
return null;
}

// Wrap around and also allow to insert at the end of the original value
int insertPosition = startPosition % (input.length + 1);
if (startPosition < 0) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,8 @@ public ByteArrayPrependValueModification createCopy() {
@Override
protected byte[] modifyImplementationHook(byte[] input) {
if (input == null) {
input = new byte[0];
return null;
}

return ArrayConverter.concatenate(bytesToPrepend, input);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ public ByteArrayXorModification createCopy() {
@Override
protected byte[] modifyImplementationHook(byte[] input) {
if (input == null) {
input = new byte[0];
return null;
}
if (input.length == 0) {
return input;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,9 @@ public IntegerAddModification createCopy() {

@Override
protected Integer modifyImplementationHook(Integer input) {
if (input == null) {
return null;
}
return input + summand;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public IntegerExplicitValueModification createCopy() {
@Override
protected Integer modifyImplementationHook(Integer input) {
if (input == null) {
throw new NullPointerException("original value must not be null");
return null;
}
return explicitValue;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,9 @@ public IntegerMultiplyModification createCopy() {

@Override
protected Integer modifyImplementationHook(Integer input) {
if (input == null) {
return null;
}
return input * factor;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,9 @@ public IntegerShiftLeftModification createCopy() {

@Override
protected Integer modifyImplementationHook(Integer input) {
if (input == null) {
return null;
}
return input << shift % MAX_SHIFT_MODIFIER;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,9 @@ public IntegerShiftRightModification createCopy() {

@Override
protected Integer modifyImplementationHook(Integer input) {
if (input == null) {
return null;
}
return input >> shift % MAX_SHIFT_MODIFIER;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,9 @@ public IntegerSubtractModification createCopy() {

@Override
protected Integer modifyImplementationHook(Integer input) {
if (input == null) {
return null;
}
return input - subtrahend;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@ public IntegerSwapEndianModification createCopy() {

@Override
protected Integer modifyImplementationHook(Integer input) {
if (input == null) {
return null;
}
return Integer.reverseBytes(input);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,9 @@ public IntegerXorModification createCopy() {

@Override
protected Integer modifyImplementationHook(Integer input) {
if (input == null) {
return null;
}
return input ^ xor;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,9 @@ public LongAddModification createCopy() {

@Override
protected Long modifyImplementationHook(Long input) {
if (input == null) {
return null;
}
return input + summand;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public LongExplicitValueModification createCopy() {
@Override
protected Long modifyImplementationHook(Long input) {
if (input == null) {
throw new NullPointerException("original value must not be null");
return null;
}
return explicitValue;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,10 @@ public LongMultiplyModification createCopy() {

@Override
protected Long modifyImplementationHook(Long input) {
return input == null ? 0L : input * factor;
if (input == null) {
return null;
}
return input * factor;
}

public Long getFactor() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,10 @@ public LongShiftLeftModification createCopy() {

@Override
protected Long modifyImplementationHook(Long input) {
return input == null ? 0L : input << shift % MAX_SHIFT_MODIFIER;
if (input == null) {
return null;
}
return input << shift % MAX_SHIFT_MODIFIER;
}

public int getShift() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,10 @@ public LongShiftRightModification createCopy() {

@Override
protected Long modifyImplementationHook(Long input) {
return input == null ? 0L : input >> shift % MAX_SHIFT_MODIFIER;
if (input == null) {
return null;
}
return input >> shift % MAX_SHIFT_MODIFIER;
}

public int getShift() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,10 @@ public LongSubtractModification createCopy() {

@Override
protected Long modifyImplementationHook(Long input) {
return input == null ? -subtrahend : input - subtrahend;
if (input == null) {
return null;
}
return input - subtrahend;
}

public Long getSubtrahend() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,10 @@ public LongXorModification createCopy() {

@Override
protected Long modifyImplementationHook(Long input) {
return input == null ? xor : input ^ xor;
if (input == null) {
return null;
}
return input ^ xor;
}

public Long getXor() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public ByteAddModification createCopy() {
@Override
protected Byte modifyImplementationHook(Byte input) {
if (input == null) {
input = 0;
return null;
}
return (byte) (input + summand);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public ByteExplicitValueModification createCopy() {
@Override
protected Byte modifyImplementationHook(Byte input) {
if (input == null) {
throw new NullPointerException("original value must not be null");
return null;
}
return explicitValue;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public ByteSubtractModification createCopy() {
@Override
protected Byte modifyImplementationHook(Byte input) {
if (input == null) {
input = 0;
return null;
}
return (byte) (input - subtrahend);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public ByteXorModification createCopy() {
@Override
protected Byte modifyImplementationHook(Byte input) {
if (input == null) {
input = 0;
return null;
}
return (byte) (input ^ xor);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,10 @@ public StringAppendValueModification createCopy() {

@Override
protected String modifyImplementationHook(String input) {
return input != null ? input + appendValue : appendValue;
if (input == null) {
return null;
}
return input + appendValue;
}

public String getAppendValue() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ public StringExplicitValueModification createCopy() {
@Override
protected String modifyImplementationHook(String input) {
if (input == null) {
throw new NullPointerException("original value must not be null");
return null;
}
return explicitValue;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,10 @@ public StringPrependValueModification createCopy() {

@Override
protected String modifyImplementationHook(String input) {
return input != null ? prependValue + input : prependValue;
if (input == null) {
return null;
}
return prependValue + input;
}

public String getPrependValue() {
Expand Down
Loading