jdk/src/share/classes/com/sun/java/util/jar/pack/ClassReader.java
changeset 7171 ee97f78e7482
parent 6901 68f3d74dbda1
child 7192 445c518364c4
equal deleted inserted replaced
7170:285c02ecbb8a 7171:ee97f78e7482
     1 /*
     1 /*
     2  * Copyright (c) 2001, 2005, Oracle and/or its affiliates. All rights reserved.
     2  * Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     4  *
     4  *
     5  * This code is free software; you can redistribute it and/or modify it
     5  * This code is free software; you can redistribute it and/or modify it
     6  * under the terms of the GNU General Public License version 2 only, as
     6  * under the terms of the GNU General Public License version 2 only, as
     7  * published by the Free Software Foundation.  Oracle designates this
     7  * published by the Free Software Foundation.  Oracle designates this
    28 import java.io.*;
    28 import java.io.*;
    29 import java.util.*;
    29 import java.util.*;
    30 import com.sun.java.util.jar.pack.Package.Class;
    30 import com.sun.java.util.jar.pack.Package.Class;
    31 import com.sun.java.util.jar.pack.Package.InnerClass;
    31 import com.sun.java.util.jar.pack.Package.InnerClass;
    32 import com.sun.java.util.jar.pack.ConstantPool.*;
    32 import com.sun.java.util.jar.pack.ConstantPool.*;
    33 import com.sun.tools.classfile.AttributeException;
       
    34 
    33 
    35 /**
    34 /**
    36  * Reader for a class file that is being incorporated into a package.
    35  * Reader for a class file that is being incorporated into a package.
    37  * @author John Rose
    36  * @author John Rose
    38  */
    37  */
   420                     m.code = new Code(m);
   419                     m.code = new Code(m);
   421                     try {
   420                     try {
   422                         readCode(m.code);
   421                         readCode(m.code);
   423                     } catch (Instruction.FormatException iie) {
   422                     } catch (Instruction.FormatException iie) {
   424                         String message = iie.getMessage() + " in " + h;
   423                         String message = iie.getMessage() + " in " + h;
   425                         throw new ClassReader.ClassFormatException(message);
   424                         throw new ClassReader.ClassFormatException(message, iie);
   426                     }
   425                     }
   427                 } else {
   426                 } else {
   428                     assert(h == cls);
   427                     assert(h == cls);
   429                     readInnerClasses(cls);
   428                     readInnerClasses(cls);
   430                 }
   429                 }
   475         }
   474         }
   476         cls.innerClasses = ics;  // set directly; do not use setInnerClasses.
   475         cls.innerClasses = ics;  // set directly; do not use setInnerClasses.
   477         // (Later, ics may be transferred to the pkg.)
   476         // (Later, ics may be transferred to the pkg.)
   478     }
   477     }
   479 
   478 
   480     class ClassFormatException extends IOException {
   479     static class ClassFormatException extends IOException {
   481         public ClassFormatException(String message) {
   480         public ClassFormatException(String message) {
   482             super(message);
   481             super(message);
   483         }
   482         }
       
   483 
       
   484         public ClassFormatException(String message, Throwable cause) {
       
   485             super(message, cause);
       
   486         }
   484     }
   487     }
   485 }
   488 }