jdk/src/share/classes/java/lang/Class.java
changeset 10419 12c063b39232
parent 10147 cd5c99f94305
child 11016 e2665f4ac6d2
equal deleted inserted replaced
10418:1d57022fdb6e 10419:12c063b39232
   972                 // the immediately enclosing method or constructor's
   972                 // the immediately enclosing method or constructor's
   973                 // descriptor (null iff name is).
   973                 // descriptor (null iff name is).
   974                 descriptor      = (String)   enclosingInfo[2];
   974                 descriptor      = (String)   enclosingInfo[2];
   975                 assert((name != null && descriptor != null) || name == descriptor);
   975                 assert((name != null && descriptor != null) || name == descriptor);
   976             } catch (ClassCastException cce) {
   976             } catch (ClassCastException cce) {
   977                 throw (InternalError)
   977                 throw new InternalError("Invalid type in enclosing method information", cce);
   978                     new InternalError("Invalid type in enclosing method information").initCause(cce);
       
   979             }
   978             }
   980         }
   979         }
   981 
   980 
   982         boolean isPartial() {
   981         boolean isPartial() {
   983             return enclosingClass == null || name == null || descriptor == null;
   982             return enclosingClass == null || name == null || descriptor == null;
  1239             return null;
  1238             return null;
  1240         // Otherwise, strip the enclosing class' name
  1239         // Otherwise, strip the enclosing class' name
  1241         try {
  1240         try {
  1242             return getName().substring(enclosingClass.getName().length());
  1241             return getName().substring(enclosingClass.getName().length());
  1243         } catch (IndexOutOfBoundsException ex) {
  1242         } catch (IndexOutOfBoundsException ex) {
  1244             throw (InternalError)
  1243             throw new InternalError("Malformed class name", ex);
  1245                 new InternalError("Malformed class name").initCause(ex);
       
  1246         }
  1244         }
  1247     }
  1245     }
  1248 
  1246 
  1249     /**
  1247     /**
  1250      * Returns {@code true} if this is a local class or an anonymous
  1248      * Returns {@code true} if this is a local class or an anonymous