diff --git a/make/common/shared/Defs-java.gmk b/make/common/shared/Defs-java.gmk index 9bfb96da4537ebe9b8d22c92cde64ca6c689d2ee..8454ab2d67448ea1c1d7ba6440eef391b8a79956 100644 --- a/make/common/shared/Defs-java.gmk +++ b/make/common/shared/Defs-java.gmk @@ -129,6 +129,9 @@ JAVACFLAGS += $(OTHER_JAVACFLAGS) # Needed for javah JAVAHFLAGS += -bootclasspath $(CLASSBINDIR) +# Needed for JAVADOC and BOOT_JAVACFLAGS +NO_PROPRIETARY_API_WARNINGS = -XDignore.symbol.file=true + # Langtools ifdef LANGTOOLS_DIST JAVAC_JAR = $(LANGTOOLS_DIST)/bootstrap/lib/javac.jar @@ -192,6 +195,8 @@ endif BOOT_JAVACFLAGS += -encoding ascii BOOT_JAR_JFLAGS += $(JAR_JFLAGS) +BOOT_JAVACFLAGS += $(NO_PROPRIETARY_API_WARNINGS) + BOOT_JAVA_CMD = $(BOOTDIR)/bin/java $(JAVA_TOOLS_FLAGS) BOOT_JAVAC_CMD = $(BOOTDIR)/bin/javac $(JAVAC_JVM_FLAGS) $(BOOT_JAVACFLAGS) BOOT_JAR_CMD = $(BOOTDIR)/bin/jar diff --git a/make/docs/Makefile b/make/docs/Makefile index 07fe50e64167bb6ddb5c5ff2856d30e9cf41bde2..492fa0591609a97d0c1f02c38adbfe5985240560 100644 --- a/make/docs/Makefile +++ b/make/docs/Makefile @@ -45,6 +45,7 @@ endif DOCSTMPDIR = $(TEMPDIR)/doctmp COMMON_JAVADOCFLAGS = \ + $(NO_PROPRIETARY_API_WARNINGS) \ -source 1.5 \ -quiet \ -use \ diff --git a/make/javax/swing/beaninfo/SwingBeans.gmk b/make/javax/swing/beaninfo/SwingBeans.gmk index 66f16aae1a196ee584e06bd1958ecd1b647af69a..cae9873e0c39d0cdd6b71259979e4dbe87b0ba9c 100644 --- a/make/javax/swing/beaninfo/SwingBeans.gmk +++ b/make/javax/swing/beaninfo/SwingBeans.gmk @@ -47,7 +47,7 @@ swing-1.2-beans-debug: LOCAL_JAVADOC = $(JAVADOC_CMD) $(JAVADOCFLAGS) # get the absolute path to the jar command. PREFIX = 1.2 -JAVADOCFLAGS = $(LANGUAGE_VERSION) +JAVADOCFLAGS = $(NO_PROPRIETARY_API_WARNINGS) $(LANGUAGE_VERSION) SWINGPKG = javax/swing LOCAL_JAVAC_FLAGS = $(OTHER_JAVACFLAGS) diff --git a/src/share/classes/com/sun/servicetag/resources/register.html b/src/share/classes/com/sun/servicetag/resources/register.html index 23e9d717ab7ec713ea51f24141057792c0656f29..29a275b35be30833304f98ebf9abea88f94a9422 100644 --- a/src/share/classes/com/sun/servicetag/resources/register.html +++ b/src/share/classes/com/sun/servicetag/resources/register.html @@ -68,7 +68,7 @@ a:visited,a:visited code{color:#917E9C} diff --git a/src/share/classes/com/sun/servicetag/resources/register_ja.html b/src/share/classes/com/sun/servicetag/resources/register_ja.html index 56ee84f54267a45cc9d4231c65f9c526b7e1a3ea..fc7cf0517c2b8d0b6b4d428fcdabf3788c35dea7 100644 --- a/src/share/classes/com/sun/servicetag/resources/register_ja.html +++ b/src/share/classes/com/sun/servicetag/resources/register_ja.html @@ -62,7 +62,7 @@ a:visited,a:visited code{color:#917E9C}

必要になるのは、Sun 開発者向けネットワークアカウントまたはその他の Sun オンラインアカウントだけです。 まだアカウントがない場合は、アカウントの作成が求められます。

-
+
- diff --git a/src/share/classes/com/sun/servicetag/resources/register_zh_CN.html b/src/share/classes/com/sun/servicetag/resources/register_zh_CN.html index c47929fb7445d2aceae6f9ac4ef9b4fe658a1e8d..92cf04b7f10b3af8d4722731f794958da96d0cd9 100644 --- a/src/share/classes/com/sun/servicetag/resources/register_zh_CN.html +++ b/src/share/classes/com/sun/servicetag/resources/register_zh_CN.html @@ -63,7 +63,7 @@ a:visited,a:visited code{color:#917E9C}

您需要具有 Sun 开发者网络或其他 Sun 联机帐户。如果您没有,系统将提示您创建一个。

+
- diff --git a/src/share/classes/java/security/Permission.java b/src/share/classes/java/security/Permission.java index 243f98317bbf421a119f8d011bb4b35d1e201a2b..a33b6e9f568b6afabd95d50b299266b9a9ebcba7 100644 --- a/src/share/classes/java/security/Permission.java +++ b/src/share/classes/java/security/Permission.java @@ -1,5 +1,5 @@ /* - * Copyright 1997-2003 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 1997-2009 Sun Microsystems, Inc. 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 @@ -214,18 +214,18 @@ public abstract class Permission implements Guard, java.io.Serializable { /** * Returns a string describing this Permission. The convention is to * specify the class name, the permission name, and the actions in - * the following format: '("ClassName" "name" "actions")'. + * the following format: '("ClassName" "name" "actions")', or + * '("ClassName" "name")' if actions list is null or empty. * * @return information about this Permission. */ - public String toString() { String actions = getActions(); if ((actions == null) || (actions.length() == 0)) { // OPTIONAL - return "(" + getClass().getName() + " " + name + ")"; + return "(\"" + getClass().getName() + "\" \"" + name + "\")"; } else { - return "(" + getClass().getName() + " " + name + " " + - actions + ")"; + return "(\"" + getClass().getName() + "\" \"" + name + + "\" \"" + actions + "\")"; } } } diff --git a/src/share/classes/java/util/concurrent/locks/AbstractQueuedLongSynchronizer.java b/src/share/classes/java/util/concurrent/locks/AbstractQueuedLongSynchronizer.java index 2b0f36c523d1c9b9288ef1af0d684eb45dbb062c..a7f048e8bdb13e52a64e0d864246ad06f45b3b5e 100644 --- a/src/share/classes/java/util/concurrent/locks/AbstractQueuedLongSynchronizer.java +++ b/src/share/classes/java/util/concurrent/locks/AbstractQueuedLongSynchronizer.java @@ -1222,8 +1222,10 @@ public abstract class AbstractQueuedLongSynchronizer // The correctness of this depends on head being initialized // before tail and on head.next being accurate if the current // thread is first in queue. - Node h, s; - return (h = head) != tail && + Node t = tail; // Read fields in reverse initialization order + Node h = head; + Node s; + return h != t && ((s = h.next) == null || s.thread != Thread.currentThread()); } diff --git a/src/share/classes/java/util/concurrent/locks/AbstractQueuedSynchronizer.java b/src/share/classes/java/util/concurrent/locks/AbstractQueuedSynchronizer.java index 597e15270aeedade66625fceb30ae5ed368c48c9..39219bb5fd9111950c61c46f9eb02631f382190e 100644 --- a/src/share/classes/java/util/concurrent/locks/AbstractQueuedSynchronizer.java +++ b/src/share/classes/java/util/concurrent/locks/AbstractQueuedSynchronizer.java @@ -1445,8 +1445,10 @@ public abstract class AbstractQueuedSynchronizer // The correctness of this depends on head being initialized // before tail and on head.next being accurate if the current // thread is first in queue. - Node h, s; - return (h = head) != tail && + Node t = tail; // Read fields in reverse initialization order + Node h = head; + Node s; + return h != t && ((s = h.next) == null || s.thread != Thread.currentThread()); } diff --git a/src/share/classes/sun/launcher/LauncherHelper.java b/src/share/classes/sun/launcher/LauncherHelper.java index 3951bcfeb12f6f1755fad8876959ca9686c446d8..76db55ebd34e4b841244518db68083eec9298c45 100644 --- a/src/share/classes/sun/launcher/LauncherHelper.java +++ b/src/share/classes/sun/launcher/LauncherHelper.java @@ -1,6 +1,5 @@ - /* - * Copyright 2007-2008 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2007-2009 Sun Microsystems, Inc. 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 @@ -55,18 +54,24 @@ public enum LauncherHelper { INSTANCE; private static final String defaultBundleName = "sun.launcher.resources.launcher"; - private static ResourceBundle javarb = - ResourceBundle.getBundle(defaultBundleName); private static final String MAIN_CLASS = "Main-Class"; private static StringBuilder outBuf = new StringBuilder(); + private static ResourceBundle javarb = null; + private static synchronized ResourceBundle getLauncherResourceBundle() { + if (javarb == null) { + javarb = ResourceBundle.getBundle(defaultBundleName); + } + return javarb; + } + /** * A private helper method to get a localized message and also * apply any arguments that we might pass. */ private static String getLocalizedMessage(String key, Object... args) { - String msg = javarb.getString(key); + String msg = getLauncherResourceBundle().getString(key); return (args != null) ? MessageFormat.format(msg, args) : msg; } diff --git a/src/share/classes/sun/misc/FloatingDecimal.java b/src/share/classes/sun/misc/FloatingDecimal.java index 46e4e55bc186f37e94175a30074af75b4a92f29f..f0316ff56315b4c917817c0bfedd961e9d9754f9 100644 --- a/src/share/classes/sun/misc/FloatingDecimal.java +++ b/src/share/classes/sun/misc/FloatingDecimal.java @@ -1867,10 +1867,16 @@ public class FloatingDecimal{ * Grammar is compatible with hexadecimal floating-point constants * described in section 6.4.4.2 of the C99 specification. */ - private static Pattern hexFloatPattern = Pattern.compile( + private static Pattern hexFloatPattern = null; + private static synchronized Pattern getHexFloatPattern() { + if (hexFloatPattern == null) { + hexFloatPattern = Pattern.compile( //1 234 56 7 8 9 "([-+])?0[xX](((\\p{XDigit}+)\\.?)|((\\p{XDigit}*)\\.(\\p{XDigit}+)))[pP]([-+])?(\\p{Digit}+)[fFdD]?" ); + } + return hexFloatPattern; + } /* * Convert string s to a suitable floating decimal; uses the @@ -1880,7 +1886,7 @@ public class FloatingDecimal{ static FloatingDecimal parseHexString(String s) { // Verify string is a member of the hexadecimal floating-point // string language. - Matcher m = hexFloatPattern.matcher(s); + Matcher m = getHexFloatPattern().matcher(s); boolean validInput = m.matches(); if (!validInput) { diff --git a/test/java/security/Permission/ToString.java b/test/java/security/Permission/ToString.java new file mode 100644 index 0000000000000000000000000000000000000000..cf2ffa11dbda446d2a7bc56aa25c9e11dc95c2c7 --- /dev/null +++ b/test/java/security/Permission/ToString.java @@ -0,0 +1,101 @@ +/* + * Copyright 2009 Sun Microsystems, Inc. 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 + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + */ + +/* + * @test + * @bug 6549506 + * @summary Specification of Permission.toString() method contradicts with + * JDK implementation + */ + +import java.security.*; + +public class ToString { + + public static void main(String[]args) throws Exception { + DummyWritePermission dummyPerm = new DummyWritePermission(); + NullActionPermission nullActionPerm = new NullActionPermission(); + System.out.println(dummyPerm.toString()); + System.out.println(dummyPerm.getDescription()); + System.out.println(nullActionPerm.toString()); + System.out.println(nullActionPerm.getDescription()); + if (!dummyPerm.toString().equals(dummyPerm.getDescription())) { + throw new Exception("The expected permission.toString() is " + + dummyPerm.getDescription() + ", but " + + dummyPerm.toString() + " returned!"); + } + + if (!nullActionPerm.toString().equals(nullActionPerm.getDescription())) { + throw new Exception("The expected permission.toString() is " + + nullActionPerm.getDescription() + ", but " + + nullActionPerm.toString() + " returned!"); + } + } + + private static abstract class SimplePermission extends Permission { + public SimplePermission(String name) { + super(name); + } + + public boolean implies(Permission permission) { + return false; + } + + public boolean equals(Object obj) { + return false; + } + + public int hashCode() { + return 13; + } + } + + private static class DummyWritePermission extends SimplePermission { + public DummyWritePermission() { + super("permit to"); + } + + public String getActions() { + return "write"; + } + + public String getDescription() { + return "(\"ToString$DummyWritePermission\" \"permit to\" \"write\")"; + } + } + + private static class NullActionPermission extends SimplePermission { + public NullActionPermission() { + super("permit to"); + } + + public String getActions() { + return null; + } + + public String getDescription() { + return "(\"ToString$NullActionPermission\" \"permit to\")"; + } + } + +} diff --git a/test/java/util/zip/ZipFile/LargeZipFile.java b/test/java/util/zip/ZipFile/LargeZipFile.java index e4f986ef210d7508cc87ab4f539aa28eeca3cfea..479bac48befe88b74c82c3bbaaa186e8bc876dc1 100644 --- a/test/java/util/zip/ZipFile/LargeZipFile.java +++ b/test/java/util/zip/ZipFile/LargeZipFile.java @@ -1,3 +1,26 @@ +/* + * Copyright 2009 Sun Microsystems, Inc. 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 + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + */ + import java.io.*; import java.nio.*; import java.util.*;
+