/*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
/**
* Reader for a class file that is being incorporated into a package.
* @author John Rose
*/
class ClassReader {
int verbose;
long inPos;
return nr;
}
public int read() throws IOException {
return ch;
}
public long skip(long n) throws IOException {
return ns;
}
});
}
}
this.attrCommands = attrCommands;
}
long skipped = 0;
while (skipped < n) {
assert(j > 0);
skipped += j;
}
assert(skipped == n);
}
return in.readUnsignedShort();
}
}
/** Read a 2-byte int, and return the <em>global</em> CP entry for it. */
int i = in.readUnsignedShort();
}
assert(e != null);
assert(e.tagMatches(tag));
return e;
}
return e;
}
}
}
}
// The class file stores a Utf8, but we want a Signature.
}
boolean ok = false;
try {
readHeader();
readMembers(false); // fields
readMembers(true); // methods
cls.finishReading();
ok = true;
} finally {
if (!ok) {
}
}
}
throw new Attribute.FormatException
("Bad magic number in class file "
//System.out.println("ClassFile.version="+cls.majver+"."+cls.minver);
throw new Attribute.FormatException
}
}
return "small";
}
return "large";
}
return null; // OK
}
//System.err.println("reading CP, length="+length);
int fptr = 0;
for (int i = 1; i < length; i++) {
//System.err.println("reading CP elt, i="+i);
switch (tag) {
case CONSTANT_Utf8:
break;
case CONSTANT_Integer:
{
}
break;
case CONSTANT_Float:
{
}
break;
case CONSTANT_Long:
{
}
break;
case CONSTANT_Double:
{
}
break;
// just read the refs; do not attempt to resolve while reading
case CONSTANT_Class:
case CONSTANT_String:
break;
case CONSTANT_Fieldref:
case CONSTANT_Methodref:
case CONSTANT_NameandType:
break;
default:
throw new ClassFormatException("Bad constant pool tag " +
" at pos: " + inPos);
}
}
// Fix up refs, which might be out of order.
while (fptr > 0) {
if (verbose > 3)
fptr = 0;
if (verbose > 3)
// Defer.
continue;
}
switch (tag) {
case CONSTANT_Class:
break;
case CONSTANT_String:
break;
case CONSTANT_Fieldref:
case CONSTANT_Methodref:
break;
case CONSTANT_NameandType:
break;
default:
assert(false);
}
}
}
}
int ni = readUnsignedShort();
for (int i = 0; i < ni; i++) {
}
}
int nm = readUnsignedShort();
for (int i = 0; i < nm; i++) {
}
}
int mflags = readUnsignedShort();
if (!doMethod)
else
m);
}
int na = readUnsignedShort();
if (verbose > 3)
for (int i = 0; i < na; i++) {
// See if there is a special command that applies.
if (attrCommands != null) {
switch (cmd) {
case "pass":
case "error":
case "strip":
continue;
}
}
}
// Find canonical instance of the requested attribute.
if (a == null) {
}
if (a == null) {
}
// Any zero-length attr is "known"...
// We can assume an empty attr. has an empty layout.
// Handles markers like Enum, Bridge, Synthetic, Deprecated.
}
if (isStackMap) {
// Known attribute but with a corner case format, "pass" it.
final int TOO_BIG = 0x10000;
// No, we don't really know what to do this this one.
// Do not compress the rare and strange "u4" and "X" cases.
a = null;
}
}
if (a == null) {
if (isStackMap) {
// Known attribute but w/o a format; pass it.
"pass");
// Skip the unknown attribute.
continue;
} else {
}
}
// These are hardwired.
try {
}
} else {
assert(h == cls);
}
// Keep empty attribute a...
} else if (length > 0) {
a = a.addContent(bytes);
}
throw new ClassFormatException(name +
": attribute length cannot be zero, in " + h);
}
h.addAttribute(a);
if (verbose > 2)
}
}
int nh = readUnsignedShort();
for (int i = 0; i < nh; i++) {
}
}
int nc = readUnsignedShort();
for (int i = 0; i < nc; i++) {
InnerClass ic =
new InnerClass(readClassRef(),
}
// (Later, ics may be transferred to the pkg.)
}
super(message);
}
}
}
}