8076409: Reinforce RMI framework
authorsmarks
Fri, 08 May 2015 15:22:53 -0700
changeset 31714 ffeeccb4c043
parent 31713 8d27f9edac84
child 31715 4e942fbc0bf6
8076409: Reinforce RMI framework Reviewed-by: coffeys, igerasim, ahgross
jdk/src/java.rmi/share/classes/java/rmi/server/RemoteObjectInvocationHandler.java
--- a/jdk/src/java.rmi/share/classes/java/rmi/server/RemoteObjectInvocationHandler.java	Wed Apr 29 16:06:18 2015 +0100
+++ b/jdk/src/java.rmi/share/classes/java/rmi/server/RemoteObjectInvocationHandler.java	Fri May 08 15:22:53 2015 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2005, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -102,6 +102,9 @@
      * representation of the proxy.
      * </ul>
      *
+     * <p>If <code>method</code> overrides {@link Object#finalize Object.finalize},
+     * it is ignored.
+     *
      * <p>Otherwise, a remote call is made as follows:
      *
      * <ul>
@@ -144,6 +147,8 @@
     {
         if (method.getDeclaringClass() == Object.class) {
             return invokeObjectMethod(proxy, method, args);
+        } else if ("finalize".equals(method.getName()) && method.getParameterCount() == 0) {
+            return null; // ignore
         } else {
             return invokeRemoteMethod(proxy, method, args);
         }