< prev index next >

src/java.rmi/share/classes/java/rmi/server/RemoteObject.java

Print this page

        

@@ -437,22 +437,20 @@
              */
             String internalRefClassName =
                 RemoteRef.packagePrefix + "." + refClassName;
             Class<?> refClass = Class.forName(internalRefClassName);
             try {
-                ref = (RemoteRef) refClass.newInstance();
+                @SuppressWarnings("deprecation")
+                Object tmp = refClass.newInstance();
+                ref = (RemoteRef) tmp;
 
                 /*
                  * If this step fails, assume we found an internal
                  * class that is not meant to be a serializable ref
                  * type.
                  */
-            } catch (InstantiationException e) {
-                throw new ClassNotFoundException(internalRefClassName, e);
-            } catch (IllegalAccessException e) {
-                throw new ClassNotFoundException(internalRefClassName, e);
-            } catch (ClassCastException e) {
+            } catch (InstantiationException | IllegalAccessException | ClassCastException e) {
                 throw new ClassNotFoundException(internalRefClassName, e);
             }
             ref.readExternal(in);
         }
     }
< prev index next >