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,6 +38,9 @@

@Override
protected BigInteger modifyImplementationHook(BigInteger input) {
if (input == null) {

Check warning on line 41 in src/main/java/de/rub/nds/modifiablevariable/biginteger/BigIntegerExplicitValueModification.java

View check run for this annotation

Jenkins CI - TLS-Attacker / JaCoCo Coverage

Partially covered line

Line 41 is only partially covered, one branch is missing
throw new NullPointerException("original value must not be null");

Check warning on line 42 in src/main/java/de/rub/nds/modifiablevariable/biginteger/BigIntegerExplicitValueModification.java

View check run for this annotation

Jenkins CI - TLS-Attacker / JaCoCo Coverage

Not covered line

Line 42 is not covered by tests
}
return explicitValue;
}

Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,9 @@

@Override
protected Boolean modifyImplementationHook(Boolean input) {
if (input == null) {

Check warning on line 39 in src/main/java/de/rub/nds/modifiablevariable/bool/BooleanExplicitValueModification.java

View check run for this annotation

Jenkins CI - TLS-Attacker / JaCoCo Coverage

Partially covered line

Line 39 is only partially covered, one branch is missing
throw new NullPointerException("original value must not be null");

Check warning on line 40 in src/main/java/de/rub/nds/modifiablevariable/bool/BooleanExplicitValueModification.java

View check run for this annotation

Jenkins CI - TLS-Attacker / JaCoCo Coverage

Not covered line

Line 40 is not covered by tests
}
return explicitValue;
}

Expand Down

This file was deleted.

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

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

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

@Override
protected byte[] modifyImplementationHook(byte[] input) {
if (input == null) {
input = new byte[0];
}

return ArrayConverter.concatenate(input, bytesToAppend);
}

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

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

@Override
protected byte[] modifyImplementationHook(byte[] input) {
if (input == null) {

Check warning on line 44 in src/main/java/de/rub/nds/modifiablevariable/bytearray/ByteArrayExplicitValueModification.java

View check run for this annotation

Jenkins CI - TLS-Attacker / JaCoCo Coverage

Partially covered line

Line 44 is only partially covered, one branch is missing
throw new NullPointerException("original value must not be null");

Check warning on line 45 in src/main/java/de/rub/nds/modifiablevariable/bytearray/ByteArrayExplicitValueModification.java

View check run for this annotation

Jenkins CI - TLS-Attacker / JaCoCo Coverage

Not covered line

Line 45 is not covered by tests
}
return explicitValue.clone();
}

Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ public IntegerAddModification createCopy() {

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

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

@Override
protected Integer modifyImplementationHook(Integer input) {
if (input == null) {
throw new NullPointerException("original value must not be null");
}
return explicitValue;
}

Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ public IntegerMultiplyModification createCopy() {

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

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

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

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

@Override
protected Integer modifyImplementationHook(Integer input) {
return input == null ? 0 : input >> shift % MAX_SHIFT_MODIFIER;
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,7 @@ public IntegerSubtractModification createCopy() {

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

public Integer getSubtrahend() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,6 @@ 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,7 +37,7 @@ public IntegerXorModification createCopy() {

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

public Integer getXor() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,11 @@ public void setAssertEquals(Integer assertEquals) {

@Override
public boolean isOriginalValueModified() {
return getOriginalValue() != null && getOriginalValue().compareTo(getValue()) != 0;
if (getOriginalValue() == null) {
throw new IllegalStateException("Original value must not be null");
} else {
return getOriginalValue().compareTo(getValue()) != 0;
}
}

public byte[] getByteArray(int size) {
Expand Down
Loading