3793N/A * Copyright (c) 2008, 2011, Oracle and/or its affiliates. All rights reserved. 1193N/A * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 1193N/A * This code is free software; you can redistribute it and/or modify it 1193N/A * under the terms of the GNU General Public License version 2 only, as 2362N/A * published by the Free Software Foundation. Oracle designates this 1193N/A * particular file as subject to the "Classpath" exception as provided 2362N/A * by Oracle in the LICENSE file that accompanied this code. 1193N/A * This code is distributed in the hope that it will be useful, but WITHOUT 1193N/A * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 1193N/A * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 1193N/A * version 2 for more details (a copy is included in the LICENSE file that 1193N/A * You should have received a copy of the GNU General Public License version 1193N/A * 2 along with this work; if not, write to the Free Software Foundation, 1193N/A * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 2362N/A * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 2362N/A * or visit www.oracle.com if you need additional information or have any 1193N/A // these are filled in on first parse: 1193N/A // used to decode UTF8 array 1193N/A /** Creates a constant pool parser. 1193N/A * @param classFile an array of bytes containing a class. 1193N/A * @throws InvalidConstantPoolFormatException if the header of the class has errors. 1193N/A /** Create a constant pool parser by loading the bytecodes of the 1193N/A * @param templateClass the class to parse. 1193N/A * @throws IOException raised if an I/O occurs when loading 1193N/A * the bytecode of the template class. 1193N/A * @throws InvalidConstantPoolFormatException if the header of the class has errors. 1193N/A * @see #ConstantPoolParser(byte[]) 1193N/A * @see AnonymousClassLoader#readClassFile(Class) 1193N/A /** Creates an empty patch to patch the class file 1193N/A * used by the current parser. 1193N/A * @return a new class patch. 1193N/A /** Report the tag of the indicated CP entry. 1193N/A * @return one of {@link ConstantPoolVisitor#CONSTANT_Utf8}, etc. 1193N/A /** Report the length of the constant pool. */ 1193N/A /** Report the offset, within the class file, of the start of the constant pool. */ 1193N/A /** Report the offset, within the class file, of the end of the constant pool. */ 1193N/A /** Report the CP index of this class's own name. */ 1193N/A /** Report the total size of the class file. */ 1193N/A /** Write the head (header plus constant pool) 1193N/A * of the class file to the indicated stream. 1193N/A /** Write the head (header plus constant pool) 1193N/A * of the class file to the indicated stream, 1193N/A * incorporating the non-null entries of the given array 1193N/A // this will be useful to partially emulate the class loader on old JVMs 1193N/A /** Write the tail (everything after the constant pool) 1193N/A * of the class file to the indicated stream. 1193N/A // skip major, minor version 1193N/A /** Parse the constant pool of the class 1193N/A * calling a method visit* each time a constant pool entry is parsed. 1193N/A * The order of the calls to visit* is not guaranteed to be the same 1193N/A * than the order of the constant pool entry in the bytecode array. 1193N/A * @throws InvalidConstantPoolFormatException 1193N/A // clean out the int[] values, which are temporary 1193N/A //System.out.println("CP resolve pass: "+beg+".."+end); 1193N/A // use the external form favored by Class.forName: 1193N/A case 0:
case 1:
case 2:
case 3:
case 4:
case 5:
case 6:
case 7:
1193N/A /* 1110 xxxx 10xx xxxx 10xx xxxx */ 1193N/A if (((
c2 &
0xC0) !=
0x80) || ((
c3 &
0xC0) !=
0x80))
1193N/A // The number of chars produced may be less than utflen