changeset 979:7546743f4cc0

Merge
author tbell
date Mon, 02 Mar 2009 15:10:55 -0800
parents 58ba2cd5a250 b656e842e1be
children 07d2550f5c84 da9d0283a496
files
diffstat 13 files changed, 166 insertions(+), 21 deletions(-) [+]
line wrap: on
line diff
--- a/make/common/shared/Defs-java.gmk	Sun Mar 01 14:44:50 2009 +0000
+++ b/make/common/shared/Defs-java.gmk	Mon Mar 02 15:10:55 2009 -0800
@@ -129,6 +129,9 @@
 # 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 @@
 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
--- a/make/docs/Makefile	Sun Mar 01 14:44:50 2009 +0000
+++ b/make/docs/Makefile	Mon Mar 02 15:10:55 2009 -0800
@@ -45,6 +45,7 @@
 DOCSTMPDIR          = $(TEMPDIR)/doctmp
 
 COMMON_JAVADOCFLAGS =					\
+		$(NO_PROPRIETARY_API_WARNINGS)		\
 		-source 1.5				\
 		-quiet					\
                 -use					\
--- a/make/javax/swing/beaninfo/SwingBeans.gmk	Sun Mar 01 14:44:50 2009 +0000
+++ b/make/javax/swing/beaninfo/SwingBeans.gmk	Mon Mar 02 15:10:55 2009 -0800
@@ -47,7 +47,7 @@
 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)
 
--- a/src/share/classes/com/sun/servicetag/resources/register.html	Sun Mar 01 14:44:50 2009 +0000
+++ b/src/share/classes/com/sun/servicetag/resources/register.html	Mon Mar 02 15:10:55 2009 -0800
@@ -68,7 +68,7 @@
           <table width="708" border="0" cellspacing="0" cellpadding="3">
             <tr valign="top">
               <td width="126" height="35">
-              <form name="form1" method="post" action="@@REGISTRATION_URL@@" enctype="text/xml">
+              <form name="form1" method="post" action="@@REGISTRATION_URL@@">
                 <input type="hidden" name="servicetag_payload" value="@@REGISTRATION_PAYLOAD@@">
                 <input type="submit" name="Submit"border="0" class="buttonblue" onmouseover="this.style.color='#fbe249';" onmouseout="this.style.color='#FFF';"  value="Register My JDK">
               </form></td>
--- a/src/share/classes/com/sun/servicetag/resources/register_ja.html	Sun Mar 01 14:44:50 2009 +0000
+++ b/src/share/classes/com/sun/servicetag/resources/register_ja.html	Mon Mar 02 15:10:55 2009 -0800
@@ -62,7 +62,7 @@
           <p class="style1">必要になるのは、Sun 開発者向けネットワークアカウントまたはその他の Sun オンラインアカウントだけです。 まだアカウントがない場合は、アカウントの作成が求められます。 </p>
           <table width="708" border="0" cellspacing="0" cellpadding="3">
             <tr valign="top">
-              <td width="126" height="35"><form name="form1" method="post" action="@@REGISTRATION_URL@@" enctype="text/xml">
+              <td width="126" height="35"><form name="form1" method="post" action="@@REGISTRATION_URL@@">
 			  <input type="hidden" name="servicetag_payload" value="@@REGISTRATION_PAYLOAD@@">
                 <input type="submit" name="Submit"border="0" class="buttonblue" onmouseover="this.style.color='#fbe249';" onmouseout="this.style.color='#FFF';"  value="JDK 製品登録">
               </form></td>
--- a/src/share/classes/com/sun/servicetag/resources/register_zh_CN.html	Sun Mar 01 14:44:50 2009 +0000
+++ b/src/share/classes/com/sun/servicetag/resources/register_zh_CN.html	Mon Mar 02 15:10:55 2009 -0800
@@ -63,7 +63,7 @@
 <p class="style1">您需要具有 Sun 开发者网络或其他 Sun 联机帐户。如果您没有,系统将提示您创建一个。 </p>
           <table width="708" border="0" cellspacing="0" cellpadding="3">
             <tr valign="top">
-              <td width="126" height="35"><form name="form1" method="post" action="@@REGISTRATION_URL@@" enctype="text/xml">
+              <td width="126" height="35"><form name="form1" method="post" action="@@REGISTRATION_URL@@">
 			  <input type="hidden" name="servicetag_payload" value="@@REGISTRATION_PAYLOAD@@">
 <input type="submit" name="Submit"border="0" class="buttonblue" onmouseover="this.style.color='#fbe249';" onmouseout="this.style.color='#FFF';"  value="注册我的 JDK">
               </form></td>
--- a/src/share/classes/java/security/Permission.java	Sun Mar 01 14:44:50 2009 +0000
+++ b/src/share/classes/java/security/Permission.java	Mon Mar 02 15:10:55 2009 -0800
@@ -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 @@
     /**
      * 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 + "\")";
         }
     }
 }
--- a/src/share/classes/java/util/concurrent/locks/AbstractQueuedLongSynchronizer.java	Sun Mar 01 14:44:50 2009 +0000
+++ b/src/share/classes/java/util/concurrent/locks/AbstractQueuedLongSynchronizer.java	Mon Mar 02 15:10:55 2009 -0800
@@ -1222,8 +1222,10 @@
         // 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());
     }
 
--- a/src/share/classes/java/util/concurrent/locks/AbstractQueuedSynchronizer.java	Sun Mar 01 14:44:50 2009 +0000
+++ b/src/share/classes/java/util/concurrent/locks/AbstractQueuedSynchronizer.java	Mon Mar 02 15:10:55 2009 -0800
@@ -1445,8 +1445,10 @@
         // 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());
     }
 
--- a/src/share/classes/sun/launcher/LauncherHelper.java	Sun Mar 01 14:44:50 2009 +0000
+++ b/src/share/classes/sun/launcher/LauncherHelper.java	Mon Mar 02 15:10:55 2009 -0800
@@ -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 @@
     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;
     }
 
--- a/src/share/classes/sun/misc/FloatingDecimal.java	Sun Mar 01 14:44:50 2009 +0000
+++ b/src/share/classes/sun/misc/FloatingDecimal.java	Mon Mar 02 15:10:55 2009 -0800
@@ -1867,10 +1867,16 @@
      * 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 @@
    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) {
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/java/security/Permission/ToString.java	Mon Mar 02 15:10:55 2009 -0800
@@ -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\")";
+        }
+    }
+
+}
--- a/test/java/util/zip/ZipFile/LargeZipFile.java	Sun Mar 01 14:44:50 2009 +0000
+++ b/test/java/util/zip/ZipFile/LargeZipFile.java	Mon Mar 02 15:10:55 2009 -0800
@@ -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.*;