jjg@1339: /* vromero@1591: * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved. jjg@1339: * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. jjg@1339: * jjg@1339: * This code is free software; you can redistribute it and/or modify it jjg@1339: * under the terms of the GNU General Public License version 2 only, as jjg@1339: * published by the Free Software Foundation. Oracle designates this jjg@1339: * particular file as subject to the "Classpath" exception as provided jjg@1339: * by Oracle in the LICENSE file that accompanied this code. jjg@1339: * jjg@1339: * This code is distributed in the hope that it will be useful, but WITHOUT jjg@1339: * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or jjg@1339: * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License jjg@1339: * version 2 for more details (a copy is included in the LICENSE file that jjg@1339: * accompanied this code). jjg@1339: * jjg@1339: * You should have received a copy of the GNU General Public License version jjg@1339: * 2 along with this work; if not, write to the Free Software Foundation, jjg@1339: * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. jjg@1339: * jjg@1339: * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA jjg@1339: * or visit www.oracle.com if you need additional information or have any jjg@1339: * questions. jjg@1339: */ jjg@1339: jjg@1339: package com.sun.tools.javac.util; jjg@1339: jjg@1339: import java.lang.reflect.Array; jjg@1339: jjg@1339: /**
This is NOT part of any supported API.
jjg@1339: * If you write code that depends on this, you do so at your own risk.
jjg@1339: * This code and its internal interfaces are subject to change or
jjg@1339: * deletion without notice.
jjg@1339: */
jjg@1339: public class ArrayUtils {
jjg@1339:
jjg@1339: private static int calculateNewLength(int currentLength, int maxIndex) {
jjg@1339: while (currentLength < maxIndex + 1)
jjg@1339: currentLength = currentLength * 2;
jjg@1339: return currentLength;
jjg@1339: }
jjg@1339:
jjg@1339: public static