Skip to content
Closed
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 @@ -113,10 +113,10 @@ public void addModification(VariableModification<E> modification) {
/**
* Returns all modifications that are set for this modifiable variable.
*
* @return The list of modifications or null if no modifications are set
* @return A copy of the list of modifications or null if no modifications are set
*/
public LinkedList<VariableModification<E>> getModifications() {
return modifications;
return modifications == null ? null : new LinkedList<>(modifications);
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,8 @@ private ByteArrayAppendValueModification() {
*/
public ByteArrayAppendValueModification(byte[] bytesToAppend) {
super();
this.bytesToAppend =
Objects.requireNonNull(bytesToAppend, "bytesToAppend must not be null");
Objects.requireNonNull(bytesToAppend, "bytesToAppend must not be null");
this.bytesToAppend = bytesToAppend.clone();
}

/**
Expand Down Expand Up @@ -105,7 +105,7 @@ protected byte[] modifyImplementationHook(byte[] input) {
* @return The bytes to append
*/
public byte[] getBytesToAppend() {
return bytesToAppend;
return bytesToAppend == null ? null : bytesToAppend.clone();
}

/**
Expand All @@ -115,8 +115,8 @@ public byte[] getBytesToAppend() {
* @throws NullPointerException if bytesToAppend is null
*/
public void setBytesToAppend(byte[] bytesToAppend) {
this.bytesToAppend =
Objects.requireNonNull(bytesToAppend, "BytesToAppend must not be null");
Objects.requireNonNull(bytesToAppend, "BytesToAppend must not be null");
this.bytesToAppend = bytesToAppend.clone();
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@ private ByteArrayExplicitValueModification() {
*/
public ByteArrayExplicitValueModification(byte[] explicitValue) {
super();
this.explicitValue =
Objects.requireNonNull(explicitValue, "ExplicitValue must not be null");
Objects.requireNonNull(explicitValue, "ExplicitValue must not be null");
this.explicitValue = explicitValue.clone();
}

/**
Expand Down Expand Up @@ -91,7 +91,7 @@ protected byte[] modifyImplementationHook(byte[] input) {
* @return The explicit byte array
*/
public byte[] getExplicitValue() {
return explicitValue;
return explicitValue == null ? null : explicitValue.clone();
}

/**
Expand All @@ -100,8 +100,8 @@ public byte[] getExplicitValue() {
* @param explicitValue The new explicit byte array to use
*/
public void setExplicitValue(byte[] explicitValue) {
this.explicitValue =
Objects.requireNonNull(explicitValue, "ExplicitValue must not be null");
Objects.requireNonNull(explicitValue, "ExplicitValue must not be null");
this.explicitValue = explicitValue.clone();
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,8 @@ private ByteArrayInsertValueModification() {
*/
public ByteArrayInsertValueModification(byte[] bytesToInsert, int startPosition) {
super();
this.bytesToInsert =
Objects.requireNonNull(bytesToInsert, "BytesToInsert must not be null");
Objects.requireNonNull(bytesToInsert, "BytesToInsert must not be null");
this.bytesToInsert = bytesToInsert.clone();
this.startPosition = startPosition;
}

Expand Down Expand Up @@ -129,7 +129,7 @@ protected byte[] modifyImplementationHook(byte[] input) {
* @return The bytes to insert
*/
public byte[] getBytesToInsert() {
return bytesToInsert;
return bytesToInsert == null ? null : bytesToInsert.clone();
}

/**
Expand All @@ -139,8 +139,8 @@ public byte[] getBytesToInsert() {
* @throws NullPointerException if bytesToInsert is null
*/
public void setBytesToInsert(byte[] bytesToInsert) {
this.bytesToInsert =
Objects.requireNonNull(bytesToInsert, "bytesToInsert must not be null");
Objects.requireNonNull(bytesToInsert, "bytesToInsert must not be null");
this.bytesToInsert = bytesToInsert.clone();
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,8 @@ private ByteArrayPrependValueModification() {
*/
public ByteArrayPrependValueModification(byte[] bytesToPrepend) {
super();
this.bytesToPrepend =
Objects.requireNonNull(bytesToPrepend, "bytesToPrepend must not be null");
Objects.requireNonNull(bytesToPrepend, "bytesToPrepend must not be null");
this.bytesToPrepend = bytesToPrepend.clone();
}

/**
Expand Down Expand Up @@ -107,7 +107,7 @@ protected byte[] modifyImplementationHook(byte[] input) {
* @return The bytes to prepend
*/
public byte[] getBytesToPrepend() {
return bytesToPrepend;
return bytesToPrepend == null ? null : bytesToPrepend.clone();
}

/**
Expand All @@ -117,8 +117,8 @@ public byte[] getBytesToPrepend() {
* @throws NullPointerException if bytesToPrepend is null
*/
public void setBytesToPrepend(byte[] bytesToPrepend) {
this.bytesToPrepend =
Objects.requireNonNull(bytesToPrepend, "bytesToPrepend must not be null");
Objects.requireNonNull(bytesToPrepend, "bytesToPrepend must not be null");
this.bytesToPrepend = bytesToPrepend.clone();
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,8 @@ private ByteArrayShuffleModification() {
*/
public ByteArrayShuffleModification(int[] shuffle) {
super();
this.shuffle = Objects.requireNonNull(shuffle, "Shuffle pattern must not be null");
Objects.requireNonNull(shuffle, "Shuffle pattern must not be null");
this.shuffle = shuffle.clone();
}

/**
Expand Down Expand Up @@ -113,7 +114,7 @@ protected byte[] modifyImplementationHook(byte[] input) {
* @return The int array containing the shuffle pattern
*/
public int[] getShuffle() {
return shuffle;
return shuffle == null ? null : shuffle.clone();
}

/**
Expand All @@ -123,7 +124,8 @@ public int[] getShuffle() {
* @throws NullPointerException if shuffle is null
*/
public void setShuffle(int[] shuffle) {
this.shuffle = Objects.requireNonNull(shuffle, "Shuffle pattern must not be null");
Objects.requireNonNull(shuffle, "Shuffle pattern must not be null");
this.shuffle = shuffle.clone();
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,8 @@ private ByteArrayXorModification() {
*/
public ByteArrayXorModification(byte[] xor, int startPosition) {
super();
this.xor = Objects.requireNonNull(xor, "XOR array must not be null");
Objects.requireNonNull(xor, "XOR array must not be null");
this.xor = xor.clone();
this.startPosition = startPosition;
}

Expand Down Expand Up @@ -126,10 +127,10 @@ protected byte[] modifyImplementationHook(byte[] input) {
/**
* Gets the byte array used for the XOR operation.
*
* @return The XOR byte array
* @return A copy of the XOR byte array
*/
public byte[] getXor() {
return xor;
return xor == null ? null : xor.clone();
}

/**
Expand All @@ -138,7 +139,7 @@ public byte[] getXor() {
* @param xor The new XOR byte array
*/
public void setXor(byte[] xor) {
this.xor = xor;
this.xor = xor == null ? null : xor.clone();
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ public ModifiableByteArray() {
*/
public ModifiableByteArray(byte[] originalValue) {
super();
this.originalValue = originalValue;
this.originalValue = originalValue == null ? null : originalValue.clone();
}

/**
Expand Down Expand Up @@ -99,7 +99,7 @@ public ModifiableByteArray createCopy() {
@Override
@XmlJavaTypeAdapter(UnformattedByteArrayAdapter.class)
public byte[] getOriginalValue() {
return originalValue;
return originalValue == null ? null : originalValue.clone();
}

/**
Expand All @@ -109,7 +109,7 @@ public byte[] getOriginalValue() {
*/
@Override
public void setOriginalValue(byte[] originalValue) {
this.originalValue = originalValue;
this.originalValue = originalValue == null ? null : originalValue.clone();
}

/**
Expand All @@ -121,7 +121,7 @@ public void setOriginalValue(byte[] originalValue) {
*/
@XmlJavaTypeAdapter(UnformattedByteArrayAdapter.class)
public byte[] getAssertEquals() {
return assertEquals;
return assertEquals == null ? null : assertEquals.clone();
}

/**
Expand All @@ -130,7 +130,7 @@ public byte[] getAssertEquals() {
* @param assertEquals The expected byte array value
*/
public void setAssertEquals(byte[] assertEquals) {
this.assertEquals = assertEquals;
this.assertEquals = assertEquals == null ? null : assertEquals.clone();
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ private ComparableByteArray() {
*/
public ComparableByteArray(byte[] array) {
super();
this.array = array;
this.array = array == null ? null : array.clone();
}

/**
Expand All @@ -53,7 +53,7 @@ public ComparableByteArray(byte[] array) {
* @return A the wrapped byte array
*/
public byte[] getArray() {
return array;
return array == null ? null : array.clone();
}

/**
Expand All @@ -62,7 +62,7 @@ public byte[] getArray() {
* @param array The new byte array to wrap
*/
public void setArray(byte[] array) {
this.array = array;
this.array = array == null ? null : array.clone();
}

/**
Expand Down