changeset 9119:6c343d3d2721

8027536: rmic: add deprecation warning message when generating JRMP static stubs/skeletons Reviewed-by: mchung, dmocek
author smarks
date Fri, 13 Dec 2013 18:08:20 -0800
parents 26028cb56c68
children 43751121b507 8e133b86b9f8
files src/share/classes/sun/rmi/rmic/Main.java src/share/classes/sun/rmi/rmic/resources/rmic.properties
diffstat 2 files changed, 19 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/src/share/classes/sun/rmi/rmic/Main.java	Fri Dec 13 13:35:35 2013 -0800
+++ b/src/share/classes/sun/rmi/rmic/Main.java	Fri Dec 13 18:08:20 2013 -0800
@@ -162,6 +162,15 @@
             return false;
         }
 
+        if ((flags & F_WARNINGS) != 0) {
+            for (Generator g : generators) {
+                if (g instanceof RMIGenerator) {
+                    output(getText("rmic.jrmp.stubs.deprecated", program));
+                    break;
+                }
+            }
+        }
+
         return doCompile();
     }
 
--- a/src/share/classes/sun/rmi/rmic/resources/rmic.properties	Fri Dec 13 13:35:35 2013 -0800
+++ b/src/share/classes/sun/rmi/rmic/resources/rmic.properties	Fri Dec 13 18:08:20 2013 -0800
@@ -1,6 +1,6 @@
 #
 #
-# Copyright (c) 1996, 2010, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 1996, 2013, 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
@@ -76,10 +76,10 @@
 \nwhere <options> includes:\
 \n  -keep          Do not delete intermediate generated source files\
 \n  -keepgenerated (same as "-keep")\
-\n  -v1.1          Create stubs/skeletons for 1.1 stub protocol version\
+\n  -v1.1          Create stubs/skeletons for 1.1 stub protocol version (deprecated)\
 \n  -vcompat       Create stubs/skeletons compatible with both\
-\n                           1.1 and 1.2 stub protocol versions\
-\n  -v1.2          (default) Create stubs for 1.2 stub protocol version only\
+\n                           1.1 and 1.2 stub protocol versions (deprecated)\
+\n  -v1.2          (default) Create stubs for 1.2 stub protocol version only (deprecated)\
 \n  -iiop          Create stubs for IIOP. When present, <options> also includes:\
 \n\
 \n                   -always           Create stubs even when they appear current\
@@ -154,6 +154,12 @@
 	An IIOP "tie" exists for class {0}:\
 	\n  {1}\
 	\nIf you use PortableRemoteObject.exportObject, you should remove this file; otherwise, your server object will be exported to IIOP rather than to JRMP.
+rmic.jrmp.stubs.deprecated=\
+	Warning: generation and use of skeletons and static stubs for JRMP\
+	\nis deprecated. Skeletons are unnecessary, and static stubs have\
+	\nbeen superseded by dynamically generated stubs. Users are\
+	\nencouraged to migrate away from using {0} to generate skeletons and static\
+	\nstubs. See the documentation for java.rmi.server.UnicastRemoteObject.
 
 #
 # RMI-IIOP Messages