Skip to content

Commit a38d992

Browse files
Add BitSet#clone
1 parent 4b9d879 commit a38d992

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

runtime/src/java/util/BitSet.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,10 @@ private BitSet(long[] bits, boolean needClear, int actualArrayLength,
112112
this.isLengthActual = isLengthActual;
113113
}
114114

115+
public BitSet clone() {
116+
return new BitSet(Arrays.copyOf(bits, bits.length), needClear, actualArrayLength, isLengthActual);
117+
}
118+
115119
/**
116120
* Compares the argument to this {@code BitSet} and returns whether they are
117121
* equal. The object must be an instance of {@code BitSet} with the same

0 commit comments

Comments
 (0)