@CheckForNull
    public static JavaClass getOuterClass(JavaClass obj) throws ClassNotFoundException {
        for (Attribute a : obj.getAttributes()) {
            if (a instanceof InnerClasses) {
                for (InnerClass ic : ((InnerClasses) a).getInnerClasses()) {
                    if (obj.getClassNameIndex() == ic.getInnerClassIndex()) {
                        // System.out.println("Outer class is " +
                        // ic.getOuterClassIndex());
                        ConstantClass oc = (ConstantClass) obj.getConstantPool().getConstant(ic.getOuterClassIndex());
                        String ocName = oc.getBytes(obj.getConstantPool());
                        return Repository.lookupClass(ocName);
                    }
                }
            }
        }
        return null;
    }
@ CheckForNull public static JavaClass getOuterClass ( JavaClass obj ) throws ClassNotFoundException { for ( Attribute a : obj . getAttributes ( ) ) { if ( a instanceof InnerClasses ) { for ( InnerClass ic : ( ( InnerClasses ) a ) . getInnerClasses ( ) ) { if ( obj . getClassNameIndex ( ) == ic . getInnerClassIndex ( ) ) { ConstantClass oc = ( ConstantClass ) obj . getConstantPool ( ) . getConstant ( ic . getOuterClassIndex ( ) ) ; String ocName = oc . getBytes ( obj . getConstantPool ( ) ) ; return Repository . lookupClass ( ocName ) ; } } } } return null ; }
Determine the outer class of obj.

@param obj
@return JavaClass for outer class, or null if obj is not an outer class
@throws ClassNotFoundException