Skip to content

Commit

Permalink
objectionary#3160 copy array instead of storing directly
Browse files Browse the repository at this point in the history
  • Loading branch information
c71n93 committed May 14, 2024
1 parent 380976e commit b2a049c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
3 changes: 1 addition & 2 deletions eo-runtime/src/main/java/org/eolang/BytesOf.java
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,8 @@ public final class BytesOf implements Bytes {
* Ctor.
* @param data Data.
*/
@SuppressWarnings("PMD.ArrayIsStoredDirectly")
public BytesOf(final byte[] data) {
this.data = data;
this.data = Arrays.copyOf(data, data.length);
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,8 @@ public final class VerboseBytesAsString implements Supplier<String> {
* Ctor.
* @param data Data.
*/
@SuppressWarnings("PMD.ArrayIsStoredDirectly")
public VerboseBytesAsString(final byte[] data) {
this.data = data;
this.data = Arrays.copyOf(data, data.length);
}

@Override
Expand Down

0 comments on commit b2a049c

Please sign in to comment.