Print this page


Split Close
Expand all
Collapse all
          --- old/src/share/classes/sun/rmi/server/UnicastServerRef.java
          +++ new/src/share/classes/sun/rmi/server/UnicastServerRef.java
↓ open down ↓ 181 lines elided ↑ open up ↑
 182  182       * Export this object, create the skeleton and stubs for this
 183  183       * dispatcher.  Create a stub based on the type of the impl,
 184  184       * initialize it with the appropriate remote reference. Create the
 185  185       * target defined by the impl, dispatcher (this) and stub.
 186  186       * Export that target via the Ref.
 187  187       */
 188  188      public Remote exportObject(Remote impl, Object data,
 189  189                                 boolean permanent)
 190  190          throws RemoteException
 191  191      {
 192      -        Class implClass = impl.getClass();
      192 +        Class<?> implClass = impl.getClass();
 193  193          Remote stub;
 194  194  
 195  195          try {
 196  196              stub = Util.createProxy(implClass, getClientRef(), forceStubUse);
 197  197          } catch (IllegalArgumentException e) {
 198  198              throw new ExportException(
 199  199                  "remote object implements illegal remote interface", e);
 200  200          }
 201  201          if (stub instanceof RemoteStub) {
 202  202              setSkeleton(impl);
↓ open down ↓ 117 lines elided ↑ open up ↑
 320  320              Object result;
 321  321              try {
 322  322                  result = method.invoke(obj, params);
 323  323              } catch (InvocationTargetException e) {
 324  324                  throw e.getTargetException();
 325  325              }
 326  326  
 327  327              // marshal return value
 328  328              try {
 329  329                  ObjectOutput out = call.getResultStream(true);
 330      -                Class rtype = method.getReturnType();
      330 +                Class<?> rtype = method.getReturnType();
 331  331                  if (rtype != void.class) {
 332  332                      marshalValue(rtype, result, out);
 333  333                  }
 334  334              } catch (IOException ex) {
 335  335                  throw new MarshalException("error marshalling return", ex);
 336  336                  /*
 337  337                   * This throw is problematic because when it is caught below,
 338  338                   * we attempt to marshal it back to the client, but at this
 339  339                   * point, a "normal return" has already been indicated,
 340  340                   * so marshalling an exception will corrupt the stream.
↓ open down ↓ 189 lines elided ↑ open up ↑
 530  530      /**
 531  531       * A weak hash map, mapping classes to hash maps that map method
 532  532       * hashes to method objects.
 533  533       **/
 534  534      private static class HashToMethod_Maps
 535  535          extends WeakClassHashMap<Map<Long,Method>>
 536  536      {
 537  537          HashToMethod_Maps() {}
 538  538  
 539  539          protected Map<Long,Method> computeValue(Class<?> remoteClass) {
 540      -            Map<Long,Method> map = new HashMap<Long,Method>();
      540 +            Map<Long,Method> map = new HashMap<>();
 541  541              for (Class<?> cl = remoteClass;
 542  542                   cl != null;
 543  543                   cl = cl.getSuperclass())
 544  544              {
 545  545                  for (Class<?> intf : cl.getInterfaces()) {
 546  546                      if (Remote.class.isAssignableFrom(intf)) {
 547  547                          for (Method method : intf.getMethods()) {
 548  548                              final Method m = method;
 549  549                              /*
 550  550                               * Set this Method object to override language
↓ open down ↓ 19 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX