提交 8d22cdf3 编写于 作者: T tbell

Merge

......@@ -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
......
......@@ -45,6 +45,7 @@ endif
DOCSTMPDIR = $(TEMPDIR)/doctmp
COMMON_JAVADOCFLAGS = \
$(NO_PROPRIETARY_API_WARNINGS) \
-source 1.5 \
-quiet \
-use \
......
......@@ -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)
......
......@@ -68,7 +68,7 @@ a:visited,a:visited code{color:#917E9C}
<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>
......
......@@ -62,7 +62,7 @@ a:visited,a:visited code{color:#917E9C}
<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>
......
......@@ -63,7 +63,7 @@ a:visited,a:visited code{color:#917E9C}
<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>
......
/*
* 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 + "\")";
}
}
}
......@@ -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());
}
......
......@@ -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());
}
......
/*
* 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;
}
......
......@@ -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) {
......
/*
* 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\")";
}
}
}
/*
* 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.*;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册