From a38d992fbacb63172c807f677f1d0b5fb2a84b06 Mon Sep 17 00:00:00 2001 From: TheLogicMaster Date: Thu, 26 May 2022 23:41:32 -0400 Subject: [PATCH] Add BitSet#clone --- runtime/src/java/util/BitSet.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/runtime/src/java/util/BitSet.java b/runtime/src/java/util/BitSet.java index 47b25c5..a3afa79 100644 --- a/runtime/src/java/util/BitSet.java +++ b/runtime/src/java/util/BitSet.java @@ -112,6 +112,10 @@ private BitSet(long[] bits, boolean needClear, int actualArrayLength, this.isLengthActual = isLengthActual; } + public BitSet clone() { + return new BitSet(Arrays.copyOf(bits, bits.length), needClear, actualArrayLength, isLengthActual); + } + /** * Compares the argument to this {@code BitSet} and returns whether they are * equal. The object must be an instance of {@code BitSet} with the same