mirror of
https://github.com/openjdk/jdk.git
synced 2025-09-22 20:14:43 +02:00
Merge
This commit is contained in:
commit
90ed74aa8c
1529 changed files with 38080 additions and 9281 deletions
2
.hgtags
2
.hgtags
|
@ -235,3 +235,5 @@ b5d2bf482a3ea1cca08c994512804ffbc73de0a1 jdk8-b110
|
||||||
b9a0f6c693f347a6f4b9bb994957f4eaa05bdedd jdk8-b111
|
b9a0f6c693f347a6f4b9bb994957f4eaa05bdedd jdk8-b111
|
||||||
ad67c34f79c28a8e755f4a49f313868619d6702c jdk8-b112
|
ad67c34f79c28a8e755f4a49f313868619d6702c jdk8-b112
|
||||||
4a4dbcf7cb7d3e1a81beaa3b11cd909f69ebc79a jdk8-b113
|
4a4dbcf7cb7d3e1a81beaa3b11cd909f69ebc79a jdk8-b113
|
||||||
|
dfa34ab293faad9b543a24646dbb381bc3ab5586 jdk8-b114
|
||||||
|
3dd9732b17034f45d111996d1d50287b05a3998c jdk8-b115
|
||||||
|
|
|
@ -235,3 +235,5 @@ b7e64be81c8a7690703df5711f4fc2375da8a9cb jdk8-b103
|
||||||
d086227bfc45d124f09b3bd72a07956b4073bf71 jdk8-b111
|
d086227bfc45d124f09b3bd72a07956b4073bf71 jdk8-b111
|
||||||
547316ea137d83d9c63083a9b83db64198fe0c81 jdk8-b112
|
547316ea137d83d9c63083a9b83db64198fe0c81 jdk8-b112
|
||||||
6ba4c7cb623ec612031e05cf8bf279d8f407bd1e jdk8-b113
|
6ba4c7cb623ec612031e05cf8bf279d8f407bd1e jdk8-b113
|
||||||
|
4f2011496393a26dcfd7b1f7787a3673ddd32599 jdk8-b114
|
||||||
|
763ada2a1d8c5962bc8c3d297e57c562d2e95338 jdk8-b115
|
||||||
|
|
|
@ -514,7 +514,7 @@ AC_DEFUN([BASIC_CHECK_MAKE_VERSION],
|
||||||
if test "x$IS_GNU_MAKE" = x; then
|
if test "x$IS_GNU_MAKE" = x; then
|
||||||
AC_MSG_NOTICE([Found potential make at $MAKE_CANDIDATE, however, this is not GNU Make. Ignoring.])
|
AC_MSG_NOTICE([Found potential make at $MAKE_CANDIDATE, however, this is not GNU Make. Ignoring.])
|
||||||
else
|
else
|
||||||
IS_MODERN_MAKE=`$ECHO $MAKE_VERSION_STRING | $GREP '\(3\.8[[12]]\)\|\(4\.\)'`
|
IS_MODERN_MAKE=`$ECHO $MAKE_VERSION_STRING | $GREP -e '3\.8[[12]]' -e '4\.'`
|
||||||
if test "x$IS_MODERN_MAKE" = x; then
|
if test "x$IS_MODERN_MAKE" = x; then
|
||||||
AC_MSG_NOTICE([Found GNU make at $MAKE_CANDIDATE, however this is not version 3.81 or later. (it is: $MAKE_VERSION_STRING). Ignoring.])
|
AC_MSG_NOTICE([Found GNU make at $MAKE_CANDIDATE, however this is not version 3.81 or later. (it is: $MAKE_VERSION_STRING). Ignoring.])
|
||||||
else
|
else
|
||||||
|
|
|
@ -3865,7 +3865,7 @@ fi
|
||||||
#CUSTOM_AUTOCONF_INCLUDE
|
#CUSTOM_AUTOCONF_INCLUDE
|
||||||
|
|
||||||
# Do not change or remove the following line, it is needed for consistency checks:
|
# Do not change or remove the following line, it is needed for consistency checks:
|
||||||
DATE_WHEN_GENERATED=1382702260
|
DATE_WHEN_GENERATED=1383151988
|
||||||
|
|
||||||
###############################################################################
|
###############################################################################
|
||||||
#
|
#
|
||||||
|
@ -8323,7 +8323,7 @@ $as_echo "$as_me: Testing potential make at $MAKE_CANDIDATE, found using $DESCRI
|
||||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: Found potential make at $MAKE_CANDIDATE, however, this is not GNU Make. Ignoring." >&5
|
{ $as_echo "$as_me:${as_lineno-$LINENO}: Found potential make at $MAKE_CANDIDATE, however, this is not GNU Make. Ignoring." >&5
|
||||||
$as_echo "$as_me: Found potential make at $MAKE_CANDIDATE, however, this is not GNU Make. Ignoring." >&6;}
|
$as_echo "$as_me: Found potential make at $MAKE_CANDIDATE, however, this is not GNU Make. Ignoring." >&6;}
|
||||||
else
|
else
|
||||||
IS_MODERN_MAKE=`$ECHO $MAKE_VERSION_STRING | $GREP '\(3\.8[12]\)\|\(4\.\)'`
|
IS_MODERN_MAKE=`$ECHO $MAKE_VERSION_STRING | $GREP -e '3\.8[12]' -e '4\.'`
|
||||||
if test "x$IS_MODERN_MAKE" = x; then
|
if test "x$IS_MODERN_MAKE" = x; then
|
||||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: Found GNU make at $MAKE_CANDIDATE, however this is not version 3.81 or later. (it is: $MAKE_VERSION_STRING). Ignoring." >&5
|
{ $as_echo "$as_me:${as_lineno-$LINENO}: Found GNU make at $MAKE_CANDIDATE, however this is not version 3.81 or later. (it is: $MAKE_VERSION_STRING). Ignoring." >&5
|
||||||
$as_echo "$as_me: Found GNU make at $MAKE_CANDIDATE, however this is not version 3.81 or later. (it is: $MAKE_VERSION_STRING). Ignoring." >&6;}
|
$as_echo "$as_me: Found GNU make at $MAKE_CANDIDATE, however this is not version 3.81 or later. (it is: $MAKE_VERSION_STRING). Ignoring." >&6;}
|
||||||
|
@ -8680,7 +8680,7 @@ $as_echo "$as_me: Testing potential make at $MAKE_CANDIDATE, found using $DESCRI
|
||||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: Found potential make at $MAKE_CANDIDATE, however, this is not GNU Make. Ignoring." >&5
|
{ $as_echo "$as_me:${as_lineno-$LINENO}: Found potential make at $MAKE_CANDIDATE, however, this is not GNU Make. Ignoring." >&5
|
||||||
$as_echo "$as_me: Found potential make at $MAKE_CANDIDATE, however, this is not GNU Make. Ignoring." >&6;}
|
$as_echo "$as_me: Found potential make at $MAKE_CANDIDATE, however, this is not GNU Make. Ignoring." >&6;}
|
||||||
else
|
else
|
||||||
IS_MODERN_MAKE=`$ECHO $MAKE_VERSION_STRING | $GREP '\(3\.8[12]\)\|\(4\.\)'`
|
IS_MODERN_MAKE=`$ECHO $MAKE_VERSION_STRING | $GREP -e '3\.8[12]' -e '4\.'`
|
||||||
if test "x$IS_MODERN_MAKE" = x; then
|
if test "x$IS_MODERN_MAKE" = x; then
|
||||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: Found GNU make at $MAKE_CANDIDATE, however this is not version 3.81 or later. (it is: $MAKE_VERSION_STRING). Ignoring." >&5
|
{ $as_echo "$as_me:${as_lineno-$LINENO}: Found GNU make at $MAKE_CANDIDATE, however this is not version 3.81 or later. (it is: $MAKE_VERSION_STRING). Ignoring." >&5
|
||||||
$as_echo "$as_me: Found GNU make at $MAKE_CANDIDATE, however this is not version 3.81 or later. (it is: $MAKE_VERSION_STRING). Ignoring." >&6;}
|
$as_echo "$as_me: Found GNU make at $MAKE_CANDIDATE, however this is not version 3.81 or later. (it is: $MAKE_VERSION_STRING). Ignoring." >&6;}
|
||||||
|
@ -9034,7 +9034,7 @@ $as_echo "$as_me: Testing potential make at $MAKE_CANDIDATE, found using $DESCRI
|
||||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: Found potential make at $MAKE_CANDIDATE, however, this is not GNU Make. Ignoring." >&5
|
{ $as_echo "$as_me:${as_lineno-$LINENO}: Found potential make at $MAKE_CANDIDATE, however, this is not GNU Make. Ignoring." >&5
|
||||||
$as_echo "$as_me: Found potential make at $MAKE_CANDIDATE, however, this is not GNU Make. Ignoring." >&6;}
|
$as_echo "$as_me: Found potential make at $MAKE_CANDIDATE, however, this is not GNU Make. Ignoring." >&6;}
|
||||||
else
|
else
|
||||||
IS_MODERN_MAKE=`$ECHO $MAKE_VERSION_STRING | $GREP '\(3\.8[12]\)\|\(4\.\)'`
|
IS_MODERN_MAKE=`$ECHO $MAKE_VERSION_STRING | $GREP -e '3\.8[12]' -e '4\.'`
|
||||||
if test "x$IS_MODERN_MAKE" = x; then
|
if test "x$IS_MODERN_MAKE" = x; then
|
||||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: Found GNU make at $MAKE_CANDIDATE, however this is not version 3.81 or later. (it is: $MAKE_VERSION_STRING). Ignoring." >&5
|
{ $as_echo "$as_me:${as_lineno-$LINENO}: Found GNU make at $MAKE_CANDIDATE, however this is not version 3.81 or later. (it is: $MAKE_VERSION_STRING). Ignoring." >&5
|
||||||
$as_echo "$as_me: Found GNU make at $MAKE_CANDIDATE, however this is not version 3.81 or later. (it is: $MAKE_VERSION_STRING). Ignoring." >&6;}
|
$as_echo "$as_me: Found GNU make at $MAKE_CANDIDATE, however this is not version 3.81 or later. (it is: $MAKE_VERSION_STRING). Ignoring." >&6;}
|
||||||
|
@ -9393,7 +9393,7 @@ $as_echo "$as_me: Testing potential make at $MAKE_CANDIDATE, found using $DESCRI
|
||||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: Found potential make at $MAKE_CANDIDATE, however, this is not GNU Make. Ignoring." >&5
|
{ $as_echo "$as_me:${as_lineno-$LINENO}: Found potential make at $MAKE_CANDIDATE, however, this is not GNU Make. Ignoring." >&5
|
||||||
$as_echo "$as_me: Found potential make at $MAKE_CANDIDATE, however, this is not GNU Make. Ignoring." >&6;}
|
$as_echo "$as_me: Found potential make at $MAKE_CANDIDATE, however, this is not GNU Make. Ignoring." >&6;}
|
||||||
else
|
else
|
||||||
IS_MODERN_MAKE=`$ECHO $MAKE_VERSION_STRING | $GREP '\(3\.8[12]\)\|\(4\.\)'`
|
IS_MODERN_MAKE=`$ECHO $MAKE_VERSION_STRING | $GREP -e '3\.8[12]' -e '4\.'`
|
||||||
if test "x$IS_MODERN_MAKE" = x; then
|
if test "x$IS_MODERN_MAKE" = x; then
|
||||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: Found GNU make at $MAKE_CANDIDATE, however this is not version 3.81 or later. (it is: $MAKE_VERSION_STRING). Ignoring." >&5
|
{ $as_echo "$as_me:${as_lineno-$LINENO}: Found GNU make at $MAKE_CANDIDATE, however this is not version 3.81 or later. (it is: $MAKE_VERSION_STRING). Ignoring." >&5
|
||||||
$as_echo "$as_me: Found GNU make at $MAKE_CANDIDATE, however this is not version 3.81 or later. (it is: $MAKE_VERSION_STRING). Ignoring." >&6;}
|
$as_echo "$as_me: Found GNU make at $MAKE_CANDIDATE, however this is not version 3.81 or later. (it is: $MAKE_VERSION_STRING). Ignoring." >&6;}
|
||||||
|
@ -9746,7 +9746,7 @@ $as_echo "$as_me: Testing potential make at $MAKE_CANDIDATE, found using $DESCRI
|
||||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: Found potential make at $MAKE_CANDIDATE, however, this is not GNU Make. Ignoring." >&5
|
{ $as_echo "$as_me:${as_lineno-$LINENO}: Found potential make at $MAKE_CANDIDATE, however, this is not GNU Make. Ignoring." >&5
|
||||||
$as_echo "$as_me: Found potential make at $MAKE_CANDIDATE, however, this is not GNU Make. Ignoring." >&6;}
|
$as_echo "$as_me: Found potential make at $MAKE_CANDIDATE, however, this is not GNU Make. Ignoring." >&6;}
|
||||||
else
|
else
|
||||||
IS_MODERN_MAKE=`$ECHO $MAKE_VERSION_STRING | $GREP '\(3\.8[12]\)\|\(4\.\)'`
|
IS_MODERN_MAKE=`$ECHO $MAKE_VERSION_STRING | $GREP -e '3\.8[12]' -e '4\.'`
|
||||||
if test "x$IS_MODERN_MAKE" = x; then
|
if test "x$IS_MODERN_MAKE" = x; then
|
||||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: Found GNU make at $MAKE_CANDIDATE, however this is not version 3.81 or later. (it is: $MAKE_VERSION_STRING). Ignoring." >&5
|
{ $as_echo "$as_me:${as_lineno-$LINENO}: Found GNU make at $MAKE_CANDIDATE, however this is not version 3.81 or later. (it is: $MAKE_VERSION_STRING). Ignoring." >&5
|
||||||
$as_echo "$as_me: Found GNU make at $MAKE_CANDIDATE, however this is not version 3.81 or later. (it is: $MAKE_VERSION_STRING). Ignoring." >&6;}
|
$as_echo "$as_me: Found GNU make at $MAKE_CANDIDATE, however this is not version 3.81 or later. (it is: $MAKE_VERSION_STRING). Ignoring." >&6;}
|
||||||
|
|
|
@ -235,3 +235,5 @@ a4bb3b4500164748a9c33b2283cfda76d89f25ab jdk8-b108
|
||||||
85c1c94e723582f9a1dd0251502c42b73d6deea7 jdk8-b111
|
85c1c94e723582f9a1dd0251502c42b73d6deea7 jdk8-b111
|
||||||
43cec76d1d62587a07af07e2d9bec93aba2a506b jdk8-b112
|
43cec76d1d62587a07af07e2d9bec93aba2a506b jdk8-b112
|
||||||
a259ff3e42d91da68f4d4f09d7eb9dc22bc024fc jdk8-b113
|
a259ff3e42d91da68f4d4f09d7eb9dc22bc024fc jdk8-b113
|
||||||
|
0bbccf77c23e566170b88b52c2cf28e5d31ce927 jdk8-b114
|
||||||
|
8d07115924b7d703a5048adb24e8aba751442f13 jdk8-b115
|
||||||
|
|
|
@ -580,7 +580,7 @@ public class AnyImpl extends Any
|
||||||
java.lang.Object[] objholder = new java.lang.Object[1];
|
java.lang.Object[] objholder = new java.lang.Object[1];
|
||||||
objholder[0] = object;
|
objholder[0] = object;
|
||||||
long[] longholder = new long[1];
|
long[] longholder = new long[1];
|
||||||
TCUtility.unmarshalIn(in, typeCode, longholder, objholder);
|
TCUtility.unmarshalIn(in, realType(), longholder, objholder);
|
||||||
value = longholder[0];
|
value = longholder[0];
|
||||||
object = objholder[0];
|
object = objholder[0];
|
||||||
stream = null;
|
stream = null;
|
||||||
|
|
|
@ -61,13 +61,11 @@ public abstract class Stub extends ObjectImpl
|
||||||
private transient StubDelegate stubDelegate = null;
|
private transient StubDelegate stubDelegate = null;
|
||||||
private static Class stubDelegateClass = null;
|
private static Class stubDelegateClass = null;
|
||||||
private static final String StubClassKey = "javax.rmi.CORBA.StubClass";
|
private static final String StubClassKey = "javax.rmi.CORBA.StubClass";
|
||||||
private static final String defaultStubImplName = "com.sun.corba.se.impl.javax.rmi.CORBA.StubDelegateImpl";
|
|
||||||
|
|
||||||
static {
|
static {
|
||||||
Object stubDelegateInstance = (Object) createDelegateIfSpecified(StubClassKey, defaultStubImplName);
|
Object stubDelegateInstance = createDelegate(StubClassKey);
|
||||||
if (stubDelegateInstance != null)
|
if (stubDelegateInstance != null)
|
||||||
stubDelegateClass = stubDelegateInstance.getClass();
|
stubDelegateClass = stubDelegateInstance.getClass();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -207,7 +205,7 @@ public abstract class Stub extends ObjectImpl
|
||||||
// are in different packages and the visibility needs to be package for
|
// are in different packages and the visibility needs to be package for
|
||||||
// security reasons. If you know a better solution how to share this code
|
// security reasons. If you know a better solution how to share this code
|
||||||
// then remove it from PortableRemoteObject. Also in Util.java
|
// then remove it from PortableRemoteObject. Also in Util.java
|
||||||
private static Object createDelegateIfSpecified(String classKey, String defaultClassName) {
|
private static Object createDelegate(String classKey) {
|
||||||
String className = (String)
|
String className = (String)
|
||||||
AccessController.doPrivileged(new GetPropertyAction(classKey));
|
AccessController.doPrivileged(new GetPropertyAction(classKey));
|
||||||
if (className == null) {
|
if (className == null) {
|
||||||
|
@ -218,7 +216,7 @@ public abstract class Stub extends ObjectImpl
|
||||||
}
|
}
|
||||||
|
|
||||||
if (className == null) {
|
if (className == null) {
|
||||||
className = defaultClassName;
|
return new com.sun.corba.se.impl.javax.rmi.CORBA.StubDelegateImpl();
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
|
|
@ -60,14 +60,11 @@ import com.sun.corba.se.impl.orbutil.GetPropertyAction;
|
||||||
public class Util {
|
public class Util {
|
||||||
|
|
||||||
// This can only be set at static initialization time (no sync necessary).
|
// This can only be set at static initialization time (no sync necessary).
|
||||||
private static javax.rmi.CORBA.UtilDelegate utilDelegate = null;
|
private static final javax.rmi.CORBA.UtilDelegate utilDelegate;
|
||||||
private static final String UtilClassKey = "javax.rmi.CORBA.UtilClass";
|
private static final String UtilClassKey = "javax.rmi.CORBA.UtilClass";
|
||||||
private static final String defaultUtilImplName =
|
|
||||||
"com.sun.corba.se.impl.javax.rmi.CORBA.Util";
|
|
||||||
|
|
||||||
static {
|
static {
|
||||||
utilDelegate = (javax.rmi.CORBA.UtilDelegate)
|
utilDelegate = (javax.rmi.CORBA.UtilDelegate)createDelegate(UtilClassKey);
|
||||||
createDelegateIfSpecified(UtilClassKey, defaultUtilImplName);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private Util(){}
|
private Util(){}
|
||||||
|
@ -338,9 +335,7 @@ Tie#deactivate}
|
||||||
// are in different packages and the visibility needs to be package for
|
// are in different packages and the visibility needs to be package for
|
||||||
// security reasons. If you know a better solution how to share this code
|
// security reasons. If you know a better solution how to share this code
|
||||||
// then remove it from PortableRemoteObject. Also in Stub.java
|
// then remove it from PortableRemoteObject. Also in Stub.java
|
||||||
private static Object createDelegateIfSpecified(String classKey,
|
private static Object createDelegate(String classKey) {
|
||||||
String defaultClassName)
|
|
||||||
{
|
|
||||||
String className = (String)
|
String className = (String)
|
||||||
AccessController.doPrivileged(new GetPropertyAction(classKey));
|
AccessController.doPrivileged(new GetPropertyAction(classKey));
|
||||||
if (className == null) {
|
if (className == null) {
|
||||||
|
@ -351,7 +346,7 @@ Tie#deactivate}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (className == null) {
|
if (className == null) {
|
||||||
className = defaultClassName;
|
return new com.sun.corba.se.impl.javax.rmi.CORBA.Util();
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
|
|
@ -65,17 +65,14 @@ import com.sun.corba.se.impl.orbutil.GetPropertyAction;
|
||||||
*/
|
*/
|
||||||
public class PortableRemoteObject {
|
public class PortableRemoteObject {
|
||||||
|
|
||||||
private static javax.rmi.CORBA.PortableRemoteObjectDelegate proDelegate = null;
|
private static final javax.rmi.CORBA.PortableRemoteObjectDelegate proDelegate;
|
||||||
|
|
||||||
private static final String PortableRemoteObjectClassKey =
|
private static final String PortableRemoteObjectClassKey =
|
||||||
"javax.rmi.CORBA.PortableRemoteObjectClass";
|
"javax.rmi.CORBA.PortableRemoteObjectClass";
|
||||||
|
|
||||||
private static final String defaultPortableRemoteObjectImplName =
|
|
||||||
"com.sun.corba.se.impl.javax.rmi.PortableRemoteObject";
|
|
||||||
|
|
||||||
static {
|
static {
|
||||||
proDelegate = (javax.rmi.CORBA.PortableRemoteObjectDelegate)
|
proDelegate = (javax.rmi.CORBA.PortableRemoteObjectDelegate)
|
||||||
createDelegateIfSpecified(PortableRemoteObjectClassKey);
|
createDelegate(PortableRemoteObjectClassKey);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -181,7 +178,7 @@ public class PortableRemoteObject {
|
||||||
// are in different packages and the visibility needs to be package for
|
// are in different packages and the visibility needs to be package for
|
||||||
// security reasons. If you know a better solution how to share this code
|
// security reasons. If you know a better solution how to share this code
|
||||||
// then remove it from here.
|
// then remove it from here.
|
||||||
private static Object createDelegateIfSpecified(String classKey) {
|
private static Object createDelegate(String classKey) {
|
||||||
String className = (String)
|
String className = (String)
|
||||||
AccessController.doPrivileged(new GetPropertyAction(classKey));
|
AccessController.doPrivileged(new GetPropertyAction(classKey));
|
||||||
if (className == null) {
|
if (className == null) {
|
||||||
|
@ -191,7 +188,7 @@ public class PortableRemoteObject {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (className == null) {
|
if (className == null) {
|
||||||
className = defaultPortableRemoteObjectImplName;
|
return new com.sun.corba.se.impl.javax.rmi.PortableRemoteObject();
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
|
|
@ -173,15 +173,6 @@ abstract public class ORB {
|
||||||
private static final String ORBClassKey = "org.omg.CORBA.ORBClass";
|
private static final String ORBClassKey = "org.omg.CORBA.ORBClass";
|
||||||
private static final String ORBSingletonClassKey = "org.omg.CORBA.ORBSingletonClass";
|
private static final String ORBSingletonClassKey = "org.omg.CORBA.ORBSingletonClass";
|
||||||
|
|
||||||
//
|
|
||||||
// The last resort fallback ORB implementation classes in case
|
|
||||||
// no ORB implementation class is dynamically configured through
|
|
||||||
// properties or applet parameters. Change these values to
|
|
||||||
// vendor-specific class names.
|
|
||||||
//
|
|
||||||
private static final String defaultORB = "com.sun.corba.se.impl.orb.ORBImpl";
|
|
||||||
private static final String defaultORBSingleton = "com.sun.corba.se.impl.orb.ORBSingleton";
|
|
||||||
|
|
||||||
//
|
//
|
||||||
// The global instance of the singleton ORB implementation which
|
// The global instance of the singleton ORB implementation which
|
||||||
// acts as a factory for typecodes for generated Helper classes.
|
// acts as a factory for typecodes for generated Helper classes.
|
||||||
|
@ -294,11 +285,12 @@ abstract public class ORB {
|
||||||
String className = getSystemProperty(ORBSingletonClassKey);
|
String className = getSystemProperty(ORBSingletonClassKey);
|
||||||
if (className == null)
|
if (className == null)
|
||||||
className = getPropertyFromFile(ORBSingletonClassKey);
|
className = getPropertyFromFile(ORBSingletonClassKey);
|
||||||
if (className == null)
|
if (className == null) {
|
||||||
className = defaultORBSingleton;
|
singleton = new com.sun.corba.se.impl.orb.ORBSingleton();
|
||||||
|
} else {
|
||||||
singleton = create_impl(className);
|
singleton = create_impl(className);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
return singleton;
|
return singleton;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -347,10 +339,12 @@ abstract public class ORB {
|
||||||
className = getSystemProperty(ORBClassKey);
|
className = getSystemProperty(ORBClassKey);
|
||||||
if (className == null)
|
if (className == null)
|
||||||
className = getPropertyFromFile(ORBClassKey);
|
className = getPropertyFromFile(ORBClassKey);
|
||||||
if (className == null)
|
if (className == null) {
|
||||||
className = defaultORB;
|
orb = new com.sun.corba.se.impl.orb.ORBImpl();
|
||||||
|
} else {
|
||||||
orb = create_impl(className);
|
orb = create_impl(className);
|
||||||
|
}
|
||||||
|
|
||||||
orb.set_parameters(args, props);
|
orb.set_parameters(args, props);
|
||||||
return orb;
|
return orb;
|
||||||
}
|
}
|
||||||
|
@ -375,10 +369,12 @@ abstract public class ORB {
|
||||||
className = getSystemProperty(ORBClassKey);
|
className = getSystemProperty(ORBClassKey);
|
||||||
if (className == null)
|
if (className == null)
|
||||||
className = getPropertyFromFile(ORBClassKey);
|
className = getPropertyFromFile(ORBClassKey);
|
||||||
if (className == null)
|
if (className == null) {
|
||||||
className = defaultORB;
|
orb = new com.sun.corba.se.impl.orb.ORBImpl();
|
||||||
|
} else {
|
||||||
orb = create_impl(className);
|
orb = create_impl(className);
|
||||||
|
}
|
||||||
|
|
||||||
orb.set_parameters(app, props);
|
orb.set_parameters(app, props);
|
||||||
return orb;
|
return orb;
|
||||||
}
|
}
|
||||||
|
|
|
@ -391,3 +391,5 @@ f6962730bbde82f279a0ae3a1c14bc5e58096c6e jdk8-b111
|
||||||
82a9cdbf683e374a76f2009352de53e16bed5a91 hs25-b56
|
82a9cdbf683e374a76f2009352de53e16bed5a91 hs25-b56
|
||||||
7fd913010dbbf75260688fd2fa8964763fa49a09 jdk8-b114
|
7fd913010dbbf75260688fd2fa8964763fa49a09 jdk8-b114
|
||||||
3b32d287da89a47a45d16f6d9ba5bd3cd9bf4b3e hs25-b57
|
3b32d287da89a47a45d16f6d9ba5bd3cd9bf4b3e hs25-b57
|
||||||
|
9ebaac78a8a0061fb9597e07f806498cb626cdeb jdk8-b115
|
||||||
|
e510dfdec6dd701410f3398ed86ebcdff0cca63a hs25-b58
|
||||||
|
|
|
@ -35,7 +35,7 @@ HOTSPOT_VM_COPYRIGHT=Copyright 2013
|
||||||
|
|
||||||
HS_MAJOR_VER=25
|
HS_MAJOR_VER=25
|
||||||
HS_MINOR_VER=0
|
HS_MINOR_VER=0
|
||||||
HS_BUILD_NUMBER=58
|
HS_BUILD_NUMBER=59
|
||||||
|
|
||||||
JDK_MAJOR_VER=1
|
JDK_MAJOR_VER=1
|
||||||
JDK_MINOR_VER=8
|
JDK_MINOR_VER=8
|
||||||
|
|
|
@ -3526,8 +3526,12 @@ void MacroAssembler::bang_stack_size(Register Rsize, Register Rtsp,
|
||||||
delayed()->sub(Rtsp, Roffset, Rtsp);
|
delayed()->sub(Rtsp, Roffset, Rtsp);
|
||||||
|
|
||||||
// Bang down shadow pages too.
|
// Bang down shadow pages too.
|
||||||
// The -1 because we already subtracted 1 page.
|
// At this point, (tmp-0) is the last address touched, so don't
|
||||||
for (int i = 0; i< StackShadowPages-1; i++) {
|
// touch it again. (It was touched as (tmp-pagesize) but then tmp
|
||||||
|
// was post-decremented.) Skip this address by starting at i=1, and
|
||||||
|
// touch a few more pages below. N.B. It is important to touch all
|
||||||
|
// the way down to and including i=StackShadowPages.
|
||||||
|
for (int i = 1; i <= StackShadowPages; i++) {
|
||||||
set((-i*offset)+STACK_BIAS, Rscratch);
|
set((-i*offset)+STACK_BIAS, Rscratch);
|
||||||
st(G0, Rtsp, Rscratch);
|
st(G0, Rtsp, Rscratch);
|
||||||
}
|
}
|
||||||
|
|
|
@ -2916,6 +2916,9 @@ enc_class Fast_Unlock(iRegP oop, iRegP box, o7RegP scratch, iRegP scratch2) %{
|
||||||
__ bind(LSkip2);
|
__ bind(LSkip2);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// We have no guarantee that on 64 bit the higher half of limit_reg is 0
|
||||||
|
__ signx(limit_reg);
|
||||||
|
|
||||||
__ subcc(limit_reg, 1 * sizeof(jchar), chr1_reg);
|
__ subcc(limit_reg, 1 * sizeof(jchar), chr1_reg);
|
||||||
__ br(Assembler::equal, true, Assembler::pn, Ldone);
|
__ br(Assembler::equal, true, Assembler::pn, Ldone);
|
||||||
__ delayed()->mov(O7, result_reg); // result is difference in lengths
|
__ delayed()->mov(O7, result_reg); // result is difference in lengths
|
||||||
|
@ -2973,6 +2976,9 @@ enc_class enc_String_Equals(o0RegP str1, o1RegP str2, g3RegI cnt, notemp_iRegI r
|
||||||
Register chr1_reg = result_reg;
|
Register chr1_reg = result_reg;
|
||||||
Register chr2_reg = tmp1_reg;
|
Register chr2_reg = tmp1_reg;
|
||||||
|
|
||||||
|
// We have no guarantee that on 64 bit the higher half of limit_reg is 0
|
||||||
|
__ signx(limit_reg);
|
||||||
|
|
||||||
//check for alignment and position the pointers to the ends
|
//check for alignment and position the pointers to the ends
|
||||||
__ or3(str1_reg, str2_reg, chr1_reg);
|
__ or3(str1_reg, str2_reg, chr1_reg);
|
||||||
__ andcc(chr1_reg, 0x3, chr1_reg);
|
__ andcc(chr1_reg, 0x3, chr1_reg);
|
||||||
|
|
|
@ -196,7 +196,7 @@ void InterpreterMacroAssembler::check_and_handle_earlyret(Register java_thread)
|
||||||
|
|
||||||
void InterpreterMacroAssembler::get_unsigned_2_byte_index_at_bcp(Register reg, int bcp_offset) {
|
void InterpreterMacroAssembler::get_unsigned_2_byte_index_at_bcp(Register reg, int bcp_offset) {
|
||||||
assert(bcp_offset >= 0, "bcp is still pointing to start of bytecode");
|
assert(bcp_offset >= 0, "bcp is still pointing to start of bytecode");
|
||||||
movl(reg, Address(rsi, bcp_offset));
|
load_unsigned_short(reg, Address(rsi, bcp_offset));
|
||||||
bswapl(reg);
|
bswapl(reg);
|
||||||
shrl(reg, 16);
|
shrl(reg, 16);
|
||||||
}
|
}
|
||||||
|
|
|
@ -192,7 +192,7 @@ void InterpreterMacroAssembler::get_unsigned_2_byte_index_at_bcp(
|
||||||
Register reg,
|
Register reg,
|
||||||
int bcp_offset) {
|
int bcp_offset) {
|
||||||
assert(bcp_offset >= 0, "bcp is still pointing to start of bytecode");
|
assert(bcp_offset >= 0, "bcp is still pointing to start of bytecode");
|
||||||
movl(reg, Address(r13, bcp_offset));
|
load_unsigned_short(reg, Address(r13, bcp_offset));
|
||||||
bswapl(reg);
|
bswapl(reg);
|
||||||
shrl(reg, 16);
|
shrl(reg, 16);
|
||||||
}
|
}
|
||||||
|
|
|
@ -1381,8 +1381,12 @@ void MacroAssembler::bang_stack_size(Register size, Register tmp) {
|
||||||
jcc(Assembler::greater, loop);
|
jcc(Assembler::greater, loop);
|
||||||
|
|
||||||
// Bang down shadow pages too.
|
// Bang down shadow pages too.
|
||||||
// The -1 because we already subtracted 1 page.
|
// At this point, (tmp-0) is the last address touched, so don't
|
||||||
for (int i = 0; i< StackShadowPages-1; i++) {
|
// touch it again. (It was touched as (tmp-pagesize) but then tmp
|
||||||
|
// was post-decremented.) Skip this address by starting at i=1, and
|
||||||
|
// touch a few more pages below. N.B. It is important to touch all
|
||||||
|
// the way down to and including i=StackShadowPages.
|
||||||
|
for (int i = 1; i <= StackShadowPages; i++) {
|
||||||
// this could be any sized move but this is can be a debugging crumb
|
// this could be any sized move but this is can be a debugging crumb
|
||||||
// so the bigger the better.
|
// so the bigger the better.
|
||||||
movptr(Address(tmp, (-i*os::vm_page_size())), size );
|
movptr(Address(tmp, (-i*os::vm_page_size())), size );
|
||||||
|
|
|
@ -558,7 +558,7 @@ void TemplateTable::aload() {
|
||||||
|
|
||||||
|
|
||||||
void TemplateTable::locals_index_wide(Register reg) {
|
void TemplateTable::locals_index_wide(Register reg) {
|
||||||
__ movl(reg, at_bcp(2));
|
__ load_unsigned_short(reg, at_bcp(2));
|
||||||
__ bswapl(reg);
|
__ bswapl(reg);
|
||||||
__ shrl(reg, 16);
|
__ shrl(reg, 16);
|
||||||
__ negptr(reg);
|
__ negptr(reg);
|
||||||
|
@ -1552,7 +1552,11 @@ void TemplateTable::branch(bool is_jsr, bool is_wide) {
|
||||||
InvocationCounter::counter_offset();
|
InvocationCounter::counter_offset();
|
||||||
|
|
||||||
// Load up EDX with the branch displacement
|
// Load up EDX with the branch displacement
|
||||||
|
if (is_wide) {
|
||||||
__ movl(rdx, at_bcp(1));
|
__ movl(rdx, at_bcp(1));
|
||||||
|
} else {
|
||||||
|
__ load_signed_short(rdx, at_bcp(1));
|
||||||
|
}
|
||||||
__ bswapl(rdx);
|
__ bswapl(rdx);
|
||||||
if (!is_wide) __ sarl(rdx, 16);
|
if (!is_wide) __ sarl(rdx, 16);
|
||||||
LP64_ONLY(__ movslq(rdx, rdx));
|
LP64_ONLY(__ movslq(rdx, rdx));
|
||||||
|
|
|
@ -568,7 +568,7 @@ void TemplateTable::aload() {
|
||||||
}
|
}
|
||||||
|
|
||||||
void TemplateTable::locals_index_wide(Register reg) {
|
void TemplateTable::locals_index_wide(Register reg) {
|
||||||
__ movl(reg, at_bcp(2));
|
__ load_unsigned_short(reg, at_bcp(2));
|
||||||
__ bswapl(reg);
|
__ bswapl(reg);
|
||||||
__ shrl(reg, 16);
|
__ shrl(reg, 16);
|
||||||
__ negptr(reg);
|
__ negptr(reg);
|
||||||
|
@ -1575,7 +1575,11 @@ void TemplateTable::branch(bool is_jsr, bool is_wide) {
|
||||||
InvocationCounter::counter_offset();
|
InvocationCounter::counter_offset();
|
||||||
|
|
||||||
// Load up edx with the branch displacement
|
// Load up edx with the branch displacement
|
||||||
|
if (is_wide) {
|
||||||
__ movl(rdx, at_bcp(1));
|
__ movl(rdx, at_bcp(1));
|
||||||
|
} else {
|
||||||
|
__ load_signed_short(rdx, at_bcp(1));
|
||||||
|
}
|
||||||
__ bswapl(rdx);
|
__ bswapl(rdx);
|
||||||
|
|
||||||
if (!is_wide) {
|
if (!is_wide) {
|
||||||
|
|
|
@ -122,7 +122,7 @@ void AbstractAssembler::bind(Label& L) {
|
||||||
void AbstractAssembler::generate_stack_overflow_check( int frame_size_in_bytes) {
|
void AbstractAssembler::generate_stack_overflow_check( int frame_size_in_bytes) {
|
||||||
if (UseStackBanging) {
|
if (UseStackBanging) {
|
||||||
// Each code entry causes one stack bang n pages down the stack where n
|
// Each code entry causes one stack bang n pages down the stack where n
|
||||||
// is configurable by StackBangPages. The setting depends on the maximum
|
// is configurable by StackShadowPages. The setting depends on the maximum
|
||||||
// depth of VM call stack or native before going back into java code,
|
// depth of VM call stack or native before going back into java code,
|
||||||
// since only java code can raise a stack overflow exception using the
|
// since only java code can raise a stack overflow exception using the
|
||||||
// stack banging mechanism. The VM and native code does not detect stack
|
// stack banging mechanism. The VM and native code does not detect stack
|
||||||
|
|
|
@ -1138,8 +1138,10 @@ IntervalUseKind LinearScan::use_kind_of_input_operand(LIR_Op* op, LIR_Opr opr) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
// We want to sometimes use logical operations on pointers, in particular in GC barriers.
|
||||||
} else if (opr_type != T_LONG) {
|
// Since 64bit logical operations do not current support operands on stack, we have to make sure
|
||||||
|
// T_OBJECT doesn't get spilled along with T_LONG.
|
||||||
|
} else if (opr_type != T_LONG LP64_ONLY(&& opr_type != T_OBJECT)) {
|
||||||
// integer instruction (note: long operands must always be in register)
|
// integer instruction (note: long operands must always be in register)
|
||||||
switch (op->code()) {
|
switch (op->code()) {
|
||||||
case lir_cmp:
|
case lir_cmp:
|
||||||
|
|
|
@ -392,10 +392,16 @@ class MethodFamily : public ResourceObj {
|
||||||
}
|
}
|
||||||
|
|
||||||
GrowableArray<Method*> qualified_methods;
|
GrowableArray<Method*> qualified_methods;
|
||||||
|
int num_defaults = 0;
|
||||||
|
int default_index = -1;
|
||||||
for (int i = 0; i < _members.length(); ++i) {
|
for (int i = 0; i < _members.length(); ++i) {
|
||||||
Pair<Method*,QualifiedState> entry = _members.at(i);
|
Pair<Method*,QualifiedState> entry = _members.at(i);
|
||||||
if (entry.second == QUALIFIED) {
|
if (entry.second == QUALIFIED) {
|
||||||
qualified_methods.append(entry.first);
|
qualified_methods.append(entry.first);
|
||||||
|
default_index++;
|
||||||
|
if (entry.first->is_default_method()) {
|
||||||
|
num_defaults++;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -408,6 +414,9 @@ class MethodFamily : public ResourceObj {
|
||||||
if (!method->is_abstract()) {
|
if (!method->is_abstract()) {
|
||||||
_selected_target = qualified_methods.at(0);
|
_selected_target = qualified_methods.at(0);
|
||||||
}
|
}
|
||||||
|
// If only one qualified method is default, select that
|
||||||
|
} else if (num_defaults == 1) {
|
||||||
|
_selected_target = qualified_methods.at(default_index);
|
||||||
} else {
|
} else {
|
||||||
_exception_message = generate_conflicts_message(&qualified_methods,CHECK);
|
_exception_message = generate_conflicts_message(&qualified_methods,CHECK);
|
||||||
_exception_name = vmSymbols::java_lang_IncompatibleClassChangeError();
|
_exception_name = vmSymbols::java_lang_IncompatibleClassChangeError();
|
||||||
|
|
|
@ -27,6 +27,7 @@
|
||||||
#include "code/codeCache.hpp"
|
#include "code/codeCache.hpp"
|
||||||
#include "compiler/compileBroker.hpp"
|
#include "compiler/compileBroker.hpp"
|
||||||
#include "oops/metadata.hpp"
|
#include "oops/metadata.hpp"
|
||||||
|
#include "prims/jvmtiImpl.hpp"
|
||||||
#include "runtime/synchronizer.hpp"
|
#include "runtime/synchronizer.hpp"
|
||||||
#include "runtime/thread.hpp"
|
#include "runtime/thread.hpp"
|
||||||
#include "utilities/growableArray.hpp"
|
#include "utilities/growableArray.hpp"
|
||||||
|
@ -48,6 +49,7 @@ MetadataOnStackMark::MetadataOnStackMark() {
|
||||||
Threads::metadata_do(Metadata::mark_on_stack);
|
Threads::metadata_do(Metadata::mark_on_stack);
|
||||||
CodeCache::alive_nmethods_do(nmethod::mark_on_stack);
|
CodeCache::alive_nmethods_do(nmethod::mark_on_stack);
|
||||||
CompileBroker::mark_on_stack();
|
CompileBroker::mark_on_stack();
|
||||||
|
JvmtiCurrentBreakpoints::metadata_do(Metadata::mark_on_stack);
|
||||||
}
|
}
|
||||||
|
|
||||||
MetadataOnStackMark::~MetadataOnStackMark() {
|
MetadataOnStackMark::~MetadataOnStackMark() {
|
||||||
|
|
|
@ -2869,7 +2869,7 @@ void Metaspace::set_narrow_klass_base_and_shift(address metaspace_base, address
|
||||||
|
|
||||||
Universe::set_narrow_klass_base(lower_base);
|
Universe::set_narrow_klass_base(lower_base);
|
||||||
|
|
||||||
if ((uint64_t)(higher_address - lower_base) < UnscaledClassSpaceMax) {
|
if ((uint64_t)(higher_address - lower_base) <= UnscaledClassSpaceMax) {
|
||||||
Universe::set_narrow_klass_shift(0);
|
Universe::set_narrow_klass_shift(0);
|
||||||
} else {
|
} else {
|
||||||
assert(!UseSharedSpaces, "Cannot shift with UseSharedSpaces");
|
assert(!UseSharedSpaces, "Cannot shift with UseSharedSpaces");
|
||||||
|
@ -2885,7 +2885,7 @@ bool Metaspace::can_use_cds_with_metaspace_addr(char* metaspace_base, address cd
|
||||||
address lower_base = MIN2((address)metaspace_base, cds_base);
|
address lower_base = MIN2((address)metaspace_base, cds_base);
|
||||||
address higher_address = MAX2((address)(cds_base + FileMapInfo::shared_spaces_size()),
|
address higher_address = MAX2((address)(cds_base + FileMapInfo::shared_spaces_size()),
|
||||||
(address)(metaspace_base + compressed_class_space_size()));
|
(address)(metaspace_base + compressed_class_space_size()));
|
||||||
return ((uint64_t)(higher_address - lower_base) < UnscaledClassSpaceMax);
|
return ((uint64_t)(higher_address - lower_base) <= UnscaledClassSpaceMax);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Try to allocate the metaspace at the requested addr.
|
// Try to allocate the metaspace at the requested addr.
|
||||||
|
|
|
@ -848,6 +848,7 @@ Compile::Compile( ciEnv* ci_env, C2Compiler* compiler, ciMethod* target, int osr
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
NOT_PRODUCT( verify_barriers(); )
|
||||||
// Now that we know the size of all the monitors we can add a fixed slot
|
// Now that we know the size of all the monitors we can add a fixed slot
|
||||||
// for the original deopt pc.
|
// for the original deopt pc.
|
||||||
|
|
||||||
|
@ -3018,7 +3019,13 @@ void Compile::final_graph_reshaping_impl( Node *n, Final_Reshape_Counts &frc) {
|
||||||
// Phi nodes shouldn't be moved. They would only match below if they
|
// Phi nodes shouldn't be moved. They would only match below if they
|
||||||
// had the same control as the MathExactNode. The only time that
|
// had the same control as the MathExactNode. The only time that
|
||||||
// would happen is if the Phi is also an input to the MathExact
|
// would happen is if the Phi is also an input to the MathExact
|
||||||
if (!out->is_Phi()) {
|
//
|
||||||
|
// Cmp nodes shouldn't have control set at all.
|
||||||
|
if (out->is_Phi() ||
|
||||||
|
out->is_Cmp()) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
if (out->in(0) == NULL) {
|
if (out->in(0) == NULL) {
|
||||||
out->set_req(0, non_throwing);
|
out->set_req(0, non_throwing);
|
||||||
} else if (out->in(0) == ctrl) {
|
} else if (out->in(0) == ctrl) {
|
||||||
|
@ -3027,7 +3034,6 @@ void Compile::final_graph_reshaping_impl( Node *n, Final_Reshape_Counts &frc) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
assert( !n->is_Call(), "" );
|
assert( !n->is_Call(), "" );
|
||||||
|
@ -3368,6 +3374,72 @@ void Compile::verify_graph_edges(bool no_dead_code) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Verify GC barriers consistency
|
||||||
|
// Currently supported:
|
||||||
|
// - G1 pre-barriers (see GraphKit::g1_write_barrier_pre())
|
||||||
|
void Compile::verify_barriers() {
|
||||||
|
if (UseG1GC) {
|
||||||
|
// Verify G1 pre-barriers
|
||||||
|
const int marking_offset = in_bytes(JavaThread::satb_mark_queue_offset() + PtrQueue::byte_offset_of_active());
|
||||||
|
|
||||||
|
ResourceArea *area = Thread::current()->resource_area();
|
||||||
|
Unique_Node_List visited(area);
|
||||||
|
Node_List worklist(area);
|
||||||
|
// We're going to walk control flow backwards starting from the Root
|
||||||
|
worklist.push(_root);
|
||||||
|
while (worklist.size() > 0) {
|
||||||
|
Node* x = worklist.pop();
|
||||||
|
if (x == NULL || x == top()) continue;
|
||||||
|
if (visited.member(x)) {
|
||||||
|
continue;
|
||||||
|
} else {
|
||||||
|
visited.push(x);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (x->is_Region()) {
|
||||||
|
for (uint i = 1; i < x->req(); i++) {
|
||||||
|
worklist.push(x->in(i));
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
worklist.push(x->in(0));
|
||||||
|
// We are looking for the pattern:
|
||||||
|
// /->ThreadLocal
|
||||||
|
// If->Bool->CmpI->LoadB->AddP->ConL(marking_offset)
|
||||||
|
// \->ConI(0)
|
||||||
|
// We want to verify that the If and the LoadB have the same control
|
||||||
|
// See GraphKit::g1_write_barrier_pre()
|
||||||
|
if (x->is_If()) {
|
||||||
|
IfNode *iff = x->as_If();
|
||||||
|
if (iff->in(1)->is_Bool() && iff->in(1)->in(1)->is_Cmp()) {
|
||||||
|
CmpNode *cmp = iff->in(1)->in(1)->as_Cmp();
|
||||||
|
if (cmp->Opcode() == Op_CmpI && cmp->in(2)->is_Con() && cmp->in(2)->bottom_type()->is_int()->get_con() == 0
|
||||||
|
&& cmp->in(1)->is_Load()) {
|
||||||
|
LoadNode* load = cmp->in(1)->as_Load();
|
||||||
|
if (load->Opcode() == Op_LoadB && load->in(2)->is_AddP() && load->in(2)->in(2)->Opcode() == Op_ThreadLocal
|
||||||
|
&& load->in(2)->in(3)->is_Con()
|
||||||
|
&& load->in(2)->in(3)->bottom_type()->is_intptr_t()->get_con() == marking_offset) {
|
||||||
|
|
||||||
|
Node* if_ctrl = iff->in(0);
|
||||||
|
Node* load_ctrl = load->in(0);
|
||||||
|
|
||||||
|
if (if_ctrl != load_ctrl) {
|
||||||
|
// Skip possible CProj->NeverBranch in infinite loops
|
||||||
|
if ((if_ctrl->is_Proj() && if_ctrl->Opcode() == Op_CProj)
|
||||||
|
&& (if_ctrl->in(0)->is_MultiBranch() && if_ctrl->in(0)->Opcode() == Op_NeverBranch)) {
|
||||||
|
if_ctrl = if_ctrl->in(0)->in(0);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
assert(load_ctrl != NULL && if_ctrl == load_ctrl, "controls must match");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// The Compile object keeps track of failure reasons separately from the ciEnv.
|
// The Compile object keeps track of failure reasons separately from the ciEnv.
|
||||||
|
|
|
@ -1148,6 +1148,9 @@ class Compile : public Phase {
|
||||||
// graph is strongly connected from root in both directions.
|
// graph is strongly connected from root in both directions.
|
||||||
void verify_graph_edges(bool no_dead_code = false) PRODUCT_RETURN;
|
void verify_graph_edges(bool no_dead_code = false) PRODUCT_RETURN;
|
||||||
|
|
||||||
|
// Verify GC barrier patterns
|
||||||
|
void verify_barriers() PRODUCT_RETURN;
|
||||||
|
|
||||||
// End-of-run dumps.
|
// End-of-run dumps.
|
||||||
static void print_statistics() PRODUCT_RETURN;
|
static void print_statistics() PRODUCT_RETURN;
|
||||||
|
|
||||||
|
|
|
@ -1964,7 +1964,7 @@ void PhaseIdealLoop::do_range_check( IdealLoopTree *loop, Node_List &old_new ) {
|
||||||
// Find loads off the surviving projection; remove their control edge
|
// Find loads off the surviving projection; remove their control edge
|
||||||
for (DUIterator_Fast imax, i = dp->fast_outs(imax); i < imax; i++) {
|
for (DUIterator_Fast imax, i = dp->fast_outs(imax); i < imax; i++) {
|
||||||
Node* cd = dp->fast_out(i); // Control-dependent node
|
Node* cd = dp->fast_out(i); // Control-dependent node
|
||||||
if( cd->is_Load() ) { // Loads can now float around in the loop
|
if (cd->is_Load() && cd->depends_only_on_test()) { // Loads can now float around in the loop
|
||||||
// Allow the load to float around in the loop, or before it
|
// Allow the load to float around in the loop, or before it
|
||||||
// but NOT before the pre-loop.
|
// but NOT before the pre-loop.
|
||||||
_igvn.replace_input_of(cd, 0, ctrl); // ctrl, not NULL
|
_igvn.replace_input_of(cd, 0, ctrl); // ctrl, not NULL
|
||||||
|
|
|
@ -204,6 +204,17 @@ public:
|
||||||
protected:
|
protected:
|
||||||
const Type* load_array_final_field(const TypeKlassPtr *tkls,
|
const Type* load_array_final_field(const TypeKlassPtr *tkls,
|
||||||
ciKlass* klass) const;
|
ciKlass* klass) const;
|
||||||
|
// depends_only_on_test is almost always true, and needs to be almost always
|
||||||
|
// true to enable key hoisting & commoning optimizations. However, for the
|
||||||
|
// special case of RawPtr loads from TLS top & end, and other loads performed by
|
||||||
|
// GC barriers, the control edge carries the dependence preventing hoisting past
|
||||||
|
// a Safepoint instead of the memory edge. (An unfortunate consequence of having
|
||||||
|
// Safepoints not set Raw Memory; itself an unfortunate consequence of having Nodes
|
||||||
|
// which produce results (new raw memory state) inside of loops preventing all
|
||||||
|
// manner of other optimizations). Basically, it's ugly but so is the alternative.
|
||||||
|
// See comment in macro.cpp, around line 125 expand_allocate_common().
|
||||||
|
virtual bool depends_only_on_test() const { return adr_type() != TypeRawPtr::BOTTOM; }
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
//------------------------------LoadBNode--------------------------------------
|
//------------------------------LoadBNode--------------------------------------
|
||||||
|
@ -370,16 +381,6 @@ public:
|
||||||
virtual uint ideal_reg() const { return Op_RegP; }
|
virtual uint ideal_reg() const { return Op_RegP; }
|
||||||
virtual int store_Opcode() const { return Op_StoreP; }
|
virtual int store_Opcode() const { return Op_StoreP; }
|
||||||
virtual BasicType memory_type() const { return T_ADDRESS; }
|
virtual BasicType memory_type() const { return T_ADDRESS; }
|
||||||
// depends_only_on_test is almost always true, and needs to be almost always
|
|
||||||
// true to enable key hoisting & commoning optimizations. However, for the
|
|
||||||
// special case of RawPtr loads from TLS top & end, the control edge carries
|
|
||||||
// the dependence preventing hoisting past a Safepoint instead of the memory
|
|
||||||
// edge. (An unfortunate consequence of having Safepoints not set Raw
|
|
||||||
// Memory; itself an unfortunate consequence of having Nodes which produce
|
|
||||||
// results (new raw memory state) inside of loops preventing all manner of
|
|
||||||
// other optimizations). Basically, it's ugly but so is the alternative.
|
|
||||||
// See comment in macro.cpp, around line 125 expand_allocate_common().
|
|
||||||
virtual bool depends_only_on_test() const { return adr_type() != TypeRawPtr::BOTTOM; }
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
@ -393,16 +394,6 @@ public:
|
||||||
virtual uint ideal_reg() const { return Op_RegN; }
|
virtual uint ideal_reg() const { return Op_RegN; }
|
||||||
virtual int store_Opcode() const { return Op_StoreN; }
|
virtual int store_Opcode() const { return Op_StoreN; }
|
||||||
virtual BasicType memory_type() const { return T_NARROWOOP; }
|
virtual BasicType memory_type() const { return T_NARROWOOP; }
|
||||||
// depends_only_on_test is almost always true, and needs to be almost always
|
|
||||||
// true to enable key hoisting & commoning optimizations. However, for the
|
|
||||||
// special case of RawPtr loads from TLS top & end, the control edge carries
|
|
||||||
// the dependence preventing hoisting past a Safepoint instead of the memory
|
|
||||||
// edge. (An unfortunate consequence of having Safepoints not set Raw
|
|
||||||
// Memory; itself an unfortunate consequence of having Nodes which produce
|
|
||||||
// results (new raw memory state) inside of loops preventing all manner of
|
|
||||||
// other optimizations). Basically, it's ugly but so is the alternative.
|
|
||||||
// See comment in macro.cpp, around line 125 expand_allocate_common().
|
|
||||||
virtual bool depends_only_on_test() const { return adr_type() != TypeRawPtr::BOTTOM; }
|
|
||||||
};
|
};
|
||||||
|
|
||||||
//------------------------------LoadKlassNode----------------------------------
|
//------------------------------LoadKlassNode----------------------------------
|
||||||
|
|
|
@ -210,6 +210,14 @@ void GrowableCache::oops_do(OopClosure* f) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void GrowableCache::metadata_do(void f(Metadata*)) {
|
||||||
|
int len = _elements->length();
|
||||||
|
for (int i=0; i<len; i++) {
|
||||||
|
GrowableElement *e = _elements->at(i);
|
||||||
|
e->metadata_do(f);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void GrowableCache::gc_epilogue() {
|
void GrowableCache::gc_epilogue() {
|
||||||
int len = _elements->length();
|
int len = _elements->length();
|
||||||
for (int i=0; i<len; i++) {
|
for (int i=0; i<len; i++) {
|
||||||
|
@ -224,20 +232,20 @@ void GrowableCache::gc_epilogue() {
|
||||||
JvmtiBreakpoint::JvmtiBreakpoint() {
|
JvmtiBreakpoint::JvmtiBreakpoint() {
|
||||||
_method = NULL;
|
_method = NULL;
|
||||||
_bci = 0;
|
_bci = 0;
|
||||||
_class_loader = NULL;
|
_class_holder = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
JvmtiBreakpoint::JvmtiBreakpoint(Method* m_method, jlocation location) {
|
JvmtiBreakpoint::JvmtiBreakpoint(Method* m_method, jlocation location) {
|
||||||
_method = m_method;
|
_method = m_method;
|
||||||
_class_loader = _method->method_holder()->class_loader_data()->class_loader();
|
_class_holder = _method->method_holder()->klass_holder();
|
||||||
#ifdef CHECK_UNHANDLED_OOPS
|
#ifdef CHECK_UNHANDLED_OOPS
|
||||||
// _class_loader can't be wrapped in a Handle, because JvmtiBreakpoint:s are
|
// _class_holder can't be wrapped in a Handle, because JvmtiBreakpoints are
|
||||||
// eventually allocated on the heap.
|
// sometimes allocated on the heap.
|
||||||
//
|
//
|
||||||
// The code handling JvmtiBreakpoint:s allocated on the stack can't be
|
// The code handling JvmtiBreakpoints allocated on the stack can't be
|
||||||
// interrupted by a GC until _class_loader is reachable by the GC via the
|
// interrupted by a GC until _class_holder is reachable by the GC via the
|
||||||
// oops_do method.
|
// oops_do method.
|
||||||
Thread::current()->allow_unhandled_oop(&_class_loader);
|
Thread::current()->allow_unhandled_oop(&_class_holder);
|
||||||
#endif // CHECK_UNHANDLED_OOPS
|
#endif // CHECK_UNHANDLED_OOPS
|
||||||
assert(_method != NULL, "_method != NULL");
|
assert(_method != NULL, "_method != NULL");
|
||||||
_bci = (int) location;
|
_bci = (int) location;
|
||||||
|
@ -247,7 +255,7 @@ JvmtiBreakpoint::JvmtiBreakpoint(Method* m_method, jlocation location) {
|
||||||
void JvmtiBreakpoint::copy(JvmtiBreakpoint& bp) {
|
void JvmtiBreakpoint::copy(JvmtiBreakpoint& bp) {
|
||||||
_method = bp._method;
|
_method = bp._method;
|
||||||
_bci = bp._bci;
|
_bci = bp._bci;
|
||||||
_class_loader = bp._class_loader;
|
_class_holder = bp._class_holder;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool JvmtiBreakpoint::lessThan(JvmtiBreakpoint& bp) {
|
bool JvmtiBreakpoint::lessThan(JvmtiBreakpoint& bp) {
|
||||||
|
@ -365,6 +373,13 @@ void VM_ChangeBreakpoints::oops_do(OopClosure* f) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void VM_ChangeBreakpoints::metadata_do(void f(Metadata*)) {
|
||||||
|
// Walk metadata in breakpoints to keep from being deallocated with RedefineClasses
|
||||||
|
if (_bp != NULL) {
|
||||||
|
_bp->metadata_do(f);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
// class JvmtiBreakpoints
|
// class JvmtiBreakpoints
|
||||||
//
|
//
|
||||||
|
@ -381,6 +396,10 @@ void JvmtiBreakpoints::oops_do(OopClosure* f) {
|
||||||
_bps.oops_do(f);
|
_bps.oops_do(f);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void JvmtiBreakpoints::metadata_do(void f(Metadata*)) {
|
||||||
|
_bps.metadata_do(f);
|
||||||
|
}
|
||||||
|
|
||||||
void JvmtiBreakpoints::gc_epilogue() {
|
void JvmtiBreakpoints::gc_epilogue() {
|
||||||
_bps.gc_epilogue();
|
_bps.gc_epilogue();
|
||||||
}
|
}
|
||||||
|
@ -499,6 +518,12 @@ void JvmtiCurrentBreakpoints::oops_do(OopClosure* f) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void JvmtiCurrentBreakpoints::metadata_do(void f(Metadata*)) {
|
||||||
|
if (_jvmti_breakpoints != NULL) {
|
||||||
|
_jvmti_breakpoints->metadata_do(f);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void JvmtiCurrentBreakpoints::gc_epilogue() {
|
void JvmtiCurrentBreakpoints::gc_epilogue() {
|
||||||
if (_jvmti_breakpoints != NULL) {
|
if (_jvmti_breakpoints != NULL) {
|
||||||
_jvmti_breakpoints->gc_epilogue();
|
_jvmti_breakpoints->gc_epilogue();
|
||||||
|
|
|
@ -69,6 +69,7 @@ public:
|
||||||
virtual bool lessThan(GrowableElement *e)=0;
|
virtual bool lessThan(GrowableElement *e)=0;
|
||||||
virtual GrowableElement *clone() =0;
|
virtual GrowableElement *clone() =0;
|
||||||
virtual void oops_do(OopClosure* f) =0;
|
virtual void oops_do(OopClosure* f) =0;
|
||||||
|
virtual void metadata_do(void f(Metadata*)) =0;
|
||||||
};
|
};
|
||||||
|
|
||||||
class GrowableCache VALUE_OBJ_CLASS_SPEC {
|
class GrowableCache VALUE_OBJ_CLASS_SPEC {
|
||||||
|
@ -115,6 +116,8 @@ public:
|
||||||
void clear();
|
void clear();
|
||||||
// apply f to every element and update the cache
|
// apply f to every element and update the cache
|
||||||
void oops_do(OopClosure* f);
|
void oops_do(OopClosure* f);
|
||||||
|
// walk metadata to preserve for RedefineClasses
|
||||||
|
void metadata_do(void f(Metadata*));
|
||||||
// update the cache after a full gc
|
// update the cache after a full gc
|
||||||
void gc_epilogue();
|
void gc_epilogue();
|
||||||
};
|
};
|
||||||
|
@ -148,6 +151,7 @@ public:
|
||||||
void remove (int index) { _cache.remove(index); }
|
void remove (int index) { _cache.remove(index); }
|
||||||
void clear() { _cache.clear(); }
|
void clear() { _cache.clear(); }
|
||||||
void oops_do(OopClosure* f) { _cache.oops_do(f); }
|
void oops_do(OopClosure* f) { _cache.oops_do(f); }
|
||||||
|
void metadata_do(void f(Metadata*)) { _cache.metadata_do(f); }
|
||||||
void gc_epilogue() { _cache.gc_epilogue(); }
|
void gc_epilogue() { _cache.gc_epilogue(); }
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -169,7 +173,7 @@ private:
|
||||||
Method* _method;
|
Method* _method;
|
||||||
int _bci;
|
int _bci;
|
||||||
Bytecodes::Code _orig_bytecode;
|
Bytecodes::Code _orig_bytecode;
|
||||||
oop _class_loader;
|
oop _class_holder; // keeps _method memory from being deallocated
|
||||||
|
|
||||||
public:
|
public:
|
||||||
JvmtiBreakpoint();
|
JvmtiBreakpoint();
|
||||||
|
@ -191,9 +195,15 @@ public:
|
||||||
bool lessThan(GrowableElement* e) { Unimplemented(); return false; }
|
bool lessThan(GrowableElement* e) { Unimplemented(); return false; }
|
||||||
bool equals(GrowableElement* e) { return equals((JvmtiBreakpoint&) *e); }
|
bool equals(GrowableElement* e) { return equals((JvmtiBreakpoint&) *e); }
|
||||||
void oops_do(OopClosure* f) {
|
void oops_do(OopClosure* f) {
|
||||||
// Mark the method loader as live
|
// Mark the method loader as live so the Method* class loader doesn't get
|
||||||
f->do_oop(&_class_loader);
|
// unloaded and Method* memory reclaimed.
|
||||||
|
f->do_oop(&_class_holder);
|
||||||
}
|
}
|
||||||
|
void metadata_do(void f(Metadata*)) {
|
||||||
|
// walk metadata to preserve for RedefineClasses
|
||||||
|
f(_method);
|
||||||
|
}
|
||||||
|
|
||||||
GrowableElement *clone() {
|
GrowableElement *clone() {
|
||||||
JvmtiBreakpoint *bp = new JvmtiBreakpoint();
|
JvmtiBreakpoint *bp = new JvmtiBreakpoint();
|
||||||
bp->copy(*this);
|
bp->copy(*this);
|
||||||
|
@ -239,6 +249,7 @@ public:
|
||||||
|
|
||||||
int length();
|
int length();
|
||||||
void oops_do(OopClosure* f);
|
void oops_do(OopClosure* f);
|
||||||
|
void metadata_do(void f(Metadata*));
|
||||||
void print();
|
void print();
|
||||||
|
|
||||||
int set(JvmtiBreakpoint& bp);
|
int set(JvmtiBreakpoint& bp);
|
||||||
|
@ -288,6 +299,7 @@ public:
|
||||||
static inline bool is_breakpoint(address bcp);
|
static inline bool is_breakpoint(address bcp);
|
||||||
|
|
||||||
static void oops_do(OopClosure* f);
|
static void oops_do(OopClosure* f);
|
||||||
|
static void metadata_do(void f(Metadata*));
|
||||||
static void gc_epilogue();
|
static void gc_epilogue();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -332,6 +344,7 @@ public:
|
||||||
VMOp_Type type() const { return VMOp_ChangeBreakpoints; }
|
VMOp_Type type() const { return VMOp_ChangeBreakpoints; }
|
||||||
void doit();
|
void doit();
|
||||||
void oops_do(OopClosure* f);
|
void oops_do(OopClosure* f);
|
||||||
|
void metadata_do(void f(Metadata*));
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
61
hotspot/test/compiler/intrinsics/mathexact/CompareTest.java
Normal file
61
hotspot/test/compiler/intrinsics/mathexact/CompareTest.java
Normal file
|
@ -0,0 +1,61 @@
|
||||||
|
/*
|
||||||
|
* Copyright (c) 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
|
||||||
|
* 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 Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||||
|
* or visit www.oracle.com if you need additional information or have any
|
||||||
|
* questions.
|
||||||
|
*/
|
||||||
|
|
||||||
|
/*
|
||||||
|
* @test
|
||||||
|
* @bug 8026722
|
||||||
|
* @summary Verify that the compare after addExact is a signed compare
|
||||||
|
* @compile CompareTest.java
|
||||||
|
* @run main CompareTest
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
public class CompareTest {
|
||||||
|
public static long store = 0;
|
||||||
|
public static long addValue = 1231;
|
||||||
|
|
||||||
|
public static void main(String[] args) {
|
||||||
|
for (int i = 0; i < 20000; ++i) {
|
||||||
|
runTest(i, i);
|
||||||
|
runTest(i-1, i);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static long create(long value, int v) {
|
||||||
|
if ((value | v) == 0) {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
// C2 turned this test into unsigned test when a control edge was set on the Cmp
|
||||||
|
if (value < -31557014167219200L || value > 31556889864403199L) {
|
||||||
|
throw new RuntimeException("error");
|
||||||
|
}
|
||||||
|
|
||||||
|
return value;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void runTest(long value, int value2) {
|
||||||
|
long res = Math.addExact(value, addValue);
|
||||||
|
store = create(res, Math.floorMod(value2, 100000));
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,82 @@
|
||||||
|
/*
|
||||||
|
* Copyright (c) 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
|
||||||
|
* 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 Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||||
|
* or visit www.oracle.com if you need additional information or have any
|
||||||
|
* questions.
|
||||||
|
*/
|
||||||
|
|
||||||
|
/*
|
||||||
|
* @test
|
||||||
|
* @bug 8027445
|
||||||
|
* @summary String.equals() may be called with a length whose upper bits are not cleared
|
||||||
|
* @run main/othervm -XX:-UseOnStackReplacement -XX:-BackgroundCompilation TestStringEqualsBadLength
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
import java.util.Arrays;
|
||||||
|
|
||||||
|
public class TestStringEqualsBadLength {
|
||||||
|
|
||||||
|
int v1;
|
||||||
|
int v2;
|
||||||
|
|
||||||
|
boolean m(String s1) {
|
||||||
|
int l = v2 - v1; // 0 - (-1) = 1. On 64 bit: 0xffffffff00000001
|
||||||
|
char[] arr = new char[l];
|
||||||
|
arr[0] = 'a';
|
||||||
|
String s2 = new String(arr);
|
||||||
|
// The string length is not reloaded but the value computed is
|
||||||
|
// reused so pointer computation must not use
|
||||||
|
// 0xffffffff00000001
|
||||||
|
return s2.equals(s1);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Same thing with String.compareTo()
|
||||||
|
int m2(String s1) {
|
||||||
|
int l = v2 - v1;
|
||||||
|
char[] arr = new char[l+1];
|
||||||
|
arr[0] = 'a';
|
||||||
|
arr[1] = 'b';
|
||||||
|
String s2 = new String(arr);
|
||||||
|
return s2.compareTo(s1);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Same thing with equals() for arrays
|
||||||
|
boolean m3(char[] arr1) {
|
||||||
|
int l = v2 - v1; // 0 - (-1) = 1. On 64 bit: 0xffffffff00000001
|
||||||
|
char[] arr2 = new char[l];
|
||||||
|
arr2[0] = 'a';
|
||||||
|
return Arrays.equals(arr2, arr1);
|
||||||
|
}
|
||||||
|
|
||||||
|
static public void main(String[] args) {
|
||||||
|
TestStringEqualsBadLength tse = new TestStringEqualsBadLength();
|
||||||
|
tse.v1 = -1;
|
||||||
|
tse.v2 = 0;
|
||||||
|
char[] arr = new char[1];
|
||||||
|
arr[0] = 'a';
|
||||||
|
for (int i = 0; i < 20000; i++) {
|
||||||
|
tse.m("a");
|
||||||
|
tse.m2("ab");
|
||||||
|
tse.m3(arr);
|
||||||
|
}
|
||||||
|
|
||||||
|
System.out.println("TEST PASSED");
|
||||||
|
}
|
||||||
|
}
|
45
hotspot/test/compiler/regalloc/C1ObjectSpillInLogicOp.java
Normal file
45
hotspot/test/compiler/regalloc/C1ObjectSpillInLogicOp.java
Normal file
|
@ -0,0 +1,45 @@
|
||||||
|
/*
|
||||||
|
* Copyright (c) 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
|
||||||
|
* 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 Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||||
|
* or visit www.oracle.com if you need additional information or have any
|
||||||
|
* questions.
|
||||||
|
*/
|
||||||
|
|
||||||
|
/*
|
||||||
|
* @test
|
||||||
|
* @bug 8027751
|
||||||
|
* @summary C1 crashes generating G1 post-barrier in Unsafe.getAndSetObject() intrinsic because of the new value spill
|
||||||
|
* @run main/othervm -XX:+UseG1GC C1ObjectSpillInLogicOp
|
||||||
|
*
|
||||||
|
* G1 barriers use logical operators (xor) on T_OBJECT mixed with T_LONG or T_INT.
|
||||||
|
* The current implementation of logical operations on x86 in C1 doesn't allow for long operands to be on stack.
|
||||||
|
* There is a special code in the register allocator that forces long arguments in registers on x86. However T_OBJECT
|
||||||
|
* can be spilled just fine, and in that case the xor emission will fail.
|
||||||
|
*/
|
||||||
|
|
||||||
|
import java.util.concurrent.atomic.*;
|
||||||
|
class C1ObjectSpillInLogicOp {
|
||||||
|
static public void main(String[] args) {
|
||||||
|
AtomicReferenceArray<Integer> x = new AtomicReferenceArray(128);
|
||||||
|
Integer y = new Integer(0);
|
||||||
|
for (int i = 0; i < 50000; i++) {
|
||||||
|
x.getAndSet(i % x.length(), y);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
10908
hotspot/test/compiler/uncommontrap/UncommonTrapStackBang.java
Normal file
10908
hotspot/test/compiler/uncommontrap/UncommonTrapStackBang.java
Normal file
File diff suppressed because it is too large
Load diff
91
hotspot/test/runtime/8026365/InvokeSpecialAnonTest.java
Normal file
91
hotspot/test/runtime/8026365/InvokeSpecialAnonTest.java
Normal file
|
@ -0,0 +1,91 @@
|
||||||
|
/*
|
||||||
|
* Copyright (c) 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
|
||||||
|
* 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 Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||||
|
* or visit www.oracle.com if you need additional information or have any
|
||||||
|
* questions.
|
||||||
|
*/
|
||||||
|
|
||||||
|
/*
|
||||||
|
* @test
|
||||||
|
* @bug 8026365
|
||||||
|
* @summary Test invokespecial of host class method from an anonymous class
|
||||||
|
* @author Robert Field
|
||||||
|
* @library /testlibrary
|
||||||
|
* @compile -XDignore.symbol.file InvokeSpecialAnonTest.java
|
||||||
|
* @run main ClassFileInstaller InvokeSpecialAnonTest AnonTester
|
||||||
|
* @run main/othervm -Xbootclasspath/a:. -Xverify:all InvokeSpecialAnonTest
|
||||||
|
*/
|
||||||
|
import jdk.internal.org.objectweb.asm.*;
|
||||||
|
import java.lang.reflect.Constructor;
|
||||||
|
import sun.misc.Unsafe;
|
||||||
|
|
||||||
|
public class InvokeSpecialAnonTest implements Opcodes {
|
||||||
|
|
||||||
|
static byte[] anonClassBytes() throws Exception {
|
||||||
|
ClassWriter cw = new ClassWriter(0);
|
||||||
|
MethodVisitor mv;
|
||||||
|
|
||||||
|
cw.visit(V1_8, ACC_FINAL + ACC_SUPER, "Anon", null, "java/lang/Object", null);
|
||||||
|
|
||||||
|
{
|
||||||
|
mv = cw.visitMethod(ACC_PUBLIC, "<init>", "()V", null, null);
|
||||||
|
mv.visitCode();
|
||||||
|
mv.visitVarInsn(ALOAD, 0);
|
||||||
|
mv.visitMethodInsn(INVOKESPECIAL, "java/lang/Object", "<init>", "()V");
|
||||||
|
mv.visitInsn(RETURN);
|
||||||
|
mv.visitMaxs(2, 2);
|
||||||
|
mv.visitEnd();
|
||||||
|
}
|
||||||
|
{
|
||||||
|
mv = cw.visitMethod(ACC_PUBLIC, "m", "(LInvokeSpecialAnonTest;)I", null, null);
|
||||||
|
mv.visitCode();
|
||||||
|
mv.visitVarInsn(ALOAD, 0);
|
||||||
|
mv.visitVarInsn(ALOAD, 1);
|
||||||
|
mv.visitMethodInsn(INVOKESPECIAL, "InvokeSpecialAnonTest", "privMethod", "()I");
|
||||||
|
mv.visitInsn(IRETURN);
|
||||||
|
mv.visitMaxs(2, 3);
|
||||||
|
mv.visitEnd();
|
||||||
|
}
|
||||||
|
cw.visitEnd();
|
||||||
|
|
||||||
|
return cw.toByteArray();
|
||||||
|
}
|
||||||
|
|
||||||
|
private int privMethod() { return 1234; }
|
||||||
|
|
||||||
|
public static void main(String[] args) throws Exception {
|
||||||
|
Class<?> klass = InvokeSpecialAnonTest.class;
|
||||||
|
try {
|
||||||
|
Class<?> result = AnonTester.defineTest(klass, anonClassBytes());
|
||||||
|
System.out.println("Passed.");
|
||||||
|
} catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
throw e;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
class AnonTester {
|
||||||
|
private static final Unsafe UNSAFE = Unsafe.getUnsafe();
|
||||||
|
|
||||||
|
public static Class<?> defineTest(Class<?> targetClass, byte[] classBytes) throws Exception {
|
||||||
|
return UNSAFE.defineAnonymousClass(targetClass, classBytes, null);
|
||||||
|
}
|
||||||
|
}
|
|
@ -235,3 +235,5 @@ d6a32e3831aab20a9a3bc78cdc0a60aaad725c6c jdk8-b107
|
||||||
17ee0d3e97fdb412e48f14d87f504946a708f846 jdk8-b111
|
17ee0d3e97fdb412e48f14d87f504946a708f846 jdk8-b111
|
||||||
c1f9158fbb9c2da50f6946fffd974e8236e08447 jdk8-b112
|
c1f9158fbb9c2da50f6946fffd974e8236e08447 jdk8-b112
|
||||||
0046d2278204b7eff76803fc4623cb48c7e6384d jdk8-b113
|
0046d2278204b7eff76803fc4623cb48c7e6384d jdk8-b113
|
||||||
|
1b1e12117fe2840e5d21ae9a4b309e4f981f3ea8 jdk8-b114
|
||||||
|
f610fd46463e6b0533dd92bce11a1e7d84984e64 jdk8-b115
|
||||||
|
|
|
@ -187,6 +187,19 @@ public final class XalanConstants {
|
||||||
public static final String XML_SECURITY_PROPERTY_MANAGER =
|
public static final String XML_SECURITY_PROPERTY_MANAGER =
|
||||||
ORACLE_JAXP_PROPERTY_PREFIX + "xmlSecurityPropertyManager";
|
ORACLE_JAXP_PROPERTY_PREFIX + "xmlSecurityPropertyManager";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Feature enableExtensionFunctions
|
||||||
|
*/
|
||||||
|
public static final String ORACLE_ENABLE_EXTENSION_FUNCTION =
|
||||||
|
ORACLE_JAXP_PROPERTY_PREFIX + "enableExtensionFunctions";
|
||||||
|
public static final String SP_ORACLE_ENABLE_EXTENSION_FUNCTION = "javax.xml.enableExtensionFunctions";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Values for a feature
|
||||||
|
*/
|
||||||
|
public static final String FEATURE_TRUE = "true";
|
||||||
|
public static final String FEATURE_FALSE = "false";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Check if we're in jdk8 or above
|
* Check if we're in jdk8 or above
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -0,0 +1,124 @@
|
||||||
|
/*
|
||||||
|
* Copyright (c) 2011, 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
|
||||||
|
* under the terms of the GNU General Public License version 2 only, as
|
||||||
|
* published by the Free Software Foundation. Oracle designates this
|
||||||
|
* particular file as subject to the "Classpath" exception as provided
|
||||||
|
* by Oracle in the LICENSE file that accompanied this code.
|
||||||
|
*
|
||||||
|
* 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 Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||||
|
* or visit www.oracle.com if you need additional information or have any
|
||||||
|
* questions.
|
||||||
|
*/
|
||||||
|
|
||||||
|
package com.sun.org.apache.xalan.internal.utils;
|
||||||
|
|
||||||
|
|
||||||
|
import com.sun.org.apache.xalan.internal.XalanConstants;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This class manages security related properties
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
public final class FeatureManager extends FeaturePropertyBase {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* States of the settings of a property, in the order: default value, value
|
||||||
|
* set by FEATURE_SECURE_PROCESSING, jaxp.properties file, jaxp system
|
||||||
|
* properties, and jaxp api properties
|
||||||
|
*/
|
||||||
|
public static enum State {
|
||||||
|
//this order reflects the overriding order
|
||||||
|
DEFAULT, FSP, JAXPDOTPROPERTIES, SYSTEMPROPERTY, APIPROPERTY
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Xalan Features
|
||||||
|
*/
|
||||||
|
public static enum Feature {
|
||||||
|
ORACLE_ENABLE_EXTENSION_FUNCTION(XalanConstants.ORACLE_ENABLE_EXTENSION_FUNCTION,
|
||||||
|
"true");
|
||||||
|
|
||||||
|
final String name;
|
||||||
|
final String defaultValue;
|
||||||
|
|
||||||
|
Feature(String name, String value) {
|
||||||
|
this.name = name;
|
||||||
|
this.defaultValue = value;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean equalsName(String propertyName) {
|
||||||
|
return (propertyName == null) ? false : name.equals(propertyName);
|
||||||
|
}
|
||||||
|
|
||||||
|
String defaultValue() {
|
||||||
|
return defaultValue;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Default constructor. Establishes default values
|
||||||
|
*/
|
||||||
|
public FeatureManager() {
|
||||||
|
values = new String[Feature.values().length];
|
||||||
|
for (Feature feature : Feature.values()) {
|
||||||
|
values[feature.ordinal()] = feature.defaultValue();
|
||||||
|
}
|
||||||
|
//read system properties or jaxp.properties
|
||||||
|
readSystemProperties();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Check if the feature is enabled
|
||||||
|
* @param feature name of the feature
|
||||||
|
* @return true if enabled, false otherwise
|
||||||
|
*/
|
||||||
|
public boolean isFeatureEnabled(Feature feature) {
|
||||||
|
return Boolean.parseBoolean(values[feature.ordinal()]);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Check if the feature is enabled
|
||||||
|
* @param propertyName name of the feature
|
||||||
|
* @return true if enabled, false otherwise
|
||||||
|
*/
|
||||||
|
public boolean isFeatureEnabled(String propertyName) {
|
||||||
|
return Boolean.parseBoolean(values[getIndex(propertyName)]);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the index by property name
|
||||||
|
* @param propertyName property name
|
||||||
|
* @return the index of the property if found; return -1 if not
|
||||||
|
*/
|
||||||
|
public int getIndex(String propertyName){
|
||||||
|
for (Feature feature : Feature.values()) {
|
||||||
|
if (feature.equalsName(propertyName)) {
|
||||||
|
return feature.ordinal();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Read from system properties, or those in jaxp.properties
|
||||||
|
*/
|
||||||
|
private void readSystemProperties() {
|
||||||
|
getSystemProperty(Feature.ORACLE_ENABLE_EXTENSION_FUNCTION,
|
||||||
|
XalanConstants.SP_ORACLE_ENABLE_EXTENSION_FUNCTION);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,215 @@
|
||||||
|
/*
|
||||||
|
* Copyright (c) 2011, 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
|
||||||
|
* under the terms of the GNU General Public License version 2 only, as
|
||||||
|
* published by the Free Software Foundation. Oracle designates this
|
||||||
|
* particular file as subject to the "Classpath" exception as provided
|
||||||
|
* by Oracle in the LICENSE file that accompanied this code.
|
||||||
|
*
|
||||||
|
* 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 Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||||
|
* or visit www.oracle.com if you need additional information or have any
|
||||||
|
* questions.
|
||||||
|
*/
|
||||||
|
|
||||||
|
package com.sun.org.apache.xalan.internal.utils;
|
||||||
|
|
||||||
|
import com.sun.org.apache.xalan.internal.XalanConstants;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This is the base class for features and properties
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
public abstract class FeaturePropertyBase {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* States of the settings of a property, in the order: default value, value
|
||||||
|
* set by FEATURE_SECURE_PROCESSING, jaxp.properties file, jaxp system
|
||||||
|
* properties, and jaxp api properties
|
||||||
|
*/
|
||||||
|
public static enum State {
|
||||||
|
//this order reflects the overriding order
|
||||||
|
DEFAULT, FSP, JAXPDOTPROPERTIES, SYSTEMPROPERTY, APIPROPERTY
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Values of the properties as defined in enum Properties
|
||||||
|
*/
|
||||||
|
String[] values = null;
|
||||||
|
/**
|
||||||
|
* States of the settings for each property in Properties above
|
||||||
|
*/
|
||||||
|
State[] states = {State.DEFAULT, State.DEFAULT};
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set the value for a specific property.
|
||||||
|
*
|
||||||
|
* @param property the property
|
||||||
|
* @param state the state of the property
|
||||||
|
* @param value the value of the property
|
||||||
|
*/
|
||||||
|
public void setValue(Enum property, State state, String value) {
|
||||||
|
//only update if it shall override
|
||||||
|
if (state.compareTo(states[property.ordinal()]) >= 0) {
|
||||||
|
values[property.ordinal()] = value;
|
||||||
|
states[property.ordinal()] = state;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set the value of a property by its index
|
||||||
|
* @param index the index of the property
|
||||||
|
* @param state the state of the property
|
||||||
|
* @param value the value of the property
|
||||||
|
*/
|
||||||
|
public void setValue(int index, State state, String value) {
|
||||||
|
//only update if it shall override
|
||||||
|
if (state.compareTo(states[index]) >= 0) {
|
||||||
|
values[index] = value;
|
||||||
|
states[index] = state;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set value by property name and state
|
||||||
|
* @param propertyName property name
|
||||||
|
* @param state the state of the property
|
||||||
|
* @param value the value of the property
|
||||||
|
* @return true if the property is managed by the security property manager;
|
||||||
|
* false if otherwise.
|
||||||
|
*/
|
||||||
|
public boolean setValue(String propertyName, State state, Object value) {
|
||||||
|
int index = getIndex(propertyName);
|
||||||
|
if (index > -1) {
|
||||||
|
setValue(index, state, (String)value);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set value by property name and state
|
||||||
|
* @param propertyName property name
|
||||||
|
* @param state the state of the property
|
||||||
|
* @param value the value of the property
|
||||||
|
* @return true if the property is managed by the security property manager;
|
||||||
|
* false if otherwise.
|
||||||
|
*/
|
||||||
|
public boolean setValue(String propertyName, State state, boolean value) {
|
||||||
|
int index = getIndex(propertyName);
|
||||||
|
if (index > -1) {
|
||||||
|
if (value) {
|
||||||
|
setValue(index, state, XalanConstants.FEATURE_TRUE);
|
||||||
|
} else {
|
||||||
|
setValue(index, state, XalanConstants.FEATURE_FALSE);
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Return the value of the specified property
|
||||||
|
*
|
||||||
|
* @param property the property
|
||||||
|
* @return the value of the property
|
||||||
|
*/
|
||||||
|
public String getValue(Enum property) {
|
||||||
|
return values[property.ordinal()];
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Return the value of the specified property
|
||||||
|
*
|
||||||
|
* @param property the property
|
||||||
|
* @return the value of the property
|
||||||
|
*/
|
||||||
|
public String getValue(String property) {
|
||||||
|
int index = getIndex(property);
|
||||||
|
if (index > -1) {
|
||||||
|
return getValueByIndex(index);
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Return the value of the specified property.
|
||||||
|
*
|
||||||
|
* @param propertyName the property name
|
||||||
|
* @return the value of the property as a string. If a property is managed
|
||||||
|
* by this manager, its value shall not be null.
|
||||||
|
*/
|
||||||
|
public String getValueAsString(String propertyName) {
|
||||||
|
int index = getIndex(propertyName);
|
||||||
|
if (index > -1) {
|
||||||
|
return getValueByIndex(index);
|
||||||
|
}
|
||||||
|
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Return the value of a property by its ordinal
|
||||||
|
* @param index the index of a property
|
||||||
|
* @return value of a property
|
||||||
|
*/
|
||||||
|
public String getValueByIndex(int index) {
|
||||||
|
return values[index];
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the index by property name
|
||||||
|
* @param propertyName property name
|
||||||
|
* @return the index of the property if found; return -1 if not
|
||||||
|
*/
|
||||||
|
public abstract int getIndex(String propertyName);
|
||||||
|
|
||||||
|
public <E extends Enum<E>> int getIndex(Class<E> property, String propertyName) {
|
||||||
|
for (Enum<E> enumItem : property.getEnumConstants()) {
|
||||||
|
if (enumItem.toString().equals(propertyName)) {
|
||||||
|
//internally, ordinal is used as index
|
||||||
|
return enumItem.ordinal();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return -1;
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Read from system properties, or those in jaxp.properties
|
||||||
|
*
|
||||||
|
* @param property the property
|
||||||
|
* @param systemProperty the name of the system property
|
||||||
|
*/
|
||||||
|
void getSystemProperty(Enum property, String systemProperty) {
|
||||||
|
try {
|
||||||
|
String value = SecuritySupport.getSystemProperty(systemProperty);
|
||||||
|
if (value != null) {
|
||||||
|
values[property.ordinal()] = value;
|
||||||
|
states[property.ordinal()] = State.SYSTEMPROPERTY;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
value = SecuritySupport.readJAXPProperty(systemProperty);
|
||||||
|
if (value != null) {
|
||||||
|
values[property.ordinal()] = value;
|
||||||
|
states[property.ordinal()] = State.JAXPDOTPROPERTIES;
|
||||||
|
}
|
||||||
|
} catch (NumberFormatException e) {
|
||||||
|
//invalid setting ignored
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -1,42 +1,28 @@
|
||||||
/*
|
/*
|
||||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
|
* Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
|
||||||
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
*
|
*
|
||||||
* Copyright (c) 2013 Oracle and/or its affiliates. All rights reserved.
|
* 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. Oracle designates this
|
||||||
|
* particular file as subject to the "Classpath" exception as provided
|
||||||
|
* by Oracle in the LICENSE file that accompanied this code.
|
||||||
*
|
*
|
||||||
* The contents of this file are subject to the terms of either the GNU
|
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||||
* General Public License Version 2 only ("GPL") or the Common Development
|
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||||
* and Distribution License("CDDL") (collectively, the "License"). You
|
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||||
* may not use this file except in compliance with the License. You can
|
* version 2 for more details (a copy is included in the LICENSE file that
|
||||||
* obtain a copy of the License at
|
* accompanied this code).
|
||||||
* https://glassfish.dev.java.net/public/CDDL+GPL_1_1.html
|
|
||||||
* or packager/legal/LICENSE.txt. See the License for the specific
|
|
||||||
* language governing permissions and limitations under the License.
|
|
||||||
*
|
*
|
||||||
* When distributing the software, include this License Header Notice in each
|
* You should have received a copy of the GNU General Public License version
|
||||||
* file and include the License file at packager/legal/LICENSE.txt.
|
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||||
|
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||||
*
|
*
|
||||||
* GPL Classpath Exception:
|
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||||
* Oracle designates this particular file as subject to the "Classpath"
|
* or visit www.oracle.com if you need additional information or have any
|
||||||
* exception as provided by Oracle in the GPL Version 2 section of the License
|
* questions.
|
||||||
* file that accompanied this code.
|
|
||||||
*
|
|
||||||
* Modifications:
|
|
||||||
* If applicable, add the following below the License Header, with the fields
|
|
||||||
* enclosed by brackets [] replaced by your own identifying information:
|
|
||||||
* "Portions Copyright [year] [name of copyright owner]"
|
|
||||||
*
|
|
||||||
* Contributor(s):
|
|
||||||
* If you wish your version of this file to be governed by only the CDDL or
|
|
||||||
* only the GPL Version 2, indicate your decision by adding "[Contributor]
|
|
||||||
* elects to include this software in this distribution under the [CDDL or GPL
|
|
||||||
* Version 2] license." If you don't indicate a single choice of license, a
|
|
||||||
* recipient has the option to distribute your version of this file under
|
|
||||||
* either the CDDL, the GPL Version 2 or to extend the choice of license to
|
|
||||||
* its licensees as provided above. However, if you add GPL Version 2 code
|
|
||||||
* and therefore, elected the GPL Version 2 license, then the option applies
|
|
||||||
* only if the new code is made subject to such option by the copyright
|
|
||||||
* holder.
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package com.sun.org.apache.xalan.internal.utils;
|
package com.sun.org.apache.xalan.internal.utils;
|
||||||
|
|
||||||
import com.sun.org.apache.xalan.internal.XalanConstants;
|
import com.sun.org.apache.xalan.internal.XalanConstants;
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2013 Oracle and/or its affiliates. All rights reserved.
|
* Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
|
||||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
*
|
*
|
||||||
* This code is free software; you can redistribute it and/or modify it
|
* This code is free software; you can redistribute it and/or modify it
|
||||||
|
@ -33,20 +33,10 @@ import javax.xml.XMLConstants;
|
||||||
* This class manages security related properties
|
* This class manages security related properties
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public final class XMLSecurityPropertyManager {
|
public final class XMLSecurityPropertyManager extends FeaturePropertyBase {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* States of the settings of a property, in the order: default value, value
|
* Properties managed by the security property manager
|
||||||
* set by FEATURE_SECURE_PROCESSING, jaxp.properties file, jaxp system
|
|
||||||
* properties, and jaxp api properties
|
|
||||||
*/
|
|
||||||
public static enum State {
|
|
||||||
//this order reflects the overriding order
|
|
||||||
DEFAULT, FSP, JAXPDOTPROPERTIES, SYSTEMPROPERTY, APIPROPERTY
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Limits managed by the security manager
|
|
||||||
*/
|
*/
|
||||||
public static enum Property {
|
public static enum Property {
|
||||||
ACCESS_EXTERNAL_DTD(XMLConstants.ACCESS_EXTERNAL_DTD,
|
ACCESS_EXTERNAL_DTD(XMLConstants.ACCESS_EXTERNAL_DTD,
|
||||||
|
@ -72,15 +62,6 @@ public final class XMLSecurityPropertyManager {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Values of the properties as defined in enum Properties
|
|
||||||
*/
|
|
||||||
private final String[] values;
|
|
||||||
/**
|
|
||||||
* States of the settings for each property in Properties above
|
|
||||||
*/
|
|
||||||
private State[] states = {State.DEFAULT, State.DEFAULT};
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Default constructor. Establishes default values
|
* Default constructor. Establishes default values
|
||||||
*/
|
*/
|
||||||
|
@ -93,86 +74,6 @@ public final class XMLSecurityPropertyManager {
|
||||||
readSystemProperties();
|
readSystemProperties();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Set limit by property name and state
|
|
||||||
* @param propertyName property name
|
|
||||||
* @param state the state of the property
|
|
||||||
* @param value the value of the property
|
|
||||||
* @return true if the property is managed by the security property manager;
|
|
||||||
* false if otherwise.
|
|
||||||
*/
|
|
||||||
public boolean setValue(String propertyName, State state, Object value) {
|
|
||||||
int index = getIndex(propertyName);
|
|
||||||
if (index > -1) {
|
|
||||||
setValue(index, state, (String)value);
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Set the value for a specific property.
|
|
||||||
*
|
|
||||||
* @param property the property
|
|
||||||
* @param state the state of the property
|
|
||||||
* @param value the value of the property
|
|
||||||
*/
|
|
||||||
public void setValue(Property property, State state, String value) {
|
|
||||||
//only update if it shall override
|
|
||||||
if (state.compareTo(states[property.ordinal()]) >= 0) {
|
|
||||||
values[property.ordinal()] = value;
|
|
||||||
states[property.ordinal()] = state;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Set the value of a property by its index
|
|
||||||
* @param index the index of the property
|
|
||||||
* @param state the state of the property
|
|
||||||
* @param value the value of the property
|
|
||||||
*/
|
|
||||||
public void setValue(int index, State state, String value) {
|
|
||||||
//only update if it shall override
|
|
||||||
if (state.compareTo(states[index]) >= 0) {
|
|
||||||
values[index] = value;
|
|
||||||
states[index] = state;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Return the value of the specified property
|
|
||||||
*
|
|
||||||
* @param propertyName the property name
|
|
||||||
* @return the value of the property as a string
|
|
||||||
*/
|
|
||||||
public String getValue(String propertyName) {
|
|
||||||
int index = getIndex(propertyName);
|
|
||||||
if (index > -1) {
|
|
||||||
return getValueByIndex(index);
|
|
||||||
}
|
|
||||||
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Return the value of the specified property
|
|
||||||
*
|
|
||||||
* @param property the property
|
|
||||||
* @return the value of the property
|
|
||||||
*/
|
|
||||||
public String getValue(Property property) {
|
|
||||||
return values[property.ordinal()];
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Return the value of a property by its ordinal
|
|
||||||
* @param index the index of a property
|
|
||||||
* @return value of a property
|
|
||||||
*/
|
|
||||||
public String getValueByIndex(int index) {
|
|
||||||
return values[index];
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the index by property name
|
* Get the index by property name
|
||||||
* @param propertyName property name
|
* @param propertyName property name
|
||||||
|
@ -198,28 +99,4 @@ public final class XMLSecurityPropertyManager {
|
||||||
XalanConstants.SP_ACCESS_EXTERNAL_STYLESHEET);
|
XalanConstants.SP_ACCESS_EXTERNAL_STYLESHEET);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Read from system properties, or those in jaxp.properties
|
|
||||||
*
|
|
||||||
* @param property the property
|
|
||||||
* @param systemProperty the name of the system property
|
|
||||||
*/
|
|
||||||
private void getSystemProperty(Property property, String systemProperty) {
|
|
||||||
try {
|
|
||||||
String value = SecuritySupport.getSystemProperty(systemProperty);
|
|
||||||
if (value != null) {
|
|
||||||
values[property.ordinal()] = value;
|
|
||||||
states[property.ordinal()] = State.SYSTEMPROPERTY;
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
value = SecuritySupport.readJAXPProperty(systemProperty);
|
|
||||||
if (value != null) {
|
|
||||||
values[property.ordinal()] = value;
|
|
||||||
states[property.ordinal()] = State.JAXPDOTPROPERTIES;
|
|
||||||
}
|
|
||||||
} catch (NumberFormatException e) {
|
|
||||||
//invalid setting ignored
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -23,6 +23,7 @@
|
||||||
|
|
||||||
package com.sun.org.apache.xalan.internal.xsltc.cmdline;
|
package com.sun.org.apache.xalan.internal.xsltc.cmdline;
|
||||||
|
|
||||||
|
import com.sun.org.apache.xalan.internal.utils.FeatureManager;
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.net.URL;
|
import java.net.URL;
|
||||||
import java.util.Vector;
|
import java.util.Vector;
|
||||||
|
@ -77,7 +78,7 @@ public final class Compile {
|
||||||
final GetOpt getopt = new GetOpt(args, "o:d:j:p:uxhsinv");
|
final GetOpt getopt = new GetOpt(args, "o:d:j:p:uxhsinv");
|
||||||
if (args.length < 1) printUsage();
|
if (args.length < 1) printUsage();
|
||||||
|
|
||||||
final XSLTC xsltc = new XSLTC(true);
|
final XSLTC xsltc = new XSLTC(true, new FeatureManager());
|
||||||
xsltc.init();
|
xsltc.init();
|
||||||
|
|
||||||
int c;
|
int c;
|
||||||
|
|
|
@ -42,6 +42,7 @@ import com.sun.org.apache.bcel.internal.generic.InvokeInstruction;
|
||||||
import com.sun.org.apache.bcel.internal.generic.LocalVariableGen;
|
import com.sun.org.apache.bcel.internal.generic.LocalVariableGen;
|
||||||
import com.sun.org.apache.bcel.internal.generic.NEW;
|
import com.sun.org.apache.bcel.internal.generic.NEW;
|
||||||
import com.sun.org.apache.bcel.internal.generic.PUSH;
|
import com.sun.org.apache.bcel.internal.generic.PUSH;
|
||||||
|
import com.sun.org.apache.xalan.internal.utils.FeatureManager;
|
||||||
import com.sun.org.apache.xalan.internal.xsltc.compiler.util.BooleanType;
|
import com.sun.org.apache.xalan.internal.xsltc.compiler.util.BooleanType;
|
||||||
import com.sun.org.apache.xalan.internal.xsltc.compiler.util.ClassGenerator;
|
import com.sun.org.apache.xalan.internal.xsltc.compiler.util.ClassGenerator;
|
||||||
import com.sun.org.apache.xalan.internal.xsltc.compiler.util.ErrorMsg;
|
import com.sun.org.apache.xalan.internal.xsltc.compiler.util.ErrorMsg;
|
||||||
|
@ -717,6 +718,8 @@ class FunctionCall extends Expression {
|
||||||
final ConstantPoolGen cpg = classGen.getConstantPool();
|
final ConstantPoolGen cpg = classGen.getConstantPool();
|
||||||
final InstructionList il = methodGen.getInstructionList();
|
final InstructionList il = methodGen.getInstructionList();
|
||||||
final boolean isSecureProcessing = classGen.getParser().getXSLTC().isSecureProcessing();
|
final boolean isSecureProcessing = classGen.getParser().getXSLTC().isSecureProcessing();
|
||||||
|
final boolean isExtensionFunctionEnabled = classGen.getParser().getXSLTC()
|
||||||
|
.getFeature(FeatureManager.Feature.ORACLE_ENABLE_EXTENSION_FUNCTION);
|
||||||
int index;
|
int index;
|
||||||
|
|
||||||
// Translate calls to methods in the BasisLibrary
|
// Translate calls to methods in the BasisLibrary
|
||||||
|
@ -760,7 +763,7 @@ class FunctionCall extends Expression {
|
||||||
il.append(new INVOKESTATIC(index));
|
il.append(new INVOKESTATIC(index));
|
||||||
}
|
}
|
||||||
else if (_isExtConstructor) {
|
else if (_isExtConstructor) {
|
||||||
if (isSecureProcessing)
|
if (isSecureProcessing && !isExtensionFunctionEnabled)
|
||||||
translateUnallowedExtension(cpg, il);
|
translateUnallowedExtension(cpg, il);
|
||||||
|
|
||||||
final String clazz =
|
final String clazz =
|
||||||
|
@ -822,7 +825,7 @@ class FunctionCall extends Expression {
|
||||||
}
|
}
|
||||||
// Invoke function calls that are handled in separate classes
|
// Invoke function calls that are handled in separate classes
|
||||||
else {
|
else {
|
||||||
if (isSecureProcessing)
|
if (isSecureProcessing && !isExtensionFunctionEnabled)
|
||||||
translateUnallowedExtension(cpg, il);
|
translateUnallowedExtension(cpg, il);
|
||||||
|
|
||||||
final String clazz = _chosenMethod.getDeclaringClass().getName();
|
final String clazz = _chosenMethod.getDeclaringClass().getName();
|
||||||
|
|
|
@ -43,6 +43,8 @@ import javax.xml.XMLConstants;
|
||||||
|
|
||||||
import com.sun.org.apache.bcel.internal.classfile.JavaClass;
|
import com.sun.org.apache.bcel.internal.classfile.JavaClass;
|
||||||
import com.sun.org.apache.xalan.internal.XalanConstants;
|
import com.sun.org.apache.xalan.internal.XalanConstants;
|
||||||
|
import com.sun.org.apache.xalan.internal.utils.FeatureManager;
|
||||||
|
import com.sun.org.apache.xalan.internal.utils.FeatureManager.Feature;
|
||||||
import com.sun.org.apache.xalan.internal.utils.SecuritySupport;
|
import com.sun.org.apache.xalan.internal.utils.SecuritySupport;
|
||||||
import com.sun.org.apache.xalan.internal.utils.XMLSecurityManager;
|
import com.sun.org.apache.xalan.internal.utils.XMLSecurityManager;
|
||||||
import com.sun.org.apache.xalan.internal.xsltc.compiler.util.ErrorMsg;
|
import com.sun.org.apache.xalan.internal.xsltc.compiler.util.ErrorMsg;
|
||||||
|
@ -148,11 +150,14 @@ public final class XSLTC {
|
||||||
|
|
||||||
private XMLSecurityManager _xmlSecurityManager;
|
private XMLSecurityManager _xmlSecurityManager;
|
||||||
|
|
||||||
|
private final FeatureManager _featureManager;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* XSLTC compiler constructor
|
* XSLTC compiler constructor
|
||||||
*/
|
*/
|
||||||
public XSLTC(boolean useServicesMechanism) {
|
public XSLTC(boolean useServicesMechanism, FeatureManager featureManager) {
|
||||||
_parser = new Parser(this, useServicesMechanism);
|
_parser = new Parser(this, useServicesMechanism);
|
||||||
|
_featureManager = featureManager;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -182,6 +187,15 @@ public final class XSLTC {
|
||||||
_useServicesMechanism = flag;
|
_useServicesMechanism = flag;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Return the value of the specified feature
|
||||||
|
* @param name name of the feature
|
||||||
|
* @return true if the feature is enabled, false otherwise
|
||||||
|
*/
|
||||||
|
public boolean getFeature(Feature name) {
|
||||||
|
return _featureManager.isFeatureEnabled(name);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Return allowed protocols for accessing external stylesheet.
|
* Return allowed protocols for accessing external stylesheet.
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -74,12 +74,12 @@ public class SAX2DOM implements ContentHandler, LexicalHandler, Constants {
|
||||||
DocumentBuilderFactory.newInstance();
|
DocumentBuilderFactory.newInstance();
|
||||||
private boolean _internal = true;
|
private boolean _internal = true;
|
||||||
|
|
||||||
public SAX2DOM(boolean useServicesMachnism) throws ParserConfigurationException {
|
public SAX2DOM(boolean useServicesMechanism) throws ParserConfigurationException {
|
||||||
_document = createDocument(useServicesMachnism);
|
_document = createDocument(useServicesMechanism);
|
||||||
_root = _document;
|
_root = _document;
|
||||||
}
|
}
|
||||||
|
|
||||||
public SAX2DOM(Node root, Node nextSibling, boolean useServicesMachnism) throws ParserConfigurationException {
|
public SAX2DOM(Node root, Node nextSibling, boolean useServicesMechanism) throws ParserConfigurationException {
|
||||||
_root = root;
|
_root = root;
|
||||||
if (root instanceof Document) {
|
if (root instanceof Document) {
|
||||||
_document = (Document)root;
|
_document = (Document)root;
|
||||||
|
@ -88,15 +88,15 @@ public class SAX2DOM implements ContentHandler, LexicalHandler, Constants {
|
||||||
_document = root.getOwnerDocument();
|
_document = root.getOwnerDocument();
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
_document = createDocument(useServicesMachnism);
|
_document = createDocument(useServicesMechanism);
|
||||||
_root = _document;
|
_root = _document;
|
||||||
}
|
}
|
||||||
|
|
||||||
_nextSibling = nextSibling;
|
_nextSibling = nextSibling;
|
||||||
}
|
}
|
||||||
|
|
||||||
public SAX2DOM(Node root, boolean useServicesMachnism) throws ParserConfigurationException {
|
public SAX2DOM(Node root, boolean useServicesMechanism) throws ParserConfigurationException {
|
||||||
this(root, null, useServicesMachnism);
|
this(root, null, useServicesMechanism);
|
||||||
}
|
}
|
||||||
|
|
||||||
public Node getDOM() {
|
public Node getDOM() {
|
||||||
|
@ -308,19 +308,20 @@ public class SAX2DOM implements ContentHandler, LexicalHandler, Constants {
|
||||||
public void startDTD(String name, String publicId, String systemId)
|
public void startDTD(String name, String publicId, String systemId)
|
||||||
throws SAXException {}
|
throws SAXException {}
|
||||||
|
|
||||||
private Document createDocument(boolean useServicesMachnism) throws ParserConfigurationException {
|
private Document createDocument(boolean useServicesMechanism) throws ParserConfigurationException {
|
||||||
if (_factory == null) {
|
if (_factory == null) {
|
||||||
if (useServicesMachnism)
|
if (useServicesMechanism) {
|
||||||
_factory = DocumentBuilderFactory.newInstance();
|
_factory = DocumentBuilderFactory.newInstance();
|
||||||
if (!(_factory instanceof com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderFactoryImpl)) {
|
if (!(_factory instanceof com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderFactoryImpl)) {
|
||||||
_internal = false;
|
_internal = false;
|
||||||
}
|
}
|
||||||
else
|
} else {
|
||||||
_factory = DocumentBuilderFactory.newInstance(
|
_factory = DocumentBuilderFactory.newInstance(
|
||||||
"com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderFactoryImpl",
|
"com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderFactoryImpl",
|
||||||
SAX2DOM.class.getClassLoader()
|
SAX2DOM.class.getClassLoader()
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
Document doc;
|
Document doc;
|
||||||
if (_internal) {
|
if (_internal) {
|
||||||
//default implementation is thread safe
|
//default implementation is thread safe
|
||||||
|
|
|
@ -95,7 +95,7 @@ public class TemplatesHandlerImpl
|
||||||
_tfactory = tfactory;
|
_tfactory = tfactory;
|
||||||
|
|
||||||
// Instantiate XSLTC and get reference to parser object
|
// Instantiate XSLTC and get reference to parser object
|
||||||
XSLTC xsltc = new XSLTC(tfactory.useServicesMechnism());
|
XSLTC xsltc = new XSLTC(tfactory.useServicesMechnism(), tfactory.getFeatureManager());
|
||||||
if (tfactory.getFeature(XMLConstants.FEATURE_SECURE_PROCESSING))
|
if (tfactory.getFeature(XMLConstants.FEATURE_SECURE_PROCESSING))
|
||||||
xsltc.setSecureProcessing(true);
|
xsltc.setSecureProcessing(true);
|
||||||
|
|
||||||
|
|
|
@ -25,12 +25,14 @@ package com.sun.org.apache.xalan.internal.xsltc.trax;
|
||||||
|
|
||||||
import com.sun.org.apache.xalan.internal.XalanConstants;
|
import com.sun.org.apache.xalan.internal.XalanConstants;
|
||||||
import com.sun.org.apache.xalan.internal.utils.FactoryImpl;
|
import com.sun.org.apache.xalan.internal.utils.FactoryImpl;
|
||||||
|
import com.sun.org.apache.xalan.internal.utils.FeatureManager;
|
||||||
|
import com.sun.org.apache.xalan.internal.utils.FeaturePropertyBase;
|
||||||
import com.sun.org.apache.xalan.internal.utils.ObjectFactory;
|
import com.sun.org.apache.xalan.internal.utils.ObjectFactory;
|
||||||
import com.sun.org.apache.xalan.internal.utils.SecuritySupport;
|
import com.sun.org.apache.xalan.internal.utils.SecuritySupport;
|
||||||
import com.sun.org.apache.xalan.internal.utils.XMLSecurityManager;
|
import com.sun.org.apache.xalan.internal.utils.XMLSecurityManager;
|
||||||
import com.sun.org.apache.xalan.internal.utils.XMLSecurityPropertyManager;
|
import com.sun.org.apache.xalan.internal.utils.XMLSecurityPropertyManager;
|
||||||
import com.sun.org.apache.xalan.internal.utils.XMLSecurityPropertyManager.Property;
|
import com.sun.org.apache.xalan.internal.utils.XMLSecurityPropertyManager.Property;
|
||||||
import com.sun.org.apache.xalan.internal.utils.XMLSecurityPropertyManager.State;
|
import com.sun.org.apache.xalan.internal.utils.FeaturePropertyBase.State;
|
||||||
import com.sun.org.apache.xalan.internal.xsltc.compiler.Constants;
|
import com.sun.org.apache.xalan.internal.xsltc.compiler.Constants;
|
||||||
import com.sun.org.apache.xalan.internal.xsltc.compiler.SourceLoader;
|
import com.sun.org.apache.xalan.internal.xsltc.compiler.SourceLoader;
|
||||||
import com.sun.org.apache.xalan.internal.xsltc.compiler.XSLTC;
|
import com.sun.org.apache.xalan.internal.xsltc.compiler.XSLTC;
|
||||||
|
@ -227,6 +229,8 @@ public class TransformerFactoryImpl
|
||||||
private XMLSecurityPropertyManager _xmlSecurityPropertyMgr;
|
private XMLSecurityPropertyManager _xmlSecurityPropertyMgr;
|
||||||
private XMLSecurityManager _xmlSecurityManager;
|
private XMLSecurityManager _xmlSecurityManager;
|
||||||
|
|
||||||
|
private final FeatureManager _featureManager;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* javax.xml.transform.sax.TransformerFactory implementation.
|
* javax.xml.transform.sax.TransformerFactory implementation.
|
||||||
*/
|
*/
|
||||||
|
@ -240,10 +244,13 @@ public class TransformerFactoryImpl
|
||||||
|
|
||||||
private TransformerFactoryImpl(boolean useServicesMechanism) {
|
private TransformerFactoryImpl(boolean useServicesMechanism) {
|
||||||
this._useServicesMechanism = useServicesMechanism;
|
this._useServicesMechanism = useServicesMechanism;
|
||||||
|
_featureManager = new FeatureManager();
|
||||||
|
|
||||||
if (System.getSecurityManager() != null) {
|
if (System.getSecurityManager() != null) {
|
||||||
_isSecureMode = true;
|
_isSecureMode = true;
|
||||||
_isNotSecureProcessing = false;
|
_isNotSecureProcessing = false;
|
||||||
|
_featureManager.setValue(FeatureManager.Feature.ORACLE_ENABLE_EXTENSION_FUNCTION,
|
||||||
|
FeaturePropertyBase.State.FSP, XalanConstants.FEATURE_FALSE);
|
||||||
}
|
}
|
||||||
|
|
||||||
_xmlSecurityPropertyMgr = new XMLSecurityPropertyManager();
|
_xmlSecurityPropertyMgr = new XMLSecurityPropertyManager();
|
||||||
|
@ -504,6 +511,10 @@ public class TransformerFactoryImpl
|
||||||
Property.ACCESS_EXTERNAL_STYLESHEET);
|
Property.ACCESS_EXTERNAL_STYLESHEET);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (value && _featureManager != null) {
|
||||||
|
_featureManager.setValue(FeatureManager.Feature.ORACLE_ENABLE_EXTENSION_FUNCTION,
|
||||||
|
FeaturePropertyBase.State.FSP, XalanConstants.FEATURE_FALSE);
|
||||||
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
else if (name.equals(XalanConstants.ORACLE_FEATURE_SERVICE_MECHANISM)) {
|
else if (name.equals(XalanConstants.ORACLE_FEATURE_SERVICE_MECHANISM)) {
|
||||||
|
@ -512,6 +523,11 @@ public class TransformerFactoryImpl
|
||||||
_useServicesMechanism = value;
|
_useServicesMechanism = value;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
if (_featureManager != null &&
|
||||||
|
_featureManager.setValue(name, State.APIPROPERTY, value)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
// unknown feature
|
// unknown feature
|
||||||
ErrorMsg err = new ErrorMsg(ErrorMsg.JAXP_UNSUPPORTED_FEATURE, name);
|
ErrorMsg err = new ErrorMsg(ErrorMsg.JAXP_UNSUPPORTED_FEATURE, name);
|
||||||
throw new TransformerConfigurationException(err.toString());
|
throw new TransformerConfigurationException(err.toString());
|
||||||
|
@ -561,6 +577,13 @@ public class TransformerFactoryImpl
|
||||||
return !_isNotSecureProcessing;
|
return !_isNotSecureProcessing;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** Check to see if the property is managed by the security manager **/
|
||||||
|
String propertyValue = (_featureManager != null) ?
|
||||||
|
_featureManager.getValueAsString(name) : null;
|
||||||
|
if (propertyValue != null) {
|
||||||
|
return Boolean.parseBoolean(propertyValue);
|
||||||
|
}
|
||||||
|
|
||||||
// Feature not supported
|
// Feature not supported
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -571,6 +594,13 @@ public class TransformerFactoryImpl
|
||||||
return _useServicesMechanism;
|
return _useServicesMechanism;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return the feature manager
|
||||||
|
*/
|
||||||
|
public FeatureManager getFeatureManager() {
|
||||||
|
return _featureManager;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* javax.xml.transform.sax.TransformerFactory implementation.
|
* javax.xml.transform.sax.TransformerFactory implementation.
|
||||||
* Get the object that is used by default during the transformation to
|
* Get the object that is used by default during the transformation to
|
||||||
|
@ -857,7 +887,7 @@ public class TransformerFactoryImpl
|
||||||
}
|
}
|
||||||
|
|
||||||
// Create and initialize a stylesheet compiler
|
// Create and initialize a stylesheet compiler
|
||||||
final XSLTC xsltc = new XSLTC(_useServicesMechanism);
|
final XSLTC xsltc = new XSLTC(_useServicesMechanism, _featureManager);
|
||||||
if (_debug) xsltc.setDebug(true);
|
if (_debug) xsltc.setDebug(true);
|
||||||
if (_enableInlining)
|
if (_enableInlining)
|
||||||
xsltc.setTemplateInlining(true);
|
xsltc.setTemplateInlining(true);
|
||||||
|
|
|
@ -569,32 +569,13 @@ public class XMLDocumentFragmentScannerImpl
|
||||||
|
|
||||||
// xerces features
|
// xerces features
|
||||||
fReportCdataEvent = componentManager.getFeature(Constants.STAX_REPORT_CDATA_EVENT, true);
|
fReportCdataEvent = componentManager.getFeature(Constants.STAX_REPORT_CDATA_EVENT, true);
|
||||||
|
|
||||||
fSecurityManager = (XMLSecurityManager)componentManager.getProperty(Constants.SECURITY_MANAGER, null);
|
fSecurityManager = (XMLSecurityManager)componentManager.getProperty(Constants.SECURITY_MANAGER, null);
|
||||||
fLimitAnalyzer = fSecurityManager.getLimitAnalyzer();
|
|
||||||
|
|
||||||
fElementAttributeLimit = (fSecurityManager != null)?
|
|
||||||
fSecurityManager.getLimit(XMLSecurityManager.Limit.ELEMENT_ATTRIBUTE_LIMIT):0;
|
|
||||||
|
|
||||||
fNotifyBuiltInRefs = componentManager.getFeature(NOTIFY_BUILTIN_REFS, false);
|
fNotifyBuiltInRefs = componentManager.getFeature(NOTIFY_BUILTIN_REFS, false);
|
||||||
|
|
||||||
Object resolver = componentManager.getProperty(ENTITY_RESOLVER, null);
|
Object resolver = componentManager.getProperty(ENTITY_RESOLVER, null);
|
||||||
fExternalSubsetResolver = (resolver instanceof ExternalSubsetResolver) ?
|
fExternalSubsetResolver = (resolver instanceof ExternalSubsetResolver) ?
|
||||||
(ExternalSubsetResolver) resolver : null;
|
(ExternalSubsetResolver) resolver : null;
|
||||||
|
|
||||||
// initialize vars
|
|
||||||
fMarkupDepth = 0;
|
|
||||||
fCurrentElement = null;
|
|
||||||
fElementStack.clear();
|
|
||||||
fHasExternalDTD = false;
|
|
||||||
fStandaloneSet = false;
|
|
||||||
fStandalone = false;
|
|
||||||
fInScanContent = false;
|
|
||||||
//skipping algorithm
|
|
||||||
fShouldSkip = false;
|
|
||||||
fAdd = false;
|
|
||||||
fSkip = false;
|
|
||||||
|
|
||||||
//attribute
|
//attribute
|
||||||
fReadingAttributes = false;
|
fReadingAttributes = false;
|
||||||
//xxx: external entities are supported in Xerces
|
//xxx: external entities are supported in Xerces
|
||||||
|
@ -606,9 +587,6 @@ public class XMLDocumentFragmentScannerImpl
|
||||||
// setup Driver
|
// setup Driver
|
||||||
setScannerState(SCANNER_STATE_CONTENT);
|
setScannerState(SCANNER_STATE_CONTENT);
|
||||||
setDriver(fContentDriver);
|
setDriver(fContentDriver);
|
||||||
fEntityStore = fEntityManager.getEntityStore();
|
|
||||||
|
|
||||||
dtdGrammarUtil = null;
|
|
||||||
|
|
||||||
// JAXP 1.5 features and properties
|
// JAXP 1.5 features and properties
|
||||||
XMLSecurityPropertyManager spm = (XMLSecurityPropertyManager)
|
XMLSecurityPropertyManager spm = (XMLSecurityPropertyManager)
|
||||||
|
@ -617,6 +595,7 @@ public class XMLDocumentFragmentScannerImpl
|
||||||
|
|
||||||
fStrictURI = componentManager.getFeature(STANDARD_URI_CONFORMANT, false);
|
fStrictURI = componentManager.getFeature(STANDARD_URI_CONFORMANT, false);
|
||||||
|
|
||||||
|
resetCommon();
|
||||||
//fEntityManager.test();
|
//fEntityManager.test();
|
||||||
} // reset(XMLComponentManager)
|
} // reset(XMLComponentManager)
|
||||||
|
|
||||||
|
@ -630,17 +609,7 @@ public class XMLDocumentFragmentScannerImpl
|
||||||
fNamespaces = ((Boolean)propertyManager.getProperty(XMLInputFactory.IS_NAMESPACE_AWARE)).booleanValue();
|
fNamespaces = ((Boolean)propertyManager.getProperty(XMLInputFactory.IS_NAMESPACE_AWARE)).booleanValue();
|
||||||
fNotifyBuiltInRefs = false ;
|
fNotifyBuiltInRefs = false ;
|
||||||
|
|
||||||
// initialize vars
|
|
||||||
fMarkupDepth = 0;
|
|
||||||
fCurrentElement = null;
|
|
||||||
fShouldSkip = false;
|
|
||||||
fAdd = false;
|
|
||||||
fSkip = false;
|
|
||||||
fElementStack.clear();
|
|
||||||
//fElementStack2.clear();
|
//fElementStack2.clear();
|
||||||
fHasExternalDTD = false;
|
|
||||||
fStandaloneSet = false;
|
|
||||||
fStandalone = false;
|
|
||||||
//fReplaceEntityReferences = true;
|
//fReplaceEntityReferences = true;
|
||||||
//fSupportExternalEntities = true;
|
//fSupportExternalEntities = true;
|
||||||
Boolean bo = (Boolean)propertyManager.getProperty(XMLInputFactoryImpl.IS_REPLACING_ENTITY_REFERENCES);
|
Boolean bo = (Boolean)propertyManager.getProperty(XMLInputFactoryImpl.IS_REPLACING_ENTITY_REFERENCES);
|
||||||
|
@ -661,20 +630,43 @@ public class XMLDocumentFragmentScannerImpl
|
||||||
//we dont need to do this -- nb.
|
//we dont need to do this -- nb.
|
||||||
//setScannerState(SCANNER_STATE_CONTENT);
|
//setScannerState(SCANNER_STATE_CONTENT);
|
||||||
//setDriver(fContentDriver);
|
//setDriver(fContentDriver);
|
||||||
fEntityStore = fEntityManager.getEntityStore();
|
|
||||||
//fEntityManager.test();
|
//fEntityManager.test();
|
||||||
|
|
||||||
dtdGrammarUtil = null;
|
|
||||||
|
|
||||||
// JAXP 1.5 features and properties
|
// JAXP 1.5 features and properties
|
||||||
XMLSecurityPropertyManager spm = (XMLSecurityPropertyManager)
|
XMLSecurityPropertyManager spm = (XMLSecurityPropertyManager)
|
||||||
propertyManager.getProperty(XML_SECURITY_PROPERTY_MANAGER);
|
propertyManager.getProperty(XML_SECURITY_PROPERTY_MANAGER);
|
||||||
fAccessExternalDTD = spm.getValue(XMLSecurityPropertyManager.Property.ACCESS_EXTERNAL_DTD);
|
fAccessExternalDTD = spm.getValue(XMLSecurityPropertyManager.Property.ACCESS_EXTERNAL_DTD);
|
||||||
|
|
||||||
fSecurityManager = (XMLSecurityManager)propertyManager.getProperty(Constants.SECURITY_MANAGER);
|
fSecurityManager = (XMLSecurityManager)propertyManager.getProperty(Constants.SECURITY_MANAGER);
|
||||||
fLimitAnalyzer = fSecurityManager.getLimitAnalyzer();
|
resetCommon();
|
||||||
} // reset(XMLComponentManager)
|
} // reset(XMLComponentManager)
|
||||||
|
|
||||||
|
void resetCommon() {
|
||||||
|
// initialize vars
|
||||||
|
fMarkupDepth = 0;
|
||||||
|
fCurrentElement = null;
|
||||||
|
fElementStack.clear();
|
||||||
|
fHasExternalDTD = false;
|
||||||
|
fStandaloneSet = false;
|
||||||
|
fStandalone = false;
|
||||||
|
fInScanContent = false;
|
||||||
|
//skipping algorithm
|
||||||
|
fShouldSkip = false;
|
||||||
|
fAdd = false;
|
||||||
|
fSkip = false;
|
||||||
|
|
||||||
|
fEntityStore = fEntityManager.getEntityStore();
|
||||||
|
dtdGrammarUtil = null;
|
||||||
|
|
||||||
|
if (fSecurityManager != null) {
|
||||||
|
fLimitAnalyzer = fSecurityManager.getLimitAnalyzer();
|
||||||
|
fElementAttributeLimit = fSecurityManager.getLimit(XMLSecurityManager.Limit.ELEMENT_ATTRIBUTE_LIMIT);
|
||||||
|
} else {
|
||||||
|
fLimitAnalyzer = null;
|
||||||
|
fElementAttributeLimit = 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns a list of feature identifiers that are recognized by
|
* Returns a list of feature identifiers that are recognized by
|
||||||
* this component. This method may return null if no features
|
* this component. This method may return null if no features
|
||||||
|
@ -1328,7 +1320,7 @@ public class XMLDocumentFragmentScannerImpl
|
||||||
fAttributes.getLength() > fElementAttributeLimit){
|
fAttributes.getLength() > fElementAttributeLimit){
|
||||||
fErrorReporter.reportError(XMLMessageFormatter.XML_DOMAIN,
|
fErrorReporter.reportError(XMLMessageFormatter.XML_DOMAIN,
|
||||||
"ElementAttributeLimit",
|
"ElementAttributeLimit",
|
||||||
new Object[]{rawname, new Integer(fAttributes.getLength()) },
|
new Object[]{rawname, fElementAttributeLimit },
|
||||||
XMLErrorReporter.SEVERITY_FATAL_ERROR );
|
XMLErrorReporter.SEVERITY_FATAL_ERROR );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -256,7 +256,7 @@ public class XMLNSDocumentScannerImpl
|
||||||
fAttributes.getLength() > fElementAttributeLimit){
|
fAttributes.getLength() > fElementAttributeLimit){
|
||||||
fErrorReporter.reportError(XMLMessageFormatter.XML_DOMAIN,
|
fErrorReporter.reportError(XMLMessageFormatter.XML_DOMAIN,
|
||||||
"ElementAttributeLimit",
|
"ElementAttributeLimit",
|
||||||
new Object[]{rawname, new Integer(fAttributes.getLength()) },
|
new Object[]{rawname, fElementAttributeLimit },
|
||||||
XMLErrorReporter.SEVERITY_FATAL_ERROR );
|
XMLErrorReporter.SEVERITY_FATAL_ERROR );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -211,7 +211,7 @@ public final class SecuritySupport {
|
||||||
if (i > 0) {
|
if (i > 0) {
|
||||||
return uri.substring(i+1, uri.length());
|
return uri.substring(i+1, uri.length());
|
||||||
}
|
}
|
||||||
return "";
|
return uri;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -33,6 +33,7 @@ import com.sun.org.apache.xpath.internal.objects.XObject;
|
||||||
import com.sun.org.apache.xpath.internal.objects.XNodeSet;
|
import com.sun.org.apache.xpath.internal.objects.XNodeSet;
|
||||||
import com.sun.org.apache.xpath.internal.res.XPATHErrorResources;
|
import com.sun.org.apache.xpath.internal.res.XPATHErrorResources;
|
||||||
import com.sun.org.apache.xalan.internal.res.XSLMessages;
|
import com.sun.org.apache.xalan.internal.res.XSLMessages;
|
||||||
|
import com.sun.org.apache.xalan.internal.utils.FeatureManager;
|
||||||
|
|
||||||
import com.sun.org.apache.xpath.internal.functions.FuncExtFunction;
|
import com.sun.org.apache.xpath.internal.functions.FuncExtFunction;
|
||||||
import java.util.Vector;
|
import java.util.Vector;
|
||||||
|
@ -54,9 +55,12 @@ public class JAXPExtensionsProvider implements ExtensionsProvider {
|
||||||
}
|
}
|
||||||
|
|
||||||
public JAXPExtensionsProvider(XPathFunctionResolver resolver,
|
public JAXPExtensionsProvider(XPathFunctionResolver resolver,
|
||||||
boolean featureSecureProcessing ) {
|
boolean featureSecureProcessing, FeatureManager featureManager ) {
|
||||||
this.resolver = resolver;
|
this.resolver = resolver;
|
||||||
this.extensionInvocationDisabled = featureSecureProcessing;
|
if (featureSecureProcessing &&
|
||||||
|
!featureManager.isFeatureEnabled(FeatureManager.Feature.ORACLE_ENABLE_EXTENSION_FUNCTION)) {
|
||||||
|
this.extensionInvocationDisabled = true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -30,6 +30,7 @@ import com.sun.org.apache.xml.internal.utils.PrefixResolver;
|
||||||
import com.sun.org.apache.xpath.internal.res.XPATHErrorResources;
|
import com.sun.org.apache.xpath.internal.res.XPATHErrorResources;
|
||||||
import com.sun.org.apache.xalan.internal.res.XSLMessages;
|
import com.sun.org.apache.xalan.internal.res.XSLMessages;
|
||||||
import com.sun.org.apache.xalan.internal.utils.FactoryImpl;
|
import com.sun.org.apache.xalan.internal.utils.FactoryImpl;
|
||||||
|
import com.sun.org.apache.xalan.internal.utils.FeatureManager;
|
||||||
|
|
||||||
import javax.xml.namespace.NamespaceContext;
|
import javax.xml.namespace.NamespaceContext;
|
||||||
import javax.xml.namespace.QName;
|
import javax.xml.namespace.QName;
|
||||||
|
@ -67,33 +68,36 @@ public class XPathExpressionImpl implements javax.xml.xpath.XPathExpression{
|
||||||
private boolean featureSecureProcessing = false;
|
private boolean featureSecureProcessing = false;
|
||||||
|
|
||||||
private boolean useServicesMechanism = true;
|
private boolean useServicesMechanism = true;
|
||||||
|
|
||||||
|
private final FeatureManager featureManager;
|
||||||
|
|
||||||
/** Protected constructor to prevent direct instantiation; use compile()
|
/** Protected constructor to prevent direct instantiation; use compile()
|
||||||
* from the context.
|
* from the context.
|
||||||
*/
|
*/
|
||||||
protected XPathExpressionImpl() { };
|
protected XPathExpressionImpl() {
|
||||||
|
this(null, null, null, null,
|
||||||
protected XPathExpressionImpl(com.sun.org.apache.xpath.internal.XPath xpath,
|
false, true, new FeatureManager());
|
||||||
JAXPPrefixResolver prefixResolver,
|
|
||||||
XPathFunctionResolver functionResolver,
|
|
||||||
XPathVariableResolver variableResolver ) {
|
|
||||||
this.xpath = xpath;
|
|
||||||
this.prefixResolver = prefixResolver;
|
|
||||||
this.functionResolver = functionResolver;
|
|
||||||
this.variableResolver = variableResolver;
|
|
||||||
this.featureSecureProcessing = false;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
protected XPathExpressionImpl(com.sun.org.apache.xpath.internal.XPath xpath,
|
protected XPathExpressionImpl(com.sun.org.apache.xpath.internal.XPath xpath,
|
||||||
JAXPPrefixResolver prefixResolver,
|
JAXPPrefixResolver prefixResolver,
|
||||||
XPathFunctionResolver functionResolver,
|
XPathFunctionResolver functionResolver,
|
||||||
XPathVariableResolver variableResolver,
|
XPathVariableResolver variableResolver ) {
|
||||||
boolean featureSecureProcessing, boolean useServicesMechanism ) {
|
this(xpath, prefixResolver, functionResolver, variableResolver,
|
||||||
|
false, true, new FeatureManager());
|
||||||
|
};
|
||||||
|
|
||||||
|
protected XPathExpressionImpl(com.sun.org.apache.xpath.internal.XPath xpath,
|
||||||
|
JAXPPrefixResolver prefixResolver,XPathFunctionResolver functionResolver,
|
||||||
|
XPathVariableResolver variableResolver, boolean featureSecureProcessing,
|
||||||
|
boolean useServicesMechanism, FeatureManager featureManager ) {
|
||||||
this.xpath = xpath;
|
this.xpath = xpath;
|
||||||
this.prefixResolver = prefixResolver;
|
this.prefixResolver = prefixResolver;
|
||||||
this.functionResolver = functionResolver;
|
this.functionResolver = functionResolver;
|
||||||
this.variableResolver = variableResolver;
|
this.variableResolver = variableResolver;
|
||||||
this.featureSecureProcessing = featureSecureProcessing;
|
this.featureSecureProcessing = featureSecureProcessing;
|
||||||
this.useServicesMechanism = useServicesMechanism;
|
this.useServicesMechanism = useServicesMechanism;
|
||||||
|
this.featureManager = featureManager;
|
||||||
};
|
};
|
||||||
|
|
||||||
public void setXPath (com.sun.org.apache.xpath.internal.XPath xpath ) {
|
public void setXPath (com.sun.org.apache.xpath.internal.XPath xpath ) {
|
||||||
|
@ -111,7 +115,7 @@ public class XPathExpressionImpl implements javax.xml.xpath.XPathExpression{
|
||||||
com.sun.org.apache.xpath.internal.XPathContext xpathSupport = null;
|
com.sun.org.apache.xpath.internal.XPathContext xpathSupport = null;
|
||||||
if ( functionResolver != null ) {
|
if ( functionResolver != null ) {
|
||||||
JAXPExtensionsProvider jep = new JAXPExtensionsProvider(
|
JAXPExtensionsProvider jep = new JAXPExtensionsProvider(
|
||||||
functionResolver, featureSecureProcessing );
|
functionResolver, featureSecureProcessing, featureManager );
|
||||||
xpathSupport = new com.sun.org.apache.xpath.internal.XPathContext( jep );
|
xpathSupport = new com.sun.org.apache.xpath.internal.XPathContext( jep );
|
||||||
} else {
|
} else {
|
||||||
xpathSupport = new com.sun.org.apache.xpath.internal.XPathContext();
|
xpathSupport = new com.sun.org.apache.xpath.internal.XPathContext();
|
||||||
|
|
|
@ -24,6 +24,8 @@ package com.sun.org.apache.xpath.internal.jaxp;
|
||||||
import com.sun.org.apache.xalan.internal.XalanConstants;
|
import com.sun.org.apache.xalan.internal.XalanConstants;
|
||||||
import com.sun.org.apache.xpath.internal.res.XPATHErrorResources;
|
import com.sun.org.apache.xpath.internal.res.XPATHErrorResources;
|
||||||
import com.sun.org.apache.xalan.internal.res.XSLMessages;
|
import com.sun.org.apache.xalan.internal.res.XSLMessages;
|
||||||
|
import com.sun.org.apache.xalan.internal.utils.FeatureManager;
|
||||||
|
import com.sun.org.apache.xalan.internal.utils.FeaturePropertyBase;
|
||||||
|
|
||||||
import javax.xml.XMLConstants;
|
import javax.xml.XMLConstants;
|
||||||
import javax.xml.xpath.XPathFactory;
|
import javax.xml.xpath.XPathFactory;
|
||||||
|
@ -68,6 +70,8 @@ public class XPathFactoryImpl extends XPathFactory {
|
||||||
|
|
||||||
private boolean _useServicesMechanism = true;
|
private boolean _useServicesMechanism = true;
|
||||||
|
|
||||||
|
private final FeatureManager _featureManager;
|
||||||
|
|
||||||
public XPathFactoryImpl() {
|
public XPathFactoryImpl() {
|
||||||
this(true);
|
this(true);
|
||||||
}
|
}
|
||||||
|
@ -77,9 +81,12 @@ public class XPathFactoryImpl extends XPathFactory {
|
||||||
}
|
}
|
||||||
|
|
||||||
public XPathFactoryImpl(boolean useServicesMechanism) {
|
public XPathFactoryImpl(boolean useServicesMechanism) {
|
||||||
|
_featureManager = new FeatureManager();
|
||||||
if (System.getSecurityManager() != null) {
|
if (System.getSecurityManager() != null) {
|
||||||
_isSecureMode = true;
|
_isSecureMode = true;
|
||||||
_isNotSecureProcessing = false;
|
_isNotSecureProcessing = false;
|
||||||
|
_featureManager.setValue(FeatureManager.Feature.ORACLE_ENABLE_EXTENSION_FUNCTION,
|
||||||
|
FeaturePropertyBase.State.FSP, XalanConstants.FEATURE_FALSE);
|
||||||
}
|
}
|
||||||
this._useServicesMechanism = useServicesMechanism;
|
this._useServicesMechanism = useServicesMechanism;
|
||||||
}
|
}
|
||||||
|
@ -131,7 +138,8 @@ public class XPathFactoryImpl extends XPathFactory {
|
||||||
public javax.xml.xpath.XPath newXPath() {
|
public javax.xml.xpath.XPath newXPath() {
|
||||||
return new com.sun.org.apache.xpath.internal.jaxp.XPathImpl(
|
return new com.sun.org.apache.xpath.internal.jaxp.XPathImpl(
|
||||||
xPathVariableResolver, xPathFunctionResolver,
|
xPathVariableResolver, xPathFunctionResolver,
|
||||||
!_isNotSecureProcessing, _useServicesMechanism );
|
!_isNotSecureProcessing, _useServicesMechanism,
|
||||||
|
_featureManager );
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -181,6 +189,10 @@ public class XPathFactoryImpl extends XPathFactory {
|
||||||
}
|
}
|
||||||
|
|
||||||
_isNotSecureProcessing = !value;
|
_isNotSecureProcessing = !value;
|
||||||
|
if (value && _featureManager != null) {
|
||||||
|
_featureManager.setValue(FeatureManager.Feature.ORACLE_ENABLE_EXTENSION_FUNCTION,
|
||||||
|
FeaturePropertyBase.State.FSP, XalanConstants.FEATURE_FALSE);
|
||||||
|
}
|
||||||
|
|
||||||
// all done processing feature
|
// all done processing feature
|
||||||
return;
|
return;
|
||||||
|
@ -192,6 +204,11 @@ public class XPathFactoryImpl extends XPathFactory {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (_featureManager != null &&
|
||||||
|
_featureManager.setValue(name, FeaturePropertyBase.State.APIPROPERTY, value)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
// unknown feature
|
// unknown feature
|
||||||
String fmsg = XSLMessages.createXPATHMessage(
|
String fmsg = XSLMessages.createXPATHMessage(
|
||||||
XPATHErrorResources.ER_FEATURE_UNKNOWN,
|
XPATHErrorResources.ER_FEATURE_UNKNOWN,
|
||||||
|
@ -240,6 +257,14 @@ public class XPathFactoryImpl extends XPathFactory {
|
||||||
if (name.equals(XalanConstants.ORACLE_FEATURE_SERVICE_MECHANISM)) {
|
if (name.equals(XalanConstants.ORACLE_FEATURE_SERVICE_MECHANISM)) {
|
||||||
return _useServicesMechanism;
|
return _useServicesMechanism;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** Check to see if the property is managed by the security manager **/
|
||||||
|
String propertyValue = (_featureManager != null) ?
|
||||||
|
_featureManager.getValueAsString(name) : null;
|
||||||
|
if (propertyValue != null) {
|
||||||
|
return _featureManager.isFeatureEnabled(name);
|
||||||
|
}
|
||||||
|
|
||||||
// unknown feature
|
// unknown feature
|
||||||
String fmsg = XSLMessages.createXPATHMessage(
|
String fmsg = XSLMessages.createXPATHMessage(
|
||||||
XPATHErrorResources.ER_GETTING_UNKNOWN_FEATURE,
|
XPATHErrorResources.ER_GETTING_UNKNOWN_FEATURE,
|
||||||
|
|
|
@ -35,6 +35,7 @@ import com.sun.org.apache.xpath.internal.objects.XObject;
|
||||||
import com.sun.org.apache.xpath.internal.res.XPATHErrorResources;
|
import com.sun.org.apache.xpath.internal.res.XPATHErrorResources;
|
||||||
import com.sun.org.apache.xalan.internal.res.XSLMessages;
|
import com.sun.org.apache.xalan.internal.res.XSLMessages;
|
||||||
import com.sun.org.apache.xalan.internal.utils.FactoryImpl;
|
import com.sun.org.apache.xalan.internal.utils.FactoryImpl;
|
||||||
|
import com.sun.org.apache.xalan.internal.utils.FeatureManager;
|
||||||
|
|
||||||
import org.w3c.dom.Node;
|
import org.w3c.dom.Node;
|
||||||
import org.w3c.dom.Document;
|
import org.w3c.dom.Document;
|
||||||
|
@ -70,18 +71,20 @@ public class XPathImpl implements javax.xml.xpath.XPath {
|
||||||
// extensions function need to throw XPathFunctionException
|
// extensions function need to throw XPathFunctionException
|
||||||
private boolean featureSecureProcessing = false;
|
private boolean featureSecureProcessing = false;
|
||||||
private boolean useServiceMechanism = true;
|
private boolean useServiceMechanism = true;
|
||||||
|
private final FeatureManager featureManager;
|
||||||
|
|
||||||
XPathImpl( XPathVariableResolver vr, XPathFunctionResolver fr ) {
|
XPathImpl( XPathVariableResolver vr, XPathFunctionResolver fr ) {
|
||||||
this.origVariableResolver = this.variableResolver = vr;
|
this(vr, fr, false, true, new FeatureManager());
|
||||||
this.origFunctionResolver = this.functionResolver = fr;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
XPathImpl( XPathVariableResolver vr, XPathFunctionResolver fr,
|
XPathImpl( XPathVariableResolver vr, XPathFunctionResolver fr,
|
||||||
boolean featureSecureProcessing, boolean useServiceMechanism ) {
|
boolean featureSecureProcessing, boolean useServiceMechanism,
|
||||||
|
FeatureManager featureManager) {
|
||||||
this.origVariableResolver = this.variableResolver = vr;
|
this.origVariableResolver = this.variableResolver = vr;
|
||||||
this.origFunctionResolver = this.functionResolver = fr;
|
this.origFunctionResolver = this.functionResolver = fr;
|
||||||
this.featureSecureProcessing = featureSecureProcessing;
|
this.featureSecureProcessing = featureSecureProcessing;
|
||||||
this.useServiceMechanism = useServiceMechanism;
|
this.useServiceMechanism = useServiceMechanism;
|
||||||
|
this.featureManager = featureManager;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -190,7 +193,7 @@ public class XPathImpl implements javax.xml.xpath.XPath {
|
||||||
com.sun.org.apache.xpath.internal.XPathContext xpathSupport = null;
|
com.sun.org.apache.xpath.internal.XPathContext xpathSupport = null;
|
||||||
if ( functionResolver != null ) {
|
if ( functionResolver != null ) {
|
||||||
JAXPExtensionsProvider jep = new JAXPExtensionsProvider(
|
JAXPExtensionsProvider jep = new JAXPExtensionsProvider(
|
||||||
functionResolver, featureSecureProcessing );
|
functionResolver, featureSecureProcessing, featureManager );
|
||||||
xpathSupport = new com.sun.org.apache.xpath.internal.XPathContext( jep );
|
xpathSupport = new com.sun.org.apache.xpath.internal.XPathContext( jep );
|
||||||
} else {
|
} else {
|
||||||
xpathSupport = new com.sun.org.apache.xpath.internal.XPathContext();
|
xpathSupport = new com.sun.org.apache.xpath.internal.XPathContext();
|
||||||
|
@ -391,7 +394,7 @@ public class XPathImpl implements javax.xml.xpath.XPath {
|
||||||
// Can have errorListener
|
// Can have errorListener
|
||||||
XPathExpressionImpl ximpl = new XPathExpressionImpl (xpath,
|
XPathExpressionImpl ximpl = new XPathExpressionImpl (xpath,
|
||||||
prefixResolver, functionResolver, variableResolver,
|
prefixResolver, functionResolver, variableResolver,
|
||||||
featureSecureProcessing, useServiceMechanism );
|
featureSecureProcessing, useServiceMechanism, featureManager );
|
||||||
return ximpl;
|
return ximpl;
|
||||||
} catch ( javax.xml.transform.TransformerException te ) {
|
} catch ( javax.xml.transform.TransformerException te ) {
|
||||||
throw new XPathExpressionException ( te ) ;
|
throw new XPathExpressionException ( te ) ;
|
||||||
|
|
|
@ -235,3 +235,5 @@ cc682329886be2fc26220fc30597ee4e5bba43ed jdk8-b110
|
||||||
32edc7a2c86696dfcbdb6ffae641ff153f8e34bd jdk8-b111
|
32edc7a2c86696dfcbdb6ffae641ff153f8e34bd jdk8-b111
|
||||||
dbdd5c76250928582cb5342bcf7b299a6007d538 jdk8-b112
|
dbdd5c76250928582cb5342bcf7b299a6007d538 jdk8-b112
|
||||||
9261f342aa73a79bbd1a817ae72fa72b15ef30bc jdk8-b113
|
9261f342aa73a79bbd1a817ae72fa72b15ef30bc jdk8-b113
|
||||||
|
9ad289610fc6effe9076280b7920d0f16470709f jdk8-b114
|
||||||
|
e126d8eca69b83a1cc159c2375b7c33140346d2b jdk8-b115
|
||||||
|
|
|
@ -235,3 +235,5 @@ eea685b9ccaa1980e0a7e07d6a3a84bcc7e9ab82 jdk8-b107
|
||||||
719befd87c7b96ae103c05730ca555227bfc0116 jdk8-b111
|
719befd87c7b96ae103c05730ca555227bfc0116 jdk8-b111
|
||||||
f002f5f3a16cca62e139cb8eed05ffaeb373587d jdk8-b112
|
f002f5f3a16cca62e139cb8eed05ffaeb373587d jdk8-b112
|
||||||
5b4261b4b72af53e8e178933ef6bc6c7f8cdbc60 jdk8-b113
|
5b4261b4b72af53e8e178933ef6bc6c7f8cdbc60 jdk8-b113
|
||||||
|
f26a0c8071bde1e3b923713c75156e4a58955623 jdk8-b114
|
||||||
|
f82b730c798b6bf38946baaba8a7d80fd5efaa70 jdk8-b115
|
||||||
|
|
|
@ -618,6 +618,11 @@ public final class TzdbZoneRulesCompiler {
|
||||||
// remove ROC, which is not supported in j.u.tz
|
// remove ROC, which is not supported in j.u.tz
|
||||||
builtZones.remove("ROC");
|
builtZones.remove("ROC");
|
||||||
links.remove("ROC");
|
links.remove("ROC");
|
||||||
|
// remove EST, HST and MST. They are supported via
|
||||||
|
// the short-id mapping
|
||||||
|
builtZones.remove("EST");
|
||||||
|
builtZones.remove("HST");
|
||||||
|
builtZones.remove("MST");
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -157,8 +157,8 @@ $(JDK_OUTPUTDIR)/demo/jfc/CodePointIM/_the.services: \
|
||||||
|
|
||||||
BUILD_DEMOS += $(JDK_OUTPUTDIR)/demo/jfc/CodePointIM/_the.services
|
BUILD_DEMOS += $(JDK_OUTPUTDIR)/demo/jfc/CodePointIM/_the.services
|
||||||
|
|
||||||
$(eval $(call SetupDemo,MoleculeViewer,applets,,XYZChemModel,,,example*.html XYZApp.java))
|
$(eval $(call SetupDemo,MoleculeViewer,applets,,XYZChemModel,,,example*.html *.java))
|
||||||
$(eval $(call SetupDemo,WireFrame,applets,,ThreeD,,,example*.html ThreeD.java))
|
$(eval $(call SetupDemo,WireFrame,applets,,ThreeD,,,example*.html *.java))
|
||||||
$(eval $(call SetupDemo,FileChooserDemo,jfc,,FileChooserDemo,,,README*))
|
$(eval $(call SetupDemo,FileChooserDemo,jfc,,FileChooserDemo,,,README*))
|
||||||
$(eval $(call SetupDemo,Font2DTest,jfc,,Font2DTest,,,*.html *.txt))
|
$(eval $(call SetupDemo,Font2DTest,jfc,,Font2DTest,,,*.html *.txt))
|
||||||
$(eval $(call SetupDemo,Metalworks,jfc,,Metalworks,,,README*))
|
$(eval $(call SetupDemo,Metalworks,jfc,,Metalworks,,,README*))
|
||||||
|
|
|
@ -27,7 +27,7 @@ DISABLE_WARNINGS := -Xlint:all,-deprecation,-unchecked,-rawtypes,-cast,-serial,-
|
||||||
|
|
||||||
# To build with all warnings enabled, do the following:
|
# To build with all warnings enabled, do the following:
|
||||||
# make JAVAC_WARNINGS="-Xlint:all -Xmaxwarns 10000"
|
# make JAVAC_WARNINGS="-Xlint:all -Xmaxwarns 10000"
|
||||||
JAVAC_WARNINGS := -Xlint:-unchecked,-deprecation,-overrides,classfile,dep-ann,divzero,varargs -Werror
|
JAVAC_WARNINGS := -Xlint:-unchecked,-deprecation,-overrides,auxiliaryclass,classfile,dep-ann,divzero,empty,try,varargs -Werror
|
||||||
|
|
||||||
# Any java code executed during a JDK build to build other parts of the JDK must be
|
# Any java code executed during a JDK build to build other parts of the JDK must be
|
||||||
# executed by the bootstrap JDK (probably with -Xbootclasspath/p: ) and for this
|
# executed by the bootstrap JDK (probably with -Xbootclasspath/p: ) and for this
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
#
|
#
|
||||||
# Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
|
# Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved.
|
||||||
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
#
|
#
|
||||||
# This code is free software; you can redistribute it and/or modify it
|
# This code is free software; you can redistribute it and/or modify it
|
||||||
|
@ -48,8 +48,10 @@ include MakeBase.gmk
|
||||||
# be built, signed, and then the resulting jar files MUST BE CHECKED
|
# be built, signed, and then the resulting jar files MUST BE CHECKED
|
||||||
# INTO THE CLOSED PART OF THE WORKSPACE*. This separate step *MUST NOT
|
# INTO THE CLOSED PART OF THE WORKSPACE*. This separate step *MUST NOT
|
||||||
# BE FORGOTTEN*, otherwise a bug fixed in the source code will not be
|
# BE FORGOTTEN*, otherwise a bug fixed in the source code will not be
|
||||||
# reflected in the shipped binaries. The "sign-jars" target in the top
|
# reflected in the shipped binaries.
|
||||||
# level Makefile should be used to generate the required files.
|
#
|
||||||
|
# Please consult with Release Engineering, which is responsible for
|
||||||
|
# creating the final JCE builds suitable for checkin.
|
||||||
#
|
#
|
||||||
|
|
||||||
# Default target
|
# Default target
|
||||||
|
@ -58,7 +60,7 @@ all:
|
||||||
ifndef OPENJDK
|
ifndef OPENJDK
|
||||||
|
|
||||||
README-MAKEFILE_WARNING := \
|
README-MAKEFILE_WARNING := \
|
||||||
"\nPlease read makefiles/SignJars.gmk for further build instructions.\n"
|
"\nPlease read jdk/makefiles/SignJars.gmk for further build instructions.\n"
|
||||||
|
|
||||||
#
|
#
|
||||||
# Location for JCE codesigning key.
|
# Location for JCE codesigning key.
|
||||||
|
@ -84,20 +86,34 @@ $(JCE_OUTPUTDIR)/%: $(JDK_OUTPUTDIR)/unsigned/%
|
||||||
$@ $(SIGNING_ALIAS) < $(SIGNING_PASSPHRASE)
|
$@ $(SIGNING_ALIAS) < $(SIGNING_PASSPHRASE)
|
||||||
@$(PRINTF) "\nJar codesigning finished.\n"
|
@$(PRINTF) "\nJar codesigning finished.\n"
|
||||||
|
|
||||||
JAR_LIST := jce.jar \
|
JAR_LIST := \
|
||||||
|
jce.jar \
|
||||||
local_policy.jar \
|
local_policy.jar \
|
||||||
sunec.jar \
|
sunec.jar \
|
||||||
sunjce_provider.jar \
|
sunjce_provider.jar \
|
||||||
sunpkcs11.jar \
|
sunpkcs11.jar \
|
||||||
US_export_policy.jar
|
US_export_policy.jar \
|
||||||
|
sunmscapi.jar \
|
||||||
|
ucrypto.jar \
|
||||||
|
#
|
||||||
|
|
||||||
SIGNED_JARS := $(addprefix $(JCE_OUTPUTDIR)/,$(JAR_LIST))
|
UNSIGNED_JARS := $(wildcard $(addprefix $(JDK_OUTPUTDIR)/unsigned/, $(JAR_LIST)))
|
||||||
|
|
||||||
|
ifeq ($(UNSIGNED_JARS), )
|
||||||
|
$(error No jars found in $(JDK_OUTPUTDIR)/unsigned/)
|
||||||
|
endif
|
||||||
|
|
||||||
|
SIGNED_JARS := $(patsubst $(JDK_OUTPUTDIR)/unsigned/%,$(JCE_OUTPUTDIR)/%, $(UNSIGNED_JARS))
|
||||||
|
|
||||||
$(SIGNED_JARS): check-keystore
|
$(SIGNED_JARS): check-keystore
|
||||||
|
|
||||||
all: $(SIGNED_JARS)
|
all: $(SIGNED_JARS)
|
||||||
@$(PRINTF) "\n***The jar files built by the 'jar-sign' target must***"
|
@$(PRINTF) "\n*** The jar files built by the 'sign-jars' target are developer ***"
|
||||||
@$(PRINTF) "\n***still be checked into the closed workspace!***"
|
@$(PRINTF) "\n*** builds only and *MUST NOT* be checked into the closed workspace. ***"
|
||||||
|
@$(PRINTF) "\n*** ***"
|
||||||
|
@$(PRINTF) "\n*** Please consult with Release Engineering: they will generate ***"
|
||||||
|
@$(PRINTF) "\n*** the proper binaries for the closed workspace. ***"
|
||||||
|
@$(PRINTF) "\n"
|
||||||
@$(PRINTF) $(README-MAKEFILE_WARNING)
|
@$(PRINTF) $(README-MAKEFILE_WARNING)
|
||||||
|
|
||||||
endif # !OPENJDK
|
endif # !OPENJDK
|
||||||
|
|
|
@ -267,7 +267,8 @@ SUNWprivate_1.1 {
|
||||||
Java_sun_misc_GC_maxObjectInspectionAge;
|
Java_sun_misc_GC_maxObjectInspectionAge;
|
||||||
Java_sun_reflect_NativeConstructorAccessorImpl_newInstance0;
|
Java_sun_reflect_NativeConstructorAccessorImpl_newInstance0;
|
||||||
Java_sun_reflect_NativeMethodAccessorImpl_invoke0;
|
Java_sun_reflect_NativeMethodAccessorImpl_invoke0;
|
||||||
Java_sun_reflect_Reflection_getCallerClass;
|
Java_sun_reflect_Reflection_getCallerClass__;
|
||||||
|
Java_sun_reflect_Reflection_getCallerClass__I;
|
||||||
Java_sun_reflect_Reflection_getClassAccessFlags;
|
Java_sun_reflect_Reflection_getClassAccessFlags;
|
||||||
Java_sun_misc_Version_getJdkVersionInfo;
|
Java_sun_misc_Version_getJdkVersionInfo;
|
||||||
Java_sun_misc_Version_getJdkSpecialVersion;
|
Java_sun_misc_Version_getJdkSpecialVersion;
|
||||||
|
|
|
@ -27,7 +27,8 @@ text: .text%Java_java_io_FileInputStream_initIDs;
|
||||||
text: .text%Java_java_io_FileDescriptor_initIDs;
|
text: .text%Java_java_io_FileDescriptor_initIDs;
|
||||||
text: .text%Java_java_io_FileOutputStream_initIDs;
|
text: .text%Java_java_io_FileOutputStream_initIDs;
|
||||||
text: .text%Java_java_lang_System_setIn0;
|
text: .text%Java_java_lang_System_setIn0;
|
||||||
text: .text%Java_sun_reflect_Reflection_getCallerClass;
|
text: .text%Java_sun_reflect_Reflection_getCallerClass__;
|
||||||
|
text: .text%Java_sun_reflect_Reflection_getCallerClass__I;
|
||||||
text: .text%Java_java_lang_Class_forName0;
|
text: .text%Java_java_lang_Class_forName0;
|
||||||
text: .text%Java_java_lang_Object_getClass;
|
text: .text%Java_java_lang_Object_getClass;
|
||||||
text: .text%Java_sun_reflect_Reflection_getClassAccessFlags;
|
text: .text%Java_sun_reflect_Reflection_getClassAccessFlags;
|
||||||
|
|
|
@ -26,7 +26,8 @@ text: .text%Java_java_io_FileInputStream_initIDs;
|
||||||
text: .text%Java_java_io_FileDescriptor_initIDs;
|
text: .text%Java_java_io_FileDescriptor_initIDs;
|
||||||
text: .text%Java_java_io_FileOutputStream_initIDs;
|
text: .text%Java_java_io_FileOutputStream_initIDs;
|
||||||
text: .text%Java_java_lang_System_setIn0;
|
text: .text%Java_java_lang_System_setIn0;
|
||||||
text: .text%Java_sun_reflect_Reflection_getCallerClass;
|
text: .text%Java_sun_reflect_Reflection_getCallerClass__;
|
||||||
|
text: .text%Java_sun_reflect_Reflection_getCallerClass__I;
|
||||||
text: .text%Java_java_lang_Class_forName0;
|
text: .text%Java_java_lang_Class_forName0;
|
||||||
text: .text%Java_java_lang_String_intern;
|
text: .text%Java_java_lang_String_intern;
|
||||||
text: .text%Java_java_lang_Float_floatToIntBits;
|
text: .text%Java_java_lang_Float_floatToIntBits;
|
||||||
|
|
|
@ -28,7 +28,8 @@ text: .text%Java_java_io_FileInputStream_initIDs;
|
||||||
text: .text%Java_java_io_FileDescriptor_initIDs;
|
text: .text%Java_java_io_FileDescriptor_initIDs;
|
||||||
text: .text%Java_java_io_FileOutputStream_initIDs;
|
text: .text%Java_java_io_FileOutputStream_initIDs;
|
||||||
text: .text%Java_java_lang_System_setIn0;
|
text: .text%Java_java_lang_System_setIn0;
|
||||||
text: .text%Java_sun_reflect_Reflection_getCallerClass;
|
text: .text%Java_sun_reflect_Reflection_getCallerClass__;
|
||||||
|
text: .text%Java_sun_reflect_Reflection_getCallerClass__I;
|
||||||
text: .text%Java_java_lang_Class_forName0;
|
text: .text%Java_java_lang_Class_forName0;
|
||||||
text: .text%Java_java_lang_String_intern;
|
text: .text%Java_java_lang_String_intern;
|
||||||
text: .text%Java_sun_reflect_NativeConstructorAccessorImpl_newInstance0;
|
text: .text%Java_sun_reflect_NativeConstructorAccessorImpl_newInstance0;
|
||||||
|
|
|
@ -163,7 +163,7 @@ NSString *GetJavaRoot(NSDictionary *jvmInfoDict) {
|
||||||
if ([[jvmInfo objectForKey:@"StartOnFirstThread"] boolValue]) {
|
if ([[jvmInfo objectForKey:@"StartOnFirstThread"] boolValue]) {
|
||||||
self.startOnFirstThread = YES;
|
self.startOnFirstThread = YES;
|
||||||
} else if ([[jvmInfo objectForKey:@"StartOnMainThread"] boolValue]) {
|
} else if ([[jvmInfo objectForKey:@"StartOnMainThread"] boolValue]) {
|
||||||
// for key compatability with the Apple JavaApplicationStub's 'Java' dictionary
|
// for key compatibility with the Apple JavaApplicationStub's 'Java' dictionary
|
||||||
self.startOnFirstThread = YES;
|
self.startOnFirstThread = YES;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,7 @@
|
||||||
|
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
|
||||||
<html>
|
<html>
|
||||||
<head>
|
<head>
|
||||||
|
<title></title>
|
||||||
</head>
|
</head>
|
||||||
<body bgcolor="white">
|
<body bgcolor="white">
|
||||||
Classes for receiving gesture events.
|
Classes for receiving gesture events.
|
||||||
|
|
|
@ -1,5 +1,7 @@
|
||||||
|
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
|
||||||
<html>
|
<html>
|
||||||
<head>
|
<head>
|
||||||
|
<title></title>
|
||||||
</head>
|
</head>
|
||||||
<body bgcolor="white">
|
<body bgcolor="white">
|
||||||
Provides classes for integrating Java applications with the native application environment.
|
Provides classes for integrating Java applications with the native application environment.
|
||||||
|
|
|
@ -244,7 +244,7 @@ public class AquaLookAndFeel extends BasicLookAndFeel {
|
||||||
* used for getting localized defaults. Also initialize the default
|
* used for getting localized defaults. Also initialize the default
|
||||||
* locale used when no locale is passed into UIDefaults.get(). The
|
* locale used when no locale is passed into UIDefaults.get(). The
|
||||||
* default locale should generally not be relied upon. It is here for
|
* default locale should generally not be relied upon. It is here for
|
||||||
* compatability with releases prior to 1.4.
|
* compatibility with releases prior to 1.4.
|
||||||
*/
|
*/
|
||||||
private void initResourceBundle(final UIDefaults table) {
|
private void initResourceBundle(final UIDefaults table) {
|
||||||
table.setDefaultLocale(Locale.getDefault());
|
table.setDefaultLocale(Locale.getDefault());
|
||||||
|
|
|
@ -406,7 +406,7 @@ public class AquaMenuPainter {
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Draw a string with the graphics g at location (x,y) just like g.drawString() would.
|
/** Draw a string with the graphics g at location (x,y) just like g.drawString() would.
|
||||||
* The first occurence of underlineChar in text will be underlined. The matching is
|
* The first occurrence of underlineChar in text will be underlined. The matching is
|
||||||
* not case sensitive.
|
* not case sensitive.
|
||||||
*/
|
*/
|
||||||
public void drawString(final Graphics g, final JComponent c, final String text, final int underlinedChar, final int x, final int y, final boolean isEnabled, final boolean isSelected) {
|
public void drawString(final Graphics g, final JComponent c, final String text, final int underlinedChar, final int x, final int y, final boolean isEnabled, final boolean isSelected) {
|
||||||
|
|
|
@ -3514,7 +3514,7 @@ public class AquaTabbedPaneCopyFromBasicUI extends TabbedPaneUI implements Swing
|
||||||
* Instantiate it only within subclasses of BasicTabbedPaneUI.
|
* Instantiate it only within subclasses of BasicTabbedPaneUI.
|
||||||
*/
|
*/
|
||||||
public class PropertyChangeHandler implements PropertyChangeListener {
|
public class PropertyChangeHandler implements PropertyChangeListener {
|
||||||
// NOTE: This class exists only for backward compatability. All
|
// NOTE: This class exists only for backward compatibility. All
|
||||||
// its functionality has been moved into Handler. If you need to add
|
// its functionality has been moved into Handler. If you need to add
|
||||||
// new functionality add it to the Handler, but make sure this
|
// new functionality add it to the Handler, but make sure this
|
||||||
// class calls into the Handler.
|
// class calls into the Handler.
|
||||||
|
@ -3528,7 +3528,7 @@ public class AquaTabbedPaneCopyFromBasicUI extends TabbedPaneUI implements Swing
|
||||||
* Instantiate it only within subclasses of BasicTabbedPaneUI.
|
* Instantiate it only within subclasses of BasicTabbedPaneUI.
|
||||||
*/
|
*/
|
||||||
public class TabSelectionHandler implements ChangeListener {
|
public class TabSelectionHandler implements ChangeListener {
|
||||||
// NOTE: This class exists only for backward compatability. All
|
// NOTE: This class exists only for backward compatibility. All
|
||||||
// its functionality has been moved into Handler. If you need to add
|
// its functionality has been moved into Handler. If you need to add
|
||||||
// new functionality add it to the Handler, but make sure this
|
// new functionality add it to the Handler, but make sure this
|
||||||
// class calls into the Handler.
|
// class calls into the Handler.
|
||||||
|
@ -3542,7 +3542,7 @@ public class AquaTabbedPaneCopyFromBasicUI extends TabbedPaneUI implements Swing
|
||||||
* Instantiate it only within subclasses of BasicTabbedPaneUI.
|
* Instantiate it only within subclasses of BasicTabbedPaneUI.
|
||||||
*/
|
*/
|
||||||
public class MouseHandler extends MouseAdapter {
|
public class MouseHandler extends MouseAdapter {
|
||||||
// NOTE: This class exists only for backward compatability. All
|
// NOTE: This class exists only for backward compatibility. All
|
||||||
// its functionality has been moved into Handler. If you need to add
|
// its functionality has been moved into Handler. If you need to add
|
||||||
// new functionality add it to the Handler, but make sure this
|
// new functionality add it to the Handler, but make sure this
|
||||||
// class calls into the Handler.
|
// class calls into the Handler.
|
||||||
|
@ -3556,7 +3556,7 @@ public class AquaTabbedPaneCopyFromBasicUI extends TabbedPaneUI implements Swing
|
||||||
* Instantiate it only within subclasses of BasicTabbedPaneUI.
|
* Instantiate it only within subclasses of BasicTabbedPaneUI.
|
||||||
*/
|
*/
|
||||||
public class FocusHandler extends FocusAdapter {
|
public class FocusHandler extends FocusAdapter {
|
||||||
// NOTE: This class exists only for backward compatability. All
|
// NOTE: This class exists only for backward compatibility. All
|
||||||
// its functionality has been moved into Handler. If you need to add
|
// its functionality has been moved into Handler. If you need to add
|
||||||
// new functionality add it to the Handler, but make sure this
|
// new functionality add it to the Handler, but make sure this
|
||||||
// class calls into the Handler.
|
// class calls into the Handler.
|
||||||
|
|
|
@ -179,7 +179,7 @@ public class AquaTreeUI extends BasicTreeUI {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Paints the expand (toggle) part of a row. The reciever should NOT modify <code>clipBounds</code>, or
|
* Paints the expand (toggle) part of a row. The receiver should NOT modify <code>clipBounds</code>, or
|
||||||
* <code>insets</code>.
|
* <code>insets</code>.
|
||||||
*/
|
*/
|
||||||
protected void paintExpandControl(final Graphics g, final Rectangle clipBounds, final Insets insets, final Rectangle bounds, final TreePath path, final int row, final boolean isExpanded, final boolean hasBeenExpanded, final boolean isLeaf) {
|
protected void paintExpandControl(final Graphics g, final Rectangle clipBounds, final Insets insets, final Rectangle bounds, final TreePath path, final int row, final boolean isExpanded, final boolean hasBeenExpanded, final boolean isLeaf) {
|
||||||
|
|
|
@ -93,9 +93,9 @@ final class ScreenMenuItemCheckbox extends CheckboxMenuItem implements ActionLis
|
||||||
}
|
}
|
||||||
|
|
||||||
if (fMenuItem instanceof JCheckBoxMenuItem) {
|
if (fMenuItem instanceof JCheckBoxMenuItem) {
|
||||||
setState(((JCheckBoxMenuItem)fMenuItem).isSelected());
|
forceSetState(fMenuItem.isSelected());
|
||||||
} else {
|
} else {
|
||||||
setState(fMenuItem.getModel().isSelected());
|
forceSetState(fMenuItem.getModel().isSelected());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -196,10 +196,10 @@ final class ScreenMenuItemCheckbox extends CheckboxMenuItem implements ActionLis
|
||||||
|
|
||||||
switch (e.getStateChange()) {
|
switch (e.getStateChange()) {
|
||||||
case ItemEvent.SELECTED:
|
case ItemEvent.SELECTED:
|
||||||
setState(true);
|
forceSetState(true);
|
||||||
break;
|
break;
|
||||||
case ItemEvent.DESELECTED:
|
case ItemEvent.DESELECTED:
|
||||||
setState(false);
|
forceSetState(false);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -210,4 +210,20 @@ final class ScreenMenuItemCheckbox extends CheckboxMenuItem implements ActionLis
|
||||||
((CCheckboxMenuItem)peer).setIsIndeterminate(indeterminate);
|
((CCheckboxMenuItem)peer).setIsIndeterminate(indeterminate);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* The CCheckboxMenuItem peer is calling setState unconditionally every time user clicks the menu
|
||||||
|
* However for Swing controls in the screen menu bar it is wrong - the state should be changed only
|
||||||
|
* in response to the ITEM_STATE_CHANGED event. So the setState is overridden to no-op and all the
|
||||||
|
* correct state changes are made with forceSetState
|
||||||
|
*/
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public synchronized void setState(boolean b) {
|
||||||
|
// No Op
|
||||||
|
}
|
||||||
|
|
||||||
|
private void forceSetState(boolean b) {
|
||||||
|
super.setState(b);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -26,7 +26,7 @@
|
||||||
package java.net;
|
package java.net;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Choose a network inteface to be the default for
|
* Choose a network interface to be the default for
|
||||||
* outgoing IPv6 traffic that does not specify a scope_id (and which needs one).
|
* outgoing IPv6 traffic that does not specify a scope_id (and which needs one).
|
||||||
* We choose the first interface that is up and is (in order of preference):
|
* We choose the first interface that is up and is (in order of preference):
|
||||||
* 1. neither loopback nor point to point
|
* 1. neither loopback nor point to point
|
||||||
|
|
|
@ -122,7 +122,7 @@ class MacOSXPreferencesFile {
|
||||||
long user() { return user; }
|
long user() { return user; }
|
||||||
long host() { return host; }
|
long host() { return host; }
|
||||||
|
|
||||||
// private contructor - use factory method getFile() instead
|
// private constructor - use factory method getFile() instead
|
||||||
private MacOSXPreferencesFile(String newName, long newUser, long newHost)
|
private MacOSXPreferencesFile(String newName, long newUser, long newHost)
|
||||||
{
|
{
|
||||||
appName = newName;
|
appName = newName;
|
||||||
|
|
|
@ -342,7 +342,7 @@ public class CFontManager extends SunFontManager {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getFontPath(boolean noType1Fonts) {
|
public String getFontPath(boolean noType1Fonts) {
|
||||||
// In the case of the Cocoa toolkit, since we go through NSFont, we dont need to register /Library/Fonts
|
// In the case of the Cocoa toolkit, since we go through NSFont, we don't need to register /Library/Fonts
|
||||||
Toolkit tk = Toolkit.getDefaultToolkit();
|
Toolkit tk = Toolkit.getDefaultToolkit();
|
||||||
if (tk instanceof HeadlessToolkit) {
|
if (tk instanceof HeadlessToolkit) {
|
||||||
tk = ((HeadlessToolkit)tk).getUnderlyingToolkit();
|
tk = ((HeadlessToolkit)tk).getUnderlyingToolkit();
|
||||||
|
|
|
@ -56,15 +56,6 @@ public class LWWindowPeer
|
||||||
|
|
||||||
private final PlatformWindow platformWindow;
|
private final PlatformWindow platformWindow;
|
||||||
|
|
||||||
// Window bounds reported by the native system (as opposed to
|
|
||||||
// regular bounds inherited from LWComponentPeer which are
|
|
||||||
// requested by user and may haven't been applied yet because
|
|
||||||
// of asynchronous requests to the windowing system)
|
|
||||||
private int sysX;
|
|
||||||
private int sysY;
|
|
||||||
private int sysW;
|
|
||||||
private int sysH;
|
|
||||||
|
|
||||||
private static final int MINIMUM_WIDTH = 1;
|
private static final int MINIMUM_WIDTH = 1;
|
||||||
private static final int MINIMUM_HEIGHT = 1;
|
private static final int MINIMUM_HEIGHT = 1;
|
||||||
|
|
||||||
|
@ -320,10 +311,18 @@ public class LWWindowPeer
|
||||||
// Don't post ComponentMoved/Resized and Paint events
|
// Don't post ComponentMoved/Resized and Paint events
|
||||||
// until we've got a notification from the delegate
|
// until we've got a notification from the delegate
|
||||||
Rectangle cb = constrainBounds(x, y, w, h);
|
Rectangle cb = constrainBounds(x, y, w, h);
|
||||||
setBounds(cb.x, cb.y, cb.width, cb.height, op, false, false);
|
|
||||||
// Get updated bounds, so we don't have to handle 'op' here manually
|
Rectangle newBounds = new Rectangle(getBounds());
|
||||||
Rectangle r = getBounds();
|
if ((op & (SET_LOCATION | SET_BOUNDS)) != 0) {
|
||||||
platformWindow.setBounds(r.x, r.y, r.width, r.height);
|
newBounds.x = cb.x;
|
||||||
|
newBounds.y = cb.y;
|
||||||
|
}
|
||||||
|
if ((op & (SET_SIZE | SET_BOUNDS)) != 0) {
|
||||||
|
newBounds.width = cb.width;
|
||||||
|
newBounds.height = cb.height;
|
||||||
|
}
|
||||||
|
// Native system could constraint bounds, so the peer wold be updated in the callback
|
||||||
|
platformWindow.setBounds(newBounds.x, newBounds.y, newBounds.width, newBounds.height);
|
||||||
}
|
}
|
||||||
|
|
||||||
public Rectangle constrainBounds(Rectangle bounds) {
|
public Rectangle constrainBounds(Rectangle bounds) {
|
||||||
|
@ -614,17 +613,10 @@ public class LWWindowPeer
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public void notifyReshape(int x, int y, int w, int h) {
|
public void notifyReshape(int x, int y, int w, int h) {
|
||||||
final boolean moved;
|
Rectangle oldBounds = getBounds();
|
||||||
final boolean resized;
|
|
||||||
final boolean invalid = updateInsets(platformWindow.getInsets());
|
final boolean invalid = updateInsets(platformWindow.getInsets());
|
||||||
synchronized (getStateLock()) {
|
final boolean moved = (x != oldBounds.x) || (y != oldBounds.y);
|
||||||
moved = (x != sysX) || (y != sysY);
|
final boolean resized = (w != oldBounds.width) || (h != oldBounds.height);
|
||||||
resized = (w != sysW) || (h != sysH);
|
|
||||||
sysX = x;
|
|
||||||
sysY = y;
|
|
||||||
sysW = w;
|
|
||||||
sysH = h;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Check if anything changed
|
// Check if anything changed
|
||||||
if (!moved && !resized && !invalid) {
|
if (!moved && !resized && !invalid) {
|
||||||
|
|
|
@ -620,8 +620,7 @@ public class CInputMethod extends InputMethodAdapter {
|
||||||
retString[0] = new String(selectedText);
|
retString[0] = new String(selectedText);
|
||||||
}}
|
}}
|
||||||
}, fAwtFocussedComponent);
|
}, fAwtFocussedComponent);
|
||||||
} catch (InterruptedException ie) { ie.printStackTrace(); }
|
} catch (InvocationTargetException ite) { ite.printStackTrace(); }
|
||||||
catch (InvocationTargetException ite) { ite.printStackTrace(); }
|
|
||||||
|
|
||||||
synchronized(retString) { return retString[0]; }
|
synchronized(retString) { return retString[0]; }
|
||||||
}
|
}
|
||||||
|
@ -669,8 +668,7 @@ public class CInputMethod extends InputMethodAdapter {
|
||||||
|
|
||||||
}}
|
}}
|
||||||
}, fAwtFocussedComponent);
|
}, fAwtFocussedComponent);
|
||||||
} catch (InterruptedException ie) { ie.printStackTrace(); }
|
} catch (InvocationTargetException ite) { ite.printStackTrace(); }
|
||||||
catch (InvocationTargetException ite) { ite.printStackTrace(); }
|
|
||||||
|
|
||||||
synchronized(returnValue) { return returnValue; }
|
synchronized(returnValue) { return returnValue; }
|
||||||
}
|
}
|
||||||
|
@ -695,8 +693,7 @@ public class CInputMethod extends InputMethodAdapter {
|
||||||
returnValue[0] = fIMContext.getInsertPositionOffset();
|
returnValue[0] = fIMContext.getInsertPositionOffset();
|
||||||
}}
|
}}
|
||||||
}, fAwtFocussedComponent);
|
}, fAwtFocussedComponent);
|
||||||
} catch (InterruptedException ie) { ie.printStackTrace(); }
|
} catch (InvocationTargetException ite) { ite.printStackTrace(); }
|
||||||
catch (InvocationTargetException ite) { ite.printStackTrace(); }
|
|
||||||
|
|
||||||
returnValue[1] = fCurrentTextLength;
|
returnValue[1] = fCurrentTextLength;
|
||||||
synchronized(returnValue) { return returnValue; }
|
synchronized(returnValue) { return returnValue; }
|
||||||
|
@ -743,8 +740,7 @@ public class CInputMethod extends InputMethodAdapter {
|
||||||
}
|
}
|
||||||
}}
|
}}
|
||||||
}, fAwtFocussedComponent);
|
}, fAwtFocussedComponent);
|
||||||
} catch (InterruptedException ie) { ie.printStackTrace(); }
|
} catch (InvocationTargetException ite) { ite.printStackTrace(); }
|
||||||
catch (InvocationTargetException ite) { ite.printStackTrace(); }
|
|
||||||
|
|
||||||
synchronized(rect) { return rect; }
|
synchronized(rect) { return rect; }
|
||||||
}
|
}
|
||||||
|
@ -764,8 +760,7 @@ public class CInputMethod extends InputMethodAdapter {
|
||||||
insertPositionOffset[0] = fIMContext.getInsertPositionOffset();
|
insertPositionOffset[0] = fIMContext.getInsertPositionOffset();
|
||||||
}}
|
}}
|
||||||
}, fAwtFocussedComponent);
|
}, fAwtFocussedComponent);
|
||||||
} catch (InterruptedException ie) { ie.printStackTrace(); }
|
} catch (InvocationTargetException ite) { ite.printStackTrace(); }
|
||||||
catch (InvocationTargetException ite) { ite.printStackTrace(); }
|
|
||||||
|
|
||||||
// This bit of gymnastics ensures that the returned location is within the composed text.
|
// This bit of gymnastics ensures that the returned location is within the composed text.
|
||||||
// If it falls outside that region, the input method will commit the text, which is inconsistent with native
|
// If it falls outside that region, the input method will commit the text, which is inconsistent with native
|
||||||
|
|
|
@ -53,14 +53,6 @@ public class CPlatformLWView extends CPlatformView {
|
||||||
public void setBounds(int x, int y, int width, int height) {
|
public void setBounds(int x, int y, int width, int height) {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public void enterFullScreenMode() {
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void exitFullScreenMode() {
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public SurfaceData replaceSurfaceData() {
|
public SurfaceData replaceSurfaceData() {
|
||||||
return null;
|
return null;
|
||||||
|
|
|
@ -96,14 +96,6 @@ public class CPlatformView extends CFRetainedResource {
|
||||||
return peer;
|
return peer;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void enterFullScreenMode() {
|
|
||||||
CWrapper.NSView.enterFullScreenMode(ptr);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void exitFullScreenMode() {
|
|
||||||
CWrapper.NSView.exitFullScreenMode(ptr);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setToolTip(String msg) {
|
public void setToolTip(String msg) {
|
||||||
CWrapper.NSView.setToolTip(ptr, msg);
|
CWrapper.NSView.setToolTip(ptr, msg);
|
||||||
}
|
}
|
||||||
|
|
|
@ -63,6 +63,8 @@ public class CPlatformWindow extends CFRetainedResource implements PlatformWindo
|
||||||
private static native void nativeSynthesizeMouseEnteredExitedEvents();
|
private static native void nativeSynthesizeMouseEnteredExitedEvents();
|
||||||
private static native void nativeDispose(long nsWindowPtr);
|
private static native void nativeDispose(long nsWindowPtr);
|
||||||
private static native CPlatformWindow nativeGetTopmostPlatformWindowUnderMouse();
|
private static native CPlatformWindow nativeGetTopmostPlatformWindowUnderMouse();
|
||||||
|
private static native void nativeEnterFullScreenMode(long nsWindowPtr);
|
||||||
|
private static native void nativeExitFullScreenMode(long nsWindowPtr);
|
||||||
|
|
||||||
// Loger to report issues happened during execution but that do not affect functionality
|
// Loger to report issues happened during execution but that do not affect functionality
|
||||||
private static final PlatformLogger logger = PlatformLogger.getLogger("sun.lwawt.macosx.CPlatformWindow");
|
private static final PlatformLogger logger = PlatformLogger.getLogger("sun.lwawt.macosx.CPlatformWindow");
|
||||||
|
@ -230,7 +232,14 @@ public class CPlatformWindow extends CFRetainedResource implements PlatformWindo
|
||||||
contentView.initialize(peer, responder);
|
contentView.initialize(peer, responder);
|
||||||
|
|
||||||
final long ownerPtr = owner != null ? owner.getNSWindowPtr() : 0L;
|
final long ownerPtr = owner != null ? owner.getNSWindowPtr() : 0L;
|
||||||
Rectangle bounds = _peer.constrainBounds(_target.getBounds());
|
Rectangle bounds;
|
||||||
|
if (!IS(DECORATED, styleBits)) {
|
||||||
|
// For undecorated frames the move/resize event does not come if the frame is centered on the screen
|
||||||
|
// so we need to set a stub location to force an initial move/resize. Real bounds would be set later.
|
||||||
|
bounds = new Rectangle(0, 0, 1, 1);
|
||||||
|
} else {
|
||||||
|
bounds = _peer.constrainBounds(_target.getBounds());
|
||||||
|
}
|
||||||
final long nativeWindowPtr = nativeCreateNSWindow(contentView.getAWTView(),
|
final long nativeWindowPtr = nativeCreateNSWindow(contentView.getAWTView(),
|
||||||
ownerPtr, styleBits, bounds.x, bounds.y, bounds.width, bounds.height);
|
ownerPtr, styleBits, bounds.x, bounds.y, bounds.width, bounds.height);
|
||||||
setPtr(nativeWindowPtr);
|
setPtr(nativeWindowPtr);
|
||||||
|
@ -433,11 +442,8 @@ public class CPlatformWindow extends CFRetainedResource implements PlatformWindo
|
||||||
|
|
||||||
@Override // PlatformWindow
|
@Override // PlatformWindow
|
||||||
public Insets getInsets() {
|
public Insets getInsets() {
|
||||||
if (!isFullScreenMode) {
|
|
||||||
return nativeGetNSWindowInsets(getNSWindowPtr());
|
return nativeGetNSWindowInsets(getNSWindowPtr());
|
||||||
}
|
}
|
||||||
return new Insets(0, 0, 0, 0);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override // PlatformWindow
|
@Override // PlatformWindow
|
||||||
public Point getLocationOnScreen() {
|
public Point getLocationOnScreen() {
|
||||||
|
@ -538,6 +544,8 @@ public class CPlatformWindow extends CFRetainedResource implements PlatformWindo
|
||||||
updateIconImages();
|
updateIconImages();
|
||||||
updateFocusabilityForAutoRequestFocus(false);
|
updateFocusabilityForAutoRequestFocus(false);
|
||||||
|
|
||||||
|
boolean wasMaximized = isMaximized();
|
||||||
|
|
||||||
// Actually show or hide the window
|
// Actually show or hide the window
|
||||||
LWWindowPeer blocker = (peer == null)? null : peer.getBlocker();
|
LWWindowPeer blocker = (peer == null)? null : peer.getBlocker();
|
||||||
if (blocker == null || !visible) {
|
if (blocker == null || !visible) {
|
||||||
|
@ -571,6 +579,10 @@ public class CPlatformWindow extends CFRetainedResource implements PlatformWindo
|
||||||
if (visible) {
|
if (visible) {
|
||||||
// Apply the extended state as expected in shared code
|
// Apply the extended state as expected in shared code
|
||||||
if (target instanceof Frame) {
|
if (target instanceof Frame) {
|
||||||
|
if (!wasMaximized && isMaximized()) {
|
||||||
|
// setVisible could have changed the native maximized state
|
||||||
|
deliverZoom(true);
|
||||||
|
} else {
|
||||||
switch (((Frame)target).getExtendedState()) {
|
switch (((Frame)target).getExtendedState()) {
|
||||||
case Frame.ICONIFIED:
|
case Frame.ICONIFIED:
|
||||||
CWrapper.NSWindow.miniaturize(nsWindowPtr);
|
CWrapper.NSWindow.miniaturize(nsWindowPtr);
|
||||||
|
@ -584,6 +596,7 @@ public class CPlatformWindow extends CFRetainedResource implements PlatformWindo
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
nativeSynthesizeMouseEnteredExitedEvents();
|
nativeSynthesizeMouseEnteredExitedEvents();
|
||||||
|
|
||||||
|
@ -750,18 +763,12 @@ public class CPlatformWindow extends CFRetainedResource implements PlatformWindo
|
||||||
@Override
|
@Override
|
||||||
public void enterFullScreenMode() {
|
public void enterFullScreenMode() {
|
||||||
isFullScreenMode = true;
|
isFullScreenMode = true;
|
||||||
contentView.enterFullScreenMode();
|
nativeEnterFullScreenMode(getNSWindowPtr());
|
||||||
// the move/size notification from the underlying system comes
|
|
||||||
// but it contains a bounds smaller than the whole screen
|
|
||||||
// and therefore we need to create the synthetic notifications
|
|
||||||
Rectangle screenBounds = getPeer().getGraphicsConfiguration().getBounds();
|
|
||||||
peer.notifyReshape(screenBounds.x, screenBounds.y, screenBounds.width,
|
|
||||||
screenBounds.height);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void exitFullScreenMode() {
|
public void exitFullScreenMode() {
|
||||||
contentView.exitFullScreenMode();
|
nativeExitFullScreenMode(getNSWindowPtr());
|
||||||
isFullScreenMode = false;
|
isFullScreenMode = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -884,7 +891,7 @@ public class CPlatformWindow extends CFRetainedResource implements PlatformWindo
|
||||||
//Posting an empty to flush the EventQueue without blocking the main thread
|
//Posting an empty to flush the EventQueue without blocking the main thread
|
||||||
}
|
}
|
||||||
}, target);
|
}, target);
|
||||||
} catch (InterruptedException | InvocationTargetException e) {
|
} catch (InvocationTargetException e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -919,13 +926,7 @@ public class CPlatformWindow extends CFRetainedResource implements PlatformWindo
|
||||||
|
|
||||||
protected void deliverMoveResizeEvent(int x, int y, int width, int height,
|
protected void deliverMoveResizeEvent(int x, int y, int width, int height,
|
||||||
boolean byUser) {
|
boolean byUser) {
|
||||||
// when the content view enters the full-screen mode, the native
|
checkZoom();
|
||||||
// move/resize notifications contain a bounds smaller than
|
|
||||||
// the whole screen and therefore we ignore the native notifications
|
|
||||||
// and the content view itself creates correct synthetic notifications
|
|
||||||
if (isFullScreenMode) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
final Rectangle oldB = nativeBounds;
|
final Rectangle oldB = nativeBounds;
|
||||||
nativeBounds = new Rectangle(x, y, width, height);
|
nativeBounds = new Rectangle(x, y, width, height);
|
||||||
|
@ -957,6 +958,17 @@ public class CPlatformWindow extends CFRetainedResource implements PlatformWindo
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void checkZoom() {
|
||||||
|
if (target instanceof Frame && isVisible()) {
|
||||||
|
Frame targetFrame = (Frame)target;
|
||||||
|
if (targetFrame.getExtendedState() != Frame.MAXIMIZED_BOTH && isMaximized()) {
|
||||||
|
deliverZoom(true);
|
||||||
|
} else if (targetFrame.getExtendedState() == Frame.MAXIMIZED_BOTH && !isMaximized()) {
|
||||||
|
deliverZoom(false);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private void deliverNCMouseDown() {
|
private void deliverNCMouseDown() {
|
||||||
if (peer != null) {
|
if (peer != null) {
|
||||||
peer.notifyNCMouseDown();
|
peer.notifyNCMouseDown();
|
||||||
|
|
|
@ -233,6 +233,10 @@ public class CPrinterJob extends RasterPrinterJob {
|
||||||
|
|
||||||
|
|
||||||
setAttributes(attributes);
|
setAttributes(attributes);
|
||||||
|
// throw exception for invalid destination
|
||||||
|
if (destinationAttr != null) {
|
||||||
|
validateDestination(destinationAttr);
|
||||||
|
}
|
||||||
|
|
||||||
/* Get the range of pages we are to print. If the
|
/* Get the range of pages we are to print. If the
|
||||||
* last page to print is unknown, then we print to
|
* last page to print is unknown, then we print to
|
||||||
|
|
|
@ -97,6 +97,6 @@ public class CViewEmbeddedFrame extends EmbeddedFrame {
|
||||||
setVisible(true);
|
setVisible(true);
|
||||||
}
|
}
|
||||||
}, this);
|
}, this);
|
||||||
} catch (InterruptedException | InvocationTargetException ex) {}
|
} catch (InvocationTargetException ex) {}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -82,9 +82,6 @@ public final class CWrapper {
|
||||||
public static native Rectangle2D frame(long view);
|
public static native Rectangle2D frame(long view);
|
||||||
public static native long window(long view);
|
public static native long window(long view);
|
||||||
|
|
||||||
public static native void enterFullScreenMode(long view);
|
|
||||||
public static native void exitFullScreenMode(long view);
|
|
||||||
|
|
||||||
public static native void setHidden(long view, boolean hidden);
|
public static native void setHidden(long view, boolean hidden);
|
||||||
|
|
||||||
public static native void setToolTip(long view, String msg);
|
public static native void setToolTip(long view, String msg);
|
||||||
|
|
|
@ -548,22 +548,18 @@ public final class LWCToolkit extends LWToolkit {
|
||||||
// Any selector invoked using ThreadUtilities performOnMainThread will be processed in doAWTRunLoop
|
// Any selector invoked using ThreadUtilities performOnMainThread will be processed in doAWTRunLoop
|
||||||
// The InvocationEvent will call LWCToolkit.stopAWTRunLoop() when finished, which will stop our manual runloop
|
// The InvocationEvent will call LWCToolkit.stopAWTRunLoop() when finished, which will stop our manual runloop
|
||||||
// Does not dispatch native events while in the loop
|
// Does not dispatch native events while in the loop
|
||||||
public static void invokeAndWait(Runnable event, Component component) throws InterruptedException, InvocationTargetException {
|
public static void invokeAndWait(Runnable runnable, Component component) throws InvocationTargetException {
|
||||||
final long mediator = createAWTRunLoopMediator();
|
final long mediator = createAWTRunLoopMediator();
|
||||||
|
|
||||||
InvocationEvent invocationEvent =
|
InvocationEvent invocationEvent =
|
||||||
new InvocationEvent(component != null ? component : Toolkit.getDefaultToolkit(), event) {
|
new InvocationEvent(component != null ? component : Toolkit.getDefaultToolkit(),
|
||||||
@Override
|
runnable,
|
||||||
public void dispatch() {
|
() -> {
|
||||||
try {
|
|
||||||
super.dispatch();
|
|
||||||
} finally {
|
|
||||||
if (mediator != 0) {
|
if (mediator != 0) {
|
||||||
stopAWTRunLoop(mediator);
|
stopAWTRunLoop(mediator);
|
||||||
}
|
}
|
||||||
}
|
},
|
||||||
}
|
true);
|
||||||
};
|
|
||||||
|
|
||||||
if (component != null) {
|
if (component != null) {
|
||||||
AppContext appContext = SunToolkit.targetToAppContext(component);
|
AppContext appContext = SunToolkit.targetToAppContext(component);
|
||||||
|
|
|
@ -272,7 +272,6 @@ AWT_ASSERT_APPKIT_THREAD;
|
||||||
*/
|
*/
|
||||||
|
|
||||||
- (void) keyDown: (NSEvent *)event {
|
- (void) keyDown: (NSEvent *)event {
|
||||||
|
|
||||||
fProcessingKeystroke = YES;
|
fProcessingKeystroke = YES;
|
||||||
fKeyEventsNeeded = YES;
|
fKeyEventsNeeded = YES;
|
||||||
|
|
||||||
|
@ -308,6 +307,23 @@ AWT_ASSERT_APPKIT_THREAD;
|
||||||
|
|
||||||
- (BOOL) performKeyEquivalent: (NSEvent *) event {
|
- (BOOL) performKeyEquivalent: (NSEvent *) event {
|
||||||
[self deliverJavaKeyEventHelper: event];
|
[self deliverJavaKeyEventHelper: event];
|
||||||
|
|
||||||
|
// Workaround for 8020209: special case for "Cmd =" and "Cmd ."
|
||||||
|
// because Cocoa calls performKeyEquivalent twice for these keystrokes
|
||||||
|
NSUInteger modFlags = [event modifierFlags] &
|
||||||
|
(NSCommandKeyMask | NSAlternateKeyMask | NSShiftKeyMask | NSControlKeyMask);
|
||||||
|
if (modFlags == NSCommandKeyMask) {
|
||||||
|
NSString *eventChars = [event charactersIgnoringModifiers];
|
||||||
|
if ([eventChars length] == 1) {
|
||||||
|
unichar ch = [eventChars characterAtIndex:0];
|
||||||
|
if (ch == '=' || ch == '.') {
|
||||||
|
[[NSApp mainMenu] performKeyEquivalent: event];
|
||||||
|
return YES;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
return NO;
|
return NO;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -580,7 +596,7 @@ AWT_ASSERT_APPKIT_THREAD;
|
||||||
|
|
||||||
// --- Services menu support for lightweights ---
|
// --- Services menu support for lightweights ---
|
||||||
|
|
||||||
// finds the focused accessable element, and if it's a text element, obtains the text from it
|
// finds the focused accessible element, and if it is a text element, obtains the text from it
|
||||||
- (NSString *)accessibleSelectedText
|
- (NSString *)accessibleSelectedText
|
||||||
{
|
{
|
||||||
id focused = [self accessibilityFocusedUIElement];
|
id focused = [self accessibilityFocusedUIElement];
|
||||||
|
@ -598,7 +614,7 @@ AWT_ASSERT_APPKIT_THREAD;
|
||||||
return rtfdData;
|
return rtfdData;
|
||||||
}
|
}
|
||||||
|
|
||||||
// finds the focused accessable element, and if it's a text element, sets the text in it
|
// finds the focused accessible element, and if it is a text element, sets the text in it
|
||||||
- (BOOL)replaceAccessibleTextSelection:(NSString *)text
|
- (BOOL)replaceAccessibleTextSelection:(NSString *)text
|
||||||
{
|
{
|
||||||
id focused = [self accessibilityFocusedUIElement];
|
id focused = [self accessibilityFocusedUIElement];
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
|
* Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved.
|
||||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
*
|
*
|
||||||
* This code is free software; you can redistribute it and/or modify it
|
* This code is free software; you can redistribute it and/or modify it
|
||||||
|
@ -45,6 +45,7 @@
|
||||||
BOOL isEnabled;
|
BOOL isEnabled;
|
||||||
NSWindow *nsWindow;
|
NSWindow *nsWindow;
|
||||||
AWTWindow *ownerWindow;
|
AWTWindow *ownerWindow;
|
||||||
|
jint preFullScreenLevel;
|
||||||
}
|
}
|
||||||
|
|
||||||
// An instance of either AWTWindow_Normal or AWTWindow_Panel
|
// An instance of either AWTWindow_Normal or AWTWindow_Panel
|
||||||
|
@ -57,6 +58,7 @@
|
||||||
@property (nonatomic) NSSize javaMaxSize;
|
@property (nonatomic) NSSize javaMaxSize;
|
||||||
@property (nonatomic) jint styleBits;
|
@property (nonatomic) jint styleBits;
|
||||||
@property (nonatomic) BOOL isEnabled;
|
@property (nonatomic) BOOL isEnabled;
|
||||||
|
@property (nonatomic) jint preFullScreenLevel;
|
||||||
|
|
||||||
|
|
||||||
- (id) initWithPlatformWindow:(JNFWeakJObjectWrapper *)javaPlatformWindow
|
- (id) initWithPlatformWindow:(JNFWeakJObjectWrapper *)javaPlatformWindow
|
||||||
|
|
|
@ -122,6 +122,7 @@ AWT_NS_WINDOW_IMPLEMENTATION
|
||||||
@synthesize styleBits;
|
@synthesize styleBits;
|
||||||
@synthesize isEnabled;
|
@synthesize isEnabled;
|
||||||
@synthesize ownerWindow;
|
@synthesize ownerWindow;
|
||||||
|
@synthesize preFullScreenLevel;
|
||||||
|
|
||||||
- (void) updateMinMaxSize:(BOOL)resizable {
|
- (void) updateMinMaxSize:(BOOL)resizable {
|
||||||
if (resizable) {
|
if (resizable) {
|
||||||
|
@ -501,20 +502,6 @@ AWT_ASSERT_APPKIT_THREAD;
|
||||||
// window exposing in _setVisible:(BOOL)
|
// window exposing in _setVisible:(BOOL)
|
||||||
}
|
}
|
||||||
|
|
||||||
- (BOOL)windowShouldZoom:(NSWindow *)window toFrame:(NSRect)proposedFrame {
|
|
||||||
AWT_ASSERT_APPKIT_THREAD;
|
|
||||||
|
|
||||||
[AWTToolkit eventCountPlusPlus];
|
|
||||||
JNIEnv *env = [ThreadUtilities getJNIEnv];
|
|
||||||
jobject platformWindow = [self.javaPlatformWindow jObjectWithEnv:env];
|
|
||||||
if (platformWindow != NULL) {
|
|
||||||
static JNF_MEMBER_CACHE(jm_deliverZoom, jc_CPlatformWindow, "deliverZoom", "(Z)V");
|
|
||||||
JNFCallVoidMethod(env, platformWindow, jm_deliverZoom, ![window isZoomed]);
|
|
||||||
(*env)->DeleteLocalRef(env, platformWindow);
|
|
||||||
}
|
|
||||||
return YES;
|
|
||||||
}
|
|
||||||
|
|
||||||
- (void) _deliverIconify:(BOOL)iconify {
|
- (void) _deliverIconify:(BOOL)iconify {
|
||||||
AWT_ASSERT_APPKIT_THREAD;
|
AWT_ASSERT_APPKIT_THREAD;
|
||||||
|
|
||||||
|
@ -1226,3 +1213,58 @@ JNF_COCOA_ENTER(env);
|
||||||
JNF_COCOA_EXIT(env);
|
JNF_COCOA_EXIT(env);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
JNIEXPORT void JNICALL Java_sun_lwawt_macosx_CPlatformWindow_nativeEnterFullScreenMode
|
||||||
|
(JNIEnv *env, jclass clazz, jlong windowPtr)
|
||||||
|
{
|
||||||
|
JNF_COCOA_ENTER(env);
|
||||||
|
|
||||||
|
NSWindow *nsWindow = OBJC(windowPtr);
|
||||||
|
[ThreadUtilities performOnMainThreadWaiting:NO block:^(){
|
||||||
|
AWTWindow *window = (AWTWindow*)[nsWindow delegate];
|
||||||
|
NSNumber* screenID = [AWTWindow getNSWindowDisplayID_AppKitThread: nsWindow];
|
||||||
|
CGDirectDisplayID aID = [screenID intValue];
|
||||||
|
|
||||||
|
if (CGDisplayCapture(aID) == kCGErrorSuccess) {
|
||||||
|
// remove window decoration
|
||||||
|
NSUInteger styleMask = [AWTWindow styleMaskForStyleBits:window.styleBits];
|
||||||
|
[nsWindow setStyleMask:(styleMask & ~NSTitledWindowMask) | NSBorderlessWindowMask];
|
||||||
|
|
||||||
|
int shieldLevel = CGShieldingWindowLevel();
|
||||||
|
window.preFullScreenLevel = [nsWindow level];
|
||||||
|
[nsWindow setLevel: shieldLevel];
|
||||||
|
|
||||||
|
NSRect screenRect = [[nsWindow screen] frame];
|
||||||
|
[nsWindow setFrame:screenRect display:YES];
|
||||||
|
} else {
|
||||||
|
[JNFException raise:env as:kRuntimeException reason:"Failed to enter full screen."];
|
||||||
|
}
|
||||||
|
}];
|
||||||
|
|
||||||
|
JNF_COCOA_EXIT(env);
|
||||||
|
}
|
||||||
|
|
||||||
|
JNIEXPORT void JNICALL Java_sun_lwawt_macosx_CPlatformWindow_nativeExitFullScreenMode
|
||||||
|
(JNIEnv *env, jclass clazz, jlong windowPtr)
|
||||||
|
{
|
||||||
|
JNF_COCOA_ENTER(env);
|
||||||
|
|
||||||
|
NSWindow *nsWindow = OBJC(windowPtr);
|
||||||
|
[ThreadUtilities performOnMainThreadWaiting:NO block:^(){
|
||||||
|
AWTWindow *window = (AWTWindow*)[nsWindow delegate];
|
||||||
|
NSNumber* screenID = [AWTWindow getNSWindowDisplayID_AppKitThread: nsWindow];
|
||||||
|
CGDirectDisplayID aID = [screenID intValue];
|
||||||
|
|
||||||
|
if (CGDisplayRelease(aID) == kCGErrorSuccess) {
|
||||||
|
NSUInteger styleMask = [AWTWindow styleMaskForStyleBits:window.styleBits];
|
||||||
|
[nsWindow setStyleMask:styleMask];
|
||||||
|
[nsWindow setLevel: window.preFullScreenLevel];
|
||||||
|
|
||||||
|
// GraphicsDevice takes care of restoring pre full screen bounds
|
||||||
|
} else {
|
||||||
|
[JNFException raise:env as:kRuntimeException reason:"Failed to exit full screen."];
|
||||||
|
}
|
||||||
|
}];
|
||||||
|
|
||||||
|
JNF_COCOA_EXIT(env);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
|
@ -359,7 +359,11 @@ static void javaPrinterJobToNSPrintInfo(JNIEnv* env, jobject srcPrinterJob, jobj
|
||||||
static JNF_CLASS_CACHE(jc_Pageable, "java/awt/print/Pageable");
|
static JNF_CLASS_CACHE(jc_Pageable, "java/awt/print/Pageable");
|
||||||
static JNF_MEMBER_CACHE(jm_getCopies, sjc_CPrinterJob, "getCopiesInt", "()I");
|
static JNF_MEMBER_CACHE(jm_getCopies, sjc_CPrinterJob, "getCopiesInt", "()I");
|
||||||
static JNF_MEMBER_CACHE(jm_isCollated, sjc_CPrinterJob, "isCollated", "()Z");
|
static JNF_MEMBER_CACHE(jm_isCollated, sjc_CPrinterJob, "isCollated", "()Z");
|
||||||
|
static JNF_MEMBER_CACHE(jm_getFromPage, sjc_CPrinterJob, "getFromPageAttrib", "()I");
|
||||||
|
static JNF_MEMBER_CACHE(jm_getToPage, sjc_CPrinterJob, "getToPageAttrib", "()I");
|
||||||
|
static JNF_MEMBER_CACHE(jm_getSelectAttrib, sjc_CPrinterJob, "getSelectAttrib", "()I");
|
||||||
static JNF_MEMBER_CACHE(jm_getNumberOfPages, jc_Pageable, "getNumberOfPages", "()I");
|
static JNF_MEMBER_CACHE(jm_getNumberOfPages, jc_Pageable, "getNumberOfPages", "()I");
|
||||||
|
static JNF_MEMBER_CACHE(jm_getPageFormat, sjc_CPrinterJob, "getPageFormatFromAttributes", "()Ljava/awt/print/PageFormat;");
|
||||||
|
|
||||||
NSMutableDictionary* printingDictionary = [dst dictionary];
|
NSMutableDictionary* printingDictionary = [dst dictionary];
|
||||||
|
|
||||||
|
@ -368,19 +372,35 @@ static void javaPrinterJobToNSPrintInfo(JNIEnv* env, jobject srcPrinterJob, jobj
|
||||||
|
|
||||||
jboolean collated = JNFCallBooleanMethod(env, srcPrinterJob, jm_isCollated); // AWT_THREADING Safe (known object)
|
jboolean collated = JNFCallBooleanMethod(env, srcPrinterJob, jm_isCollated); // AWT_THREADING Safe (known object)
|
||||||
[printingDictionary setObject:[NSNumber numberWithBool:collated ? YES : NO] forKey:NSPrintMustCollate];
|
[printingDictionary setObject:[NSNumber numberWithBool:collated ? YES : NO] forKey:NSPrintMustCollate];
|
||||||
|
|
||||||
jint jNumPages = JNFCallIntMethod(env, srcPageable, jm_getNumberOfPages); // AWT_THREADING Safe (!appKit)
|
jint jNumPages = JNFCallIntMethod(env, srcPageable, jm_getNumberOfPages); // AWT_THREADING Safe (!appKit)
|
||||||
if (jNumPages != java_awt_print_Pageable_UNKNOWN_NUMBER_OF_PAGES)
|
if (jNumPages != java_awt_print_Pageable_UNKNOWN_NUMBER_OF_PAGES)
|
||||||
{
|
{
|
||||||
|
jint selectID = JNFCallIntMethod(env, srcPrinterJob, jm_getSelectAttrib);
|
||||||
|
if (selectID ==0) {
|
||||||
|
[printingDictionary setObject:[NSNumber numberWithBool:YES] forKey:NSPrintAllPages];
|
||||||
|
} else if (selectID == 2) {
|
||||||
|
// In Mac 10.7, Print ALL is deselected if PrintSelection is YES whether
|
||||||
|
// NSPrintAllPages is YES or NO
|
||||||
[printingDictionary setObject:[NSNumber numberWithBool:NO] forKey:NSPrintAllPages];
|
[printingDictionary setObject:[NSNumber numberWithBool:NO] forKey:NSPrintAllPages];
|
||||||
|
[printingDictionary setObject:[NSNumber numberWithBool:YES] forKey:NSPrintSelectionOnly];
|
||||||
|
} else {
|
||||||
|
[printingDictionary setObject:[NSNumber numberWithBool:NO] forKey:NSPrintAllPages];
|
||||||
|
}
|
||||||
|
|
||||||
[printingDictionary setObject:[NSNumber numberWithInteger:1] forKey:NSPrintFirstPage];
|
jint fromPage = JNFCallIntMethod(env, srcPrinterJob, jm_getFromPage);
|
||||||
[printingDictionary setObject:[NSNumber numberWithInteger:jNumPages] forKey:NSPrintLastPage];
|
jint toPage = JNFCallIntMethod(env, srcPrinterJob, jm_getToPage);
|
||||||
|
// setting fromPage and toPage will not be shown in the dialog if printing All pages
|
||||||
|
[printingDictionary setObject:[NSNumber numberWithInteger:fromPage] forKey:NSPrintFirstPage];
|
||||||
|
[printingDictionary setObject:[NSNumber numberWithInteger:toPage] forKey:NSPrintLastPage];
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
[printingDictionary setObject:[NSNumber numberWithBool:YES] forKey:NSPrintAllPages];
|
[printingDictionary setObject:[NSNumber numberWithBool:YES] forKey:NSPrintAllPages];
|
||||||
}
|
}
|
||||||
|
jobject page = JNFCallObjectMethod(env, srcPrinterJob, jm_getPageFormat);
|
||||||
|
if (page != NULL) {
|
||||||
|
javaPageFormatToNSPrintInfo(env, NULL, page, dst);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
|
@ -322,7 +322,7 @@ static void DrawTextContext
|
||||||
|
|
||||||
Each stage of the pipeline is responsible for doing only one major thing, like allocating buffers,
|
Each stage of the pipeline is responsible for doing only one major thing, like allocating buffers,
|
||||||
aquiring transform arrays from JNI, filling buffers, or striking glyphs. All resources or memory
|
aquiring transform arrays from JNI, filling buffers, or striking glyphs. All resources or memory
|
||||||
aquired at a given stage, must be released in that stage. Any error that occurs (like a failed malloc)
|
acquired at a given stage, must be released in that stage. Any error that occurs (like a failed malloc)
|
||||||
is to be handled in the stage it occurs in, and is to return immediatly after freeing it's resources.
|
is to be handled in the stage it occurs in, and is to return immediatly after freeing it's resources.
|
||||||
|
|
||||||
-----------------------------------*/
|
-----------------------------------*/
|
||||||
|
|
|
@ -585,46 +585,6 @@ JNF_COCOA_EXIT(env);
|
||||||
return jRect;
|
return jRect;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* Class: sun_lwawt_macosx_CWrapper$NSView
|
|
||||||
* Method: enterFullScreenMode
|
|
||||||
* Signature: (J)V
|
|
||||||
*/
|
|
||||||
JNIEXPORT void JNICALL
|
|
||||||
Java_sun_lwawt_macosx_CWrapper_00024NSView_enterFullScreenMode
|
|
||||||
(JNIEnv *env, jclass cls, jlong viewPtr)
|
|
||||||
{
|
|
||||||
JNF_COCOA_ENTER(env);
|
|
||||||
|
|
||||||
NSView *view = (NSView *)jlong_to_ptr(viewPtr);
|
|
||||||
[ThreadUtilities performOnMainThreadWaiting:NO block:^(){
|
|
||||||
NSScreen *screen = [[view window] screen];
|
|
||||||
NSDictionary *opts = [NSDictionary dictionaryWithObjectsAndKeys:[NSNumber numberWithBool:NO], NSFullScreenModeAllScreens, nil];
|
|
||||||
[view enterFullScreenMode:screen withOptions:opts];
|
|
||||||
}];
|
|
||||||
|
|
||||||
JNF_COCOA_EXIT(env);
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Class: sun_lwawt_macosx_CWrapper$NSView
|
|
||||||
* Method: exitFullScreenMode
|
|
||||||
* Signature: (J)V
|
|
||||||
*/
|
|
||||||
JNIEXPORT void JNICALL
|
|
||||||
Java_sun_lwawt_macosx_CWrapper_00024NSView_exitFullScreenMode
|
|
||||||
(JNIEnv *env, jclass cls, jlong viewPtr)
|
|
||||||
{
|
|
||||||
JNF_COCOA_ENTER(env);
|
|
||||||
|
|
||||||
NSView *view = (NSView *)jlong_to_ptr(viewPtr);
|
|
||||||
[ThreadUtilities performOnMainThreadWaiting:NO block:^(){
|
|
||||||
[view exitFullScreenModeWithOptions:nil];
|
|
||||||
}];
|
|
||||||
|
|
||||||
JNF_COCOA_EXIT(env);
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Class: sun_lwawt_macosx_CWrapper$NSView
|
* Class: sun_lwawt_macosx_CWrapper$NSView
|
||||||
* Method: window
|
* Method: window
|
||||||
|
|
|
@ -312,6 +312,7 @@ AWT_ASSERT_APPKIT_THREAD;
|
||||||
if (verbose) AWT_DEBUG_LOG(@"got out of the AppKit startup mutex");
|
if (verbose) AWT_DEBUG_LOG(@"got out of the AppKit startup mutex");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!headless) {
|
||||||
// Don't set the delegate until the NSApplication has been created and
|
// Don't set the delegate until the NSApplication has been created and
|
||||||
// its finishLaunching has initialized it.
|
// its finishLaunching has initialized it.
|
||||||
// ApplicationDelegate is the support code for com.apple.eawt.
|
// ApplicationDelegate is the support code for com.apple.eawt.
|
||||||
|
@ -322,6 +323,7 @@ AWT_ASSERT_APPKIT_THREAD;
|
||||||
}
|
}
|
||||||
}];
|
}];
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
- (void)starter:(NSArray*)args {
|
- (void)starter:(NSArray*)args {
|
||||||
NSAutoreleasePool *pool = [NSAutoreleasePool new];
|
NSAutoreleasePool *pool = [NSAutoreleasePool new];
|
||||||
|
|
|
@ -341,6 +341,10 @@ AWT_ASSERT_APPKIT_THREAD;
|
||||||
if ([event type] == NSApplicationDefined && TS_EQUAL([event timestamp], dummyEventTimestamp)) {
|
if ([event type] == NSApplicationDefined && TS_EQUAL([event timestamp], dummyEventTimestamp)) {
|
||||||
[seenDummyEventLock lockWhenCondition:NO];
|
[seenDummyEventLock lockWhenCondition:NO];
|
||||||
[seenDummyEventLock unlockWithCondition:YES];
|
[seenDummyEventLock unlockWithCondition:YES];
|
||||||
|
} else if ([event type] == NSKeyUp && ([event modifierFlags] & NSCommandKeyMask)) {
|
||||||
|
// Cocoa won't send us key up event when releasing a key while Cmd is down,
|
||||||
|
// so we have to do it ourselves.
|
||||||
|
[[self keyWindow] sendEvent:event];
|
||||||
} else {
|
} else {
|
||||||
[super sendEvent:event];
|
[super sendEvent:event];
|
||||||
}
|
}
|
||||||
|
|
|
@ -47,7 +47,7 @@ name(PacketInputStream *in, PacketOutputStream *out)
|
||||||
|
|
||||||
(void)memset(&info, 0, sizeof(info));
|
(void)memset(&info, 0, sizeof(info));
|
||||||
threadGroupInfo(group, &info);
|
threadGroupInfo(group, &info);
|
||||||
(void)outStream_writeString(out, info.name);
|
(void)outStream_writeString(out, info.name == NULL ? "" : info.name);
|
||||||
if ( info.name != NULL )
|
if ( info.name != NULL )
|
||||||
jvmtiDeallocate(info.name);
|
jvmtiDeallocate(info.name);
|
||||||
|
|
||||||
|
|
|
@ -52,7 +52,7 @@
|
||||||
* the number times an object has been referenced through
|
* the number times an object has been referenced through
|
||||||
* commonRef_refToID. A RefNode is freed once the reference
|
* commonRef_refToID. A RefNode is freed once the reference
|
||||||
* count is decremented to 0 (with commonRef_release*), even if the
|
* count is decremented to 0 (with commonRef_release*), even if the
|
||||||
* correspoding object has not been collected.
|
* corresponding object has not been collected.
|
||||||
*
|
*
|
||||||
* One hash table is maintained. The mapping of ID to jobject (or RefNode*)
|
* One hash table is maintained. The mapping of ID to jobject (or RefNode*)
|
||||||
* is handled with one hash table that will re-size itself as the number
|
* is handled with one hash table that will re-size itself as the number
|
||||||
|
|
|
@ -644,7 +644,7 @@ eventFilter_predictFiltering(HandlerNode *node, jclass clazz, char *classname)
|
||||||
|
|
||||||
case JDWP_REQUEST_MODIFIER(Count): {
|
case JDWP_REQUEST_MODIFIER(Count): {
|
||||||
/*
|
/*
|
||||||
* If preceeding filters have determined that events will
|
* If preceding filters have determined that events will
|
||||||
* be filtered out, that is fine and we won't get here.
|
* be filtered out, that is fine and we won't get here.
|
||||||
* However, the count must be decremented - even if
|
* However, the count must be decremented - even if
|
||||||
* subsequent filters will filter these events. We
|
* subsequent filters will filter these events. We
|
||||||
|
|
|
@ -298,17 +298,15 @@ jdwpError
|
||||||
outStream_writeString(PacketOutputStream *stream, char *string)
|
outStream_writeString(PacketOutputStream *stream, char *string)
|
||||||
{
|
{
|
||||||
jdwpError error;
|
jdwpError error;
|
||||||
jint length;
|
jint length = string != NULL ? (int)strlen(string) : 0;
|
||||||
|
|
||||||
/* Options utf8=y/n controls if we want Standard UTF-8 or Modified */
|
/* Options utf8=y/n controls if we want Standard UTF-8 or Modified */
|
||||||
if ( gdata->modifiedUtf8 ) {
|
if ( gdata->modifiedUtf8 ) {
|
||||||
length = (int)strlen(string);
|
|
||||||
(void)outStream_writeInt(stream, length);
|
(void)outStream_writeInt(stream, length);
|
||||||
error = writeBytes(stream, (jbyte *)string, length);
|
error = writeBytes(stream, (jbyte *)string, length);
|
||||||
} else {
|
} else {
|
||||||
jint new_length;
|
jint new_length;
|
||||||
|
|
||||||
length = (int)strlen(string);
|
|
||||||
new_length = (gdata->npt->utf8mToUtf8sLength)
|
new_length = (gdata->npt->utf8mToUtf8sLength)
|
||||||
(gdata->npt->utf, (jbyte*)string, length);
|
(gdata->npt->utf, (jbyte*)string, length);
|
||||||
if ( new_length == length ) {
|
if ( new_length == length ) {
|
||||||
|
|
|
@ -1092,7 +1092,7 @@ debugMonitorWait(jrawMonitorID monitor)
|
||||||
* we don't want to consume it. It came from
|
* we don't want to consume it. It came from
|
||||||
* user code and is intended for user code, not us.
|
* user code and is intended for user code, not us.
|
||||||
* So, we will remember that the interrupt has
|
* So, we will remember that the interrupt has
|
||||||
* occured and re-activate it when this thread
|
* occurred and re-activate it when this thread
|
||||||
* goes back into user code.
|
* goes back into user code.
|
||||||
* That being said, what do we do here? Since
|
* That being said, what do we do here? Since
|
||||||
* we could have been notified too, here we will
|
* we could have been notified too, here we will
|
||||||
|
|
|
@ -40,7 +40,7 @@ abstract class AccessorElementHandler extends ElementHandler {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Parses attributes of the element.
|
* Parses attributes of the element.
|
||||||
* The following atributes are supported:
|
* The following attributes are supported:
|
||||||
* <dl>
|
* <dl>
|
||||||
* <dt>name
|
* <dt>name
|
||||||
* <dd>the name of the accessible entity
|
* <dd>the name of the accessible entity
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2008, Oracle and/or its affiliates. All rights reserved.
|
* Copyright (c) 2008, 2013 Oracle and/or its affiliates. All rights reserved.
|
||||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
*
|
*
|
||||||
* This code is free software; you can redistribute it and/or modify it
|
* This code is free software; you can redistribute it and/or modify it
|
||||||
|
@ -57,7 +57,7 @@ import java.lang.reflect.Array;
|
||||||
* <int>456</int>
|
* <int>456</int>
|
||||||
* </array></pre>
|
* </array></pre>
|
||||||
* is equivalent to {@code int[] array = {123, 456}} in Java code.
|
* is equivalent to {@code int[] array = {123, 456}} in Java code.
|
||||||
* <p>The following atributes are supported:
|
* <p>The following attributes are supported:
|
||||||
* <dl>
|
* <dl>
|
||||||
* <dt>length
|
* <dt>length
|
||||||
* <dd>the array length
|
* <dd>the array length
|
||||||
|
@ -76,7 +76,7 @@ final class ArrayElementHandler extends NewElementHandler {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Parses attributes of the element.
|
* Parses attributes of the element.
|
||||||
* The following atributes are supported:
|
* The following attributes are supported:
|
||||||
* <dl>
|
* <dl>
|
||||||
* <dt>length
|
* <dt>length
|
||||||
* <dd>the array length
|
* <dd>the array length
|
||||||
|
@ -109,6 +109,20 @@ final class ArrayElementHandler extends NewElementHandler {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Tests whether the value of this element can be used
|
||||||
|
* as an argument of the element that contained in this one.
|
||||||
|
*
|
||||||
|
* @return {@code true} if the value of this element can be used
|
||||||
|
* as an argument of the element that contained in this one,
|
||||||
|
* {@code false} otherwise
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
protected boolean isArgument() {
|
||||||
|
return true; // hack for compatibility
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Creates an instance of the array.
|
* Creates an instance of the array.
|
||||||
*
|
*
|
||||||
|
|
|
@ -37,7 +37,7 @@ package com.sun.beans.decoder;
|
||||||
* <string>true</string>
|
* <string>true</string>
|
||||||
* </method></pre>
|
* </method></pre>
|
||||||
* which is equivalent to {@code Boolean.valueOf("true")} in Java code.
|
* which is equivalent to {@code Boolean.valueOf("true")} in Java code.
|
||||||
* <p>The following atribute is supported:
|
* <p>The following attribute is supported:
|
||||||
* <dl>
|
* <dl>
|
||||||
* <dt>id
|
* <dt>id
|
||||||
* <dd>the identifier of the variable that is intended to store the result
|
* <dd>the identifier of the variable that is intended to store the result
|
||||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue