src/share/classes/com/sun/tools/javac/util/Bits.java

changeset 1339
0e5899f09dab
parent 1326
30c36e23f154
child 1713
2ca9e7d50136
equal deleted inserted replaced
1338:ad2ca2a4ab5e 1339:0e5899f09dab
22 * or visit www.oracle.com if you need additional information or have any 22 * or visit www.oracle.com if you need additional information or have any
23 * questions. 23 * questions.
24 */ 24 */
25 25
26 package com.sun.tools.javac.util; 26 package com.sun.tools.javac.util;
27
28 import java.util.Arrays;
27 29
28 /** A class for extensible, mutable bit sets. 30 /** A class for extensible, mutable bit sets.
29 * 31 *
30 * <p><b>This is NOT part of any supported API. 32 * <p><b>This is NOT part of any supported API.
31 * If you write code that depends on this, you do so at your own risk. 33 * If you write code that depends on this, you do so at your own risk.
60 inclRange(start, limit); 62 inclRange(start, limit);
61 } 63 }
62 64
63 private void sizeTo(int len) { 65 private void sizeTo(int len) {
64 if (bits.length < len) { 66 if (bits.length < len) {
65 int[] newbits = new int[len]; 67 bits = Arrays.copyOf(bits, len);
66 System.arraycopy(bits, 0, newbits, 0, bits.length);
67 bits = newbits;
68 } 68 }
69 } 69 }
70 70
71 /** This set = {}. 71 /** This set = {}.
72 */ 72 */

mercurial