Skip to content

Commit

Permalink
Fix large array clone methods
Browse files Browse the repository at this point in the history
  • Loading branch information
neesjanvaneck committed Aug 18, 2023
1 parent 15cf642 commit 94c72d2
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 4 deletions.
4 changes: 3 additions & 1 deletion src/main/java/nl/cwts/util/LargeBooleanArray.java
Original file line number Diff line number Diff line change
Expand Up @@ -761,7 +761,9 @@ public LargeBooleanArray clone()
try
{
clonedArray = (LargeBooleanArray)super.clone();
clonedArray.values = values.clone();
clonedArray.values = new boolean[values.length][];
for (int i = 0; i < values.length; i++)
clonedArray.values[i] = values[i].clone();
return clonedArray;
}
catch (CloneNotSupportedException e)
Expand Down
4 changes: 3 additions & 1 deletion src/main/java/nl/cwts/util/LargeDoubleArray.java
Original file line number Diff line number Diff line change
Expand Up @@ -1057,7 +1057,9 @@ public LargeDoubleArray clone()
try
{
clonedArray = (LargeDoubleArray)super.clone();
clonedArray.values = values.clone();
clonedArray.values = new double[values.length][];
for (int i = 0; i < values.length; i++)
clonedArray.values[i] = values[i].clone();
return clonedArray;
}
catch (CloneNotSupportedException e)
Expand Down
4 changes: 3 additions & 1 deletion src/main/java/nl/cwts/util/LargeIntArray.java
Original file line number Diff line number Diff line change
Expand Up @@ -1055,7 +1055,9 @@ public LargeIntArray clone()
try
{
clonedArray = (LargeIntArray)super.clone();
clonedArray.values = values.clone();
clonedArray.values = new int[values.length][];
for (int i = 0; i < values.length; i++)
clonedArray.values[i] = values[i].clone();
return clonedArray;
}
catch (CloneNotSupportedException e)
Expand Down
4 changes: 3 additions & 1 deletion src/main/java/nl/cwts/util/LargeLongArray.java
Original file line number Diff line number Diff line change
Expand Up @@ -1056,7 +1056,9 @@ public LargeLongArray clone()
try
{
clonedArray = (LargeLongArray)super.clone();
clonedArray.values = values.clone();
clonedArray.values = new long[values.length][];
for (int i = 0; i < values.length; i++)
clonedArray.values[i] = values[i].clone();
return clonedArray;
}
catch (CloneNotSupportedException e)
Expand Down

0 comments on commit 94c72d2

Please sign in to comment.