# HG changeset patch # User valeriep # Date 1418775568 0 # Node ID ef63e17cd3ce14f7f9d56ce75cea46771819f5ea # Parent cff55956b24c4d51722b96b99585ece1d03be758# Parent c510e26fcd5510500bdad0e298b75d50b7af8523 Merge diff -r cff55956b24c -r ef63e17cd3ce jdk/src/java.base/share/classes/sun/launcher/resources/launcher.properties --- a/jdk/src/java.base/share/classes/sun/launcher/resources/launcher.properties Tue Dec 16 22:33:43 2014 +0000 +++ b/jdk/src/java.base/share/classes/sun/launcher/resources/launcher.properties Wed Dec 17 00:19:28 2014 +0000 @@ -1,5 +1,5 @@ # -# Copyright (c) 2007, 2013, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2007, 2014, 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 @@ -46,11 +46,7 @@ \ -verbose:[class|gc|jni]\n\ \ enable verbose output\n\ \ -version print product version and exit\n\ -\ -version:\n\ -\ require the specified version to run\n\ \ -showversion print product version and continue\n\ -\ -jre-restrict-search | -no-jre-restrict-search\n\ -\ include/exclude user private JREs in the version search\n\ \ -? -help print this help message\n\ \ -X print help on non-standard options\n\ \ -ea[:...|:]\n\ diff -r cff55956b24c -r ef63e17cd3ce jdk/test/tools/launcher/MultipleJRE.sh --- a/jdk/test/tools/launcher/MultipleJRE.sh Tue Dec 16 22:33:43 2014 +0000 +++ b/jdk/test/tools/launcher/MultipleJRE.sh Wed Dec 17 00:19:28 2014 +0000 @@ -1,15 +1,14 @@ #!/bin/sh # @test MultipleJRE.sh -# @bug 4811102 4953711 4955505 4956301 4991229 4998210 5018605 6387069 6733959 +# @bug 4811102 4953711 4955505 4956301 4991229 4998210 5018605 6387069 6733959 8058407 8067421 # @build PrintVersion # @build UglyPrintVersion # @build ZipMeUp # @run shell MultipleJRE.sh # @summary Verify Multiple JRE version support has been removed # @author Joseph E. Kowalski - # -# Copyright (c) 2003, 2008, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2003, 2014, 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 @@ -91,6 +90,36 @@ } # +# Shell routine to ensure help page does not include mjre options +# +TestHelp() { + mess="`$JAVA -help 2>&1`" + # make sure it worked + if [ $? -ne 0 ]; then + echo "java -help failed ????" + exit 1 + fi + + echo $mess | grep '\-version:' > /dev/null 2>&1 + if [ $? -eq 0 ]; then + echo "help message contains obsolete option version:" + exit 1 + fi + + echo $mess | grep '\-jre-restrict-search' > /dev/null 2>&1 + if [ $? -eq 0 ]; then + echo "help message contains obsolete option jre-restrict-search" + exit 1 + fi + + echo $mess | grep '\-no-jre-restrict-search' > /dev/null 2>&1 + if [ $? -eq 0 ]; then + echo "help message contains obsolete option no-jre-restrict-search" + exit 1 + fi +} + +# # Just as the name says. We sprinkle these in the appropriate location # in the test file system and they just say who they are pretending to be. # @@ -457,7 +486,8 @@ LaunchVM "" "${RELEASE}" # Going to silently ignore JRE-Version setting in jar file manifest #LaunchVM "" "warning: The jarfile JRE-Version" - + + # Verify help does not contain obsolete options + TestHelp exit 0 - diff -r cff55956b24c -r ef63e17cd3ce jdk/test/tools/launcher/PrintVersion.java --- a/jdk/test/tools/launcher/PrintVersion.java Tue Dec 16 22:33:43 2014 +0000 +++ b/jdk/test/tools/launcher/PrintVersion.java Wed Dec 17 00:19:28 2014 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2014, 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 @@ -27,12 +27,9 @@ * This stub simply prints out the java version string. It is used * by MultipleJRE.sh. */ -import sun.misc.Version; public class PrintVersion { - - public static void main(String argv[]) { - Version.print(); - } - + public static void main(String argv[]) { + System.out.println(System.getProperty("java.version")); + } } diff -r cff55956b24c -r ef63e17cd3ce jdk/test/tools/launcher/UglyPrintVersion.java --- a/jdk/test/tools/launcher/UglyPrintVersion.java Tue Dec 16 22:33:43 2014 +0000 +++ b/jdk/test/tools/launcher/UglyPrintVersion.java Wed Dec 17 00:19:28 2014 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2004, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2014, 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 @@ -30,12 +30,8 @@ */ package reallyreallyreallyreallyreallyreallyreallyreallyreallyreallyreallyreallyreallyreallyreallyreallyreallylongpackagename; -import sun.misc.Version; - public class UglyPrintVersion { - - public static void main(String argv[]) { - Version.print(); - } - + public static void main(String argv[]) { + System.out.println(System.getProperty("java.version")); + } }