< prev index next >

src/java.desktop/share/classes/java/beans/Beans.java

Print this page




 213                 cl = ClassFinder.findClass(beanName, cls);
 214             } catch (ClassNotFoundException ex) {
 215                 // There is no appropriate class.  If we earlier tried to
 216                 // deserialize an object and got an IO exception, throw that,
 217                 // otherwise rethrow the ClassNotFoundException.
 218                 if (serex != null) {
 219                     throw serex;
 220                 }
 221                 throw ex;
 222             }
 223 
 224             if (!Modifier.isPublic(cl.getModifiers())) {
 225                 throw new ClassNotFoundException("" + cl + " : no public access");
 226             }
 227 
 228             /*
 229              * Try to instantiate the class.
 230              */
 231 
 232             try {
 233                 result = cl.newInstance();


 234             } catch (Exception ex) {
 235                 // We have to remap the exception to one in our signature.
 236                 // But we pass extra information in the detail message.
 237                 throw new ClassNotFoundException("" + cl + " : " + ex, ex);
 238             }
 239         }
 240 
 241         if (result != null) {
 242 
 243             // Ok, if the result is an applet initialize it.
 244 
 245             AppletStub stub = null;
 246 
 247             if (result instanceof Applet) {
 248                 Applet  applet      = (Applet) result;
 249                 boolean needDummies = initializer == null;
 250 
 251                 if (needDummies) {
 252 
 253                     // Figure our the codebase and docbase URLs.  We do this




 213                 cl = ClassFinder.findClass(beanName, cls);
 214             } catch (ClassNotFoundException ex) {
 215                 // There is no appropriate class.  If we earlier tried to
 216                 // deserialize an object and got an IO exception, throw that,
 217                 // otherwise rethrow the ClassNotFoundException.
 218                 if (serex != null) {
 219                     throw serex;
 220                 }
 221                 throw ex;
 222             }
 223 
 224             if (!Modifier.isPublic(cl.getModifiers())) {
 225                 throw new ClassNotFoundException("" + cl + " : no public access");
 226             }
 227 
 228             /*
 229              * Try to instantiate the class.
 230              */
 231 
 232             try {
 233                 @SuppressWarnings("deprecation")
 234                 Object tmp = cl.newInstance();
 235                 result = tmp;
 236             } catch (Exception ex) {
 237                 // We have to remap the exception to one in our signature.
 238                 // But we pass extra information in the detail message.
 239                 throw new ClassNotFoundException("" + cl + " : " + ex, ex);
 240             }
 241         }
 242 
 243         if (result != null) {
 244 
 245             // Ok, if the result is an applet initialize it.
 246 
 247             AppletStub stub = null;
 248 
 249             if (result instanceof Applet) {
 250                 Applet  applet      = (Applet) result;
 251                 boolean needDummies = initializer == null;
 252 
 253                 if (needDummies) {
 254 
 255                     // Figure our the codebase and docbase URLs.  We do this


< prev index next >