changeset 13497:9c6dcadf4470

8076409: Reinforce RMI framework Reviewed-by: coffeys, igerasim, ahgross
author smarks
date Fri, 08 May 2015 15:22:53 -0700
parents 2fd73cf7bf07
children e3cc06506ed6
files src/java.rmi/share/classes/java/rmi/server/RemoteObjectInvocationHandler.java
diffstat 1 files changed, 6 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/src/java.rmi/share/classes/java/rmi/server/RemoteObjectInvocationHandler.java	Wed Apr 29 16:06:18 2015 +0100
+++ b/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);
         }