diff --git a/.hgtags b/.hgtags
index 7a1ef94c809..d1af44ccacc 100644
--- a/.hgtags
+++ b/.hgtags
@@ -287,3 +287,4 @@ b409bc51bc23cfd51f2bd04ea919ec83535af9d0 jdk9-b37
3107be2ba9c6e208a0b86bc7100a141abbc5b5fb jdk9-b42
6494b13f88a867026ee316b444d9a4fa589dd6bd jdk9-b43
abbfccd659b91a7bb815d5e36fed635dcdd40f31 jdk9-b44
+bfc24ae2b900187585079bb11e66e459d1e525fe jdk9-b45
diff --git a/.hgtags-top-repo b/.hgtags-top-repo
index 1c8881b0d18..0ad3d644f11 100644
--- a/.hgtags-top-repo
+++ b/.hgtags-top-repo
@@ -287,3 +287,4 @@ cf136458ee747e151a27aa9ea0c1492ea55ef3e7 jdk9-b40
f7c11da0b0481d49cc7a65a453336c108191e821 jdk9-b42
02ee8c65622e8bd97496d584e22fc7dcf0edc4ae jdk9-b43
8994f5d87b3bb5e8d317d4e8ccb326da1a73684a jdk9-b44
+3dd628fde2086218d548841022ee8436b6b88185 jdk9-b45
diff --git a/Makefile b/Makefile
index 1eff79b2194..0814d3867c6 100644
--- a/Makefile
+++ b/Makefile
@@ -54,8 +54,11 @@ ifneq ($(findstring qp,$(MAKEFLAGS)),)
# Duplication of global targets, needed before ParseConfAndSpec in case we have
# no configurations.
help:
- # If CONF is not set, look for all available configurations
- CONF?=
+ # If both CONF and SPEC are unset, look for all available configurations by
+ # setting CONF to the empty string.
+ ifeq ($(SPEC), )
+ CONF?=
+ endif
endif
# ... and then we can include our helper functions
diff --git a/common/autoconf/generated-configure.sh b/common/autoconf/generated-configure.sh
index 59c1a8ae9e8..21ab1f47ecd 100644
--- a/common/autoconf/generated-configure.sh
+++ b/common/autoconf/generated-configure.sh
@@ -4329,7 +4329,7 @@ TOOLCHAIN_DESCRIPTION_xlc="IBM XL C/C++"
#CUSTOM_AUTOCONF_INCLUDE
# Do not change or remove the following line, it is needed for consistency checks:
-DATE_WHEN_GENERATED=1418395009
+DATE_WHEN_GENERATED=1420811523
###############################################################################
#
@@ -27408,8 +27408,8 @@ $as_echo "$as_me: Trying to extract Visual Studio environment variables" >&6;}
# The trailing space for everyone except PATH is no typo, but is needed due
# to trailing \ in the Windows paths. These will be stripped later.
$ECHO "$WINPATH_BASH -c 'echo VS_PATH="'\"$PATH\" > set-vs-env.sh' >> $EXTRACT_VC_ENV_BAT_FILE
- $ECHO "$WINPATH_BASH -c 'echo VS_INCLUDE="'\"$INCLUDE \" >> set-vs-env.sh' >> $EXTRACT_VC_ENV_BAT_FILE
- $ECHO "$WINPATH_BASH -c 'echo VS_LIB="'\"$LIB \" >> set-vs-env.sh' >> $EXTRACT_VC_ENV_BAT_FILE
+ $ECHO "$WINPATH_BASH -c 'echo VS_INCLUDE="'\"$INCLUDE\;$include \" >> set-vs-env.sh' >> $EXTRACT_VC_ENV_BAT_FILE
+ $ECHO "$WINPATH_BASH -c 'echo VS_LIB="'\"$LIB\;$lib \" >> set-vs-env.sh' >> $EXTRACT_VC_ENV_BAT_FILE
$ECHO "$WINPATH_BASH -c 'echo VCINSTALLDIR="'\"$VCINSTALLDIR \" >> set-vs-env.sh' >> $EXTRACT_VC_ENV_BAT_FILE
$ECHO "$WINPATH_BASH -c 'echo WindowsSdkDir="'\"$WindowsSdkDir \" >> set-vs-env.sh' >> $EXTRACT_VC_ENV_BAT_FILE
$ECHO "$WINPATH_BASH -c 'echo WINDOWSSDKDIR="'\"$WINDOWSSDKDIR \" >> set-vs-env.sh' >> $EXTRACT_VC_ENV_BAT_FILE
diff --git a/common/autoconf/spec.gmk.in b/common/autoconf/spec.gmk.in
index 60d70886925..1c6c1c40132 100644
--- a/common/autoconf/spec.gmk.in
+++ b/common/autoconf/spec.gmk.in
@@ -690,10 +690,15 @@ OS_VERSION_MICRO:=@OS_VERSION_MICRO@
# Images directory definitions
JDK_IMAGE_SUBDIR:=jdk
JRE_IMAGE_SUBDIR:=jre
+
# Colon left out to be able to override output dir for bootcycle-images
JDK_IMAGE_DIR=$(IMAGES_OUTPUTDIR)/$(JDK_IMAGE_SUBDIR)
JRE_IMAGE_DIR=$(IMAGES_OUTPUTDIR)/$(JRE_IMAGE_SUBDIR)
+# Test image, as above
+TEST_IMAGE_SUBDIR:=test
+TEST_IMAGE_DIR=$(IMAGES_OUTPUTDIR)/$(TEST_IMAGE_SUBDIR)
+
# Macosx bundles directory definitions
JDK_BUNDLE_SUBDIR=jdk-bundle/jdk$(JDK_VERSION).jdk/Contents
JRE_BUNDLE_SUBDIR=jre-bundle/jre$(JDK_VERSION).jre/Contents
diff --git a/common/autoconf/toolchain_windows.m4 b/common/autoconf/toolchain_windows.m4
index 231d2e837f2..e1ec6f3db5b 100644
--- a/common/autoconf/toolchain_windows.m4
+++ b/common/autoconf/toolchain_windows.m4
@@ -173,8 +173,8 @@ AC_DEFUN([TOOLCHAIN_SETUP_VISUAL_STUDIO_ENV],
# The trailing space for everyone except PATH is no typo, but is needed due
# to trailing \ in the Windows paths. These will be stripped later.
$ECHO "$WINPATH_BASH -c 'echo VS_PATH="'\"$PATH\" > set-vs-env.sh' >> $EXTRACT_VC_ENV_BAT_FILE
- $ECHO "$WINPATH_BASH -c 'echo VS_INCLUDE="'\"$INCLUDE \" >> set-vs-env.sh' >> $EXTRACT_VC_ENV_BAT_FILE
- $ECHO "$WINPATH_BASH -c 'echo VS_LIB="'\"$LIB \" >> set-vs-env.sh' >> $EXTRACT_VC_ENV_BAT_FILE
+ $ECHO "$WINPATH_BASH -c 'echo VS_INCLUDE="'\"$INCLUDE\;$include \" >> set-vs-env.sh' >> $EXTRACT_VC_ENV_BAT_FILE
+ $ECHO "$WINPATH_BASH -c 'echo VS_LIB="'\"$LIB\;$lib \" >> set-vs-env.sh' >> $EXTRACT_VC_ENV_BAT_FILE
$ECHO "$WINPATH_BASH -c 'echo VCINSTALLDIR="'\"$VCINSTALLDIR \" >> set-vs-env.sh' >> $EXTRACT_VC_ENV_BAT_FILE
$ECHO "$WINPATH_BASH -c 'echo WindowsSdkDir="'\"$WindowsSdkDir \" >> set-vs-env.sh' >> $EXTRACT_VC_ENV_BAT_FILE
$ECHO "$WINPATH_BASH -c 'echo WINDOWSSDKDIR="'\"$WINDOWSSDKDIR \" >> set-vs-env.sh' >> $EXTRACT_VC_ENV_BAT_FILE
diff --git a/common/bin/unshuffle_list.txt b/common/bin/unshuffle_list.txt
index cd0749c7aa8..0219bd7b005 100644
--- a/common/bin/unshuffle_list.txt
+++ b/common/bin/unshuffle_list.txt
@@ -26,10 +26,8 @@ corba/src/java.corba/share/classes/com/sun/org/omg : corba/src/share/classes/com
corba/src/java.corba/share/classes/com/sun/tools/corba/se/idl : corba/src/share/classes/com/sun/tools/corba/se/idl
corba/src/java.corba/share/classes/javax/activity : corba/src/share/classes/javax/activity
corba/src/java.corba/share/classes/javax/rmi : corba/src/share/classes/javax/rmi
-corba/src/java.corba/share/classes/javax/transaction : corba/src/share/classes/javax/transaction
corba/src/java.corba/share/classes/org/omg : corba/src/share/classes/org/omg
corba/src/java.corba/share/classes/sun/corba : corba/src/share/classes/sun/corba
-corba/src/java.sql/share/classes/javax/transaction/xa : corba/src/share/classes/javax/transaction/xa
corba/src/jdk.rmic/share/classes/sun/rmi/rmic/iiop : corba/src/share/classes/sun/rmi/rmic/iiop
jaxp/src/java.xml/share/classes/com/sun/java_cup/internal/runtime : jaxp/src/com/sun/java_cup/internal/runtime
jaxp/src/java.xml/share/classes/com/sun/org/apache/bcel/internal : jaxp/src/com/sun/org/apache/bcel/internal
@@ -66,8 +64,8 @@ jaxws/src/java.xml.bind/share/classes/com/sun/xml/internal/fastinfoset : jaxws/s
jaxws/src/java.xml.bind/share/classes/com/sun/xml/internal/org : jaxws/src/share/jaxws_classes/com/sun/xml/internal/org
jaxws/src/java.xml.bind/share/classes/com/sun/xml/internal/txw2 : jaxws/src/share/jaxws_classes/com/sun/xml/internal/txw2
jaxws/src/java.xml.bind/share/classes/javax/xml/bind : jaxws/src/share/jaxws_classes/javax/xml/bind
-jaxws/src/java.xml.soap/share/classes/com/sun/xml/internal/messaging : jaxws/src/share/jaxws_classes/com/sun/xml/internal/messaging
-jaxws/src/java.xml.soap/share/classes/javax/xml/soap : jaxws/src/share/jaxws_classes/javax/xml/soap
+jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging : jaxws/src/share/jaxws_classes/com/sun/xml/internal/messaging
+jaxws/src/java.xml.ws/share/classes/javax/xml/soap : jaxws/src/share/jaxws_classes/javax/xml/soap
jaxws/src/java.xml.ws/share/classes/com/oracle/webservices/internal : jaxws/src/share/jaxws_classes/com/oracle/webservices/internal
jaxws/src/java.xml.ws/share/classes/com/oracle/xmlns/internal : jaxws/src/share/jaxws_classes/com/oracle/xmlns/internal
jaxws/src/java.xml.ws/share/classes/com/sun/org/glassfish : jaxws/src/share/jaxws_classes/com/sun/org/glassfish
@@ -1245,6 +1243,8 @@ jdk/src/java.sql.rowset/share/classes/com/sun/rowset : jdk/src/share/classes/com
jdk/src/java.sql.rowset/share/classes/javax/sql/rowset : jdk/src/share/classes/javax/sql/rowset
jdk/src/java.sql/share/classes/java/sql : jdk/src/share/classes/java/sql
jdk/src/java.sql/share/classes/javax/sql : jdk/src/share/classes/javax/sql
+jdk/src/java.sql/share/classes/javax/transaction/xa : corba/src/share/classes/javax/transaction/xa
+jdk/src/java.transaction/share/classes/javax/transaction : corba/src/share/classes/javax/transaction
jdk/src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security : jdk/src/share/classes/com/sun/org/apache/xml/internal/security
jdk/src/java.xml.crypto/share/classes/javax/xml/crypto : jdk/src/share/classes/javax/xml/crypto
jdk/src/java.xml.crypto/share/classes/org/jcp/xml/dsig/internal : jdk/src/share/classes/org/jcp/xml/dsig/internal
diff --git a/corba/.hgtags b/corba/.hgtags
index 3c3ea198849..859c412f8a7 100644
--- a/corba/.hgtags
+++ b/corba/.hgtags
@@ -287,3 +287,4 @@ e27c725d6c9d155667b35255f442d4ceb8c3c084 jdk9-b40
078bb11af876fe528d4b516f33ad4dd9bb60549e jdk9-b42
9645e35616b60c5c07b4fdf11a132afc8081dfa8 jdk9-b43
1f57bd728c9e6865ccb9d43ccd80a1c11230a32f jdk9-b44
+9e3f2bed80c0e5a84a256ce41f1d10c5ade48466 jdk9-b45
diff --git a/corba/src/java.sql/share/classes/javax/transaction/xa/XAResource.java b/corba/src/java.sql/share/classes/javax/transaction/xa/XAResource.java
deleted file mode 100644
index ffb7226a446..00000000000
--- a/corba/src/java.sql/share/classes/javax/transaction/xa/XAResource.java
+++ /dev/null
@@ -1,314 +0,0 @@
-/*
- * Copyright (c) 2000, 2001, 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 javax.transaction.xa;
-
-/**
The XAResource interface is a Java mapping of the industry standard
- * XA interface based on the X/Open CAE Specification (Distributed
- * Transaction Processing: The XA Specification).
- *
- *
The XA interface defines the contract between a Resource Manager
- * and a Transaction Manager in a distributed transaction processing
- * (DTP) environment. A JDBC driver or a JMS provider implements
- * this interface to support the association between a global transaction
- * and a database or message service connection.
- *
- *
The XAResource interface can be supported by any transactional
- * resource that is intended to be used by application programs in an
- * environment where transactions are controlled by an external
- * transaction manager. An example of such a resource is a database
- * management system. An application may access data through multiple
- * database connections. Each database connection is enlisted with
- * the transaction manager as a transactional resource. The transaction
- * manager obtains an XAResource for each connection participating
- * in a global transaction. The transaction manager uses the
- * start method
- * to associate the global transaction with the resource, and it uses the
- * end method to disassociate the transaction from
- * the resource. The resource
- * manager is responsible for associating the global transaction to all
- * work performed on its data between the start and end method invocations.
- *
- *
At transaction commit time, the resource managers are informed by
- * the transaction manager to prepare, commit, or rollback a transaction
- * according to the two-phase commit protocol.
- *
- */
-
-public interface XAResource
-{
- /** Commits the global transaction specified by xid.
- *
- * @param xid A global transaction identifier
- *
- * @param onePhase If true, the resource manager should use a one-phase
- * commit protocol to commit the work done on behalf of xid.
- *
- * @exception XAException An error has occurred. Possible XAExceptions
- * are XA_HEURHAZ, XA_HEURCOM, XA_HEURRB, XA_HEURMIX, XAER_RMERR,
- * XAER_RMFAIL, XAER_NOTA, XAER_INVAL, or XAER_PROTO.
- *
- * If the resource manager did not commit the transaction and the
- * paramether onePhase is set to true, the resource manager may throw
- * one of the XA_RB* exceptions. Upon return, the resource manager has
- * rolled back the branch's work and has released all held resources.
- */
-
- void commit(Xid xid, boolean onePhase) throws XAException;
-
-
- /** Ends the work performed on behalf of a transaction branch.
- * The resource manager disassociates the XA resource from the
- * transaction branch specified and lets the transaction
- * complete.
- *
- *
If TMSUSPEND is specified in the flags, the transaction branch
- * is temporarily suspended in an incomplete state. The transaction
- * context is in a suspended state and must be resumed via the
- * start method with TMRESUME specified.
- *
- * If TMFAIL is specified, the portion of work has failed.
- * The resource manager may mark the transaction as rollback-only
- *
- * If TMSUCCESS is specified, the portion of work has completed
- * successfully.
- *
- * @param xid A global transaction identifier that is the same as
- * the identifier used previously in the start method.
- *
- * @param flags One of TMSUCCESS, TMFAIL, or TMSUSPEND.
- *
- * @exception XAException An error has occurred. Possible XAException
- * values are XAER_RMERR, XAER_RMFAILED, XAER_NOTA, XAER_INVAL,
- * XAER_PROTO, or XA_RB*.
- */
-
- void end(Xid xid, int flags) throws XAException;
-
-
- /** Tells the resource manager to forget about a heuristically
- * completed transaction branch.
- *
- * @param xid A global transaction identifier.
- *
- * @exception XAException An error has occurred. Possible exception
- * values are XAER_RMERR, XAER_RMFAIL, XAER_NOTA, XAER_INVAL, or
- * XAER_PROTO.
- */
-
- void forget(Xid xid) throws XAException;
-
- /** Obtains the current transaction timeout value set for this
- * XAResource instance. If XAResource.setTransactionTimeout
- * was not used prior to invoking this method, the return value
- * is the default timeout set for the resource manager; otherwise,
- * the value used in the previous setTransactionTimeout
- * call is returned.
- *
- * @return the transaction timeout value in seconds.
- *
- * @exception XAException An error has occurred. Possible exception
- * values are XAER_RMERR and XAER_RMFAIL.
- */
- int getTransactionTimeout() throws XAException;
-
- /** This method is called to determine if the resource manager
- * instance represented by the target object is the same as the
- * resouce manager instance represented by the parameter xares .
- *
- * @param xares An XAResource object whose resource manager instance
- * is to be compared with the resource manager instance of the
- * target object.
- *
- * @return true if it's the same RM instance; otherwise
- * false .
- *
- * @exception XAException An error has occurred. Possible exception
- * values are XAER_RMERR and XAER_RMFAIL.
- *
- */
- boolean isSameRM(XAResource xares) throws XAException;
-
- /** Ask the resource manager to prepare for a transaction commit
- * of the transaction specified in xid.
- *
- * @param xid A global transaction identifier.
- *
- * @exception XAException An error has occurred. Possible exception
- * values are: XA_RB*, XAER_RMERR, XAER_RMFAIL, XAER_NOTA, XAER_INVAL,
- * or XAER_PROTO.
- *
- * @return A value indicating the resource manager's vote on the
- * outcome of the transaction. The possible values are: XA_RDONLY
- * or XA_OK. If the resource manager wants to roll back the
- * transaction, it should do so by raising an appropriate XAException
- * in the prepare method.
- */
-
- int prepare(Xid xid) throws XAException;
-
-
- /** Obtains a list of prepared transaction branches from a resource
- * manager. The transaction manager calls this method during recovery
- * to obtain the list of transaction branches that are currently in
- * prepared or heuristically completed states.
- *
- * @param flag One of TMSTARTRSCAN, TMENDRSCAN, TMNOFLAGS. TMNOFLAGS
- * must be used when no other flags are set in the parameter.
- *
- * @exception XAException An error has occurred. Possible values are
- * XAER_RMERR, XAER_RMFAIL, XAER_INVAL, and XAER_PROTO.
- *
- * @return The resource manager returns zero or more XIDs of the
- * transaction branches that are currently in a prepared or
- * heuristically completed state. If an error occurs during the
- * operation, the resource manager should throw the appropriate
- * XAException.
- *
- */
-
- Xid[] recover(int flag) throws XAException;
-
-
- /** Informs the resource manager to roll back work done on behalf
- * of a transaction branch.
- *
- * @param xid A global transaction identifier.
- *
- * @exception XAException An error has occurred.
- */
-
- void rollback(Xid xid) throws XAException;
-
-
- /** Sets the current transaction timeout value for this XAResource
- * instance. Once set, this timeout value is effective until
- * setTransactionTimeout is invoked again with a different
- * value. To reset the timeout value to the default value used by the resource
- * manager, set the value to zero.
- *
- * If the timeout operation is performed successfully, the method returns
- * true ; otherwise false . If a resource manager does not
- * support explicitly setting the transaction timeout value, this method
- * returns false .
- *
- * @param seconds The transaction timeout value in seconds.
- *
- * @return true if the transaction timeout value is set successfully;
- * otherwise false .
- *
- * @exception XAException An error has occurred. Possible exception values
- * are XAER_RMERR, XAER_RMFAIL, or XAER_INVAL.
- */
- boolean setTransactionTimeout(int seconds) throws XAException;
-
-
- /** Starts work on behalf of a transaction branch specified in
- * xid.
- *
- * If TMJOIN is specified, the start applies to joining a transaction
- * previously seen by the resource manager. If TMRESUME is specified,
- * the start applies to resuming a suspended transaction specified in the
- * parameter xid.
- *
- * If neither TMJOIN nor TMRESUME is specified and the transaction
- * specified by xid has previously been seen by the resource
- * manager, the resource manager throws the XAException exception with
- * XAER_DUPID error code.
- *
- * @param xid A global transaction identifier to be associated
- * with the resource.
- *
- * @param flags One of TMNOFLAGS, TMJOIN, or TMRESUME.
- *
- * @exception XAException An error has occurred. Possible exceptions
- * are XA_RB*, XAER_RMERR, XAER_RMFAIL, XAER_DUPID, XAER_OUTSIDE,
- * XAER_NOTA, XAER_INVAL, or XAER_PROTO.
- *
- */
- void start(Xid xid, int flags) throws XAException;
-
-
- /**
- * Ends a recovery scan.
- */
- public final static int TMENDRSCAN = 0x00800000;
-
- /**
- * Disassociates the caller and marks the transaction branch
- * rollback-only.
- */
- public final static int TMFAIL = 0x20000000;
-
- /**
- * Caller is joining existing transaction branch.
- */
- public final static int TMJOIN = 0x00200000;
-
- /**
- * Use TMNOFLAGS to indicate no flags value is selected.
- */
- public final static int TMNOFLAGS = 0x00000000;
-
- /**
- * Caller is using one-phase optimization.
- */
- public final static int TMONEPHASE = 0x40000000;
-
- /**
- * Caller is resuming association with a suspended
- * transaction branch.
- */
- public final static int TMRESUME = 0x08000000;
-
- /**
- * Starts a recovery scan.
- */
- public final static int TMSTARTRSCAN = 0x01000000;
-
-
- /**
- * Disassociates caller from a transaction branch.
- */
- public final static int TMSUCCESS = 0x04000000;
-
-
- /**
- * Caller is suspending (not ending) its association with
- * a transaction branch.
- */
- public final static int TMSUSPEND = 0x02000000;
-
- /**
- * The transaction branch has been read-only and has been committed.
- */
- public final static int XA_RDONLY = 0x00000003;
-
- /**
- * The transaction work has been prepared normally.
- */
- public final static int XA_OK = 0;
-
-}
diff --git a/hotspot/.hgtags b/hotspot/.hgtags
index ed88a27ff49..b4e518b36eb 100644
--- a/hotspot/.hgtags
+++ b/hotspot/.hgtags
@@ -447,3 +447,4 @@ c363a8b87e477ee45d6d3cb2a36cb365141bc596 jdk9-b38
38cb4fbd47e3472bd1b5ebac83bda96fe4869c4f jdk9-b42
65a9747147b8090037541040ba67156ec914db6a jdk9-b43
43a44b56dca61a4d766a20f0528fdd8b5ceff873 jdk9-b44
+5dc8184af1e2bb30b0103113d1f1a58a21a80c37 jdk9-b45
diff --git a/hotspot/src/cpu/ppc/vm/assembler_ppc.hpp b/hotspot/src/cpu/ppc/vm/assembler_ppc.hpp
index 7d9aecb310f..f1087dbc02c 100644
--- a/hotspot/src/cpu/ppc/vm/assembler_ppc.hpp
+++ b/hotspot/src/cpu/ppc/vm/assembler_ppc.hpp
@@ -1,6 +1,6 @@
/*
- * Copyright (c) 2002, 2013, Oracle and/or its affiliates. All rights reserved.
- * Copyright 2012, 2013 SAP AG. All rights reserved.
+ * Copyright (c) 2002, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright 2012, 2015 SAP AG. 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
@@ -284,19 +284,20 @@ class Assembler : public AbstractAssembler {
MTCTR_OPCODE = (MTSPR_OPCODE | 9 << SPR_0_4_SHIFT),
MFCTR_OPCODE = (MFSPR_OPCODE | 9 << SPR_0_4_SHIFT),
- MTTFHAR_OPCODE = (MTSPR_OPCODE | 128 << SPR_0_4_SHIFT),
- MFTFHAR_OPCODE = (MFSPR_OPCODE | 128 << SPR_0_4_SHIFT),
- MTTFIAR_OPCODE = (MTSPR_OPCODE | 129 << SPR_0_4_SHIFT),
- MFTFIAR_OPCODE = (MFSPR_OPCODE | 129 << SPR_0_4_SHIFT),
- MTTEXASR_OPCODE = (MTSPR_OPCODE | 130 << SPR_0_4_SHIFT),
- MFTEXASR_OPCODE = (MFSPR_OPCODE | 130 << SPR_0_4_SHIFT),
- MTTEXASRU_OPCODE = (MTSPR_OPCODE | 131 << SPR_0_4_SHIFT),
- MFTEXASRU_OPCODE = (MFSPR_OPCODE | 131 << SPR_0_4_SHIFT),
+ // Attention: Higher and lower half are inserted in reversed order.
+ MTTFHAR_OPCODE = (MTSPR_OPCODE | 4 << SPR_5_9_SHIFT | 0 << SPR_0_4_SHIFT),
+ MFTFHAR_OPCODE = (MFSPR_OPCODE | 4 << SPR_5_9_SHIFT | 0 << SPR_0_4_SHIFT),
+ MTTFIAR_OPCODE = (MTSPR_OPCODE | 4 << SPR_5_9_SHIFT | 1 << SPR_0_4_SHIFT),
+ MFTFIAR_OPCODE = (MFSPR_OPCODE | 4 << SPR_5_9_SHIFT | 1 << SPR_0_4_SHIFT),
+ MTTEXASR_OPCODE = (MTSPR_OPCODE | 4 << SPR_5_9_SHIFT | 2 << SPR_0_4_SHIFT),
+ MFTEXASR_OPCODE = (MFSPR_OPCODE | 4 << SPR_5_9_SHIFT | 2 << SPR_0_4_SHIFT),
+ MTTEXASRU_OPCODE = (MTSPR_OPCODE | 4 << SPR_5_9_SHIFT | 3 << SPR_0_4_SHIFT),
+ MFTEXASRU_OPCODE = (MFSPR_OPCODE | 4 << SPR_5_9_SHIFT | 3 << SPR_0_4_SHIFT),
- MTVRSAVE_OPCODE = (MTSPR_OPCODE | 256 << SPR_0_4_SHIFT),
- MFVRSAVE_OPCODE = (MFSPR_OPCODE | 256 << SPR_0_4_SHIFT),
+ MTVRSAVE_OPCODE = (MTSPR_OPCODE | 8 << SPR_5_9_SHIFT | 0 << SPR_0_4_SHIFT),
+ MFVRSAVE_OPCODE = (MFSPR_OPCODE | 8 << SPR_5_9_SHIFT | 0 << SPR_0_4_SHIFT),
- MFTB_OPCODE = (MFSPR_OPCODE | 268 << SPR_0_4_SHIFT),
+ MFTB_OPCODE = (MFSPR_OPCODE | 8 << SPR_5_9_SHIFT | 12 << SPR_0_4_SHIFT),
MTCRF_OPCODE = (31u << OPCODE_SHIFT | 144u << 1),
MFCR_OPCODE = (31u << OPCODE_SHIFT | 19u << 1),
@@ -1494,6 +1495,26 @@ class Assembler : public AbstractAssembler {
inline void mftexasr(Register d);
inline void mftexasru(Register d);
+ // TEXASR bit description
+ enum transaction_failure_reason {
+ // Upper half (TEXASRU):
+ tm_failure_persistent = 7, // The failure is likely to recur on each execution.
+ tm_disallowed = 8, // The instruction is not permitted.
+ tm_nesting_of = 9, // The maximum transaction level was exceeded.
+ tm_footprint_of = 10, // The tracking limit for transactional storage accesses was exceeded.
+ tm_self_induced_cf = 11, // A self-induced conflict occurred in Suspended state.
+ tm_non_trans_cf = 12, // A conflict occurred with a non-transactional access by another processor.
+ tm_trans_cf = 13, // A conflict occurred with another transaction.
+ tm_translation_cf = 14, // A conflict occurred with a TLB invalidation.
+ tm_inst_fetch_cf = 16, // An instruction fetch was performed from a block that was previously written transactionally.
+ tm_tabort = 31, // Termination was caused by the execution of an abort instruction.
+ // Lower half:
+ tm_suspended = 32, // Failure was recorded in Suspended state.
+ tm_failure_summary = 36, // Failure has been detected and recorded.
+ tm_tfiar_exact = 37, // Value in the TFIAR is exact.
+ tm_rot = 38, // Rollback-only transaction.
+ };
+
// PPC 1, section 2.4.1 Branch Instructions
inline void b( address a, relocInfo::relocType rt = relocInfo::none);
inline void b( Label& L);
@@ -1581,6 +1602,7 @@ class Assembler : public AbstractAssembler {
inline void bnectrl(ConditionRegister crx, relocInfo::relocType rt = relocInfo::none);
// condition register logic instructions
+ // NOTE: There's a preferred form: d and s2 should point into the same condition register.
inline void crand( int d, int s1, int s2);
inline void crnand(int d, int s1, int s2);
inline void cror( int d, int s1, int s2);
@@ -1590,6 +1612,19 @@ class Assembler : public AbstractAssembler {
inline void crandc(int d, int s1, int s2);
inline void crorc( int d, int s1, int s2);
+ // More convenient version.
+ int condition_register_bit(ConditionRegister cr, Condition c) {
+ return 4 * (int)(intptr_t)cr + c;
+ }
+ void crand( ConditionRegister crdst, Condition cdst, ConditionRegister crsrc, Condition csrc);
+ void crnand(ConditionRegister crdst, Condition cdst, ConditionRegister crsrc, Condition csrc);
+ void cror( ConditionRegister crdst, Condition cdst, ConditionRegister crsrc, Condition csrc);
+ void crxor( ConditionRegister crdst, Condition cdst, ConditionRegister crsrc, Condition csrc);
+ void crnor( ConditionRegister crdst, Condition cdst, ConditionRegister crsrc, Condition csrc);
+ void creqv( ConditionRegister crdst, Condition cdst, ConditionRegister crsrc, Condition csrc);
+ void crandc(ConditionRegister crdst, Condition cdst, ConditionRegister crsrc, Condition csrc);
+ void crorc( ConditionRegister crdst, Condition cdst, ConditionRegister crsrc, Condition csrc);
+
// icache and dcache related instructions
inline void icbi( Register s1, Register s2);
//inline void dcba(Register s1, Register s2); // Instruction for embedded processor only.
@@ -1673,6 +1708,10 @@ class Assembler : public AbstractAssembler {
inline void smt_prio_low();
inline void smt_prio_medium_low();
inline void smt_prio_medium();
+ // >= Power7
+ inline void smt_yield();
+ inline void smt_mdoio();
+ inline void smt_mdoom();
// trap instructions
inline void twi_0(Register a); // for load with acquire semantics use load+twi_0+isync (trap can't occur)
@@ -1958,6 +1997,7 @@ class Assembler : public AbstractAssembler {
inline void tbeginrot_(); // R=1 Rollback-Only Transaction
inline void tend_(); // A=0
inline void tendall_(); // A=1
+ inline void tabort_();
inline void tabort_(Register a);
inline void tabortwc_(int t, Register a, Register b);
inline void tabortwci_(int t, Register a, int si);
@@ -1967,6 +2007,10 @@ class Assembler : public AbstractAssembler {
inline void tresume_(); // tsr with L=1
inline void tcheck(int f);
+ static bool is_tbegin(int x) {
+ return TBEGIN_OPCODE == (x & (0x3f << OPCODE_SHIFT | 0x3ff << 1));
+ }
+
// The following encoders use r0 as second operand. These instructions
// read r0 as '0'.
inline void lwzx( Register d, Register s2);
diff --git a/hotspot/src/cpu/ppc/vm/assembler_ppc.inline.hpp b/hotspot/src/cpu/ppc/vm/assembler_ppc.inline.hpp
index b4a7370994d..5493f124371 100644
--- a/hotspot/src/cpu/ppc/vm/assembler_ppc.inline.hpp
+++ b/hotspot/src/cpu/ppc/vm/assembler_ppc.inline.hpp
@@ -1,6 +1,6 @@
/*
- * Copyright (c) 2002, 2013, Oracle and/or its affiliates. All rights reserved.
- * Copyright 2012, 2014 SAP AG. All rights reserved.
+ * Copyright (c) 2002, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright 2012, 2015 SAP AG. 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
@@ -453,6 +453,48 @@ inline void Assembler::creqv( int d, int s1, int s2) { emit_int32(CREQV_OPCODE
inline void Assembler::crandc(int d, int s1, int s2) { emit_int32(CRANDC_OPCODE | bt(d) | ba(s1) | bb(s2)); }
inline void Assembler::crorc( int d, int s1, int s2) { emit_int32(CRORC_OPCODE | bt(d) | ba(s1) | bb(s2)); }
+// More convenient version.
+inline void Assembler::crand( ConditionRegister crdst, Condition cdst, ConditionRegister crsrc, Condition csrc) {
+ int dst_bit = condition_register_bit(crdst, cdst),
+ src_bit = condition_register_bit(crsrc, csrc);
+ crand(dst_bit, src_bit, dst_bit);
+}
+inline void Assembler::crnand(ConditionRegister crdst, Condition cdst, ConditionRegister crsrc, Condition csrc) {
+ int dst_bit = condition_register_bit(crdst, cdst),
+ src_bit = condition_register_bit(crsrc, csrc);
+ crnand(dst_bit, src_bit, dst_bit);
+}
+inline void Assembler::cror( ConditionRegister crdst, Condition cdst, ConditionRegister crsrc, Condition csrc) {
+ int dst_bit = condition_register_bit(crdst, cdst),
+ src_bit = condition_register_bit(crsrc, csrc);
+ cror(dst_bit, src_bit, dst_bit);
+}
+inline void Assembler::crxor( ConditionRegister crdst, Condition cdst, ConditionRegister crsrc, Condition csrc) {
+ int dst_bit = condition_register_bit(crdst, cdst),
+ src_bit = condition_register_bit(crsrc, csrc);
+ crxor(dst_bit, src_bit, dst_bit);
+}
+inline void Assembler::crnor( ConditionRegister crdst, Condition cdst, ConditionRegister crsrc, Condition csrc) {
+ int dst_bit = condition_register_bit(crdst, cdst),
+ src_bit = condition_register_bit(crsrc, csrc);
+ crnor(dst_bit, src_bit, dst_bit);
+}
+inline void Assembler::creqv( ConditionRegister crdst, Condition cdst, ConditionRegister crsrc, Condition csrc) {
+ int dst_bit = condition_register_bit(crdst, cdst),
+ src_bit = condition_register_bit(crsrc, csrc);
+ creqv(dst_bit, src_bit, dst_bit);
+}
+inline void Assembler::crandc(ConditionRegister crdst, Condition cdst, ConditionRegister crsrc, Condition csrc) {
+ int dst_bit = condition_register_bit(crdst, cdst),
+ src_bit = condition_register_bit(crsrc, csrc);
+ crandc(dst_bit, src_bit, dst_bit);
+}
+inline void Assembler::crorc( ConditionRegister crdst, Condition cdst, ConditionRegister crsrc, Condition csrc) {
+ int dst_bit = condition_register_bit(crdst, cdst),
+ src_bit = condition_register_bit(crsrc, csrc);
+ crorc(dst_bit, src_bit, dst_bit);
+}
+
// Conditional move (>= Power7)
inline void Assembler::isel(Register d, ConditionRegister cr, Condition cc, bool inv, Register a, Register b) {
if (b == noreg) {
@@ -516,6 +558,10 @@ inline void Assembler::smt_prio_medium_low() { Assembler::or_unchecked(R6, R6,
inline void Assembler::smt_prio_medium() { Assembler::or_unchecked(R2, R2, R2); }
inline void Assembler::smt_prio_medium_high() { Assembler::or_unchecked(R5, R5, R5); }
inline void Assembler::smt_prio_high() { Assembler::or_unchecked(R3, R3, R3); }
+// >= Power7
+inline void Assembler::smt_yield() { Assembler::or_unchecked(R27, R27, R27); }
+inline void Assembler::smt_mdoio() { Assembler::or_unchecked(R29, R29, R29); }
+inline void Assembler::smt_mdoom() { Assembler::or_unchecked(R30, R30, R30); }
inline void Assembler::twi_0(Register a) { twi_unchecked(0, a, 0);}
@@ -778,7 +824,8 @@ inline void Assembler::tbegin_() { emit_int32( TB
inline void Assembler::tbeginrot_() { emit_int32( TBEGIN_OPCODE | /*R=1*/ 1u << (31-10) | rc(1)); }
inline void Assembler::tend_() { emit_int32( TEND_OPCODE | rc(1)); }
inline void Assembler::tendall_() { emit_int32( TEND_OPCODE | /*A=1*/ 1u << (31-6) | rc(1)); }
-inline void Assembler::tabort_(Register a) { emit_int32( TABORT_OPCODE | ra(a) | rc(1)); }
+inline void Assembler::tabort_() { emit_int32( TABORT_OPCODE | rc(1)); }
+inline void Assembler::tabort_(Register a) { assert(a != R0, "r0 not allowed"); emit_int32( TABORT_OPCODE | ra(a) | rc(1)); }
inline void Assembler::tabortwc_(int t, Register a, Register b) { emit_int32( TABORTWC_OPCODE | to(t) | ra(a) | rb(b) | rc(1)); }
inline void Assembler::tabortwci_(int t, Register a, int si) { emit_int32( TABORTWCI_OPCODE | to(t) | ra(a) | sh1620(si) | rc(1)); }
inline void Assembler::tabortdc_(int t, Register a, Register b) { emit_int32( TABORTDC_OPCODE | to(t) | ra(a) | rb(b) | rc(1)); }
diff --git a/hotspot/src/cpu/ppc/vm/interp_masm_ppc_64.cpp b/hotspot/src/cpu/ppc/vm/interp_masm_ppc_64.cpp
index dec0d9732a8..9cb22c11433 100644
--- a/hotspot/src/cpu/ppc/vm/interp_masm_ppc_64.cpp
+++ b/hotspot/src/cpu/ppc/vm/interp_masm_ppc_64.cpp
@@ -1,6 +1,6 @@
/*
- * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved.
- * Copyright 2012, 2014 SAP AG. All rights reserved.
+ * Copyright (c) 2003, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright 2012, 2015 SAP AG. 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
@@ -1712,7 +1712,7 @@ void InterpreterMacroAssembler::profile_obj_type(Register obj, Register mdo_addr
andi_(R0, klass, TypeEntries::type_unknown);
// Already unknown. Nothing to do anymore.
//bne(CCR0, do_nothing);
- crorc(/*CCR0 eq*/2, /*CCR1 eq*/4+2, /*CCR0 eq*/2); // cr0 eq = cr1 eq or cr0 ne
+ crorc(CCR0, Assembler::equal, CCR1, Assembler::equal); // cr0 eq = cr1 eq or cr0 ne
beq(CCR0, do_nothing);
clrrdi_(R0, tmp, exact_log2(-TypeEntries::type_mask));
@@ -1826,9 +1826,9 @@ void InterpreterMacroAssembler::profile_return_type(Register ret, Register tmp1,
lbz(tmp2, Method::intrinsic_id_offset_in_bytes(), R19_method);
cmpwi(CCR0, tmp1, Bytecodes::_invokedynamic);
cmpwi(CCR1, tmp1, Bytecodes::_invokehandle);
- cror(/*CR0 eq*/2, /*CR1 eq*/4+2, /*CR0 eq*/2);
+ cror(CCR0, Assembler::equal, CCR1, Assembler::equal);
cmpwi(CCR1, tmp2, vmIntrinsics::_compiledLambdaForm);
- cror(/*CR0 eq*/2, /*CR1 eq*/4+2, /*CR0 eq*/2);
+ cror(CCR0, Assembler::equal, CCR1, Assembler::equal);
bne(CCR0, profile_continue);
}
diff --git a/hotspot/src/cpu/ppc/vm/stubGenerator_ppc.cpp b/hotspot/src/cpu/ppc/vm/stubGenerator_ppc.cpp
index 0f8c752cacc..43258ce2a9a 100644
--- a/hotspot/src/cpu/ppc/vm/stubGenerator_ppc.cpp
+++ b/hotspot/src/cpu/ppc/vm/stubGenerator_ppc.cpp
@@ -1,6 +1,6 @@
/*
- * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
- * Copyright 2012, 2014 SAP AG. All rights reserved.
+ * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright 2012, 2015 SAP AG. 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
@@ -1079,7 +1079,7 @@ class StubGenerator: public StubCodeGenerator {
__ sldi(tmp2, R5_ARG3, log2_elem_size); // size in bytes
__ cmpld(CCR0, R3_ARG1, R4_ARG2); // Use unsigned comparison!
__ cmpld(CCR1, tmp1, tmp2);
- __ crand(/*CCR0 lt*/0, /*CCR1 lt*/4+0, /*CCR0 lt*/0);
+ __ crand(CCR0, Assembler::less, CCR1, Assembler::less);
__ blt(CCR0, l_overlap); // Src before dst and distance smaller than size.
// need to copy forwards
diff --git a/hotspot/src/cpu/ppc/vm/templateTable_ppc_64.cpp b/hotspot/src/cpu/ppc/vm/templateTable_ppc_64.cpp
index 40cd339c2c0..69c1e0d1be1 100644
--- a/hotspot/src/cpu/ppc/vm/templateTable_ppc_64.cpp
+++ b/hotspot/src/cpu/ppc/vm/templateTable_ppc_64.cpp
@@ -1,6 +1,6 @@
/*
- * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
- * Copyright 2013, 2014 SAP AG. All rights reserved.
+ * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright 2013, 2015 SAP AG. 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
@@ -335,11 +335,11 @@ void TemplateTable::ldc(bool wide) {
__ cmpwi(CCR0, Rscratch2, JVM_CONSTANT_UnresolvedClass); // Unresolved class?
__ cmpwi(CCR1, Rscratch2, JVM_CONSTANT_UnresolvedClassInError); // Unresolved class in error state?
- __ cror(/*CR0 eq*/2, /*CR1 eq*/4+2, /*CR0 eq*/2);
+ __ cror(CCR0, Assembler::equal, CCR1, Assembler::equal);
// Resolved class - need to call vm to get java mirror of the class.
__ cmpwi(CCR1, Rscratch2, JVM_CONSTANT_Class);
- __ crnor(/*CR0 eq*/2, /*CR1 eq*/4+2, /*CR0 eq*/2); // Neither resolved class nor unresolved case from above?
+ __ crnor(CCR0, Assembler::equal, CCR1, Assembler::equal); // Neither resolved class nor unresolved case from above?
__ beq(CCR0, notClass);
__ li(R4, wide ? 1 : 0);
@@ -2611,7 +2611,7 @@ void TemplateTable::jvmti_post_field_mod(Register Rcache, Register Rscratch, boo
__ cmpwi(CCR0, Rflags, ltos);
__ cmpwi(CCR1, Rflags, dtos);
__ addi(base, R15_esp, Interpreter::expr_offset_in_bytes(1));
- __ crnor(/*CR0 eq*/2, /*CR1 eq*/4+2, /*CR0 eq*/2);
+ __ crnor(CCR0, Assembler::equal, CCR1, Assembler::equal);
__ beq(CCR0, is_one_slot);
__ addi(base, R15_esp, Interpreter::expr_offset_in_bytes(2));
__ bind(is_one_slot);
@@ -3563,7 +3563,7 @@ void TemplateTable::_new() {
// Make sure klass does not have has_finalizer, or is abstract, or interface or java/lang/Class.
__ andi_(R0, Rinstance_size, Klass::_lh_instance_slow_path_bit); // slow path bit equals 0?
- __ crnand(/*CR0 eq*/2, /*CR1 eq*/4+2, /*CR0 eq*/2); // slow path bit set or not fully initialized?
+ __ crnand(CCR0, Assembler::equal, CCR1, Assembler::equal); // slow path bit set or not fully initialized?
__ beq(CCR0, Lslow_case);
// --------------------------------------------------------------------------
diff --git a/hotspot/src/cpu/x86/vm/macroAssembler_x86.cpp b/hotspot/src/cpu/x86/vm/macroAssembler_x86.cpp
index a6a5b43c07b..24587840f98 100644
--- a/hotspot/src/cpu/x86/vm/macroAssembler_x86.cpp
+++ b/hotspot/src/cpu/x86/vm/macroAssembler_x86.cpp
@@ -3184,7 +3184,24 @@ void MacroAssembler::pow_or_exp(bool is_exp, int num_fpu_regs_in_use) {
jmp(done);
} else {
// Stack: X Y
- Label x_negative, y_odd;
+ Label x_negative, y_not_2;
+
+ static double two = 2.0;
+ ExternalAddress two_addr((address)&two);
+
+ // constant maybe too far on 64 bit
+ lea(tmp2, two_addr);
+ fld_d(Address(tmp2, 0)); // Stack: 2 X Y
+ fcmp(tmp, 2, true, false); // Stack: X Y
+ jcc(Assembler::parity, y_not_2);
+ jcc(Assembler::notEqual, y_not_2);
+
+ fxch(); fpop(); // Stack: X
+ fmul(0); // Stack: X*X
+
+ jmp(done);
+
+ bind(y_not_2);
fldz(); // Stack: 0 X Y
fcmp(tmp, 1, true, false); // Stack: X Y
diff --git a/hotspot/src/share/vm/compiler/compileBroker.cpp b/hotspot/src/share/vm/compiler/compileBroker.cpp
index 2b22da1f705..4f0def89a20 100644
--- a/hotspot/src/share/vm/compiler/compileBroker.cpp
+++ b/hotspot/src/share/vm/compiler/compileBroker.cpp
@@ -252,7 +252,7 @@ CompileTask* CompileTask::allocate() {
} else {
task = new CompileTask();
DEBUG_ONLY(_num_allocated_tasks++;)
- assert (_num_allocated_tasks < 10000, "Leaking compilation tasks?");
+ assert (WhiteBoxAPI || _num_allocated_tasks < 10000, "Leaking compilation tasks?");
task->set_next(NULL);
task->set_is_free(true);
}
diff --git a/hotspot/src/share/vm/compiler/compilerOracle.cpp b/hotspot/src/share/vm/compiler/compilerOracle.cpp
index b733305666b..a6351be1783 100644
--- a/hotspot/src/share/vm/compiler/compilerOracle.cpp
+++ b/hotspot/src/share/vm/compiler/compilerOracle.cpp
@@ -105,7 +105,6 @@ class MethodMatcher : public CHeapObj {
tty->print(".");
print_symbol(method_name(), _method_mode);
if (signature() != NULL) {
- tty->print(" ");
signature()->print_symbol_on(tty);
}
}
@@ -467,43 +466,85 @@ static OracleCommand parse_command_name(const char * line, int* bytes_read) {
return UnknownCommand;
}
-
static void usage() {
- tty->print_cr(" CompileCommand and the CompilerOracle allows simple control over");
- tty->print_cr(" what's allowed to be compiled. The standard supported directives");
- tty->print_cr(" are exclude and compileonly. The exclude directive stops a method");
- tty->print_cr(" from being compiled and compileonly excludes all methods except for");
- tty->print_cr(" the ones mentioned by compileonly directives. The basic form of");
- tty->print_cr(" all commands is a command name followed by the name of the method");
- tty->print_cr(" in one of two forms: the standard class file format as in");
- tty->print_cr(" class/name.methodName or the PrintCompilation format");
- tty->print_cr(" class.name::methodName. The method name can optionally be followed");
- tty->print_cr(" by a space then the signature of the method in the class file");
- tty->print_cr(" format. Otherwise the directive applies to all methods with the");
- tty->print_cr(" same name and class regardless of signature. Leading and trailing");
- tty->print_cr(" *'s in the class and/or method name allows a small amount of");
- tty->print_cr(" wildcarding. ");
tty->cr();
- tty->print_cr(" Examples:");
+ tty->print_cr("The CompileCommand option enables the user of the JVM to control specific");
+ tty->print_cr("behavior of the dynamic compilers. Many commands require a pattern that defines");
+ tty->print_cr("the set of methods the command shall be applied to. The CompileCommand");
+ tty->print_cr("option provides the following commands:");
tty->cr();
- tty->print_cr(" exclude java/lang/StringBuffer.append");
- tty->print_cr(" compileonly java/lang/StringBuffer.toString ()Ljava/lang/String;");
- tty->print_cr(" exclude java/lang/String*.*");
- tty->print_cr(" exclude *.toString");
-}
+ tty->print_cr(" break, - debug breakpoint in compiler and in generated code");
+ tty->print_cr(" print, - print assembly");
+ tty->print_cr(" exclude, - don't compile or inline");
+ tty->print_cr(" inline, - always inline");
+ tty->print_cr(" dontinline, - don't inline");
+ tty->print_cr(" compileonly, - compile only");
+ tty->print_cr(" log, - log compilation");
+ tty->print_cr(" option,,, ,");
+ tty->print_cr(" - set value of custom option");
+ tty->print_cr(" option,,");
+ tty->print_cr(" - shorthand for setting boolean flag");
+ tty->print_cr(" quiet - silence the compile command output");
+ tty->print_cr(" help - print this text");
+ tty->cr();
+ tty->print_cr("The preferred format for the method matching pattern is:");
+ tty->print_cr(" package/Class.method()");
+ tty->cr();
+ tty->print_cr("For backward compatibility this form is also allowed:");
+ tty->print_cr(" package.Class::method()");
+ tty->cr();
+ tty->print_cr("The signature can be separated by an optional whitespace or comma:");
+ tty->print_cr(" package/Class.method ()");
+ tty->cr();
+ tty->print_cr("The class and method identifier can be used together with leading or");
+ tty->print_cr("trailing *'s for a small amount of wildcarding:");
+ tty->print_cr(" *ackage/Clas*.*etho*()");
+ tty->cr();
+ tty->print_cr("It is possible to use more than one CompileCommand on the command line:");
+ tty->print_cr(" -XX:CompileCommand=exclude,java/*.* -XX:CompileCommand=log,java*.*");
+ tty->cr();
+ tty->print_cr("The CompileCommands can be loaded from a file with the flag");
+ tty->print_cr("-XX:CompileCommandFile= or be added to the file '.hotspot_compiler'");
+ tty->print_cr("Use the same format in the file as the argument to the CompileCommand flag.");
+ tty->print_cr("Add one command on each line.");
+ tty->print_cr(" exclude java/*.*");
+ tty->print_cr(" option java/*.* ReplayInline");
+ tty->cr();
+ tty->print_cr("The following commands have conflicting behavior: 'exclude', 'inline', 'dontinline',");
+ tty->print_cr("and 'compileonly'. There is no priority of commands. Applying (a subset of) these");
+ tty->print_cr("commands to the same method results in undefined behavior.");
+ tty->cr();
+};
+// The JVM specification defines the allowed characters.
+// Tokens that are disallowed by the JVM specification can have
+// a meaning to the parser so we need to include them here.
+// The parser does not enforce all rules of the JVMS - a successful parse
+// does not mean that it is an allowed name. Illegal names will
+// be ignored since they never can match a class or method.
+//
+// '\0' and 0xf0-0xff are disallowed in constant string values
+// 0x20 ' ', 0x09 '\t' and, 0x2c ',' are used in the matching
+// 0x5b '[' and 0x5d ']' can not be used because of the matcher
+// 0x28 '(' and 0x29 ')' are used for the signature
+// 0x2e '.' is always replaced before the matching
+// 0x2f '/' is only used in the class name as package separator
-// The characters allowed in a class or method name. All characters > 0x7f
-// are allowed in order to handle obfuscated class files (e.g. Volano)
-#define RANGEBASE "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789$_<>" \
- "\x80\x81\x82\x83\x84\x85\x86\x87\x88\x89\x8a\x8b\x8c\x8d\x8e\x8f" \
- "\x90\x91\x92\x93\x94\x95\x96\x97\x98\x99\x9a\x9b\x9c\x9d\x9e\x9f" \
- "\xa0\xa1\xa2\xa3\xa4\xa5\xa6\xa7\xa8\xa9\xaa\xab\xac\xad\xae\xaf" \
- "\xb0\xb1\xb2\xb3\xb4\xb5\xb6\xb7\xb8\xb9\xba\xbb\xbc\xbd\xbe\xbf" \
- "\xc0\xc1\xc2\xc3\xc4\xc5\xc6\xc7\xc8\xc9\xca\xcb\xcc\xcd\xce\xcf" \
- "\xd0\xd1\xd2\xd3\xd4\xd5\xd6\xd7\xd8\xd9\xda\xdb\xdc\xdd\xde\xdf" \
- "\xe0\xe1\xe2\xe3\xe4\xe5\xe6\xe7\xe8\xe9\xea\xeb\xec\xed\xee\xef" \
- "\xf0\xf1\xf2\xf3\xf4\xf5\xf6\xf7\xf8\xf9\xfa\xfb\xfc\xfd\xfe\xff"
+#define RANGEBASE "\x1\x2\x3\x4\x5\x6\x7\x8\xa\xb\xc\xd\xe\xf" \
+ "\x10\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f" \
+ "\x21\x22\x23\x24\x25\x26\x27\x2a\x2b\x2c\x2d" \
+ "\x30\x31\x32\x33\x34\x35\x36\x37\x38\x39\x3a\x3b\x3c\x3d\x3e\x3f" \
+ "\x40\x41\x42\x43\x44\x45\x46\x47\x48\x49\x4a\x4b\x4c\x4d\x4e\x4f" \
+ "\x50\x51\x52\x53\x54\x55\x56\x57\x58\x59\x5a\x5c\x5e\x5f" \
+ "\x60\x61\x62\x63\x64\x65\x66\x67\x68\x69\x6a\x6b\x6c\x6d\x6e\x6f" \
+ "\x70\x71\x72\x73\x74\x75\x76\x77\x78\x79\x7a\x7b\x7c\x7d\x7e\x7f" \
+ "\x80\x81\x82\x83\x84\x85\x86\x87\x88\x89\x8a\x8b\x8c\x8d\x8e\x8f" \
+ "\x90\x91\x92\x93\x94\x95\x96\x97\x98\x99\x9a\x9b\x9c\x9d\x9e\x9f" \
+ "\xa0\xa1\xa2\xa3\xa4\xa5\xa6\xa7\xa8\xa9\xaa\xab\xac\xad\xae\xaf" \
+ "\xb0\xb1\xb2\xb3\xb4\xb5\xb6\xb7\xb8\xb9\xba\xbb\xbc\xbd\xbe\xbf" \
+ "\xc0\xc1\xc2\xc3\xc4\xc5\xc6\xc7\xc8\xc9\xca\xcb\xcc\xcd\xce\xcf" \
+ "\xd0\xd1\xd2\xd3\xd4\xd5\xd6\xd7\xd8\xd9\xda\xdb\xdc\xdd\xde\xdf" \
+ "\xe0\xe1\xe2\xe3\xe4\xe5\xe6\xe7\xe8\xe9\xea\xeb\xec\xed\xee\xef"
#define RANGE0 "[*" RANGEBASE "]"
#define RANGESLASH "[*" RANGEBASE "/]"
@@ -681,8 +722,9 @@ void CompilerOracle::parse_from_line(char* line) {
if (command == UnknownCommand) {
ttyLocker ttyl;
- tty->print_cr("CompilerOracle: unrecognized line");
+ tty->print_cr("CompileCommand: unrecognized command");
tty->print_cr(" \"%s\"", original_line);
+ CompilerOracle::print_tip();
return;
}
@@ -712,9 +754,17 @@ void CompilerOracle::parse_from_line(char* line) {
Symbol* signature = NULL;
line += bytes_read;
+
+ // Skip any leading spaces before signature
+ int whitespace_read = 0;
+ sscanf(line, "%*[ \t]%n", &whitespace_read);
+ if (whitespace_read > 0) {
+ line += whitespace_read;
+ }
+
// there might be a signature following the method.
// signatures always begin with ( so match that by hand
- if (1 == sscanf(line, "%*[ \t](%254[[);/" RANGEBASE "]%n", sig + 1, &bytes_read)) {
+ if (1 == sscanf(line, "(%254[[);/" RANGEBASE "]%n", sig + 1, &bytes_read)) {
sig[0] = '(';
line += bytes_read;
signature = SymbolTable::new_symbol(sig, CHECK);
@@ -740,7 +790,7 @@ void CompilerOracle::parse_from_line(char* line) {
if (match != NULL && !_quiet) {
// Print out the last match added
ttyLocker ttyl;
- tty->print("CompilerOracle: %s ", command_names[command]);
+ tty->print("CompileCommand: %s ", command_names[command]);
match->print();
}
line += bytes_read;
@@ -775,26 +825,36 @@ void CompilerOracle::parse_from_line(char* line) {
ttyLocker ttyl;
if (error_msg != NULL) {
// an error has happened
- tty->print_cr("CompilerOracle: unrecognized line");
+ tty->print_cr("CompileCommand: An error occured during parsing");
tty->print_cr(" \"%s\"", original_line);
if (error_msg != NULL) {
tty->print_cr("%s", error_msg);
}
+ CompilerOracle::print_tip();
+
} else {
// check for remaining characters
bytes_read = 0;
sscanf(line, "%*[ \t]%n", &bytes_read);
if (line[bytes_read] != '\0') {
- tty->print_cr("CompilerOracle: unrecognized line");
+ tty->print_cr("CompileCommand: Bad pattern");
tty->print_cr(" \"%s\"", original_line);
tty->print_cr(" Unrecognized text %s after command ", line);
+ CompilerOracle::print_tip();
} else if (match != NULL && !_quiet) {
- tty->print("CompilerOracle: %s ", command_names[command]);
+ tty->print("CompileCommand: %s ", command_names[command]);
match->print();
}
}
}
+void CompilerOracle::print_tip() {
+ tty->cr();
+ tty->print_cr("Usage: '-XX:CompileCommand=command,\"package/Class.method()\"'");
+ tty->print_cr("Use: '-XX:CompileCommand=help' for more information.");
+ tty->cr();
+}
+
static const char* default_cc_file = ".hotspot_compiler";
static const char* cc_file() {
diff --git a/hotspot/src/share/vm/compiler/compilerOracle.hpp b/hotspot/src/share/vm/compiler/compilerOracle.hpp
index 8a5981ff1f8..b4b2974ce21 100644
--- a/hotspot/src/share/vm/compiler/compilerOracle.hpp
+++ b/hotspot/src/share/vm/compiler/compilerOracle.hpp
@@ -34,6 +34,7 @@
class CompilerOracle : AllStatic {
private:
static bool _quiet;
+ static void print_tip();
public:
diff --git a/hotspot/src/share/vm/gc_implementation/g1/concurrentMark.cpp b/hotspot/src/share/vm/gc_implementation/g1/concurrentMark.cpp
index 6bb8b5de63c..0119858fe5b 100644
--- a/hotspot/src/share/vm/gc_implementation/g1/concurrentMark.cpp
+++ b/hotspot/src/share/vm/gc_implementation/g1/concurrentMark.cpp
@@ -1910,7 +1910,6 @@ public:
}
void work(uint worker_id) {
- double start = os::elapsedTime();
FreeRegionList local_cleanup_list("Local Cleanup List");
HRRSCleanupTask hrrs_cleanup_task;
G1NoteEndOfConcMarkClosure g1_note_end(_g1h, &local_cleanup_list,
diff --git a/hotspot/src/share/vm/gc_implementation/g1/g1CollectedHeap.cpp b/hotspot/src/share/vm/gc_implementation/g1/g1CollectedHeap.cpp
index 335ba2265d5..0d81bbfec83 100644
--- a/hotspot/src/share/vm/gc_implementation/g1/g1CollectedHeap.cpp
+++ b/hotspot/src/share/vm/gc_implementation/g1/g1CollectedHeap.cpp
@@ -1229,7 +1229,6 @@ bool G1CollectedHeap::do_collection(bool explicit_gc,
TraceCollectorStats tcs(g1mm()->full_collection_counters());
TraceMemoryManagerStats tms(true /* fullGC */, gc_cause());
- double start = os::elapsedTime();
g1_policy()->record_full_collection_start();
// Note: When we have a more flexible GC logging framework that
@@ -1436,7 +1435,6 @@ bool G1CollectedHeap::do_collection(bool explicit_gc,
_allocator->init_mutator_alloc_region();
- double end = os::elapsedTime();
g1_policy()->record_full_collection_end();
if (G1Log::fine()) {
diff --git a/hotspot/src/share/vm/gc_implementation/g1/g1CollectedHeap.hpp b/hotspot/src/share/vm/gc_implementation/g1/g1CollectedHeap.hpp
index ab79bcd05ad..3286453095c 100644
--- a/hotspot/src/share/vm/gc_implementation/g1/g1CollectedHeap.hpp
+++ b/hotspot/src/share/vm/gc_implementation/g1/g1CollectedHeap.hpp
@@ -56,7 +56,6 @@ class HRRSCleanupTask;
class GenerationSpec;
class OopsInHeapRegionClosure;
class G1KlassScanClosure;
-class G1ScanHeapEvacClosure;
class ObjectClosure;
class SpaceClosure;
class CompactibleSpaceClosure;
diff --git a/hotspot/src/share/vm/gc_implementation/g1/g1CollectorPolicy.cpp b/hotspot/src/share/vm/gc_implementation/g1/g1CollectorPolicy.cpp
index 5cc47a24964..175c5eb9448 100644
--- a/hotspot/src/share/vm/gc_implementation/g1/g1CollectorPolicy.cpp
+++ b/hotspot/src/share/vm/gc_implementation/g1/g1CollectorPolicy.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2001, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2015, 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
@@ -153,14 +153,6 @@ G1CollectorPolicy::G1CollectorPolicy() :
_inc_cset_predicted_elapsed_time_ms(0.0),
_inc_cset_predicted_elapsed_time_ms_diffs(0.0),
-#ifdef _MSC_VER // the use of 'this' below gets a warning, make it go away
-#pragma warning( disable:4355 ) // 'this' : used in base member initializer list
-#endif // _MSC_VER
-
- _short_lived_surv_rate_group(new SurvRateGroup(this, "Short Lived",
- G1YoungSurvRateNumRegionsSummary)),
- _survivor_surv_rate_group(new SurvRateGroup(this, "Survivor",
- G1YoungSurvRateNumRegionsSummary)),
// add here any more surv rate groups
_recorded_survivor_regions(0),
_recorded_survivor_head(NULL),
@@ -169,6 +161,22 @@ G1CollectorPolicy::G1CollectorPolicy() :
_gc_overhead_perc(0.0) {
+ uintx confidence_perc = G1ConfidencePercent;
+ // Put an artificial ceiling on this so that it's not set to a silly value.
+ if (confidence_perc > 100) {
+ confidence_perc = 100;
+ warning("G1ConfidencePercent is set to a value that is too large, "
+ "it's been updated to %u", confidence_perc);
+ }
+ // '_sigma' must be initialized before the SurvRateGroups below because they
+ // indirecty access '_sigma' trough the 'this' pointer in their constructor.
+ _sigma = (double) confidence_perc / 100.0;
+
+ _short_lived_surv_rate_group =
+ new SurvRateGroup(this, "Short Lived", G1YoungSurvRateNumRegionsSummary);
+ _survivor_surv_rate_group =
+ new SurvRateGroup(this, "Survivor", G1YoungSurvRateNumRegionsSummary);
+
// Set up the region size and associated fields. Given that the
// policy is created before the heap, we have to set this up here,
// so it's done as soon as possible.
@@ -283,15 +291,6 @@ G1CollectorPolicy::G1CollectorPolicy() :
double time_slice = (double) GCPauseIntervalMillis / 1000.0;
_mmu_tracker = new G1MMUTrackerQueue(time_slice, max_gc_time);
- uintx confidence_perc = G1ConfidencePercent;
- // Put an artificial ceiling on this so that it's not set to a silly value.
- if (confidence_perc > 100) {
- confidence_perc = 100;
- warning("G1ConfidencePercent is set to a value that is too large, "
- "it's been updated to %u", confidence_perc);
- }
- _sigma = (double) confidence_perc / 100.0;
-
// start conservatively (around 50ms is about right)
_concurrent_mark_remark_times_ms->add(0.05);
_concurrent_mark_cleanup_times_ms->add(0.20);
diff --git a/hotspot/src/share/vm/gc_implementation/g1/g1MarkSweep.hpp b/hotspot/src/share/vm/gc_implementation/g1/g1MarkSweep.hpp
index cdde980d306..e8d8c307676 100644
--- a/hotspot/src/share/vm/gc_implementation/g1/g1MarkSweep.hpp
+++ b/hotspot/src/share/vm/gc_implementation/g1/g1MarkSweep.hpp
@@ -46,9 +46,6 @@ class ReferenceProcessor;
class G1PrepareCompactClosure;
class G1MarkSweep : AllStatic {
- friend class VM_G1MarkSweep;
- friend class Scavenge;
-
public:
static void invoke_at_safepoint(ReferenceProcessor* rp,
diff --git a/hotspot/src/share/vm/gc_implementation/g1/g1PageBasedVirtualSpace.cpp b/hotspot/src/share/vm/gc_implementation/g1/g1PageBasedVirtualSpace.cpp
index d972b5cc71c..008002566da 100644
--- a/hotspot/src/share/vm/gc_implementation/g1/g1PageBasedVirtualSpace.cpp
+++ b/hotspot/src/share/vm/gc_implementation/g1/g1PageBasedVirtualSpace.cpp
@@ -45,7 +45,8 @@
#include "utilities/bitMap.inline.hpp"
G1PageBasedVirtualSpace::G1PageBasedVirtualSpace() : _low_boundary(NULL),
- _high_boundary(NULL), _committed(), _page_size(0), _special(false), _executable(false) {
+ _high_boundary(NULL), _committed(), _page_size(0), _special(false),
+ _dirty(), _executable(false) {
}
bool G1PageBasedVirtualSpace::initialize_with_granularity(ReservedSpace rs, size_t page_size) {
@@ -66,6 +67,9 @@ bool G1PageBasedVirtualSpace::initialize_with_granularity(ReservedSpace rs, size
assert(_committed.size() == 0, "virtual space initialized more than once");
uintx size_in_bits = rs.size() / page_size;
_committed.resize(size_in_bits, /* in_resource_area */ false);
+ if (_special) {
+ _dirty.resize(size_in_bits, /* in_resource_area */ false);
+ }
return true;
}
@@ -84,6 +88,7 @@ void G1PageBasedVirtualSpace::release() {
_executable = false;
_page_size = 0;
_committed.resize(0, false);
+ _dirty.resize(0, false);
}
size_t G1PageBasedVirtualSpace::committed_size() const {
@@ -120,34 +125,43 @@ size_t G1PageBasedVirtualSpace::byte_size_for_pages(size_t num) {
return num * _page_size;
}
-MemRegion G1PageBasedVirtualSpace::commit(uintptr_t start, size_t size_in_pages) {
+bool G1PageBasedVirtualSpace::commit(uintptr_t start, size_t size_in_pages) {
// We need to make sure to commit all pages covered by the given area.
guarantee(is_area_uncommitted(start, size_in_pages), "Specified area is not uncommitted");
- if (!_special) {
+ bool zero_filled = true;
+ uintptr_t end = start + size_in_pages;
+
+ if (_special) {
+ // Check for dirty pages and update zero_filled if any found.
+ if (_dirty.get_next_one_offset(start,end) < end) {
+ zero_filled = false;
+ _dirty.clear_range(start, end);
+ }
+ } else {
os::commit_memory_or_exit(page_start(start), byte_size_for_pages(size_in_pages), _executable,
err_msg("Failed to commit pages from "SIZE_FORMAT" of length "SIZE_FORMAT, start, size_in_pages));
}
- _committed.set_range(start, start + size_in_pages);
+ _committed.set_range(start, end);
- MemRegion result((HeapWord*)page_start(start), byte_size_for_pages(size_in_pages) / HeapWordSize);
if (AlwaysPreTouch) {
- os::pretouch_memory((char*)result.start(), (char*)result.end());
+ os::pretouch_memory(page_start(start), page_start(end));
}
- return result;
+ return zero_filled;
}
-MemRegion G1PageBasedVirtualSpace::uncommit(uintptr_t start, size_t size_in_pages) {
+void G1PageBasedVirtualSpace::uncommit(uintptr_t start, size_t size_in_pages) {
guarantee(is_area_committed(start, size_in_pages), "checking");
- if (!_special) {
+ if (_special) {
+ // Mark that memory is dirty. If committed again the memory might
+ // need to be cleared explicitly.
+ _dirty.set_range(start, start + size_in_pages);
+ } else {
os::uncommit_memory(page_start(start), byte_size_for_pages(size_in_pages));
}
_committed.clear_range(start, start + size_in_pages);
-
- MemRegion result((HeapWord*)page_start(start), byte_size_for_pages(size_in_pages) / HeapWordSize);
- return result;
}
bool G1PageBasedVirtualSpace::contains(const void* p) const {
@@ -157,7 +171,7 @@ bool G1PageBasedVirtualSpace::contains(const void* p) const {
#ifndef PRODUCT
void G1PageBasedVirtualSpace::print_on(outputStream* out) {
out->print ("Virtual space:");
- if (special()) out->print(" (pinned in memory)");
+ if (_special) out->print(" (pinned in memory)");
out->cr();
out->print_cr(" - committed: " SIZE_FORMAT, committed_size());
out->print_cr(" - reserved: " SIZE_FORMAT, reserved_size());
diff --git a/hotspot/src/share/vm/gc_implementation/g1/g1PageBasedVirtualSpace.hpp b/hotspot/src/share/vm/gc_implementation/g1/g1PageBasedVirtualSpace.hpp
index 972a69b2e8f..fb2c78415f9 100644
--- a/hotspot/src/share/vm/gc_implementation/g1/g1PageBasedVirtualSpace.hpp
+++ b/hotspot/src/share/vm/gc_implementation/g1/g1PageBasedVirtualSpace.hpp
@@ -49,6 +49,12 @@ class G1PageBasedVirtualSpace VALUE_OBJ_CLASS_SPEC {
// Bitmap used for verification of commit/uncommit operations.
BitMap _committed;
+ // Bitmap used to keep track of which pages are dirty or not for _special
+ // spaces. This is needed because for those spaces the underlying memory
+ // will only be zero filled the first time it is committed. Calls to commit
+ // will use this bitmap and return whether or not the memory is zero filled.
+ BitMap _dirty;
+
// Indicates that the entire space has been committed and pinned in memory,
// os::commit_memory() or os::uncommit_memory() have no function.
bool _special;
@@ -71,12 +77,11 @@ class G1PageBasedVirtualSpace VALUE_OBJ_CLASS_SPEC {
public:
// Commit the given area of pages starting at start being size_in_pages large.
- MemRegion commit(uintptr_t start, size_t size_in_pages);
+ // Returns true if the given area is zero filled upon completion.
+ bool commit(uintptr_t start, size_t size_in_pages);
// Uncommit the given area of pages starting at start being size_in_pages large.
- MemRegion uncommit(uintptr_t start, size_t size_in_pages);
-
- bool special() const { return _special; }
+ void uncommit(uintptr_t start, size_t size_in_pages);
// Initialization
G1PageBasedVirtualSpace();
diff --git a/hotspot/src/share/vm/gc_implementation/g1/g1RegionToSpaceMapper.cpp b/hotspot/src/share/vm/gc_implementation/g1/g1RegionToSpaceMapper.cpp
index 41eb0265dbf..68d967c764a 100644
--- a/hotspot/src/share/vm/gc_implementation/g1/g1RegionToSpaceMapper.cpp
+++ b/hotspot/src/share/vm/gc_implementation/g1/g1RegionToSpaceMapper.cpp
@@ -67,9 +67,9 @@ class G1RegionsLargerThanCommitSizeMapper : public G1RegionToSpaceMapper {
}
virtual void commit_regions(uintptr_t start_idx, size_t num_regions) {
- _storage.commit(start_idx * _pages_per_region, num_regions * _pages_per_region);
+ bool zero_filled = _storage.commit(start_idx * _pages_per_region, num_regions * _pages_per_region);
_commit_map.set_range(start_idx, start_idx + num_regions);
- fire_on_commit(start_idx, num_regions, true);
+ fire_on_commit(start_idx, num_regions, zero_filled);
}
virtual void uncommit_regions(uintptr_t start_idx, size_t num_regions) {
@@ -117,8 +117,7 @@ class G1RegionsSmallerThanCommitSizeMapper : public G1RegionToSpaceMapper {
uint old_refcount = _refcounts.get_by_index(idx);
bool zero_filled = false;
if (old_refcount == 0) {
- _storage.commit(idx, 1);
- zero_filled = true;
+ zero_filled = _storage.commit(idx, 1);
}
_refcounts.set_by_index(idx, old_refcount + 1);
_commit_map.set_bit(i);
diff --git a/hotspot/src/share/vm/gc_implementation/g1/g1RemSet.hpp b/hotspot/src/share/vm/gc_implementation/g1/g1RemSet.hpp
index 468d109803b..fb9d348789e 100644
--- a/hotspot/src/share/vm/gc_implementation/g1/g1RemSet.hpp
+++ b/hotspot/src/share/vm/gc_implementation/g1/g1RemSet.hpp
@@ -31,7 +31,6 @@
// collection set.
class G1CollectedHeap;
-class CardTableModRefBarrierSet;
class ConcurrentG1Refine;
class G1ParPushHeapRSClosure;
diff --git a/hotspot/src/share/vm/memory/heap.cpp b/hotspot/src/share/vm/memory/heap.cpp
index 5ba099e78e8..5501700312e 100644
--- a/hotspot/src/share/vm/memory/heap.cpp
+++ b/hotspot/src/share/vm/memory/heap.cpp
@@ -279,10 +279,12 @@ size_t CodeHeap::alignment_offset() const {
return sizeof(HeapBlock) & (_segment_size - 1);
}
-// Finds the next free heapblock. If the current one is free, that it returned
-void* CodeHeap::next_free(HeapBlock* b) const {
- // Since free blocks are merged, there is max. on free block
- // between two used ones
+// Returns the current block if available and used.
+// If not, it returns the subsequent block (if available), NULL otherwise.
+// Free blocks are merged, therefore there is at most one free block
+// between two used ones. As a result, the subsequent block (if available) is
+// guaranteed to be used.
+void* CodeHeap::next_used(HeapBlock* b) const {
if (b != NULL && b->free()) b = next_block(b);
assert(b == NULL || !b->free(), "must be in use or at end of heap");
return (b == NULL) ? NULL : b->allocated_space();
diff --git a/hotspot/src/share/vm/memory/heap.hpp b/hotspot/src/share/vm/memory/heap.hpp
index 4fdbeabbfc3..45b43ce06c1 100644
--- a/hotspot/src/share/vm/memory/heap.hpp
+++ b/hotspot/src/share/vm/memory/heap.hpp
@@ -123,7 +123,7 @@ class CodeHeap : public CHeapObj {
FreeBlock* search_freelist(size_t length);
// Iteration helpers
- void* next_free(HeapBlock* b) const;
+ void* next_used(HeapBlock* b) const;
HeapBlock* first_block() const;
HeapBlock* next_block(HeapBlock* b) const;
HeapBlock* block_start(void* p) const;
@@ -158,9 +158,9 @@ class CodeHeap : public CHeapObj {
int freelist_length() const { return _freelist_length; } // number of elements in the freelist
// returns the first block or NULL
- void* first() const { return next_free(first_block()); }
+ void* first() const { return next_used(first_block()); }
// returns the next block given a block p or NULL
- void* next(void* p) const { return next_free(next_block(block_start(p))); }
+ void* next(void* p) const { return next_used(next_block(block_start(p))); }
// Statistics
size_t capacity() const;
diff --git a/hotspot/src/share/vm/memory/metaspace.cpp b/hotspot/src/share/vm/memory/metaspace.cpp
index 88d49fc78bf..7ef45f4bb25 100644
--- a/hotspot/src/share/vm/memory/metaspace.cpp
+++ b/hotspot/src/share/vm/memory/metaspace.cpp
@@ -3840,11 +3840,13 @@ class TestVirtualSpaceNodeTest {
assert(cm.sum_free_chunks() == 2*MediumChunk, "sizes should add up");
}
- { // 4 pages of VSN is committed, some is used by chunks
+ const size_t page_chunks = 4 * (size_t)os::vm_page_size() / BytesPerWord;
+ // This doesn't work for systems with vm_page_size >= 16K.
+ if (page_chunks < MediumChunk) {
+ // 4 pages of VSN is committed, some is used by chunks
ChunkManager cm(SpecializedChunk, SmallChunk, MediumChunk);
VirtualSpaceNode vsn(vsn_test_size_bytes);
- const size_t page_chunks = 4 * (size_t)os::vm_page_size() / BytesPerWord;
- assert(page_chunks < MediumChunk, "Test expects medium chunks to be at least 4*page_size");
+
vsn.initialize();
vsn.expand_by(page_chunks, page_chunks);
vsn.get_chunk_vs(SmallChunk);
diff --git a/hotspot/src/share/vm/opto/cfgnode.hpp b/hotspot/src/share/vm/opto/cfgnode.hpp
index e795483e3cb..fc3235afecd 100644
--- a/hotspot/src/share/vm/opto/cfgnode.hpp
+++ b/hotspot/src/share/vm/opto/cfgnode.hpp
@@ -361,22 +361,36 @@ public:
#endif
};
-class IfTrueNode : public CProjNode {
+class IfProjNode : public CProjNode {
public:
- IfTrueNode( IfNode *ifnode ) : CProjNode(ifnode,1) {
+ IfProjNode(IfNode *ifnode, uint idx) : CProjNode(ifnode,idx) {}
+ virtual Node *Identity(PhaseTransform *phase);
+
+protected:
+ // Type of If input when this branch is always taken
+ virtual bool always_taken(const TypeTuple* t) const = 0;
+};
+
+class IfTrueNode : public IfProjNode {
+public:
+ IfTrueNode( IfNode *ifnode ) : IfProjNode(ifnode,1) {
init_class_id(Class_IfTrue);
}
virtual int Opcode() const;
- virtual Node *Identity( PhaseTransform *phase );
+
+protected:
+ virtual bool always_taken(const TypeTuple* t) const { return t == TypeTuple::IFTRUE; }
};
-class IfFalseNode : public CProjNode {
+class IfFalseNode : public IfProjNode {
public:
- IfFalseNode( IfNode *ifnode ) : CProjNode(ifnode,0) {
+ IfFalseNode( IfNode *ifnode ) : IfProjNode(ifnode,0) {
init_class_id(Class_IfFalse);
}
virtual int Opcode() const;
- virtual Node *Identity( PhaseTransform *phase );
+
+protected:
+ virtual bool always_taken(const TypeTuple* t) const { return t == TypeTuple::IFFALSE; }
};
diff --git a/hotspot/src/share/vm/opto/ifnode.cpp b/hotspot/src/share/vm/opto/ifnode.cpp
index 7b5f0d7b4be..493d4a021b8 100644
--- a/hotspot/src/share/vm/opto/ifnode.cpp
+++ b/hotspot/src/share/vm/opto/ifnode.cpp
@@ -1122,12 +1122,21 @@ void IfNode::dominated_by( Node *prev_dom, PhaseIterGVN *igvn ) {
//------------------------------Identity---------------------------------------
// If the test is constant & we match, then we are the input Control
-Node *IfTrueNode::Identity( PhaseTransform *phase ) {
+Node *IfProjNode::Identity(PhaseTransform *phase) {
// Can only optimize if cannot go the other way
const TypeTuple *t = phase->type(in(0))->is_tuple();
- return ( t == TypeTuple::IFNEITHER || t == TypeTuple::IFTRUE )
- ? in(0)->in(0) // IfNode control
- : this; // no progress
+ if (t == TypeTuple::IFNEITHER ||
+ // kill dead branch first otherwise the IfNode's control will
+ // have 2 control uses (the IfNode that doesn't go away because
+ // it still has uses and this branch of the
+ // If). Node::has_special_unique_user() will cause this node to
+ // be reprocessed once the dead branch is killed.
+ (always_taken(t) && in(0)->outcnt() == 1)) {
+ // IfNode control
+ return in(0)->in(0);
+ }
+ // no progress
+ return this;
}
//------------------------------dump_spec--------------------------------------
@@ -1195,13 +1204,3 @@ static IfNode* idealize_test(PhaseGVN* phase, IfNode* iff) {
// Progress
return iff;
}
-
-//------------------------------Identity---------------------------------------
-// If the test is constant & we match, then we are the input Control
-Node *IfFalseNode::Identity( PhaseTransform *phase ) {
- // Can only optimize if cannot go the other way
- const TypeTuple *t = phase->type(in(0))->is_tuple();
- return ( t == TypeTuple::IFNEITHER || t == TypeTuple::IFFALSE )
- ? in(0)->in(0) // IfNode control
- : this; // no progress
-}
diff --git a/hotspot/src/share/vm/opto/node.cpp b/hotspot/src/share/vm/opto/node.cpp
index 29cd82e4acc..8ed950a021e 100644
--- a/hotspot/src/share/vm/opto/node.cpp
+++ b/hotspot/src/share/vm/opto/node.cpp
@@ -1080,18 +1080,21 @@ bool Node::has_special_unique_user() const {
assert(outcnt() == 1, "match only for unique out");
Node* n = unique_out();
int op = Opcode();
- if( this->is_Store() ) {
+ if (this->is_Store()) {
// Condition for back-to-back stores folding.
return n->Opcode() == op && n->in(MemNode::Memory) == this;
} else if (this->is_Load()) {
// Condition for removing an unused LoadNode from the MemBarAcquire precedence input
return n->Opcode() == Op_MemBarAcquire;
- } else if( op == Op_AddL ) {
+ } else if (op == Op_AddL) {
// Condition for convL2I(addL(x,y)) ==> addI(convL2I(x),convL2I(y))
return n->Opcode() == Op_ConvL2I && n->in(1) == this;
- } else if( op == Op_SubI || op == Op_SubL ) {
+ } else if (op == Op_SubI || op == Op_SubL) {
// Condition for subI(x,subI(y,z)) ==> subI(addI(x,z),y)
return n->Opcode() == op && n->in(2) == this;
+ } else if (is_If() && (n->is_IfFalse() || n->is_IfTrue())) {
+ // See IfProjNode::Identity()
+ return true;
}
return false;
};
diff --git a/hotspot/src/share/vm/utilities/debug.hpp b/hotspot/src/share/vm/utilities/debug.hpp
index cdca3201069..85fae1733a5 100644
--- a/hotspot/src/share/vm/utilities/debug.hpp
+++ b/hotspot/src/share/vm/utilities/debug.hpp
@@ -209,21 +209,22 @@ void report_untested(const char* file, int line, const char* message);
void warning(const char* format, ...) ATTRIBUTE_PRINTF(1, 2);
-#ifdef ASSERT
-// Compile-time asserts.
-template struct StaticAssert;
-template <> struct StaticAssert {};
+// Compile-time asserts. Cond must be a compile-time constant expression that
+// is convertible to bool. STATIC_ASSERT() can be used anywhere a declaration
+// may appear.
+//
+// Implementation Note: STATIC_ASSERT_FAILURE provides a value member
+// rather than type member that could be used directly in the typedef, because
+// a type member would require conditional use of "typename", depending on
+// whether Cond is dependent or not. The use of a value member leads to the
+// use of an array type.
-// Only StaticAssert is defined, so if cond evaluates to false we get
-// a compile time exception when trying to use StaticAssert.
-#define STATIC_ASSERT(cond) \
- do { \
- StaticAssert<(cond)> DUMMY_STATIC_ASSERT; \
- (void)DUMMY_STATIC_ASSERT; /* ignore */ \
- } while (false)
-#else
-#define STATIC_ASSERT(cond)
-#endif
+template struct STATIC_ASSERT_FAILURE;
+template<> struct STATIC_ASSERT_FAILURE { enum { value = 1 }; };
+
+#define STATIC_ASSERT(Cond) \
+ typedef char STATIC_ASSERT_FAILURE_ ## __LINE__ [ \
+ STATIC_ASSERT_FAILURE< (Cond) >::value ]
// out of shared space reporting
enum SharedSpaceType {
diff --git a/hotspot/test/TEST.groups b/hotspot/test/TEST.groups
index 31402ea90dd..8c52e3ac175 100644
--- a/hotspot/test/TEST.groups
+++ b/hotspot/test/TEST.groups
@@ -232,7 +232,8 @@ needs_g1gc = \
gc/g1/ \
gc/metaspace/G1AddMetaspaceDependency.java \
gc/metaspace/TestMetaspacePerfCounters.java \
- gc/startup_warnings/TestG1.java
+ gc/startup_warnings/TestG1.java \
+ gc/whitebox/TestConcMarkCycleWB.java
# All tests that explicitly set the serial GC
#
@@ -357,7 +358,8 @@ hotspot_compiler_2 = \
compiler/inlining/ \
compiler/integerArithmetic/ \
compiler/interpreter/ \
- -compiler/codegen/7184394
+ -compiler/codegen/7184394 \
+ -compiler/codecache/stress
hotspot_compiler_3 = \
compiler/intrinsics/ \
diff --git a/hotspot/test/compiler/codecache/jmx/PoolsIndependenceTest.java b/hotspot/test/compiler/codecache/jmx/PoolsIndependenceTest.java
index a2ea70a1fe2..04551a2d2df 100644
--- a/hotspot/test/compiler/codecache/jmx/PoolsIndependenceTest.java
+++ b/hotspot/test/compiler/codecache/jmx/PoolsIndependenceTest.java
@@ -37,6 +37,7 @@ import sun.hotspot.code.BlobType;
/*
* @test PoolsIndependenceTest
+ * @ignore 8068385
* @library /testlibrary /../../test/lib
* @build PoolsIndependenceTest
* @run main ClassFileInstaller sun.hotspot.WhiteBox
diff --git a/hotspot/test/compiler/codecache/stress/CodeCacheStressRunner.java b/hotspot/test/compiler/codecache/stress/CodeCacheStressRunner.java
new file mode 100644
index 00000000000..1a7ae636097
--- /dev/null
+++ b/hotspot/test/compiler/codecache/stress/CodeCacheStressRunner.java
@@ -0,0 +1,52 @@
+/*
+ * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * 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.
+ *
+ */
+
+import com.oracle.java.testlibrary.TimeLimitedRunner;
+import com.oracle.java.testlibrary.Utils;
+
+public class CodeCacheStressRunner {
+ private final Runnable action;
+ public CodeCacheStressRunner(Runnable action) {
+ this.action = action;
+ }
+
+ protected final void runTest() {
+ Helper.startInfiniteLoopThread(action);
+ try {
+ // adjust timeout and substract vm init and exit time
+ long timeout = Utils.adjustTimeout(Utils.DEFAULT_TEST_TIMEOUT);
+ timeout *= 0.9;
+ new TimeLimitedRunner(timeout, 2.0d, this::test).call();
+ } catch (Exception e) {
+ throw new Error("Exception occurred during test execution", e);
+ }
+ }
+
+ private boolean test() {
+ Helper.TestCase obj = Helper.TestCase.get();
+ Helper.callMethod(obj.getCallable(), obj.expectedValue());
+ return true;
+ }
+
+}
diff --git a/hotspot/test/compiler/codecache/stress/Helper.java b/hotspot/test/compiler/codecache/stress/Helper.java
new file mode 100644
index 00000000000..0a4a3791b6c
--- /dev/null
+++ b/hotspot/test/compiler/codecache/stress/Helper.java
@@ -0,0 +1,141 @@
+/*
+ * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * 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.
+ *
+ */
+
+import java.io.BufferedInputStream;
+import java.io.ByteArrayOutputStream;
+import java.io.IOException;
+import java.util.concurrent.Callable;
+import java.util.Random;
+
+import com.oracle.java.testlibrary.Asserts;
+import com.oracle.java.testlibrary.ByteCodeLoader;
+import com.oracle.java.testlibrary.InfiniteLoop;
+import com.oracle.java.testlibrary.Utils;
+import sun.hotspot.WhiteBox;
+
+public final class Helper {
+ public static final WhiteBox WHITE_BOX = WhiteBox.getWhiteBox();
+ public static final Random RNG = Utils.getRandomInstance();
+
+ private static final long THRESHOLD = WHITE_BOX.getIntxVMFlag("CompileThreshold");
+ private static final String TEST_CASE_IMPL_CLASS_NAME = "Helper$TestCaseImpl";
+ private static byte[] CLASS_DATA;
+ static {
+ try {
+ CLASS_DATA = loadClassData(TEST_CASE_IMPL_CLASS_NAME);
+ } catch (IOException e) {
+ throw new Error("TESTBUG: cannot load class byte code", e);
+ }
+ }
+
+ private Helper() {
+ }
+
+ public static void startInfiniteLoopThread(Runnable action) {
+ startInfiniteLoopThread(action, 0L);
+ }
+
+ public static void startInfiniteLoopThread(Runnable action, long millis) {
+ Thread t = new Thread(new InfiniteLoop(action, millis));
+ t.setDaemon(true);
+ t.start();
+ }
+
+ public static int callMethod(Callable callable, int expected) {
+ int result = 0;
+ for (int i = 0; i < THRESHOLD; ++i) {
+ try {
+ result = callable.call();
+ } catch (Exception e) {
+ throw new AssertionError(
+ "Exception occurred during test method execution", e);
+ }
+ Asserts.assertEQ(result, expected, "Method returns unexpected value");
+ }
+ return result;
+ }
+
+ private static byte[] loadClassData(String name) throws IOException {
+ try (BufferedInputStream in = new BufferedInputStream(
+ ClassLoader.getSystemResourceAsStream(name.replace(".", "/")
+ + ".class"))) {
+ ByteArrayOutputStream result = new ByteArrayOutputStream();
+ byte[] buffer = new byte[1024];
+ int read;
+ while ((read = in.read(buffer)) != -1) {
+ result.write(buffer, 0, read);
+ }
+ return result.toByteArray();
+ }
+ }
+
+ public interface TestCase {
+
+ public static TestCase get() {
+ try {
+ Class clazz = ByteCodeLoader.load(
+ TEST_CASE_IMPL_CLASS_NAME, CLASS_DATA);
+ return (TestCase) clazz.newInstance();
+ } catch (ReflectiveOperationException e) {
+ throw new Error(String.format(
+ "TESTBUG: error while creating %s instance from reloaded class",
+ TEST_CASE_IMPL_CLASS_NAME), e);
+ }
+ }
+
+ Callable getCallable();
+ int method();
+ int expectedValue();
+ }
+
+ public static class TestCaseImpl implements TestCase {
+ private static final int RETURN_VALUE = 42;
+ private static final int RECURSION_DEPTH = 10;
+ private volatile int i;
+
+ @Override
+ public Callable getCallable() {
+ return () -> {
+ i = 0;
+ return method();
+ };
+ }
+
+ @Override
+ public int method() {
+ ++i;
+ int result = RETURN_VALUE;
+ if (i < RECURSION_DEPTH) {
+ return result + method();
+ }
+ return result;
+ }
+
+ @Override
+ public int expectedValue() {
+ return RETURN_VALUE * RECURSION_DEPTH;
+ }
+ }
+
+}
diff --git a/hotspot/test/compiler/codecache/stress/OverloadCompileQueueTest.java b/hotspot/test/compiler/codecache/stress/OverloadCompileQueueTest.java
new file mode 100644
index 00000000000..5f52ef679ea
--- /dev/null
+++ b/hotspot/test/compiler/codecache/stress/OverloadCompileQueueTest.java
@@ -0,0 +1,111 @@
+/*
+ * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * 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.
+ *
+ */
+
+import java.lang.reflect.Method;
+import java.util.stream.IntStream;
+
+import com.oracle.java.testlibrary.Platform;
+
+/*
+ * @test OverloadCompileQueueTest
+ * @library /testlibrary /../../test/lib
+ * @build OverloadCompileQueueTest
+ * @run main ClassFileInstaller sun.hotspot.WhiteBox
+ * sun.hotspot.WhiteBox$WhiteBoxPermission
+ * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions
+ * -XX:CompileCommand=dontinline,Helper$TestCase::method
+ * -XX:+WhiteBoxAPI -XX:-SegmentedCodeCache OverloadCompileQueueTest
+ * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions
+ * -XX:CompileCommand=dontinline,Helper$TestCase::method
+ * -XX:+WhiteBoxAPI -XX:+SegmentedCodeCache OverloadCompileQueueTest
+ * @summary stressing code cache by overloading compile queues
+ */
+public class OverloadCompileQueueTest implements Runnable {
+ private static final int MAX_SLEEP = 10000;
+ private static final String METHOD_TO_ENQUEUE = "method";
+ private static final int LEVEL_SIMPLE = 1;
+ private static final int LEVEL_FULL_OPTIMIZATION = 4;
+ private static final boolean INTERPRETED
+ = System.getProperty("java.vm.info").startsWith("interpreted ");
+ private static final boolean TIERED_COMPILATION
+ = Helper.WHITE_BOX.getBooleanVMFlag("TieredCompilation");
+ private static final int TIERED_STOP_AT_LEVEL
+ = Helper.WHITE_BOX.getIntxVMFlag("TieredStopAtLevel").intValue();
+ private static final int[] AVAILABLE_LEVELS;
+ static {
+ if (TIERED_COMPILATION) {
+ AVAILABLE_LEVELS = IntStream
+ .rangeClosed(LEVEL_SIMPLE, TIERED_STOP_AT_LEVEL)
+ .toArray();
+ } else if (Platform.isServer()) {
+ AVAILABLE_LEVELS = new int[] { LEVEL_FULL_OPTIMIZATION };
+ } else if (Platform.isClient() || Platform.isMinimal()) {
+ AVAILABLE_LEVELS = new int[] { LEVEL_SIMPLE };
+ } else {
+ throw new Error(String.format(
+ "TESTBUG: unknown VM: %s", System.getProperty("java.vm.name")));
+ }
+ }
+
+ public static void main(String[] args) {
+ if (INTERPRETED) {
+ System.err.println("Test isn't applicable for interpreter. Skip test.");
+ return;
+ }
+ new CodeCacheStressRunner(new OverloadCompileQueueTest()).runTest();
+ }
+
+ public OverloadCompileQueueTest() {
+ Helper.startInfiniteLoopThread(this::lockUnlock);
+ }
+
+ @Override
+ public void run() {
+ Helper.TestCase obj = Helper.TestCase.get();
+ Class clazz = obj.getClass();
+ Method mEnqueue;
+ try {
+ mEnqueue = clazz.getMethod(METHOD_TO_ENQUEUE);
+ } catch (NoSuchMethodException | SecurityException e) {
+ throw new Error(String.format(
+ "TESTBUG: cannot get method '%s' of class %s",
+ METHOD_TO_ENQUEUE, clazz.getName()), e);
+ }
+ for (int compLevel : AVAILABLE_LEVELS) {
+ Helper.WHITE_BOX.enqueueMethodForCompilation(mEnqueue, compLevel);
+ }
+ }
+
+ private void lockUnlock() {
+ try {
+ Helper.WHITE_BOX.lockCompilation();
+ Thread.sleep(Helper.RNG.nextInt(MAX_SLEEP));
+ } catch (InterruptedException e) {
+ throw new Error("TESTBUG: lockUnlocker thread was unexpectedly interrupted", e);
+ } finally {
+ Helper.WHITE_BOX.unlockCompilation();
+ }
+ }
+
+}
diff --git a/hotspot/test/compiler/codecache/stress/RandomAllocationTest.java b/hotspot/test/compiler/codecache/stress/RandomAllocationTest.java
new file mode 100644
index 00000000000..466bcc4b895
--- /dev/null
+++ b/hotspot/test/compiler/codecache/stress/RandomAllocationTest.java
@@ -0,0 +1,71 @@
+/*
+ * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * 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.
+ *
+ */
+
+import java.util.ArrayList;
+
+import sun.hotspot.code.BlobType;
+
+/*
+ * @test RandomAllocationTest
+ * @library /testlibrary /../../test/lib
+ * @build RandomAllocationTest
+ * @run main ClassFileInstaller sun.hotspot.WhiteBox
+ * sun.hotspot.WhiteBox$WhiteBoxPermission
+ * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions
+ * -XX:CompileCommand=dontinline,Helper$TestCase::method
+ * -XX:+WhiteBoxAPI -XX:-SegmentedCodeCache RandomAllocationTest
+ * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions
+ * -XX:CompileCommand=dontinline,Helper$TestCase::method
+ * -XX:+WhiteBoxAPI -XX:+SegmentedCodeCache RandomAllocationTest
+ * @summary stressing code cache by allocating randomly sized "dummy" code blobs
+ */
+public class RandomAllocationTest implements Runnable {
+ private static final long CODE_CACHE_SIZE
+ = Helper.WHITE_BOX.getUintxVMFlag("ReservedCodeCacheSize");
+ private static final int MAX_BLOB_SIZE = (int) (CODE_CACHE_SIZE >> 7);
+ private static final BlobType[] BLOB_TYPES
+ = BlobType.getAvailable().toArray(new BlobType[0]);
+
+ public static void main(String[] args) {
+ new CodeCacheStressRunner(new RandomAllocationTest()).runTest();
+ }
+
+ private final ArrayList blobs = new ArrayList<>();
+ @Override
+ public void run() {
+ boolean allocate = blobs.isEmpty() || Helper.RNG.nextBoolean();
+ if (allocate) {
+ int type = Helper.RNG.nextInt(BLOB_TYPES.length);
+ long addr = Helper.WHITE_BOX.allocateCodeBlob(
+ Helper.RNG.nextInt(MAX_BLOB_SIZE), BLOB_TYPES[type].id);
+ if (addr != 0) {
+ blobs.add(addr);
+ }
+ } else {
+ int index = Helper.RNG.nextInt(blobs.size());
+ Helper.WHITE_BOX.freeCodeBlob(blobs.remove(index));
+ }
+ }
+
+}
diff --git a/hotspot/test/compiler/codecache/stress/UnexpectedDeoptimizationTest.java b/hotspot/test/compiler/codecache/stress/UnexpectedDeoptimizationTest.java
new file mode 100644
index 00000000000..f8ff8e5deb4
--- /dev/null
+++ b/hotspot/test/compiler/codecache/stress/UnexpectedDeoptimizationTest.java
@@ -0,0 +1,52 @@
+/*
+ * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * 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 UnexpectedDeoptimizationTest
+ * @library /testlibrary /../../test/lib
+ * @build UnexpectedDeoptimizationTest
+ * @run main ClassFileInstaller sun.hotspot.WhiteBox
+ * sun.hotspot.WhiteBox$WhiteBoxPermission
+ * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions
+ * -XX:CompileCommand=dontinline,Helper$TestCase::method
+ * -XX:+WhiteBoxAPI -XX:-SegmentedCodeCache -XX:-DeoptimizeRandom
+ * UnexpectedDeoptimizationTest
+ * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions
+ * -XX:CompileCommand=dontinline,Helper$TestCase::method
+ * -XX:+WhiteBoxAPI -XX:+SegmentedCodeCache -XX:-DeoptimizeRandom
+ * UnexpectedDeoptimizationTest
+ * @summary stressing code cache by forcing unexpected deoptimizations
+ */
+public class UnexpectedDeoptimizationTest implements Runnable {
+
+ public static void main(String[] args) {
+ new CodeCacheStressRunner(new UnexpectedDeoptimizationTest()).runTest();
+ }
+
+ @Override
+ public void run() {
+ Helper.WHITE_BOX.deoptimizeFrames(Helper.RNG.nextBoolean());
+ }
+
+}
diff --git a/hotspot/test/compiler/exceptions/TestRecursiveReplacedException.java b/hotspot/test/compiler/exceptions/TestRecursiveReplacedException.java
index 996d82a0feb..d3cace05343 100644
--- a/hotspot/test/compiler/exceptions/TestRecursiveReplacedException.java
+++ b/hotspot/test/compiler/exceptions/TestRecursiveReplacedException.java
@@ -25,7 +25,7 @@
* @test
* @bug 8054224
* @summary Recursive method compiled by C1 is unable to catch StackOverflowError
- * @run main/othervm -Xcomp -XX:CompileOnly=Test.run -XX:+TieredCompilation -XX:TieredStopAtLevel=2 -Xss256K TestRecursiveReplacedException
+ * @run main/othervm -Xcomp -XX:CompileOnly=Test.run -XX:+TieredCompilation -XX:TieredStopAtLevel=2 -Xss392K TestRecursiveReplacedException
*
*/
diff --git a/hotspot/test/compiler/floatingpoint/TestPow2.java b/hotspot/test/compiler/floatingpoint/TestPow2.java
new file mode 100644
index 00000000000..699904b6e4f
--- /dev/null
+++ b/hotspot/test/compiler/floatingpoint/TestPow2.java
@@ -0,0 +1,73 @@
+/*
+ * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * 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 8063086
+ * @summary X^2 special case for C2 yields different result than interpreter
+ * @library /testlibrary /../../test/lib /compiler/whitebox
+ * @build TestPow2
+ * @run main ClassFileInstaller sun.hotspot.WhiteBox
+ * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI
+ * -XX:-BackgroundCompilation -XX:-UseOnStackReplacement TestPow2
+ *
+ */
+
+import java.lang.reflect.*;
+import sun.hotspot.WhiteBox;
+
+public class TestPow2 {
+
+ private static final WhiteBox WHITE_BOX = WhiteBox.getWhiteBox();
+
+ private static final double base = 5350.456329377186;
+ private static final double exp = 2.0;
+
+ static double m() {
+ return Math.pow(base, exp);
+ }
+
+ static public void main(String[] args) throws NoSuchMethodException {
+ Method test_method = TestPow2.class.getDeclaredMethod("m");
+
+ double interpreter_result = m();
+
+ // Compile with C1 if possible
+ WHITE_BOX.enqueueMethodForCompilation(test_method, CompilerWhiteBoxTest.COMP_LEVEL_SIMPLE);
+
+ double c1_result = m();
+
+ WHITE_BOX.deoptimizeMethod(test_method);
+
+ // Compile it with C2 if possible
+ WHITE_BOX.enqueueMethodForCompilation(test_method, CompilerWhiteBoxTest.COMP_LEVEL_FULL_OPTIMIZATION);
+
+ double c2_result = m();
+
+ if (interpreter_result != c1_result || interpreter_result != c2_result ||
+ c1_result != c2_result) {
+ System.out.println("interpreter = " + interpreter_result + " c1 = " + c1_result + " c2 = " + c2_result);
+ throw new RuntimeException("Test Failed");
+ }
+ }
+}
diff --git a/hotspot/test/compiler/oracle/CheckCompileCommandOption.java b/hotspot/test/compiler/oracle/CheckCompileCommandOption.java
index b4c08155101..8248582d38c 100644
--- a/hotspot/test/compiler/oracle/CheckCompileCommandOption.java
+++ b/hotspot/test/compiler/oracle/CheckCompileCommandOption.java
@@ -172,7 +172,7 @@ public class CheckCompileCommandOption {
out.shouldContain(expected_output);
}
- out.shouldNotContain("CompilerOracle: unrecognized line");
+ out.shouldNotContain("CompileCommand: unrecognized line");
out.shouldHaveExitValue(0);
}
@@ -183,7 +183,7 @@ public class CheckCompileCommandOption {
pb = ProcessTools.createJavaProcessBuilder(arguments);
out = new OutputAnalyzer(pb.start());
- out.shouldContain("CompilerOracle: unrecognized line");
+ out.shouldContain("CompileCommand: unrecognized line");
out.shouldHaveExitValue(0);
}
diff --git a/hotspot/test/compiler/rtm/locking/TestRTMDeoptOnLowAbortRatio.java b/hotspot/test/compiler/rtm/locking/TestRTMDeoptOnLowAbortRatio.java
index 128ec7bd403..ae39ffb25c0 100644
--- a/hotspot/test/compiler/rtm/locking/TestRTMDeoptOnLowAbortRatio.java
+++ b/hotspot/test/compiler/rtm/locking/TestRTMDeoptOnLowAbortRatio.java
@@ -53,6 +53,7 @@ import sun.misc.Unsafe;
*/
public class TestRTMDeoptOnLowAbortRatio extends CommandLineOptionTest {
private static final long LOCKING_THRESHOLD = 100L;
+ private static final long ABORT_THRESHOLD = LOCKING_THRESHOLD / 2L;
private TestRTMDeoptOnLowAbortRatio() {
super(new AndPredicate(new SupportedCPU(), new SupportedVM()));
@@ -77,7 +78,8 @@ public class TestRTMDeoptOnLowAbortRatio extends CommandLineOptionTest {
useStackLock),
CommandLineOptionTest.prepareNumericFlag("RTMLockingThreshold",
TestRTMDeoptOnLowAbortRatio.LOCKING_THRESHOLD),
- "-XX:RTMAbortThreshold=1",
+ CommandLineOptionTest.prepareNumericFlag("RTMAbortThreshold",
+ TestRTMDeoptOnLowAbortRatio.ABORT_THRESHOLD),
"-XX:RTMAbortRatio=100",
"-XX:CompileThreshold=1",
"-XX:RTMRetryCount=0",
@@ -107,7 +109,7 @@ public class TestRTMDeoptOnLowAbortRatio extends CommandLineOptionTest {
for (RTMLockingStatistics s : statistics) {
if (s.getTotalLocks()
- == TestRTMDeoptOnLowAbortRatio.LOCKING_THRESHOLD + 1L) {
+ == TestRTMDeoptOnLowAbortRatio.LOCKING_THRESHOLD) {
Asserts.assertNull(statisticsBeforeDeopt,
"Only one abort was expected during test run");
statisticsBeforeDeopt = s;
@@ -154,8 +156,7 @@ public class TestRTMDeoptOnLowAbortRatio extends CommandLineOptionTest {
}
for (int i = 0; i < AbortProvoker.DEFAULT_ITERATIONS; i++) {
AbortProvoker.verifyMonitorState(t.monitor, shouldBeInflated);
- t.forceAbort(
- i == TestRTMDeoptOnLowAbortRatio.LOCKING_THRESHOLD);
+ t.forceAbort(i >= TestRTMDeoptOnLowAbortRatio.ABORT_THRESHOLD);
}
}
}
diff --git a/hotspot/test/compiler/rtm/locking/TestRTMLockingThreshold.java b/hotspot/test/compiler/rtm/locking/TestRTMLockingThreshold.java
index 75a94c6d989..66daef96ff5 100644
--- a/hotspot/test/compiler/rtm/locking/TestRTMLockingThreshold.java
+++ b/hotspot/test/compiler/rtm/locking/TestRTMLockingThreshold.java
@@ -58,7 +58,7 @@ public class TestRTMLockingThreshold extends CommandLineOptionTest {
* interrupts, VMM calls, etc. during first lock attempt.
*
*/
- private static final int ABORT_THRESHOLD = 10;
+ private static final int MIN_ABORT_THRESHOLD = 10;
@Override
protected void runTestCases() throws Throwable {
@@ -75,6 +75,9 @@ public class TestRTMLockingThreshold extends CommandLineOptionTest {
boolean useStackLock) throws Throwable {
CompilableTest test = new Test();
+ int abortThreshold = Math.max(lockingThreshold / 2,
+ TestRTMLockingThreshold.MIN_ABORT_THRESHOLD);
+
OutputAnalyzer outputAnalyzer = RTMTestBase.executeRTMTest(
test,
"-XX:CompileThreshold=1",
@@ -84,7 +87,7 @@ public class TestRTMLockingThreshold extends CommandLineOptionTest {
"-XX:RTMTotalCountIncrRate=1",
"-XX:RTMRetryCount=0",
CommandLineOptionTest.prepareNumericFlag("RTMAbortThreshold",
- TestRTMLockingThreshold.ABORT_THRESHOLD),
+ abortThreshold),
CommandLineOptionTest.prepareNumericFlag("RTMLockingThreshold",
lockingThreshold),
"-XX:RTMAbortRatio=100",
@@ -103,16 +106,12 @@ public class TestRTMLockingThreshold extends CommandLineOptionTest {
+ "RTM locking statistics entries.");
/**
- * We force abort on each odd iteration, so if RTMLockingThreshold==0,
- * then we have to make 1 call without abort to avoid rtm state
- * transition to NoRTM (otherwise actual abort ratio will be 100%),
- * and after that make 1 call with abort to force deoptimization.
- * This leads us to two locks for threshold 0.
- * For other threshold values we have to make RTMLockingThreshold + 1
- * locks if locking threshold is even, or + 0 if odd.
+ * If RTMLockingThreshold==0, then we have to make at least 1 call.
*/
- long expectedValue = lockingThreshold +
- (lockingThreshold == 0L ? 2L : lockingThreshold % 2L);
+ long expectedValue = lockingThreshold;
+ if (expectedValue == 0) {
+ expectedValue++;
+ }
RTMLockingStatistics statBeforeDeopt = null;
for (RTMLockingStatistics s : statistics) {
@@ -159,15 +158,16 @@ public class TestRTMLockingThreshold extends CommandLineOptionTest {
* Test <inflate monitor>
*/
public static void main(String args[]) throws Throwable {
- Asserts.assertGTE(args.length, 1, "One argument required.");
+ Asserts.assertGTE(args.length, 2, "Two arguments required.");
Test t = new Test();
boolean shouldBeInflated = Boolean.valueOf(args[0]);
+ int lockingThreshold = Integer.valueOf(args[1]);
if (shouldBeInflated) {
AbortProvoker.inflateMonitor(t.monitor);
}
for (int i = 0; i < Test.TOTAL_ITERATIONS; i++) {
AbortProvoker.verifyMonitorState(t.monitor, shouldBeInflated);
- t.lock(i % 2 == 1);
+ t.lock(i >= lockingThreshold / 2);
}
}
}
diff --git a/hotspot/test/compiler/rtm/locking/TestRTMTotalCountIncrRate.java b/hotspot/test/compiler/rtm/locking/TestRTMTotalCountIncrRate.java
index 7a3327606fd..d27a87d8c2e 100644
--- a/hotspot/test/compiler/rtm/locking/TestRTMTotalCountIncrRate.java
+++ b/hotspot/test/compiler/rtm/locking/TestRTMTotalCountIncrRate.java
@@ -35,6 +35,7 @@
* -XX:+WhiteBoxAPI TestRTMTotalCountIncrRate
*/
+import sun.misc.Unsafe;
import java.util.List;
import com.oracle.java.testlibrary.*;
@@ -97,14 +98,12 @@ public class TestRTMTotalCountIncrRate extends CommandLineOptionTest {
Asserts.assertEQ(lock.getTotalLocks(), Test.TOTAL_ITERATIONS,
"Total locks should be exactly the same as amount of "
+ "iterations.");
- } else {
- Asserts.assertGT(lock.getTotalLocks(), 0L, "RTM statistics "
- + "should contain information for at least on lock.");
}
}
public static class Test implements CompilableTest {
private static final long TOTAL_ITERATIONS = 10000L;
+ private static final Unsafe UNSAFE = Utils.getUnsafe();
private final Object monitor = new Object();
// Following field have to be static in order to avoid escape analysis.
@SuppressWarnings("UnsuedDeclaration")
@@ -120,8 +119,17 @@ public class TestRTMTotalCountIncrRate extends CommandLineOptionTest {
return new String[] { getMethodWithLockName() };
}
- public void lock() {
+ public void lock(booleab forceAbort) {
synchronized(monitor) {
+ if (forceAbort) {
+ // We're calling native method in order to force
+ // abort. It's done by explicit xabort call emitted
+ // in SharedRuntime::generate_native_wrapper.
+ // If an actuall JNI call will be replaced by
+ // intrinsic - we'll be in trouble, since xabort
+ // will be no longer called and test may fail.
+ UNSAFE.addressSize();
+ }
Test.field++;
}
}
@@ -140,7 +148,11 @@ public class TestRTMTotalCountIncrRate extends CommandLineOptionTest {
for (long i = 0L; i < Test.TOTAL_ITERATIONS; i++) {
AbortProvoker.verifyMonitorState(test.monitor,
shouldBeInflated);
- test.lock();
+ // Force abort on first iteration to avoid rare case when
+ // there were no aborts and locks count was not incremented
+ // with RTMTotalCountIncrRate > 1 (in such case JVM won't
+ // print JVM locking statistics).
+ test.lock(i == 0);
}
}
}
diff --git a/hotspot/test/compiler/rtm/print/TestPrintPreciseRTMLockingStatistics.java b/hotspot/test/compiler/rtm/print/TestPrintPreciseRTMLockingStatistics.java
index 80b412272b0..291d4cabef5 100644
--- a/hotspot/test/compiler/rtm/print/TestPrintPreciseRTMLockingStatistics.java
+++ b/hotspot/test/compiler/rtm/print/TestPrintPreciseRTMLockingStatistics.java
@@ -125,9 +125,6 @@ public class TestPrintPreciseRTMLockingStatistics
RTMLockingStatistics lock = statistics.get(0);
- Asserts.assertGT(lock.getTotalLocks(), 0L, "RTM locking statistics "
- + "should contain non zero total locks count");
-
Asserts.assertGT(lock.getTotalAborts(), 0L,
"RTM locking statistics should contain non zero total aborts "
+ "count");
diff --git a/hotspot/test/compiler/runtime/6865265/StackOverflowBug.java b/hotspot/test/compiler/runtime/6865265/StackOverflowBug.java
index 295a6b41777..b8fe082fd94 100644
--- a/hotspot/test/compiler/runtime/6865265/StackOverflowBug.java
+++ b/hotspot/test/compiler/runtime/6865265/StackOverflowBug.java
@@ -28,7 +28,7 @@
* @summary JVM crashes with "missing exception handler" error
* @author volker.simonis@sap.com
*
- * @run main/othervm -XX:CompileThreshold=100 -Xbatch -Xss248k StackOverflowBug
+ * @run main/othervm -XX:CompileThreshold=100 -Xbatch -Xss392k StackOverflowBug
*/
diff --git a/hotspot/test/compiler/testlibrary/uncommontrap/Verifier.java b/hotspot/test/compiler/testlibrary/uncommontrap/Verifier.java
new file mode 100644
index 00000000000..5ec38bf254a
--- /dev/null
+++ b/hotspot/test/compiler/testlibrary/uncommontrap/Verifier.java
@@ -0,0 +1,145 @@
+/*
+ * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * 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.
+ */
+
+package uncommontrap;
+
+import java.io.FileReader;
+import java.io.IOException;
+import java.nio.file.Files;
+import java.nio.file.Path;
+import java.nio.file.Paths;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Properties;
+import java.util.regex.Pattern;
+
+import com.oracle.java.testlibrary.Asserts;
+/**
+ * Utility tool aimed to verify presence or absence of specified uncommon trap
+ * in compilation log.
+ */
+public class Verifier {
+ public static final String PROPERTIES_FILE_SUFFIX = ".verify.properties";
+ public static final String VERIFICATION_SHOULD_BE_SKIPPED
+ = "uncommon.trap.verification.skipped";
+ public static final String UNCOMMON_TRAP_NAME = "uncommon.trap.name";
+ public static final String UNCOMMON_TRAP_BCI = "uncommon.trap.bci";
+ public static final String UNCOMMON_TRAP_COMMENT = "uncommon.trap.comment";
+ public static final String UNCOMMON_TRAP_ACTION = "uncommon.trap.action";
+ public static final String UNCOMMON_TRAP_SHOULD_EMITTED
+ = "uncommon.trap.emitted";
+ public static final String UNCOMMON_TRAP_SHOULD_FIRED
+ = "uncommon.trap.fired";
+
+ private static final String EMITTED_TRAP_PATTERN
+ = " compLogContent = Files.readAllLines(compLogFile);
+ verifyUncommonTrapEmitted(properties, compLogContent);
+ verifyUncommonTrapFired(properties, compLogContent);
+ }
+
+ private static void verifyUncommonTrapEmitted(Properties properties,
+ List compLogContent) {
+ String emittedTrapRE = String.format(EMITTED_TRAP_PATTERN,
+ properties.getProperty(UNCOMMON_TRAP_BCI, ".*"),
+ properties.getProperty(UNCOMMON_TRAP_NAME, ".*"),
+ properties.getProperty(UNCOMMON_TRAP_ACTION, ".*"),
+ properties.getProperty(UNCOMMON_TRAP_COMMENT, ".*"));
+ Pattern pattern = Pattern.compile(emittedTrapRE);
+
+ long trapsCount = compLogContent.stream()
+ .filter(line -> pattern.matcher(line).find())
+ .count();
+
+ boolean shouldBeEmitted = Boolean.valueOf(
+ properties.getProperty(UNCOMMON_TRAP_SHOULD_EMITTED));
+
+ Asserts.assertEQ(shouldBeEmitted, trapsCount > 0, String.format(
+ "Uncommon trap that matches following string in compilation log"
+ + " should %sbe emitted: %s.",
+ (shouldBeEmitted ? " " : "not "), emittedTrapRE));
+ }
+
+ private static void verifyUncommonTrapFired(Properties properties,
+ List compLogContent) {
+ String firedTrapRE = String.format(FIRED_TRAP_PATTERN,
+ properties.getProperty(UNCOMMON_TRAP_NAME, ".*"),
+ properties.getProperty(UNCOMMON_TRAP_ACTION, ".*"));
+ String jvmsRE = String.format(JVMS_PATTERN,
+ properties.getProperty(UNCOMMON_TRAP_BCI, ".*"));
+
+ boolean trapFired = false;
+ Pattern firedTrapPattern = Pattern.compile(firedTrapRE);
+ Pattern jvmsPattern = Pattern.compile(jvmsRE);
+
+ Iterator iterator = compLogContent.iterator();
+ while (iterator.hasNext() && !trapFired) {
+ trapFired = firedTrapPattern.matcher(iterator.next()).find()
+ && jvmsPattern.matcher(iterator.next()).find();
+ }
+
+ boolean shouldBeFired = Boolean.valueOf(
+ properties.getProperty(UNCOMMON_TRAP_SHOULD_FIRED));
+ Asserts.assertEQ(shouldBeFired, trapFired, String.format(
+ "Uncommon trap that matches following string in compilation log"
+ + " should %sbe fired: %s.",
+ (shouldBeFired ? "" : "not "), firedTrapRE));
+ }
+}
+
diff --git a/hotspot/test/compiler/uncommontrap/8009761/Test8009761.java b/hotspot/test/compiler/uncommontrap/8009761/Test8009761.java
index aff4947ee74..63db9ba2d4e 100644
--- a/hotspot/test/compiler/uncommontrap/8009761/Test8009761.java
+++ b/hotspot/test/compiler/uncommontrap/8009761/Test8009761.java
@@ -32,7 +32,7 @@ import java.lang.reflect.Method;
* @build Test8009761
* @run main ClassFileInstaller sun.hotspot.WhiteBox
* sun.hotspot.WhiteBox$WhiteBoxPermission
- * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -XX:CompileCommand=exclude,Test8009761::m2 -XX:-UseOnStackReplacement -XX:-BackgroundCompilation -Xss256K Test8009761
+ * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -XX:CompileCommand=exclude,Test8009761::m2 -XX:-UseOnStackReplacement -XX:-BackgroundCompilation -Xss392K Test8009761
*/
public class Test8009761 {
diff --git a/hotspot/test/compiler/uncommontrap/StackOverflowGuardPagesOff.java b/hotspot/test/compiler/uncommontrap/StackOverflowGuardPagesOff.java
index 4ad409bb1eb..ba3b8795537 100644
--- a/hotspot/test/compiler/uncommontrap/StackOverflowGuardPagesOff.java
+++ b/hotspot/test/compiler/uncommontrap/StackOverflowGuardPagesOff.java
@@ -25,7 +25,7 @@
* @test
* @bug 8029383
* @summary stack overflow if callee is marked for deoptimization causes crash
- * @run main/othervm -XX:TieredStopAtLevel=1 -XX:-BackgroundCompilation -XX:CompileCommand=dontinline,StackOverflowGuardPagesOff::m1 -XX:CompileCommand=exclude,StackOverflowGuardPagesOff::m2 -Xss256K -XX:-UseOnStackReplacement StackOverflowGuardPagesOff
+ * @run main/othervm -XX:TieredStopAtLevel=1 -XX:-BackgroundCompilation -XX:CompileCommand=dontinline,StackOverflowGuardPagesOff::m1 -XX:CompileCommand=exclude,StackOverflowGuardPagesOff::m2 -Xss392K -XX:-UseOnStackReplacement StackOverflowGuardPagesOff
*
*/
diff --git a/hotspot/test/compiler/uncommontrap/TestStackBangMonitorOwned.java b/hotspot/test/compiler/uncommontrap/TestStackBangMonitorOwned.java
index 3d93d7d5a5e..83345642f74 100644
--- a/hotspot/test/compiler/uncommontrap/TestStackBangMonitorOwned.java
+++ b/hotspot/test/compiler/uncommontrap/TestStackBangMonitorOwned.java
@@ -25,7 +25,7 @@
* @test
* @bug 8032410
* @summary Stack overflow at deoptimization doesn't release owned monitors
- * @run main/othervm -XX:-BackgroundCompilation -XX:CompileCommand=dontinline,TestStackBangMonitorOwned::m1 -XX:CompileCommand=exclude,TestStackBangMonitorOwned::m2 -Xss256K -XX:-UseOnStackReplacement TestStackBangMonitorOwned
+ * @run main/othervm -XX:-BackgroundCompilation -XX:CompileCommand=dontinline,TestStackBangMonitorOwned::m1 -XX:CompileCommand=exclude,TestStackBangMonitorOwned::m2 -Xss392K -XX:-UseOnStackReplacement TestStackBangMonitorOwned
*
*/
public class TestStackBangMonitorOwned {
diff --git a/hotspot/test/compiler/uncommontrap/TestStackBangRbp.java b/hotspot/test/compiler/uncommontrap/TestStackBangRbp.java
index 38d4e206e01..f242e6edd6b 100644
--- a/hotspot/test/compiler/uncommontrap/TestStackBangRbp.java
+++ b/hotspot/test/compiler/uncommontrap/TestStackBangRbp.java
@@ -25,7 +25,7 @@
* @test
* @bug 8028308
* @summary rbp not restored when stack overflow is thrown from deopt/uncommon trap blobs
- * @run main/othervm -XX:-BackgroundCompilation -XX:CompileCommand=dontinline,TestStackBangRbp::m1 -XX:CompileCommand=exclude,TestStackBangRbp::m2 -Xss256K -XX:-UseOnStackReplacement TestStackBangRbp
+ * @run main/othervm -XX:-BackgroundCompilation -XX:CompileCommand=dontinline,TestStackBangRbp::m1 -XX:CompileCommand=exclude,TestStackBangRbp::m2 -Xss392K -XX:-UseOnStackReplacement TestStackBangRbp
*
*/
public class TestStackBangRbp {
diff --git a/hotspot/test/compiler/uncommontrap/TestUnstableIfTrap.java b/hotspot/test/compiler/uncommontrap/TestUnstableIfTrap.java
new file mode 100644
index 00000000000..87aaf66d247
--- /dev/null
+++ b/hotspot/test/compiler/uncommontrap/TestUnstableIfTrap.java
@@ -0,0 +1,257 @@
+/*
+ * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * 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.
+ */
+import java.io.File;
+import java.io.FileWriter;
+import java.io.IOException;
+import java.lang.reflect.Method;
+import java.util.Properties;
+
+import com.oracle.java.testlibrary.ByteCodeLoader;
+import com.oracle.java.testlibrary.Platform;
+import jdk.internal.org.objectweb.asm.ClassVisitor;
+import jdk.internal.org.objectweb.asm.ClassWriter;
+import jdk.internal.org.objectweb.asm.Label;
+import jdk.internal.org.objectweb.asm.MethodVisitor;
+import static jdk.internal.org.objectweb.asm.Opcodes.*;
+
+import sun.hotspot.WhiteBox;
+import uncommontrap.Verifier;
+
+/*
+ * @test
+ * @bug 8030976 8059226
+ * @library /testlibrary /compiler/testlibrary /../../test/lib
+ * @build TestUnstableIfTrap com.oracle.java.testlibrary.* uncommontrap.Verifier
+ * @run main ClassFileInstaller sun.hotspot.WhiteBox
+ * sun.hotspot.WhiteBox$WhiteBoxPermission
+ * @run main/othervm -Xbatch -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions
+ * -XX:+WhiteBoxAPI -XX:+LogCompilation
+ * -XX:CompileCommand=compileonly,UnstableIfExecutable.test
+ * -XX:LogFile=always_taken_not_fired.xml
+ * TestUnstableIfTrap ALWAYS_TAKEN false
+ * @run main/othervm -Xbatch -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions
+ * -XX:+WhiteBoxAPI -XX:+LogCompilation
+ * -XX:CompileCommand=compileonly,UnstableIfExecutable.test
+ * -XX:LogFile=always_taken_fired.xml
+ * TestUnstableIfTrap ALWAYS_TAKEN true
+ * @run main/othervm -Xbatch -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions
+ * -XX:+WhiteBoxAPI -XX:+LogCompilation
+ * -XX:CompileCommand=compileonly,UnstableIfExecutable.test
+ * -XX:LogFile=never_taken_not_fired.xml
+ * TestUnstableIfTrap NEVER_TAKEN false
+ * @run main/othervm -Xbatch -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions
+ * -XX:+WhiteBoxAPI -XX:+LogCompilation
+ * -XX:CompileCommand=compileonly,UnstableIfExecutable.test
+ * -XX:LogFile=never_taken_fired.xml
+ * TestUnstableIfTrap NEVER_TAKEN true
+ * @run main uncommontrap.Verifier always_taken_not_fired.xml
+ * always_taken_fired.xml
+ * never_taken_not_fired.xml
+ * never_taken_fired.xml
+ */
+public class TestUnstableIfTrap {
+ private static final WhiteBox WB = WhiteBox.getWhiteBox();
+ private static final String CLASS_NAME = "UnstableIfExecutable";
+ private static final String METHOD_NAME = "test";
+ private static final String FIELD_NAME = "field";
+ private static final int ITERATIONS = 1_000_000;
+ // There is no dependency on particular class file version, so it could be
+ // set to any version (if you're updating this test for Java 42).
+ private static final int CLASS_FILE_VERSION = 49;
+ private static final int MAX_TIER = 4;
+ // This test aimed to verify that uncommon trap with reason "unstable_if"
+ // is emitted when method that contain control-flow divergence such that
+ // one of two branches is never taken (and other one is taken always).
+ // C2 will made a decision whether or not the branch was ever taken
+ // depending on method's profile.
+ // If profile was collected for a few method's invocations, then C2 will not
+ // trust in branches' probabilities and the tested trap won't be emitted.
+ // In fact, a method has to be invoked at least 40 time at the day when this
+ // comment was written (see Parse::dynamic_branch_prediction for an actual
+ // value). It would be to implementation dependent to use "40" as
+ // a threshold value in the test, so in order to improve test's robustness
+ // the threshold value is 1000: if the tested method was compiled by C2
+ // before it was invoked 1000 times, then we won't verify that trap was
+ // emitted and fired.
+ private static final int MIN_INVOCATIONS_BEFORE_C2_COMPILATION = 1000;
+ /**
+ * Description of test case parameters and uncommon trap that will
+ * be emitted during tested method compilation.
+ */
+ private static enum TestCaseName {
+ ALWAYS_TAKEN(false, "taken always"),
+ NEVER_TAKEN(true, "taken never");
+ TestCaseName(boolean predicate, String comment) {
+ this.predicate = predicate;
+ this.comment = comment;
+ }
+
+ public final boolean predicate;
+ public final String name = "unstable_if";
+ public final String comment;
+ }
+
+ public static void main(String args[]) {
+ if (args.length != 2) {
+ throw new Error("Expected two arguments: test case name and a "
+ + "boolean determining if uncommon trap should be fired.");
+ }
+ test(TestCaseName.valueOf(args[0]), Boolean.valueOf(args[1]));
+ }
+
+ private static void test(TestCaseName testCase, boolean shouldBeFired) {
+ Method testMethod;
+ Label unstableIfLocation = new Label();
+ boolean shouldBeEmitted;
+ boolean compiledToEarly = false;
+
+ try {
+ Class testClass = ByteCodeLoader.load(CLASS_NAME,
+ generateTest(unstableIfLocation));
+ testMethod = testClass.getDeclaredMethod(METHOD_NAME,
+ boolean.class);
+ for (int i = 0; i < ITERATIONS; i++) {
+ testMethod.invoke(null, testCase.predicate);
+ if (i < MIN_INVOCATIONS_BEFORE_C2_COMPILATION
+ && isMethodCompiledByC2(testMethod)) {
+ compiledToEarly = true;
+ // There is no sense in further invocations: we already
+ // decided to avoid verification.
+ break;
+ }
+ }
+ // We're checking that trap should be emitted (i.e. it was compiled
+ // by C2) before the trap is fired, because otherwise the nmethod
+ // will be deoptimized and isMethodCompiledByC2 will return false.
+ shouldBeEmitted = isMethodCompiledByC2(testMethod)
+ && !compiledToEarly;
+ if (shouldBeFired) {
+ testMethod.invoke(null, !testCase.predicate);
+ }
+ } catch (ReflectiveOperationException e) {
+ throw new Error("Test case should be generated, loaded and executed"
+ + " without any issues.", e);
+ }
+
+ shouldBeFired &= shouldBeEmitted;
+
+ Properties properties = new Properties();
+ properties.setProperty(Verifier.VERIFICATION_SHOULD_BE_SKIPPED,
+ Boolean.toString(compiledToEarly));
+ properties.setProperty(Verifier.UNCOMMON_TRAP_SHOULD_EMITTED,
+ Boolean.toString(shouldBeEmitted));
+ properties.setProperty(Verifier.UNCOMMON_TRAP_SHOULD_FIRED,
+ Boolean.toString(shouldBeFired));
+ properties.setProperty(Verifier.UNCOMMON_TRAP_NAME, testCase.name);
+ properties.setProperty(Verifier.UNCOMMON_TRAP_COMMENT,
+ testCase.comment);
+ properties.setProperty(Verifier.UNCOMMON_TRAP_BCI,
+ Integer.toString(unstableIfLocation.getOffset()));
+
+ properties.list(System.out);
+
+ File f = new File(WB.getStringVMFlag("LogFile") +
+ Verifier.PROPERTIES_FILE_SUFFIX);
+ try (FileWriter wr = new FileWriter(f)) {
+ properties.store(wr, "");
+ } catch (IOException e) {
+ throw new Error("Unable to store test properties.", e);
+ }
+ }
+
+ private static boolean isMethodCompiledByC2(Method m) {
+ boolean isTiered = WB.getBooleanVMFlag("TieredCompilation");
+ boolean isMethodCompiled = WB.isMethodCompiled(m);
+ boolean isMethodCompiledAtMaxTier
+ = WB.getMethodCompilationLevel(m) == MAX_TIER;
+
+ return Platform.isServer() && isMethodCompiled
+ && (!isTiered || isMethodCompiledAtMaxTier);
+ }
+
+ /**
+ * Generates class with name {@code CLASS_NAME}, which will contain a
+ * static method {@code METHOD_NAME}:
+ *
+ * {@code
+ * public abstract class UnstableIfExecutable {
+ * private static int field = 0;
+ *
+ * public static void test(boolean alwaysTrue) {
+ * if (alwaysTrue) {
+ * field++;
+ * } else {
+ * field--;
+ * }
+ * }
+ * }
+ * }
+ *
+ * @return generated bytecode.
+ */
+ private static byte[] generateTest(Label unstableIfLocation) {
+ ClassWriter cw = new ClassWriter(ClassWriter.COMPUTE_FRAMES);
+
+ cw.visit(CLASS_FILE_VERSION, ACC_PUBLIC | ACC_ABSTRACT, CLASS_NAME,
+ null, "java/lang/Object", null);
+
+ cw.visitField(ACC_PUBLIC | ACC_STATIC | ACC_VOLATILE, FIELD_NAME,
+ "I", null, Integer.valueOf(0));
+
+ generateTestMethod(cw, unstableIfLocation);
+
+ return cw.toByteArray();
+ }
+
+ private static void generateTestMethod(ClassVisitor cv,
+ Label unstableIfLocation) {
+ MethodVisitor mv = cv.visitMethod(ACC_PUBLIC | ACC_STATIC, METHOD_NAME,
+ "(Z)V", null, null);
+ mv.visitCode();
+
+ Label end = new Label();
+ Label falseBranch = new Label();
+
+ // push "field" field's value and 1 to stack
+ mv.visitFieldInsn(GETSTATIC, CLASS_NAME, FIELD_NAME, "I");
+ mv.visitInsn(ICONST_1);
+ // load argument's value
+ mv.visitVarInsn(ILOAD, 0); // alwaysTrue
+ // here is our unstable if
+ mv.visitLabel(unstableIfLocation);
+ mv.visitJumpInsn(IFEQ, falseBranch);
+ // increment on "true"
+ mv.visitInsn(IADD);
+ mv.visitJumpInsn(GOTO, end);
+ // decrement on "false"
+ mv.visitLabel(falseBranch);
+ mv.visitInsn(ISUB);
+ mv.visitLabel(end);
+ // bye bye
+ mv.visitInsn(RETURN);
+
+ mv.visitMaxs(0, 0);
+ mv.visitEnd();
+ }
+}
+
diff --git a/hotspot/test/compiler/whitebox/ForceNMethodSweepTest.java b/hotspot/test/compiler/whitebox/ForceNMethodSweepTest.java
index 5038e7cfa8f..c08067ec4be 100644
--- a/hotspot/test/compiler/whitebox/ForceNMethodSweepTest.java
+++ b/hotspot/test/compiler/whitebox/ForceNMethodSweepTest.java
@@ -34,6 +34,7 @@ import com.oracle.java.testlibrary.InfiniteLoop;
/*
* @test
* @bug 8059624 8064669
+ * @ignore 8066998
* @library /testlibrary /../../test/lib
* @build ForceNMethodSweepTest
* @run main ClassFileInstaller sun.hotspot.WhiteBox
diff --git a/hotspot/test/gc/TestSmallHeap.java b/hotspot/test/gc/TestSmallHeap.java
index 321e33bf3b6..170b5397740 100644
--- a/hotspot/test/gc/TestSmallHeap.java
+++ b/hotspot/test/gc/TestSmallHeap.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2015, 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
@@ -26,34 +26,46 @@
* @bug 8067438
* @requires vm.gc=="null"
* @summary Verify that starting the VM with a small heap works
- * @library /testlibrary
- * @run main/othervm -Xmx4m -XX:+UseParallelGC TestSmallHeap
- * @run main/othervm -Xmx4m -XX:+UseSerialGC TestSmallHeap
- * @run main/othervm -Xmx4m -XX:+UseG1GC TestSmallHeap
- * @run main/othervm -Xmx4m -XX:+UseConcMarkSweepGC -XX:CMSMarkStackSizeMax=1032 TestSmallHeap
+ * @library /testlibrary /../../test/lib
+ * @build TestSmallHeap
+ * @run main ClassFileInstaller sun.hotspot.WhiteBox
+ * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xmx2m -XX:+UseParallelGC TestSmallHeap
+ * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xmx2m -XX:+UseSerialGC TestSmallHeap
+ * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xmx2m -XX:+UseG1GC TestSmallHeap
+ * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xmx2m -XX:+UseConcMarkSweepGC TestSmallHeap
+ *
+ * Note: It would be nice to verify the minimal supported heap size (2m) here,
+ * but we align the heap size based on the card table size. And the card table
+ * size is aligned based on the minimal pages size provided by the os. This
+ * means that on most platforms, where the minimal page size is 4k, we get a
+ * minimal heap size of 2m but on Solaris/Sparc we have a page size of 8k and
+ * get a minimal heap size of 4m. And on platforms where the page size is 64k
+ * we get a minimal heap size of 32m. We never use large pages for the card table.
*
- * Note: It would be nice to verify the minimal supported heap size here,
- * but that turns out to be quite tricky since we align the heap size based
- * on the card table size. And the card table size is aligned based on the
- * minimal pages size provided by the os. This means that on most platforms,
- * where the minimal page size is 4k, we get a minimal heap size of 2m but
- * on Solaris/Sparc we have a page size of 8k and get a minimal heap size
- * of 8m.
* There is also no check in the VM for verifying that the maximum heap size
* is larger than the supported minimal heap size. This means that specifying
- * -Xmx1m on the command line is fine but will give a heap of 2m (or 4m).
- * To work around these rather strange behaviors this test uses 4m for all
- * platforms.
+ * -Xmx1m on the command line is fine but will give a heap of 2m (or 4m or 32m).
+ *
+ * To work around these rather strange behaviors this test uses -Xmx2m but then
+ * calculates what the expected heap size should be. The calculation is a
+ * simplified version of the code in the VM. We assume that the card table will
+ * use one page. Each byte in the card table corresponds to 512 bytes on the heap.
+ * So, the expected heap size is page_size * 512.
*/
-import sun.management.ManagementFactoryHelper;
+import com.oracle.java.testlibrary.*;
import static com.oracle.java.testlibrary.Asserts.*;
+import sun.hotspot.WhiteBox;
+import sun.management.ManagementFactoryHelper;
public class TestSmallHeap {
public static void main(String[] args) {
+ WhiteBox wb = WhiteBox.getWhiteBox();
+ int pageSize = wb.getVMPageSize();
+ int heapBytesPerCard = 512;
+ long expectedMaxHeap = pageSize * heapBytesPerCard;
String maxHeap = ManagementFactoryHelper.getDiagnosticMXBean().getVMOption("MaxHeapSize").getValue();
- String expectedMaxHeap = "4194304";
- assertEQ(maxHeap, expectedMaxHeap);
+ assertEQ(Long.parseLong(maxHeap), expectedMaxHeap);
}
}
diff --git a/hotspot/test/gc/arguments/TestMaxHeapSizeTools.java b/hotspot/test/gc/arguments/TestMaxHeapSizeTools.java
index b5859b5cf49..99ed508d677 100644
--- a/hotspot/test/gc/arguments/TestMaxHeapSizeTools.java
+++ b/hotspot/test/gc/arguments/TestMaxHeapSizeTools.java
@@ -112,7 +112,7 @@ class TestMaxHeapSizeTools {
}
private static void checkInvalidMinInitialHeapCombinations(String gcflag) throws Exception {
- expectError(new String[] { gcflag, "-Xms8M", "-XX:InitialHeapSize=4M", "-version" });
+ expectError(new String[] { gcflag, "-Xms64M", "-XX:InitialHeapSize=32M", "-version" });
}
private static void checkValidMinInitialHeapCombinations(String gcflag) throws Exception {
diff --git a/hotspot/test/gc/g1/TestGCLogMessages.java b/hotspot/test/gc/g1/TestGCLogMessages.java
index 5e19d4f2d14..938d17bfec4 100644
--- a/hotspot/test/gc/g1/TestGCLogMessages.java
+++ b/hotspot/test/gc/g1/TestGCLogMessages.java
@@ -107,8 +107,8 @@ public class TestGCLogMessages {
private static void testWithToSpaceExhaustionLogs() throws Exception {
ProcessBuilder pb = ProcessTools.createJavaProcessBuilder("-XX:+UseG1GC",
- "-Xmx10M",
- "-Xmn5M",
+ "-Xmx32M",
+ "-Xmn16M",
"-XX:+PrintGCDetails",
GCTestWithToSpaceExhaustion.class.getName());
@@ -120,8 +120,8 @@ public class TestGCLogMessages {
output.shouldHaveExitValue(0);
pb = ProcessTools.createJavaProcessBuilder("-XX:+UseG1GC",
- "-Xmx10M",
- "-Xmn5M",
+ "-Xmx32M",
+ "-Xmn16M",
"-XX:+PrintGCDetails",
"-XX:+UnlockExperimentalVMOptions",
"-XX:G1LogLevel=finest",
@@ -151,7 +151,7 @@ public class TestGCLogMessages {
private static byte[] garbage;
private static byte[] largeObject;
public static void main(String [] args) {
- largeObject = new byte[5*1024*1024];
+ largeObject = new byte[16*1024*1024];
System.out.println("Creating garbage");
// create 128MB of garbage. This should result in at least one GC,
// some of them with to-space exhaustion.
diff --git a/hotspot/test/gc/g1/TestHumongousAllocInitialMark.java b/hotspot/test/gc/g1/TestHumongousAllocInitialMark.java
index 473ce666e9e..b6e5c3d66d3 100644
--- a/hotspot/test/gc/g1/TestHumongousAllocInitialMark.java
+++ b/hotspot/test/gc/g1/TestHumongousAllocInitialMark.java
@@ -31,7 +31,9 @@
import com.oracle.java.testlibrary.*;
public class TestHumongousAllocInitialMark {
- private static final int heapSize = 200; // MB
+ // Heap sizes < 224 MB are increased to 224 MB if vm_page_size == 64K to
+ // fulfill alignment constraints.
+ private static final int heapSize = 224; // MB
private static final int heapRegionSize = 1; // MB
private static final int initiatingHeapOccupancyPercent = 50; // %
diff --git a/hotspot/test/runtime/6888954/vmerrors.sh b/hotspot/test/runtime/6888954/vmerrors.sh
index 28f6eea0fec..98540c4d235 100644
--- a/hotspot/test/runtime/6888954/vmerrors.sh
+++ b/hotspot/test/runtime/6888954/vmerrors.sh
@@ -1,4 +1,4 @@
-# Copyright (c) 2013, 2014, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2013, 2015, 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
@@ -71,11 +71,12 @@ bad_data_ptr_re='(SIGILL|SIGSEGV|EXCEPTION_ACCESS_VIOLATION).* at pc='
# EXCEPTION_ACCESS_VIOLATION - Win-*
# SIGBUS - Solaris SPARC-64
# SIGSEGV - Linux-*, Solaris SPARC-32, Solaris X86-*
+# SIGILL - Aix
#
# Note: would like to use "pc=0x00*0f," in the pattern, but Solaris SPARC-*
# gets its signal at a PC in test_error_handler().
#
-bad_func_ptr_re='(SIGBUS|SIGSEGV|EXCEPTION_ACCESS_VIOLATION).* at pc='
+bad_func_ptr_re='(SIGBUS|SIGSEGV|SIGILL|EXCEPTION_ACCESS_VIOLATION).* at pc='
guarantee_re='guarantee[(](str|num).*failed: *'
fatal_re='fatal error: *'
tail_1='.*expected null'
diff --git a/hotspot/test/runtime/CommandLine/CompilerConfigFileWarning.java b/hotspot/test/runtime/CommandLine/CompilerConfigFileWarning.java
index aa5b4746139..c546272641a 100644
--- a/hotspot/test/runtime/CommandLine/CompilerConfigFileWarning.java
+++ b/hotspot/test/runtime/CommandLine/CompilerConfigFileWarning.java
@@ -43,7 +43,7 @@ public class CompilerConfigFileWarning {
pb = ProcessTools.createJavaProcessBuilder("-XX:CompileCommandFile=hs_comp.txt", "-version");
output = new OutputAnalyzer(pb.start());
- output.shouldContain("CompilerOracle: unrecognized line");
+ output.shouldContain("CompileCommand: unrecognized command");
output.shouldContain("aaa aaa");
// Skip on debug builds since we'll always read the file there
diff --git a/hotspot/test/runtime/whitebox/WBStackSize.java b/hotspot/test/runtime/whitebox/WBStackSize.java
index b3226974553..0941fb793df 100644
--- a/hotspot/test/runtime/whitebox/WBStackSize.java
+++ b/hotspot/test/runtime/whitebox/WBStackSize.java
@@ -47,7 +47,7 @@ public class WBStackSize {
static final long K = 1024;
static final long MIN_STACK_SIZE = 8 * K;
- static final long MAX_STACK_SIZE_ALLOCATED_IN_MAIN = 200 * K; // current value is about 130k on 64-bit platforms
+ static final long MAX_STACK_SIZE_ALLOCATED_IN_MAIN = 150 * K; // current value is about 130k on 64-bit platforms
static final WhiteBox wb = WhiteBox.getWhiteBox();
@@ -82,9 +82,11 @@ public class WBStackSize {
public static void main(String[] args) {
long configStackSize = wb.getIntxVMFlag("ThreadStackSize") * K;
-
System.out.println("ThreadStackSize VM option: " + configStackSize);
+ long stackProtectionSize = wb.getIntxVMFlag("StackShadowPages") * wb.getVMPageSize();
+ System.out.println("Size of protected shadow pages: " + stackProtectionSize);
+
long actualStackSize = wb.getThreadStackSize();
System.out.println("Full stack size: " + actualStackSize);
@@ -96,14 +98,16 @@ public class WBStackSize {
long remainingStackSize = wb.getThreadRemainingStackSize();
System.out.println("Remaining stack size in main(): " + remainingStackSize);
- // Up to 200k can be already allocated by VM
+ // Up to 150k can be already allocated by VM and some space is used for stack protection.
+ long spaceAlreadyOccupied = MAX_STACK_SIZE_ALLOCATED_IN_MAIN + stackProtectionSize;
+
if (remainingStackSize > configStackSize
- || (configStackSize > MAX_STACK_SIZE_ALLOCATED_IN_MAIN
- && remainingStackSize < configStackSize - MAX_STACK_SIZE_ALLOCATED_IN_MAIN)) {
+ || (configStackSize > spaceAlreadyOccupied
+ && remainingStackSize < configStackSize - spaceAlreadyOccupied)) {
throw new RuntimeException("getThreadRemainingStackSize value [" + remainingStackSize
+ "] should be at least ThreadStackSize value [" + configStackSize + "] minus ["
- + MAX_STACK_SIZE_ALLOCATED_IN_MAIN + "]");
+ + spaceAlreadyOccupied + "]");
}
testStackOverflow();
diff --git a/hotspot/test/serviceability/dcmd/DynLibDcmdTest.java b/hotspot/test/serviceability/dcmd/DynLibDcmdTest.java
index 069b06f1937..2f6b08ddd94 100644
--- a/hotspot/test/serviceability/dcmd/DynLibDcmdTest.java
+++ b/hotspot/test/serviceability/dcmd/DynLibDcmdTest.java
@@ -3,7 +3,7 @@ import java.util.Set;
import com.oracle.java.testlibrary.Platform;
/*
- * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2015, 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
@@ -39,14 +39,16 @@ public class DynLibDcmdTest {
String result = DcmdUtil.executeDcmd("VM.dynlibs");
String osDependentBaseString = null;
- if (Platform.isSolaris()) {
+ if (Platform.isAix()) {
+ osDependentBaseString = "lib%s.so";
+ } else if (Platform.isLinux()) {
+ osDependentBaseString = "lib%s.so";
+ } else if (Platform.isOSX()) {
+ osDependentBaseString = "lib%s.dylib";
+ } else if (Platform.isSolaris()) {
osDependentBaseString = "lib%s.so";
} else if (Platform.isWindows()) {
osDependentBaseString = "%s.dll";
- } else if (Platform.isOSX()) {
- osDependentBaseString = "lib%s.dylib";
- } else if (Platform.isLinux()) {
- osDependentBaseString = "lib%s.so";
}
if (osDependentBaseString == null) {
diff --git a/hotspot/test/test_env.sh b/hotspot/test/test_env.sh
index e9fc3abb0ff..7fcfb93c737 100644
--- a/hotspot/test/test_env.sh
+++ b/hotspot/test/test_env.sh
@@ -1,6 +1,6 @@
#!/bin/sh
#
-# Copyright (c) 2013, 2014, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2013, 2015, 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
@@ -56,7 +56,7 @@ echo "TESTOPTS=${TESTOPTS}"
# set platform-dependent variables
OS=`uname -s`
case "$OS" in
- SunOS | Linux | Darwin )
+ AIX | Darwin | Linux | SunOS )
NULL=/dev/null
PS=":"
FS="/"
@@ -133,26 +133,31 @@ then
fi
VM_OS="unknown"
-grep "solaris" vm_version.out > ${NULL}
+grep "aix" vm_version.out > ${NULL}
if [ $? = 0 ]
then
- VM_OS="solaris"
+ VM_OS="aix"
+fi
+grep "bsd" vm_version.out > ${NULL}
+if [ $? = 0 ]
+then
+ VM_OS="bsd"
fi
grep "linux" vm_version.out > ${NULL}
if [ $? = 0 ]
then
VM_OS="linux"
fi
+grep "solaris" vm_version.out > ${NULL}
+if [ $? = 0 ]
+then
+ VM_OS="solaris"
+fi
grep "windows" vm_version.out > ${NULL}
if [ $? = 0 ]
then
VM_OS="windows"
fi
-grep "bsd" vm_version.out > ${NULL}
-if [ $? = 0 ]
-then
- VM_OS="bsd"
-fi
VM_CPU="unknown"
grep "sparc" vm_version.out > ${NULL}
diff --git a/hotspot/test/testlibrary/com/oracle/java/testlibrary/Platform.java b/hotspot/test/testlibrary/com/oracle/java/testlibrary/Platform.java
index 8bdb863ed46..d26702deffa 100644
--- a/hotspot/test/testlibrary/com/oracle/java/testlibrary/Platform.java
+++ b/hotspot/test/testlibrary/com/oracle/java/testlibrary/Platform.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2015, 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
@@ -68,20 +68,24 @@ public class Platform {
return dataModel.equals("64");
}
- public static boolean isSolaris() {
- return isOs("sunos");
+ public static boolean isAix() {
+ return isOs("aix");
}
- public static boolean isWindows() {
- return isOs("win");
+ public static boolean isLinux() {
+ return isOs("linux");
}
public static boolean isOSX() {
return isOs("mac");
}
- public static boolean isLinux() {
- return isOs("linux");
+ public static boolean isSolaris() {
+ return isOs("sunos");
+ }
+
+ public static boolean isWindows() {
+ return isOs("win");
}
private static boolean isOs(String osname) {
@@ -140,7 +144,9 @@ public class Platform {
*/
public static boolean shouldSAAttach() throws Exception {
- if (isLinux()) {
+ if (isAix()) {
+ return false; // SA not implemented.
+ } else if (isLinux()) {
return canPtraceAttachLinux();
} else if (isOSX()) {
return canAttachOSX();
diff --git a/hotspot/test/testlibrary_tests/TestMutuallyExclusivePlatformPredicates.java b/hotspot/test/testlibrary_tests/TestMutuallyExclusivePlatformPredicates.java
index b16d6eb7540..1f022a9d0f8 100644
--- a/hotspot/test/testlibrary_tests/TestMutuallyExclusivePlatformPredicates.java
+++ b/hotspot/test/testlibrary_tests/TestMutuallyExclusivePlatformPredicates.java
@@ -45,7 +45,7 @@ public class TestMutuallyExclusivePlatformPredicates {
private static enum MethodGroup {
ARCH("isARM", "isPPC", "isSparc", "isX86", "isX64"),
BITNESS("is32bit", "is64bit"),
- OS("isLinux", "isSolaris", "isWindows", "isOSX"),
+ OS("isAix", "isLinux", "isOSX", "isSolaris", "isWindows"),
VM_TYPE("isClient", "isServer", "isGraal", "isMinimal"),
IGNORED("isEmbedded", "isDebugBuild", "shouldSAAttach",
"canPtraceAttachLinux", "canAttachOSX", "isTieredSupported");
diff --git a/jaxp/.hgtags b/jaxp/.hgtags
index bd9d0889f34..cf9a1867715 100644
--- a/jaxp/.hgtags
+++ b/jaxp/.hgtags
@@ -287,3 +287,4 @@ a12d347f84176200593999f4da91ae2bb86865b2 jdk9-b39
47b0d3fa4118b9d56870cf4004987438c501f5c0 jdk9-b42
40b242363040229a05224fbc5dc203a3f46a8f8f jdk9-b43
0cb0844b58924d6086d2850c22087d06679d5eef jdk9-b44
+0dab3e848229127c7aca4c58b98e2d90ba70372f jdk9-b45
diff --git a/jaxws/.hgtags b/jaxws/.hgtags
index 7e1244a3c4b..e529fdaecfb 100644
--- a/jaxws/.hgtags
+++ b/jaxws/.hgtags
@@ -290,3 +290,4 @@ dd4ba422dba858b1c3c4b38f49a3e514be4e2790 jdk9-b38
301ddb4478fb36d1f025d14e7e48c2a434e9e6ff jdk9-b42
edc13d27dc871be57d7ca77eef77e6d04972fee2 jdk9-b43
2a03baa4d849818ff6d635f110c2813b12fc2326 jdk9-b44
+e529374fbe526dbd668e5e98fc047b42b3bc6d33 jdk9-b45
diff --git a/jaxws/src/java.xml.soap/share/classes/com/sun/xml/internal/messaging/saaj/LazyEnvelopeSource.java b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/LazyEnvelopeSource.java
similarity index 100%
rename from jaxws/src/java.xml.soap/share/classes/com/sun/xml/internal/messaging/saaj/LazyEnvelopeSource.java
rename to jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/LazyEnvelopeSource.java
diff --git a/jaxws/src/java.xml.soap/share/classes/com/sun/xml/internal/messaging/saaj/SOAPExceptionImpl.java b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/SOAPExceptionImpl.java
similarity index 100%
rename from jaxws/src/java.xml.soap/share/classes/com/sun/xml/internal/messaging/saaj/SOAPExceptionImpl.java
rename to jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/SOAPExceptionImpl.java
diff --git a/jaxws/src/java.xml.soap/share/classes/com/sun/xml/internal/messaging/saaj/client/p2p/HttpSOAPConnection.java b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/client/p2p/HttpSOAPConnection.java
similarity index 100%
rename from jaxws/src/java.xml.soap/share/classes/com/sun/xml/internal/messaging/saaj/client/p2p/HttpSOAPConnection.java
rename to jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/client/p2p/HttpSOAPConnection.java
diff --git a/jaxws/src/java.xml.soap/share/classes/com/sun/xml/internal/messaging/saaj/client/p2p/HttpSOAPConnectionFactory.java b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/client/p2p/HttpSOAPConnectionFactory.java
similarity index 100%
rename from jaxws/src/java.xml.soap/share/classes/com/sun/xml/internal/messaging/saaj/client/p2p/HttpSOAPConnectionFactory.java
rename to jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/client/p2p/HttpSOAPConnectionFactory.java
diff --git a/jaxws/src/java.xml.soap/share/classes/com/sun/xml/internal/messaging/saaj/client/p2p/LocalStrings.properties b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/client/p2p/LocalStrings.properties
similarity index 100%
rename from jaxws/src/java.xml.soap/share/classes/com/sun/xml/internal/messaging/saaj/client/p2p/LocalStrings.properties
rename to jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/client/p2p/LocalStrings.properties
diff --git a/jaxws/src/java.xml.soap/share/classes/com/sun/xml/internal/messaging/saaj/client/p2p/LocalStrings_de.properties b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/client/p2p/LocalStrings_de.properties
similarity index 100%
rename from jaxws/src/java.xml.soap/share/classes/com/sun/xml/internal/messaging/saaj/client/p2p/LocalStrings_de.properties
rename to jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/client/p2p/LocalStrings_de.properties
diff --git a/jaxws/src/java.xml.soap/share/classes/com/sun/xml/internal/messaging/saaj/client/p2p/LocalStrings_es.properties b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/client/p2p/LocalStrings_es.properties
similarity index 100%
rename from jaxws/src/java.xml.soap/share/classes/com/sun/xml/internal/messaging/saaj/client/p2p/LocalStrings_es.properties
rename to jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/client/p2p/LocalStrings_es.properties
diff --git a/jaxws/src/java.xml.soap/share/classes/com/sun/xml/internal/messaging/saaj/client/p2p/LocalStrings_fr.properties b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/client/p2p/LocalStrings_fr.properties
similarity index 100%
rename from jaxws/src/java.xml.soap/share/classes/com/sun/xml/internal/messaging/saaj/client/p2p/LocalStrings_fr.properties
rename to jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/client/p2p/LocalStrings_fr.properties
diff --git a/jaxws/src/java.xml.soap/share/classes/com/sun/xml/internal/messaging/saaj/client/p2p/LocalStrings_it.properties b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/client/p2p/LocalStrings_it.properties
similarity index 100%
rename from jaxws/src/java.xml.soap/share/classes/com/sun/xml/internal/messaging/saaj/client/p2p/LocalStrings_it.properties
rename to jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/client/p2p/LocalStrings_it.properties
diff --git a/jaxws/src/java.xml.soap/share/classes/com/sun/xml/internal/messaging/saaj/client/p2p/LocalStrings_ja.properties b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/client/p2p/LocalStrings_ja.properties
similarity index 100%
rename from jaxws/src/java.xml.soap/share/classes/com/sun/xml/internal/messaging/saaj/client/p2p/LocalStrings_ja.properties
rename to jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/client/p2p/LocalStrings_ja.properties
diff --git a/jaxws/src/java.xml.soap/share/classes/com/sun/xml/internal/messaging/saaj/client/p2p/LocalStrings_ko.properties b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/client/p2p/LocalStrings_ko.properties
similarity index 100%
rename from jaxws/src/java.xml.soap/share/classes/com/sun/xml/internal/messaging/saaj/client/p2p/LocalStrings_ko.properties
rename to jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/client/p2p/LocalStrings_ko.properties
diff --git a/jaxws/src/java.xml.soap/share/classes/com/sun/xml/internal/messaging/saaj/client/p2p/LocalStrings_pt_BR.properties b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/client/p2p/LocalStrings_pt_BR.properties
similarity index 100%
rename from jaxws/src/java.xml.soap/share/classes/com/sun/xml/internal/messaging/saaj/client/p2p/LocalStrings_pt_BR.properties
rename to jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/client/p2p/LocalStrings_pt_BR.properties
diff --git a/jaxws/src/java.xml.soap/share/classes/com/sun/xml/internal/messaging/saaj/client/p2p/LocalStrings_zh_CN.properties b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/client/p2p/LocalStrings_zh_CN.properties
similarity index 100%
rename from jaxws/src/java.xml.soap/share/classes/com/sun/xml/internal/messaging/saaj/client/p2p/LocalStrings_zh_CN.properties
rename to jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/client/p2p/LocalStrings_zh_CN.properties
diff --git a/jaxws/src/java.xml.soap/share/classes/com/sun/xml/internal/messaging/saaj/client/p2p/LocalStrings_zh_TW.properties b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/client/p2p/LocalStrings_zh_TW.properties
similarity index 100%
rename from jaxws/src/java.xml.soap/share/classes/com/sun/xml/internal/messaging/saaj/client/p2p/LocalStrings_zh_TW.properties
rename to jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/client/p2p/LocalStrings_zh_TW.properties
diff --git a/jaxws/src/java.xml.soap/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/Header.java b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/Header.java
similarity index 100%
rename from jaxws/src/java.xml.soap/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/Header.java
rename to jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/Header.java
diff --git a/jaxws/src/java.xml.soap/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/MessagingException.java b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/MessagingException.java
similarity index 100%
rename from jaxws/src/java.xml.soap/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/MessagingException.java
rename to jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/MessagingException.java
diff --git a/jaxws/src/java.xml.soap/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/MultipartDataSource.java b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/MultipartDataSource.java
similarity index 100%
rename from jaxws/src/java.xml.soap/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/MultipartDataSource.java
rename to jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/MultipartDataSource.java
diff --git a/jaxws/src/java.xml.soap/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/internet/BMMimeMultipart.java b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/internet/BMMimeMultipart.java
similarity index 100%
rename from jaxws/src/java.xml.soap/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/internet/BMMimeMultipart.java
rename to jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/internet/BMMimeMultipart.java
diff --git a/jaxws/src/java.xml.soap/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/internet/ContentDisposition.java b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/internet/ContentDisposition.java
similarity index 100%
rename from jaxws/src/java.xml.soap/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/internet/ContentDisposition.java
rename to jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/internet/ContentDisposition.java
diff --git a/jaxws/src/java.xml.soap/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/internet/ContentType.java b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/internet/ContentType.java
similarity index 100%
rename from jaxws/src/java.xml.soap/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/internet/ContentType.java
rename to jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/internet/ContentType.java
diff --git a/jaxws/src/java.xml.soap/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/internet/HeaderTokenizer.java b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/internet/HeaderTokenizer.java
similarity index 100%
rename from jaxws/src/java.xml.soap/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/internet/HeaderTokenizer.java
rename to jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/internet/HeaderTokenizer.java
diff --git a/jaxws/src/java.xml.soap/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/internet/InternetHeaders.java b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/internet/InternetHeaders.java
similarity index 100%
rename from jaxws/src/java.xml.soap/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/internet/InternetHeaders.java
rename to jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/internet/InternetHeaders.java
diff --git a/jaxws/src/java.xml.soap/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/internet/MimeBodyPart.java b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/internet/MimeBodyPart.java
similarity index 100%
rename from jaxws/src/java.xml.soap/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/internet/MimeBodyPart.java
rename to jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/internet/MimeBodyPart.java
diff --git a/jaxws/src/java.xml.soap/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/internet/MimeMultipart.java b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/internet/MimeMultipart.java
similarity index 100%
rename from jaxws/src/java.xml.soap/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/internet/MimeMultipart.java
rename to jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/internet/MimeMultipart.java
diff --git a/jaxws/src/java.xml.soap/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/internet/MimePartDataSource.java b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/internet/MimePartDataSource.java
similarity index 100%
rename from jaxws/src/java.xml.soap/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/internet/MimePartDataSource.java
rename to jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/internet/MimePartDataSource.java
diff --git a/jaxws/src/java.xml.soap/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/internet/MimePullMultipart.java b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/internet/MimePullMultipart.java
similarity index 100%
rename from jaxws/src/java.xml.soap/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/internet/MimePullMultipart.java
rename to jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/internet/MimePullMultipart.java
diff --git a/jaxws/src/java.xml.soap/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/internet/MimeUtility.java b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/internet/MimeUtility.java
similarity index 100%
rename from jaxws/src/java.xml.soap/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/internet/MimeUtility.java
rename to jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/internet/MimeUtility.java
diff --git a/jaxws/src/java.xml.soap/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/internet/ParameterList.java b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/internet/ParameterList.java
similarity index 100%
rename from jaxws/src/java.xml.soap/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/internet/ParameterList.java
rename to jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/internet/ParameterList.java
diff --git a/jaxws/src/java.xml.soap/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/internet/ParseException.java b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/internet/ParseException.java
similarity index 100%
rename from jaxws/src/java.xml.soap/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/internet/ParseException.java
rename to jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/internet/ParseException.java
diff --git a/jaxws/src/java.xml.soap/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/internet/SharedInputStream.java b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/internet/SharedInputStream.java
similarity index 100%
rename from jaxws/src/java.xml.soap/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/internet/SharedInputStream.java
rename to jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/internet/SharedInputStream.java
diff --git a/jaxws/src/java.xml.soap/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/internet/UniqueValue.java b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/internet/UniqueValue.java
similarity index 100%
rename from jaxws/src/java.xml.soap/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/internet/UniqueValue.java
rename to jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/internet/UniqueValue.java
diff --git a/jaxws/src/java.xml.soap/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/util/ASCIIUtility.java b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/util/ASCIIUtility.java
similarity index 100%
rename from jaxws/src/java.xml.soap/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/util/ASCIIUtility.java
rename to jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/util/ASCIIUtility.java
diff --git a/jaxws/src/java.xml.soap/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/util/BASE64DecoderStream.java b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/util/BASE64DecoderStream.java
similarity index 100%
rename from jaxws/src/java.xml.soap/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/util/BASE64DecoderStream.java
rename to jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/util/BASE64DecoderStream.java
diff --git a/jaxws/src/java.xml.soap/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/util/BASE64EncoderStream.java b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/util/BASE64EncoderStream.java
similarity index 100%
rename from jaxws/src/java.xml.soap/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/util/BASE64EncoderStream.java
rename to jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/util/BASE64EncoderStream.java
diff --git a/jaxws/src/java.xml.soap/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/util/BEncoderStream.java b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/util/BEncoderStream.java
similarity index 100%
rename from jaxws/src/java.xml.soap/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/util/BEncoderStream.java
rename to jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/util/BEncoderStream.java
diff --git a/jaxws/src/java.xml.soap/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/util/LineInputStream.java b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/util/LineInputStream.java
similarity index 100%
rename from jaxws/src/java.xml.soap/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/util/LineInputStream.java
rename to jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/util/LineInputStream.java
diff --git a/jaxws/src/java.xml.soap/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/util/OutputUtil.java b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/util/OutputUtil.java
similarity index 100%
rename from jaxws/src/java.xml.soap/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/util/OutputUtil.java
rename to jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/util/OutputUtil.java
diff --git a/jaxws/src/java.xml.soap/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/util/QDecoderStream.java b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/util/QDecoderStream.java
similarity index 100%
rename from jaxws/src/java.xml.soap/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/util/QDecoderStream.java
rename to jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/util/QDecoderStream.java
diff --git a/jaxws/src/java.xml.soap/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/util/QEncoderStream.java b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/util/QEncoderStream.java
similarity index 100%
rename from jaxws/src/java.xml.soap/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/util/QEncoderStream.java
rename to jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/util/QEncoderStream.java
diff --git a/jaxws/src/java.xml.soap/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/util/QPDecoderStream.java b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/util/QPDecoderStream.java
similarity index 100%
rename from jaxws/src/java.xml.soap/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/util/QPDecoderStream.java
rename to jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/util/QPDecoderStream.java
diff --git a/jaxws/src/java.xml.soap/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/util/QPEncoderStream.java b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/util/QPEncoderStream.java
similarity index 100%
rename from jaxws/src/java.xml.soap/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/util/QPEncoderStream.java
rename to jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/util/QPEncoderStream.java
diff --git a/jaxws/src/java.xml.soap/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/util/UUDecoderStream.java b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/util/UUDecoderStream.java
similarity index 100%
rename from jaxws/src/java.xml.soap/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/util/UUDecoderStream.java
rename to jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/util/UUDecoderStream.java
diff --git a/jaxws/src/java.xml.soap/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/util/UUEncoderStream.java b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/util/UUEncoderStream.java
similarity index 100%
rename from jaxws/src/java.xml.soap/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/util/UUEncoderStream.java
rename to jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/util/UUEncoderStream.java
diff --git a/jaxws/src/java.xml.soap/share/classes/com/sun/xml/internal/messaging/saaj/soap/AttachmentPartImpl.java b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/AttachmentPartImpl.java
similarity index 100%
rename from jaxws/src/java.xml.soap/share/classes/com/sun/xml/internal/messaging/saaj/soap/AttachmentPartImpl.java
rename to jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/AttachmentPartImpl.java
diff --git a/jaxws/src/java.xml.soap/share/classes/com/sun/xml/internal/messaging/saaj/soap/ContextClassloaderLocal.java b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/ContextClassloaderLocal.java
similarity index 100%
rename from jaxws/src/java.xml.soap/share/classes/com/sun/xml/internal/messaging/saaj/soap/ContextClassloaderLocal.java
rename to jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/ContextClassloaderLocal.java
diff --git a/jaxws/src/java.xml.soap/share/classes/com/sun/xml/internal/messaging/saaj/soap/ContextClassloaderLocal.properties b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/ContextClassloaderLocal.properties
similarity index 100%
rename from jaxws/src/java.xml.soap/share/classes/com/sun/xml/internal/messaging/saaj/soap/ContextClassloaderLocal.properties
rename to jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/ContextClassloaderLocal.properties
diff --git a/jaxws/src/java.xml.soap/share/classes/com/sun/xml/internal/messaging/saaj/soap/Envelope.java b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/Envelope.java
similarity index 100%
rename from jaxws/src/java.xml.soap/share/classes/com/sun/xml/internal/messaging/saaj/soap/Envelope.java
rename to jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/Envelope.java
diff --git a/jaxws/src/java.xml.soap/share/classes/com/sun/xml/internal/messaging/saaj/soap/EnvelopeFactory.java b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/EnvelopeFactory.java
similarity index 100%
rename from jaxws/src/java.xml.soap/share/classes/com/sun/xml/internal/messaging/saaj/soap/EnvelopeFactory.java
rename to jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/EnvelopeFactory.java
diff --git a/jaxws/src/java.xml.soap/share/classes/com/sun/xml/internal/messaging/saaj/soap/FastInfosetDataContentHandler.java b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/FastInfosetDataContentHandler.java
similarity index 100%
rename from jaxws/src/java.xml.soap/share/classes/com/sun/xml/internal/messaging/saaj/soap/FastInfosetDataContentHandler.java
rename to jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/FastInfosetDataContentHandler.java
diff --git a/jaxws/src/java.xml.soap/share/classes/com/sun/xml/internal/messaging/saaj/soap/GifDataContentHandler.java b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/GifDataContentHandler.java
similarity index 100%
rename from jaxws/src/java.xml.soap/share/classes/com/sun/xml/internal/messaging/saaj/soap/GifDataContentHandler.java
rename to jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/GifDataContentHandler.java
diff --git a/jaxws/src/java.xml.soap/share/classes/com/sun/xml/internal/messaging/saaj/soap/ImageDataContentHandler.java b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/ImageDataContentHandler.java
similarity index 100%
rename from jaxws/src/java.xml.soap/share/classes/com/sun/xml/internal/messaging/saaj/soap/ImageDataContentHandler.java
rename to jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/ImageDataContentHandler.java
diff --git a/jaxws/src/java.xml.soap/share/classes/com/sun/xml/internal/messaging/saaj/soap/JpegDataContentHandler.java b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/JpegDataContentHandler.java
similarity index 100%
rename from jaxws/src/java.xml.soap/share/classes/com/sun/xml/internal/messaging/saaj/soap/JpegDataContentHandler.java
rename to jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/JpegDataContentHandler.java
diff --git a/jaxws/src/java.xml.soap/share/classes/com/sun/xml/internal/messaging/saaj/soap/LazyEnvelope.java b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/LazyEnvelope.java
similarity index 100%
rename from jaxws/src/java.xml.soap/share/classes/com/sun/xml/internal/messaging/saaj/soap/LazyEnvelope.java
rename to jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/LazyEnvelope.java
diff --git a/jaxws/src/java.xml.soap/share/classes/com/sun/xml/internal/messaging/saaj/soap/LocalStrings.properties b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/LocalStrings.properties
similarity index 100%
rename from jaxws/src/java.xml.soap/share/classes/com/sun/xml/internal/messaging/saaj/soap/LocalStrings.properties
rename to jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/LocalStrings.properties
diff --git a/jaxws/src/java.xml.soap/share/classes/com/sun/xml/internal/messaging/saaj/soap/LocalStrings_de.properties b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/LocalStrings_de.properties
similarity index 100%
rename from jaxws/src/java.xml.soap/share/classes/com/sun/xml/internal/messaging/saaj/soap/LocalStrings_de.properties
rename to jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/LocalStrings_de.properties
diff --git a/jaxws/src/java.xml.soap/share/classes/com/sun/xml/internal/messaging/saaj/soap/LocalStrings_es.properties b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/LocalStrings_es.properties
similarity index 100%
rename from jaxws/src/java.xml.soap/share/classes/com/sun/xml/internal/messaging/saaj/soap/LocalStrings_es.properties
rename to jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/LocalStrings_es.properties
diff --git a/jaxws/src/java.xml.soap/share/classes/com/sun/xml/internal/messaging/saaj/soap/LocalStrings_fr.properties b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/LocalStrings_fr.properties
similarity index 100%
rename from jaxws/src/java.xml.soap/share/classes/com/sun/xml/internal/messaging/saaj/soap/LocalStrings_fr.properties
rename to jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/LocalStrings_fr.properties
diff --git a/jaxws/src/java.xml.soap/share/classes/com/sun/xml/internal/messaging/saaj/soap/LocalStrings_it.properties b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/LocalStrings_it.properties
similarity index 100%
rename from jaxws/src/java.xml.soap/share/classes/com/sun/xml/internal/messaging/saaj/soap/LocalStrings_it.properties
rename to jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/LocalStrings_it.properties
diff --git a/jaxws/src/java.xml.soap/share/classes/com/sun/xml/internal/messaging/saaj/soap/LocalStrings_ja.properties b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/LocalStrings_ja.properties
similarity index 100%
rename from jaxws/src/java.xml.soap/share/classes/com/sun/xml/internal/messaging/saaj/soap/LocalStrings_ja.properties
rename to jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/LocalStrings_ja.properties
diff --git a/jaxws/src/java.xml.soap/share/classes/com/sun/xml/internal/messaging/saaj/soap/LocalStrings_ko.properties b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/LocalStrings_ko.properties
similarity index 100%
rename from jaxws/src/java.xml.soap/share/classes/com/sun/xml/internal/messaging/saaj/soap/LocalStrings_ko.properties
rename to jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/LocalStrings_ko.properties
diff --git a/jaxws/src/java.xml.soap/share/classes/com/sun/xml/internal/messaging/saaj/soap/LocalStrings_pt_BR.properties b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/LocalStrings_pt_BR.properties
similarity index 100%
rename from jaxws/src/java.xml.soap/share/classes/com/sun/xml/internal/messaging/saaj/soap/LocalStrings_pt_BR.properties
rename to jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/LocalStrings_pt_BR.properties
diff --git a/jaxws/src/java.xml.soap/share/classes/com/sun/xml/internal/messaging/saaj/soap/LocalStrings_zh_CN.properties b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/LocalStrings_zh_CN.properties
similarity index 100%
rename from jaxws/src/java.xml.soap/share/classes/com/sun/xml/internal/messaging/saaj/soap/LocalStrings_zh_CN.properties
rename to jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/LocalStrings_zh_CN.properties
diff --git a/jaxws/src/java.xml.soap/share/classes/com/sun/xml/internal/messaging/saaj/soap/LocalStrings_zh_TW.properties b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/LocalStrings_zh_TW.properties
similarity index 100%
rename from jaxws/src/java.xml.soap/share/classes/com/sun/xml/internal/messaging/saaj/soap/LocalStrings_zh_TW.properties
rename to jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/LocalStrings_zh_TW.properties
diff --git a/jaxws/src/java.xml.soap/share/classes/com/sun/xml/internal/messaging/saaj/soap/MessageFactoryImpl.java b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/MessageFactoryImpl.java
similarity index 100%
rename from jaxws/src/java.xml.soap/share/classes/com/sun/xml/internal/messaging/saaj/soap/MessageFactoryImpl.java
rename to jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/MessageFactoryImpl.java
diff --git a/jaxws/src/java.xml.soap/share/classes/com/sun/xml/internal/messaging/saaj/soap/MessageImpl.java b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/MessageImpl.java
similarity index 100%
rename from jaxws/src/java.xml.soap/share/classes/com/sun/xml/internal/messaging/saaj/soap/MessageImpl.java
rename to jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/MessageImpl.java
diff --git a/jaxws/src/java.xml.soap/share/classes/com/sun/xml/internal/messaging/saaj/soap/MultipartDataContentHandler.java b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/MultipartDataContentHandler.java
similarity index 100%
rename from jaxws/src/java.xml.soap/share/classes/com/sun/xml/internal/messaging/saaj/soap/MultipartDataContentHandler.java
rename to jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/MultipartDataContentHandler.java
diff --git a/jaxws/src/java.xml.soap/share/classes/com/sun/xml/internal/messaging/saaj/soap/SAAJMetaFactoryImpl.java b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/SAAJMetaFactoryImpl.java
similarity index 100%
rename from jaxws/src/java.xml.soap/share/classes/com/sun/xml/internal/messaging/saaj/soap/SAAJMetaFactoryImpl.java
rename to jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/SAAJMetaFactoryImpl.java
diff --git a/jaxws/src/java.xml.soap/share/classes/com/sun/xml/internal/messaging/saaj/soap/SOAPDocument.java b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/SOAPDocument.java
similarity index 100%
rename from jaxws/src/java.xml.soap/share/classes/com/sun/xml/internal/messaging/saaj/soap/SOAPDocument.java
rename to jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/SOAPDocument.java
diff --git a/jaxws/src/java.xml.soap/share/classes/com/sun/xml/internal/messaging/saaj/soap/SOAPDocumentFragment.java b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/SOAPDocumentFragment.java
similarity index 100%
rename from jaxws/src/java.xml.soap/share/classes/com/sun/xml/internal/messaging/saaj/soap/SOAPDocumentFragment.java
rename to jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/SOAPDocumentFragment.java
diff --git a/jaxws/src/java.xml.soap/share/classes/com/sun/xml/internal/messaging/saaj/soap/SOAPDocumentImpl.java b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/SOAPDocumentImpl.java
similarity index 100%
rename from jaxws/src/java.xml.soap/share/classes/com/sun/xml/internal/messaging/saaj/soap/SOAPDocumentImpl.java
rename to jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/SOAPDocumentImpl.java
diff --git a/jaxws/src/java.xml.soap/share/classes/com/sun/xml/internal/messaging/saaj/soap/SOAPFactoryImpl.java b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/SOAPFactoryImpl.java
similarity index 100%
rename from jaxws/src/java.xml.soap/share/classes/com/sun/xml/internal/messaging/saaj/soap/SOAPFactoryImpl.java
rename to jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/SOAPFactoryImpl.java
diff --git a/jaxws/src/java.xml.soap/share/classes/com/sun/xml/internal/messaging/saaj/soap/SOAPIOException.java b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/SOAPIOException.java
similarity index 100%
rename from jaxws/src/java.xml.soap/share/classes/com/sun/xml/internal/messaging/saaj/soap/SOAPIOException.java
rename to jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/SOAPIOException.java
diff --git a/jaxws/src/java.xml.soap/share/classes/com/sun/xml/internal/messaging/saaj/soap/SOAPPartImpl.java b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/SOAPPartImpl.java
similarity index 100%
rename from jaxws/src/java.xml.soap/share/classes/com/sun/xml/internal/messaging/saaj/soap/SOAPPartImpl.java
rename to jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/SOAPPartImpl.java
diff --git a/jaxws/src/java.xml.soap/share/classes/com/sun/xml/internal/messaging/saaj/soap/SOAPVersionMismatchException.java b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/SOAPVersionMismatchException.java
similarity index 100%
rename from jaxws/src/java.xml.soap/share/classes/com/sun/xml/internal/messaging/saaj/soap/SOAPVersionMismatchException.java
rename to jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/SOAPVersionMismatchException.java
diff --git a/jaxws/src/java.xml.soap/share/classes/com/sun/xml/internal/messaging/saaj/soap/StaxBridge.java b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/StaxBridge.java
similarity index 100%
rename from jaxws/src/java.xml.soap/share/classes/com/sun/xml/internal/messaging/saaj/soap/StaxBridge.java
rename to jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/StaxBridge.java
diff --git a/jaxws/src/java.xml.soap/share/classes/com/sun/xml/internal/messaging/saaj/soap/StaxLazySourceBridge.java b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/StaxLazySourceBridge.java
similarity index 100%
rename from jaxws/src/java.xml.soap/share/classes/com/sun/xml/internal/messaging/saaj/soap/StaxLazySourceBridge.java
rename to jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/StaxLazySourceBridge.java
diff --git a/jaxws/src/java.xml.soap/share/classes/com/sun/xml/internal/messaging/saaj/soap/StaxReaderBridge.java b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/StaxReaderBridge.java
similarity index 100%
rename from jaxws/src/java.xml.soap/share/classes/com/sun/xml/internal/messaging/saaj/soap/StaxReaderBridge.java
rename to jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/StaxReaderBridge.java
diff --git a/jaxws/src/java.xml.soap/share/classes/com/sun/xml/internal/messaging/saaj/soap/StringDataContentHandler.java b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/StringDataContentHandler.java
similarity index 100%
rename from jaxws/src/java.xml.soap/share/classes/com/sun/xml/internal/messaging/saaj/soap/StringDataContentHandler.java
rename to jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/StringDataContentHandler.java
diff --git a/jaxws/src/java.xml.soap/share/classes/com/sun/xml/internal/messaging/saaj/soap/XmlDataContentHandler.java b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/XmlDataContentHandler.java
similarity index 100%
rename from jaxws/src/java.xml.soap/share/classes/com/sun/xml/internal/messaging/saaj/soap/XmlDataContentHandler.java
rename to jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/XmlDataContentHandler.java
diff --git a/jaxws/src/java.xml.soap/share/classes/com/sun/xml/internal/messaging/saaj/soap/dynamic/SOAPFactoryDynamicImpl.java b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/dynamic/SOAPFactoryDynamicImpl.java
similarity index 100%
rename from jaxws/src/java.xml.soap/share/classes/com/sun/xml/internal/messaging/saaj/soap/dynamic/SOAPFactoryDynamicImpl.java
rename to jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/dynamic/SOAPFactoryDynamicImpl.java
diff --git a/jaxws/src/java.xml.soap/share/classes/com/sun/xml/internal/messaging/saaj/soap/dynamic/SOAPMessageFactoryDynamicImpl.java b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/dynamic/SOAPMessageFactoryDynamicImpl.java
similarity index 100%
rename from jaxws/src/java.xml.soap/share/classes/com/sun/xml/internal/messaging/saaj/soap/dynamic/SOAPMessageFactoryDynamicImpl.java
rename to jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/dynamic/SOAPMessageFactoryDynamicImpl.java
diff --git a/jaxws/src/java.xml.soap/share/classes/com/sun/xml/internal/messaging/saaj/soap/impl/BodyElementImpl.java b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/impl/BodyElementImpl.java
similarity index 100%
rename from jaxws/src/java.xml.soap/share/classes/com/sun/xml/internal/messaging/saaj/soap/impl/BodyElementImpl.java
rename to jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/impl/BodyElementImpl.java
diff --git a/jaxws/src/java.xml.soap/share/classes/com/sun/xml/internal/messaging/saaj/soap/impl/BodyImpl.java b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/impl/BodyImpl.java
similarity index 100%
rename from jaxws/src/java.xml.soap/share/classes/com/sun/xml/internal/messaging/saaj/soap/impl/BodyImpl.java
rename to jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/impl/BodyImpl.java
diff --git a/jaxws/src/java.xml.soap/share/classes/com/sun/xml/internal/messaging/saaj/soap/impl/CDATAImpl.java b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/impl/CDATAImpl.java
similarity index 100%
rename from jaxws/src/java.xml.soap/share/classes/com/sun/xml/internal/messaging/saaj/soap/impl/CDATAImpl.java
rename to jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/impl/CDATAImpl.java
diff --git a/jaxws/src/java.xml.soap/share/classes/com/sun/xml/internal/messaging/saaj/soap/impl/DetailEntryImpl.java b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/impl/DetailEntryImpl.java
similarity index 100%
rename from jaxws/src/java.xml.soap/share/classes/com/sun/xml/internal/messaging/saaj/soap/impl/DetailEntryImpl.java
rename to jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/impl/DetailEntryImpl.java
diff --git a/jaxws/src/java.xml.soap/share/classes/com/sun/xml/internal/messaging/saaj/soap/impl/DetailImpl.java b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/impl/DetailImpl.java
similarity index 100%
rename from jaxws/src/java.xml.soap/share/classes/com/sun/xml/internal/messaging/saaj/soap/impl/DetailImpl.java
rename to jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/impl/DetailImpl.java
diff --git a/jaxws/src/java.xml.soap/share/classes/com/sun/xml/internal/messaging/saaj/soap/impl/ElementFactory.java b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/impl/ElementFactory.java
similarity index 100%
rename from jaxws/src/java.xml.soap/share/classes/com/sun/xml/internal/messaging/saaj/soap/impl/ElementFactory.java
rename to jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/impl/ElementFactory.java
diff --git a/jaxws/src/java.xml.soap/share/classes/com/sun/xml/internal/messaging/saaj/soap/impl/ElementImpl.java b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/impl/ElementImpl.java
similarity index 100%
rename from jaxws/src/java.xml.soap/share/classes/com/sun/xml/internal/messaging/saaj/soap/impl/ElementImpl.java
rename to jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/impl/ElementImpl.java
diff --git a/jaxws/src/java.xml.soap/share/classes/com/sun/xml/internal/messaging/saaj/soap/impl/EnvelopeImpl.java b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/impl/EnvelopeImpl.java
similarity index 100%
rename from jaxws/src/java.xml.soap/share/classes/com/sun/xml/internal/messaging/saaj/soap/impl/EnvelopeImpl.java
rename to jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/impl/EnvelopeImpl.java
diff --git a/jaxws/src/java.xml.soap/share/classes/com/sun/xml/internal/messaging/saaj/soap/impl/FaultElementImpl.java b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/impl/FaultElementImpl.java
similarity index 100%
rename from jaxws/src/java.xml.soap/share/classes/com/sun/xml/internal/messaging/saaj/soap/impl/FaultElementImpl.java
rename to jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/impl/FaultElementImpl.java
diff --git a/jaxws/src/java.xml.soap/share/classes/com/sun/xml/internal/messaging/saaj/soap/impl/FaultImpl.java b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/impl/FaultImpl.java
similarity index 100%
rename from jaxws/src/java.xml.soap/share/classes/com/sun/xml/internal/messaging/saaj/soap/impl/FaultImpl.java
rename to jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/impl/FaultImpl.java
diff --git a/jaxws/src/java.xml.soap/share/classes/com/sun/xml/internal/messaging/saaj/soap/impl/HeaderElementImpl.java b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/impl/HeaderElementImpl.java
similarity index 100%
rename from jaxws/src/java.xml.soap/share/classes/com/sun/xml/internal/messaging/saaj/soap/impl/HeaderElementImpl.java
rename to jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/impl/HeaderElementImpl.java
diff --git a/jaxws/src/java.xml.soap/share/classes/com/sun/xml/internal/messaging/saaj/soap/impl/HeaderImpl.java b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/impl/HeaderImpl.java
similarity index 100%
rename from jaxws/src/java.xml.soap/share/classes/com/sun/xml/internal/messaging/saaj/soap/impl/HeaderImpl.java
rename to jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/impl/HeaderImpl.java
diff --git a/jaxws/src/java.xml.soap/share/classes/com/sun/xml/internal/messaging/saaj/soap/impl/LocalStrings.properties b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/impl/LocalStrings.properties
similarity index 100%
rename from jaxws/src/java.xml.soap/share/classes/com/sun/xml/internal/messaging/saaj/soap/impl/LocalStrings.properties
rename to jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/impl/LocalStrings.properties
diff --git a/jaxws/src/java.xml.soap/share/classes/com/sun/xml/internal/messaging/saaj/soap/impl/LocalStrings_de.properties b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/impl/LocalStrings_de.properties
similarity index 100%
rename from jaxws/src/java.xml.soap/share/classes/com/sun/xml/internal/messaging/saaj/soap/impl/LocalStrings_de.properties
rename to jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/impl/LocalStrings_de.properties
diff --git a/jaxws/src/java.xml.soap/share/classes/com/sun/xml/internal/messaging/saaj/soap/impl/LocalStrings_es.properties b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/impl/LocalStrings_es.properties
similarity index 100%
rename from jaxws/src/java.xml.soap/share/classes/com/sun/xml/internal/messaging/saaj/soap/impl/LocalStrings_es.properties
rename to jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/impl/LocalStrings_es.properties
diff --git a/jaxws/src/java.xml.soap/share/classes/com/sun/xml/internal/messaging/saaj/soap/impl/LocalStrings_fr.properties b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/impl/LocalStrings_fr.properties
similarity index 100%
rename from jaxws/src/java.xml.soap/share/classes/com/sun/xml/internal/messaging/saaj/soap/impl/LocalStrings_fr.properties
rename to jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/impl/LocalStrings_fr.properties
diff --git a/jaxws/src/java.xml.soap/share/classes/com/sun/xml/internal/messaging/saaj/soap/impl/LocalStrings_it.properties b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/impl/LocalStrings_it.properties
similarity index 100%
rename from jaxws/src/java.xml.soap/share/classes/com/sun/xml/internal/messaging/saaj/soap/impl/LocalStrings_it.properties
rename to jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/impl/LocalStrings_it.properties
diff --git a/jaxws/src/java.xml.soap/share/classes/com/sun/xml/internal/messaging/saaj/soap/impl/LocalStrings_ja.properties b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/impl/LocalStrings_ja.properties
similarity index 100%
rename from jaxws/src/java.xml.soap/share/classes/com/sun/xml/internal/messaging/saaj/soap/impl/LocalStrings_ja.properties
rename to jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/impl/LocalStrings_ja.properties
diff --git a/jaxws/src/java.xml.soap/share/classes/com/sun/xml/internal/messaging/saaj/soap/impl/LocalStrings_ko.properties b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/impl/LocalStrings_ko.properties
similarity index 100%
rename from jaxws/src/java.xml.soap/share/classes/com/sun/xml/internal/messaging/saaj/soap/impl/LocalStrings_ko.properties
rename to jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/impl/LocalStrings_ko.properties
diff --git a/jaxws/src/java.xml.soap/share/classes/com/sun/xml/internal/messaging/saaj/soap/impl/LocalStrings_pt_BR.properties b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/impl/LocalStrings_pt_BR.properties
similarity index 100%
rename from jaxws/src/java.xml.soap/share/classes/com/sun/xml/internal/messaging/saaj/soap/impl/LocalStrings_pt_BR.properties
rename to jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/impl/LocalStrings_pt_BR.properties
diff --git a/jaxws/src/java.xml.soap/share/classes/com/sun/xml/internal/messaging/saaj/soap/impl/LocalStrings_zh_CN.properties b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/impl/LocalStrings_zh_CN.properties
similarity index 100%
rename from jaxws/src/java.xml.soap/share/classes/com/sun/xml/internal/messaging/saaj/soap/impl/LocalStrings_zh_CN.properties
rename to jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/impl/LocalStrings_zh_CN.properties
diff --git a/jaxws/src/java.xml.soap/share/classes/com/sun/xml/internal/messaging/saaj/soap/impl/LocalStrings_zh_TW.properties b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/impl/LocalStrings_zh_TW.properties
similarity index 100%
rename from jaxws/src/java.xml.soap/share/classes/com/sun/xml/internal/messaging/saaj/soap/impl/LocalStrings_zh_TW.properties
rename to jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/impl/LocalStrings_zh_TW.properties
diff --git a/jaxws/src/java.xml.soap/share/classes/com/sun/xml/internal/messaging/saaj/soap/impl/SOAPCommentImpl.java b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/impl/SOAPCommentImpl.java
similarity index 100%
rename from jaxws/src/java.xml.soap/share/classes/com/sun/xml/internal/messaging/saaj/soap/impl/SOAPCommentImpl.java
rename to jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/impl/SOAPCommentImpl.java
diff --git a/jaxws/src/java.xml.soap/share/classes/com/sun/xml/internal/messaging/saaj/soap/impl/SOAPTextImpl.java b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/impl/SOAPTextImpl.java
similarity index 100%
rename from jaxws/src/java.xml.soap/share/classes/com/sun/xml/internal/messaging/saaj/soap/impl/SOAPTextImpl.java
rename to jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/impl/SOAPTextImpl.java
diff --git a/jaxws/src/java.xml.soap/share/classes/com/sun/xml/internal/messaging/saaj/soap/impl/TreeException.java b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/impl/TreeException.java
similarity index 100%
rename from jaxws/src/java.xml.soap/share/classes/com/sun/xml/internal/messaging/saaj/soap/impl/TreeException.java
rename to jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/impl/TreeException.java
diff --git a/jaxws/src/java.xml.soap/share/classes/com/sun/xml/internal/messaging/saaj/soap/name/LocalStrings.properties b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/name/LocalStrings.properties
similarity index 100%
rename from jaxws/src/java.xml.soap/share/classes/com/sun/xml/internal/messaging/saaj/soap/name/LocalStrings.properties
rename to jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/name/LocalStrings.properties
diff --git a/jaxws/src/java.xml.soap/share/classes/com/sun/xml/internal/messaging/saaj/soap/name/LocalStrings_de.properties b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/name/LocalStrings_de.properties
similarity index 100%
rename from jaxws/src/java.xml.soap/share/classes/com/sun/xml/internal/messaging/saaj/soap/name/LocalStrings_de.properties
rename to jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/name/LocalStrings_de.properties
diff --git a/jaxws/src/java.xml.soap/share/classes/com/sun/xml/internal/messaging/saaj/soap/name/LocalStrings_es.properties b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/name/LocalStrings_es.properties
similarity index 100%
rename from jaxws/src/java.xml.soap/share/classes/com/sun/xml/internal/messaging/saaj/soap/name/LocalStrings_es.properties
rename to jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/name/LocalStrings_es.properties
diff --git a/jaxws/src/java.xml.soap/share/classes/com/sun/xml/internal/messaging/saaj/soap/name/LocalStrings_fr.properties b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/name/LocalStrings_fr.properties
similarity index 100%
rename from jaxws/src/java.xml.soap/share/classes/com/sun/xml/internal/messaging/saaj/soap/name/LocalStrings_fr.properties
rename to jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/name/LocalStrings_fr.properties
diff --git a/jaxws/src/java.xml.soap/share/classes/com/sun/xml/internal/messaging/saaj/soap/name/LocalStrings_it.properties b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/name/LocalStrings_it.properties
similarity index 100%
rename from jaxws/src/java.xml.soap/share/classes/com/sun/xml/internal/messaging/saaj/soap/name/LocalStrings_it.properties
rename to jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/name/LocalStrings_it.properties
diff --git a/jaxws/src/java.xml.soap/share/classes/com/sun/xml/internal/messaging/saaj/soap/name/LocalStrings_ja.properties b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/name/LocalStrings_ja.properties
similarity index 100%
rename from jaxws/src/java.xml.soap/share/classes/com/sun/xml/internal/messaging/saaj/soap/name/LocalStrings_ja.properties
rename to jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/name/LocalStrings_ja.properties
diff --git a/jaxws/src/java.xml.soap/share/classes/com/sun/xml/internal/messaging/saaj/soap/name/LocalStrings_ko.properties b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/name/LocalStrings_ko.properties
similarity index 100%
rename from jaxws/src/java.xml.soap/share/classes/com/sun/xml/internal/messaging/saaj/soap/name/LocalStrings_ko.properties
rename to jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/name/LocalStrings_ko.properties
diff --git a/jaxws/src/java.xml.soap/share/classes/com/sun/xml/internal/messaging/saaj/soap/name/LocalStrings_pt_BR.properties b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/name/LocalStrings_pt_BR.properties
similarity index 100%
rename from jaxws/src/java.xml.soap/share/classes/com/sun/xml/internal/messaging/saaj/soap/name/LocalStrings_pt_BR.properties
rename to jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/name/LocalStrings_pt_BR.properties
diff --git a/jaxws/src/java.xml.soap/share/classes/com/sun/xml/internal/messaging/saaj/soap/name/LocalStrings_zh_CN.properties b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/name/LocalStrings_zh_CN.properties
similarity index 100%
rename from jaxws/src/java.xml.soap/share/classes/com/sun/xml/internal/messaging/saaj/soap/name/LocalStrings_zh_CN.properties
rename to jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/name/LocalStrings_zh_CN.properties
diff --git a/jaxws/src/java.xml.soap/share/classes/com/sun/xml/internal/messaging/saaj/soap/name/LocalStrings_zh_TW.properties b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/name/LocalStrings_zh_TW.properties
similarity index 100%
rename from jaxws/src/java.xml.soap/share/classes/com/sun/xml/internal/messaging/saaj/soap/name/LocalStrings_zh_TW.properties
rename to jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/name/LocalStrings_zh_TW.properties
diff --git a/jaxws/src/java.xml.soap/share/classes/com/sun/xml/internal/messaging/saaj/soap/name/NameImpl.java b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/name/NameImpl.java
similarity index 100%
rename from jaxws/src/java.xml.soap/share/classes/com/sun/xml/internal/messaging/saaj/soap/name/NameImpl.java
rename to jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/name/NameImpl.java
diff --git a/jaxws/src/java.xml.soap/share/classes/com/sun/xml/internal/messaging/saaj/soap/ver1_1/Body1_1Impl.java b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/ver1_1/Body1_1Impl.java
similarity index 100%
rename from jaxws/src/java.xml.soap/share/classes/com/sun/xml/internal/messaging/saaj/soap/ver1_1/Body1_1Impl.java
rename to jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/ver1_1/Body1_1Impl.java
diff --git a/jaxws/src/java.xml.soap/share/classes/com/sun/xml/internal/messaging/saaj/soap/ver1_1/BodyElement1_1Impl.java b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/ver1_1/BodyElement1_1Impl.java
similarity index 100%
rename from jaxws/src/java.xml.soap/share/classes/com/sun/xml/internal/messaging/saaj/soap/ver1_1/BodyElement1_1Impl.java
rename to jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/ver1_1/BodyElement1_1Impl.java
diff --git a/jaxws/src/java.xml.soap/share/classes/com/sun/xml/internal/messaging/saaj/soap/ver1_1/Detail1_1Impl.java b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/ver1_1/Detail1_1Impl.java
similarity index 100%
rename from jaxws/src/java.xml.soap/share/classes/com/sun/xml/internal/messaging/saaj/soap/ver1_1/Detail1_1Impl.java
rename to jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/ver1_1/Detail1_1Impl.java
diff --git a/jaxws/src/java.xml.soap/share/classes/com/sun/xml/internal/messaging/saaj/soap/ver1_1/DetailEntry1_1Impl.java b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/ver1_1/DetailEntry1_1Impl.java
similarity index 100%
rename from jaxws/src/java.xml.soap/share/classes/com/sun/xml/internal/messaging/saaj/soap/ver1_1/DetailEntry1_1Impl.java
rename to jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/ver1_1/DetailEntry1_1Impl.java
diff --git a/jaxws/src/java.xml.soap/share/classes/com/sun/xml/internal/messaging/saaj/soap/ver1_1/Envelope1_1Impl.java b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/ver1_1/Envelope1_1Impl.java
similarity index 100%
rename from jaxws/src/java.xml.soap/share/classes/com/sun/xml/internal/messaging/saaj/soap/ver1_1/Envelope1_1Impl.java
rename to jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/ver1_1/Envelope1_1Impl.java
diff --git a/jaxws/src/java.xml.soap/share/classes/com/sun/xml/internal/messaging/saaj/soap/ver1_1/Fault1_1Impl.java b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/ver1_1/Fault1_1Impl.java
similarity index 100%
rename from jaxws/src/java.xml.soap/share/classes/com/sun/xml/internal/messaging/saaj/soap/ver1_1/Fault1_1Impl.java
rename to jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/ver1_1/Fault1_1Impl.java
diff --git a/jaxws/src/java.xml.soap/share/classes/com/sun/xml/internal/messaging/saaj/soap/ver1_1/FaultElement1_1Impl.java b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/ver1_1/FaultElement1_1Impl.java
similarity index 100%
rename from jaxws/src/java.xml.soap/share/classes/com/sun/xml/internal/messaging/saaj/soap/ver1_1/FaultElement1_1Impl.java
rename to jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/ver1_1/FaultElement1_1Impl.java
diff --git a/jaxws/src/java.xml.soap/share/classes/com/sun/xml/internal/messaging/saaj/soap/ver1_1/Header1_1Impl.java b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/ver1_1/Header1_1Impl.java
similarity index 100%
rename from jaxws/src/java.xml.soap/share/classes/com/sun/xml/internal/messaging/saaj/soap/ver1_1/Header1_1Impl.java
rename to jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/ver1_1/Header1_1Impl.java
diff --git a/jaxws/src/java.xml.soap/share/classes/com/sun/xml/internal/messaging/saaj/soap/ver1_1/HeaderElement1_1Impl.java b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/ver1_1/HeaderElement1_1Impl.java
similarity index 100%
rename from jaxws/src/java.xml.soap/share/classes/com/sun/xml/internal/messaging/saaj/soap/ver1_1/HeaderElement1_1Impl.java
rename to jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/ver1_1/HeaderElement1_1Impl.java
diff --git a/jaxws/src/java.xml.soap/share/classes/com/sun/xml/internal/messaging/saaj/soap/ver1_1/LocalStrings.properties b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/ver1_1/LocalStrings.properties
similarity index 100%
rename from jaxws/src/java.xml.soap/share/classes/com/sun/xml/internal/messaging/saaj/soap/ver1_1/LocalStrings.properties
rename to jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/ver1_1/LocalStrings.properties
diff --git a/jaxws/src/java.xml.soap/share/classes/com/sun/xml/internal/messaging/saaj/soap/ver1_1/LocalStrings_de.properties b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/ver1_1/LocalStrings_de.properties
similarity index 100%
rename from jaxws/src/java.xml.soap/share/classes/com/sun/xml/internal/messaging/saaj/soap/ver1_1/LocalStrings_de.properties
rename to jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/ver1_1/LocalStrings_de.properties
diff --git a/jaxws/src/java.xml.soap/share/classes/com/sun/xml/internal/messaging/saaj/soap/ver1_1/LocalStrings_es.properties b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/ver1_1/LocalStrings_es.properties
similarity index 100%
rename from jaxws/src/java.xml.soap/share/classes/com/sun/xml/internal/messaging/saaj/soap/ver1_1/LocalStrings_es.properties
rename to jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/ver1_1/LocalStrings_es.properties
diff --git a/jaxws/src/java.xml.soap/share/classes/com/sun/xml/internal/messaging/saaj/soap/ver1_1/LocalStrings_fr.properties b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/ver1_1/LocalStrings_fr.properties
similarity index 100%
rename from jaxws/src/java.xml.soap/share/classes/com/sun/xml/internal/messaging/saaj/soap/ver1_1/LocalStrings_fr.properties
rename to jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/ver1_1/LocalStrings_fr.properties
diff --git a/jaxws/src/java.xml.soap/share/classes/com/sun/xml/internal/messaging/saaj/soap/ver1_1/LocalStrings_it.properties b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/ver1_1/LocalStrings_it.properties
similarity index 100%
rename from jaxws/src/java.xml.soap/share/classes/com/sun/xml/internal/messaging/saaj/soap/ver1_1/LocalStrings_it.properties
rename to jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/ver1_1/LocalStrings_it.properties
diff --git a/jaxws/src/java.xml.soap/share/classes/com/sun/xml/internal/messaging/saaj/soap/ver1_1/LocalStrings_ja.properties b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/ver1_1/LocalStrings_ja.properties
similarity index 100%
rename from jaxws/src/java.xml.soap/share/classes/com/sun/xml/internal/messaging/saaj/soap/ver1_1/LocalStrings_ja.properties
rename to jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/ver1_1/LocalStrings_ja.properties
diff --git a/jaxws/src/java.xml.soap/share/classes/com/sun/xml/internal/messaging/saaj/soap/ver1_1/LocalStrings_ko.properties b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/ver1_1/LocalStrings_ko.properties
similarity index 100%
rename from jaxws/src/java.xml.soap/share/classes/com/sun/xml/internal/messaging/saaj/soap/ver1_1/LocalStrings_ko.properties
rename to jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/ver1_1/LocalStrings_ko.properties
diff --git a/jaxws/src/java.xml.soap/share/classes/com/sun/xml/internal/messaging/saaj/soap/ver1_1/LocalStrings_pt_BR.properties b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/ver1_1/LocalStrings_pt_BR.properties
similarity index 100%
rename from jaxws/src/java.xml.soap/share/classes/com/sun/xml/internal/messaging/saaj/soap/ver1_1/LocalStrings_pt_BR.properties
rename to jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/ver1_1/LocalStrings_pt_BR.properties
diff --git a/jaxws/src/java.xml.soap/share/classes/com/sun/xml/internal/messaging/saaj/soap/ver1_1/LocalStrings_zh_CN.properties b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/ver1_1/LocalStrings_zh_CN.properties
similarity index 100%
rename from jaxws/src/java.xml.soap/share/classes/com/sun/xml/internal/messaging/saaj/soap/ver1_1/LocalStrings_zh_CN.properties
rename to jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/ver1_1/LocalStrings_zh_CN.properties
diff --git a/jaxws/src/java.xml.soap/share/classes/com/sun/xml/internal/messaging/saaj/soap/ver1_1/LocalStrings_zh_TW.properties b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/ver1_1/LocalStrings_zh_TW.properties
similarity index 100%
rename from jaxws/src/java.xml.soap/share/classes/com/sun/xml/internal/messaging/saaj/soap/ver1_1/LocalStrings_zh_TW.properties
rename to jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/ver1_1/LocalStrings_zh_TW.properties
diff --git a/jaxws/src/java.xml.soap/share/classes/com/sun/xml/internal/messaging/saaj/soap/ver1_1/Message1_1Impl.java b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/ver1_1/Message1_1Impl.java
similarity index 100%
rename from jaxws/src/java.xml.soap/share/classes/com/sun/xml/internal/messaging/saaj/soap/ver1_1/Message1_1Impl.java
rename to jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/ver1_1/Message1_1Impl.java
diff --git a/jaxws/src/java.xml.soap/share/classes/com/sun/xml/internal/messaging/saaj/soap/ver1_1/SOAPFactory1_1Impl.java b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/ver1_1/SOAPFactory1_1Impl.java
similarity index 100%
rename from jaxws/src/java.xml.soap/share/classes/com/sun/xml/internal/messaging/saaj/soap/ver1_1/SOAPFactory1_1Impl.java
rename to jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/ver1_1/SOAPFactory1_1Impl.java
diff --git a/jaxws/src/java.xml.soap/share/classes/com/sun/xml/internal/messaging/saaj/soap/ver1_1/SOAPMessageFactory1_1Impl.java b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/ver1_1/SOAPMessageFactory1_1Impl.java
similarity index 100%
rename from jaxws/src/java.xml.soap/share/classes/com/sun/xml/internal/messaging/saaj/soap/ver1_1/SOAPMessageFactory1_1Impl.java
rename to jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/ver1_1/SOAPMessageFactory1_1Impl.java
diff --git a/jaxws/src/java.xml.soap/share/classes/com/sun/xml/internal/messaging/saaj/soap/ver1_1/SOAPPart1_1Impl.java b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/ver1_1/SOAPPart1_1Impl.java
similarity index 100%
rename from jaxws/src/java.xml.soap/share/classes/com/sun/xml/internal/messaging/saaj/soap/ver1_1/SOAPPart1_1Impl.java
rename to jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/ver1_1/SOAPPart1_1Impl.java
diff --git a/jaxws/src/java.xml.soap/share/classes/com/sun/xml/internal/messaging/saaj/soap/ver1_2/Body1_2Impl.java b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/ver1_2/Body1_2Impl.java
similarity index 100%
rename from jaxws/src/java.xml.soap/share/classes/com/sun/xml/internal/messaging/saaj/soap/ver1_2/Body1_2Impl.java
rename to jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/ver1_2/Body1_2Impl.java
diff --git a/jaxws/src/java.xml.soap/share/classes/com/sun/xml/internal/messaging/saaj/soap/ver1_2/BodyElement1_2Impl.java b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/ver1_2/BodyElement1_2Impl.java
similarity index 100%
rename from jaxws/src/java.xml.soap/share/classes/com/sun/xml/internal/messaging/saaj/soap/ver1_2/BodyElement1_2Impl.java
rename to jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/ver1_2/BodyElement1_2Impl.java
diff --git a/jaxws/src/java.xml.soap/share/classes/com/sun/xml/internal/messaging/saaj/soap/ver1_2/Detail1_2Impl.java b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/ver1_2/Detail1_2Impl.java
similarity index 100%
rename from jaxws/src/java.xml.soap/share/classes/com/sun/xml/internal/messaging/saaj/soap/ver1_2/Detail1_2Impl.java
rename to jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/ver1_2/Detail1_2Impl.java
diff --git a/jaxws/src/java.xml.soap/share/classes/com/sun/xml/internal/messaging/saaj/soap/ver1_2/DetailEntry1_2Impl.java b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/ver1_2/DetailEntry1_2Impl.java
similarity index 100%
rename from jaxws/src/java.xml.soap/share/classes/com/sun/xml/internal/messaging/saaj/soap/ver1_2/DetailEntry1_2Impl.java
rename to jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/ver1_2/DetailEntry1_2Impl.java
diff --git a/jaxws/src/java.xml.soap/share/classes/com/sun/xml/internal/messaging/saaj/soap/ver1_2/Envelope1_2Impl.java b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/ver1_2/Envelope1_2Impl.java
similarity index 100%
rename from jaxws/src/java.xml.soap/share/classes/com/sun/xml/internal/messaging/saaj/soap/ver1_2/Envelope1_2Impl.java
rename to jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/ver1_2/Envelope1_2Impl.java
diff --git a/jaxws/src/java.xml.soap/share/classes/com/sun/xml/internal/messaging/saaj/soap/ver1_2/Fault1_2Impl.java b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/ver1_2/Fault1_2Impl.java
similarity index 100%
rename from jaxws/src/java.xml.soap/share/classes/com/sun/xml/internal/messaging/saaj/soap/ver1_2/Fault1_2Impl.java
rename to jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/ver1_2/Fault1_2Impl.java
diff --git a/jaxws/src/java.xml.soap/share/classes/com/sun/xml/internal/messaging/saaj/soap/ver1_2/FaultElement1_2Impl.java b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/ver1_2/FaultElement1_2Impl.java
similarity index 100%
rename from jaxws/src/java.xml.soap/share/classes/com/sun/xml/internal/messaging/saaj/soap/ver1_2/FaultElement1_2Impl.java
rename to jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/ver1_2/FaultElement1_2Impl.java
diff --git a/jaxws/src/java.xml.soap/share/classes/com/sun/xml/internal/messaging/saaj/soap/ver1_2/Header1_2Impl.java b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/ver1_2/Header1_2Impl.java
similarity index 100%
rename from jaxws/src/java.xml.soap/share/classes/com/sun/xml/internal/messaging/saaj/soap/ver1_2/Header1_2Impl.java
rename to jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/ver1_2/Header1_2Impl.java
diff --git a/jaxws/src/java.xml.soap/share/classes/com/sun/xml/internal/messaging/saaj/soap/ver1_2/HeaderElement1_2Impl.java b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/ver1_2/HeaderElement1_2Impl.java
similarity index 100%
rename from jaxws/src/java.xml.soap/share/classes/com/sun/xml/internal/messaging/saaj/soap/ver1_2/HeaderElement1_2Impl.java
rename to jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/ver1_2/HeaderElement1_2Impl.java
diff --git a/jaxws/src/java.xml.soap/share/classes/com/sun/xml/internal/messaging/saaj/soap/ver1_2/LocalStrings.properties b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/ver1_2/LocalStrings.properties
similarity index 100%
rename from jaxws/src/java.xml.soap/share/classes/com/sun/xml/internal/messaging/saaj/soap/ver1_2/LocalStrings.properties
rename to jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/ver1_2/LocalStrings.properties
diff --git a/jaxws/src/java.xml.soap/share/classes/com/sun/xml/internal/messaging/saaj/soap/ver1_2/LocalStrings_de.properties b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/ver1_2/LocalStrings_de.properties
similarity index 100%
rename from jaxws/src/java.xml.soap/share/classes/com/sun/xml/internal/messaging/saaj/soap/ver1_2/LocalStrings_de.properties
rename to jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/ver1_2/LocalStrings_de.properties
diff --git a/jaxws/src/java.xml.soap/share/classes/com/sun/xml/internal/messaging/saaj/soap/ver1_2/LocalStrings_es.properties b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/ver1_2/LocalStrings_es.properties
similarity index 100%
rename from jaxws/src/java.xml.soap/share/classes/com/sun/xml/internal/messaging/saaj/soap/ver1_2/LocalStrings_es.properties
rename to jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/ver1_2/LocalStrings_es.properties
diff --git a/jaxws/src/java.xml.soap/share/classes/com/sun/xml/internal/messaging/saaj/soap/ver1_2/LocalStrings_fr.properties b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/ver1_2/LocalStrings_fr.properties
similarity index 100%
rename from jaxws/src/java.xml.soap/share/classes/com/sun/xml/internal/messaging/saaj/soap/ver1_2/LocalStrings_fr.properties
rename to jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/ver1_2/LocalStrings_fr.properties
diff --git a/jaxws/src/java.xml.soap/share/classes/com/sun/xml/internal/messaging/saaj/soap/ver1_2/LocalStrings_it.properties b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/ver1_2/LocalStrings_it.properties
similarity index 100%
rename from jaxws/src/java.xml.soap/share/classes/com/sun/xml/internal/messaging/saaj/soap/ver1_2/LocalStrings_it.properties
rename to jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/ver1_2/LocalStrings_it.properties
diff --git a/jaxws/src/java.xml.soap/share/classes/com/sun/xml/internal/messaging/saaj/soap/ver1_2/LocalStrings_ja.properties b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/ver1_2/LocalStrings_ja.properties
similarity index 100%
rename from jaxws/src/java.xml.soap/share/classes/com/sun/xml/internal/messaging/saaj/soap/ver1_2/LocalStrings_ja.properties
rename to jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/ver1_2/LocalStrings_ja.properties
diff --git a/jaxws/src/java.xml.soap/share/classes/com/sun/xml/internal/messaging/saaj/soap/ver1_2/LocalStrings_ko.properties b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/ver1_2/LocalStrings_ko.properties
similarity index 100%
rename from jaxws/src/java.xml.soap/share/classes/com/sun/xml/internal/messaging/saaj/soap/ver1_2/LocalStrings_ko.properties
rename to jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/ver1_2/LocalStrings_ko.properties
diff --git a/jaxws/src/java.xml.soap/share/classes/com/sun/xml/internal/messaging/saaj/soap/ver1_2/LocalStrings_pt_BR.properties b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/ver1_2/LocalStrings_pt_BR.properties
similarity index 100%
rename from jaxws/src/java.xml.soap/share/classes/com/sun/xml/internal/messaging/saaj/soap/ver1_2/LocalStrings_pt_BR.properties
rename to jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/ver1_2/LocalStrings_pt_BR.properties
diff --git a/jaxws/src/java.xml.soap/share/classes/com/sun/xml/internal/messaging/saaj/soap/ver1_2/LocalStrings_zh_CN.properties b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/ver1_2/LocalStrings_zh_CN.properties
similarity index 100%
rename from jaxws/src/java.xml.soap/share/classes/com/sun/xml/internal/messaging/saaj/soap/ver1_2/LocalStrings_zh_CN.properties
rename to jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/ver1_2/LocalStrings_zh_CN.properties
diff --git a/jaxws/src/java.xml.soap/share/classes/com/sun/xml/internal/messaging/saaj/soap/ver1_2/LocalStrings_zh_TW.properties b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/ver1_2/LocalStrings_zh_TW.properties
similarity index 100%
rename from jaxws/src/java.xml.soap/share/classes/com/sun/xml/internal/messaging/saaj/soap/ver1_2/LocalStrings_zh_TW.properties
rename to jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/ver1_2/LocalStrings_zh_TW.properties
diff --git a/jaxws/src/java.xml.soap/share/classes/com/sun/xml/internal/messaging/saaj/soap/ver1_2/Message1_2Impl.java b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/ver1_2/Message1_2Impl.java
similarity index 100%
rename from jaxws/src/java.xml.soap/share/classes/com/sun/xml/internal/messaging/saaj/soap/ver1_2/Message1_2Impl.java
rename to jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/ver1_2/Message1_2Impl.java
diff --git a/jaxws/src/java.xml.soap/share/classes/com/sun/xml/internal/messaging/saaj/soap/ver1_2/SOAPFactory1_2Impl.java b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/ver1_2/SOAPFactory1_2Impl.java
similarity index 100%
rename from jaxws/src/java.xml.soap/share/classes/com/sun/xml/internal/messaging/saaj/soap/ver1_2/SOAPFactory1_2Impl.java
rename to jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/ver1_2/SOAPFactory1_2Impl.java
diff --git a/jaxws/src/java.xml.soap/share/classes/com/sun/xml/internal/messaging/saaj/soap/ver1_2/SOAPMessageFactory1_2Impl.java b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/ver1_2/SOAPMessageFactory1_2Impl.java
similarity index 100%
rename from jaxws/src/java.xml.soap/share/classes/com/sun/xml/internal/messaging/saaj/soap/ver1_2/SOAPMessageFactory1_2Impl.java
rename to jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/ver1_2/SOAPMessageFactory1_2Impl.java
diff --git a/jaxws/src/java.xml.soap/share/classes/com/sun/xml/internal/messaging/saaj/soap/ver1_2/SOAPPart1_2Impl.java b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/ver1_2/SOAPPart1_2Impl.java
similarity index 100%
rename from jaxws/src/java.xml.soap/share/classes/com/sun/xml/internal/messaging/saaj/soap/ver1_2/SOAPPart1_2Impl.java
rename to jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/ver1_2/SOAPPart1_2Impl.java
diff --git a/jaxws/src/java.xml.soap/share/classes/com/sun/xml/internal/messaging/saaj/util/Base64.java b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/util/Base64.java
similarity index 100%
rename from jaxws/src/java.xml.soap/share/classes/com/sun/xml/internal/messaging/saaj/util/Base64.java
rename to jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/util/Base64.java
diff --git a/jaxws/src/java.xml.soap/share/classes/com/sun/xml/internal/messaging/saaj/util/ByteInputStream.java b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/util/ByteInputStream.java
similarity index 100%
rename from jaxws/src/java.xml.soap/share/classes/com/sun/xml/internal/messaging/saaj/util/ByteInputStream.java
rename to jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/util/ByteInputStream.java
diff --git a/jaxws/src/java.xml.soap/share/classes/com/sun/xml/internal/messaging/saaj/util/ByteOutputStream.java b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/util/ByteOutputStream.java
similarity index 100%
rename from jaxws/src/java.xml.soap/share/classes/com/sun/xml/internal/messaging/saaj/util/ByteOutputStream.java
rename to jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/util/ByteOutputStream.java
diff --git a/jaxws/src/java.xml.soap/share/classes/com/sun/xml/internal/messaging/saaj/util/CharReader.java b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/util/CharReader.java
similarity index 100%
rename from jaxws/src/java.xml.soap/share/classes/com/sun/xml/internal/messaging/saaj/util/CharReader.java
rename to jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/util/CharReader.java
diff --git a/jaxws/src/java.xml.soap/share/classes/com/sun/xml/internal/messaging/saaj/util/CharWriter.java b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/util/CharWriter.java
similarity index 100%
rename from jaxws/src/java.xml.soap/share/classes/com/sun/xml/internal/messaging/saaj/util/CharWriter.java
rename to jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/util/CharWriter.java
diff --git a/jaxws/src/java.xml.soap/share/classes/com/sun/xml/internal/messaging/saaj/util/FastInfosetReflection.java b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/util/FastInfosetReflection.java
similarity index 100%
rename from jaxws/src/java.xml.soap/share/classes/com/sun/xml/internal/messaging/saaj/util/FastInfosetReflection.java
rename to jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/util/FastInfosetReflection.java
diff --git a/jaxws/src/java.xml.soap/share/classes/com/sun/xml/internal/messaging/saaj/util/FinalArrayList.java b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/util/FinalArrayList.java
similarity index 100%
rename from jaxws/src/java.xml.soap/share/classes/com/sun/xml/internal/messaging/saaj/util/FinalArrayList.java
rename to jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/util/FinalArrayList.java
diff --git a/jaxws/src/java.xml.soap/share/classes/com/sun/xml/internal/messaging/saaj/util/JAXMStreamSource.java b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/util/JAXMStreamSource.java
similarity index 100%
rename from jaxws/src/java.xml.soap/share/classes/com/sun/xml/internal/messaging/saaj/util/JAXMStreamSource.java
rename to jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/util/JAXMStreamSource.java
diff --git a/jaxws/src/java.xml.soap/share/classes/com/sun/xml/internal/messaging/saaj/util/JaxmURI.java b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/util/JaxmURI.java
similarity index 100%
rename from jaxws/src/java.xml.soap/share/classes/com/sun/xml/internal/messaging/saaj/util/JaxmURI.java
rename to jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/util/JaxmURI.java
diff --git a/jaxws/src/java.xml.soap/share/classes/com/sun/xml/internal/messaging/saaj/util/LocalStrings.properties b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/util/LocalStrings.properties
similarity index 100%
rename from jaxws/src/java.xml.soap/share/classes/com/sun/xml/internal/messaging/saaj/util/LocalStrings.properties
rename to jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/util/LocalStrings.properties
diff --git a/jaxws/src/java.xml.soap/share/classes/com/sun/xml/internal/messaging/saaj/util/LocalStrings_de.properties b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/util/LocalStrings_de.properties
similarity index 100%
rename from jaxws/src/java.xml.soap/share/classes/com/sun/xml/internal/messaging/saaj/util/LocalStrings_de.properties
rename to jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/util/LocalStrings_de.properties
diff --git a/jaxws/src/java.xml.soap/share/classes/com/sun/xml/internal/messaging/saaj/util/LocalStrings_es.properties b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/util/LocalStrings_es.properties
similarity index 100%
rename from jaxws/src/java.xml.soap/share/classes/com/sun/xml/internal/messaging/saaj/util/LocalStrings_es.properties
rename to jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/util/LocalStrings_es.properties
diff --git a/jaxws/src/java.xml.soap/share/classes/com/sun/xml/internal/messaging/saaj/util/LocalStrings_fr.properties b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/util/LocalStrings_fr.properties
similarity index 100%
rename from jaxws/src/java.xml.soap/share/classes/com/sun/xml/internal/messaging/saaj/util/LocalStrings_fr.properties
rename to jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/util/LocalStrings_fr.properties
diff --git a/jaxws/src/java.xml.soap/share/classes/com/sun/xml/internal/messaging/saaj/util/LocalStrings_it.properties b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/util/LocalStrings_it.properties
similarity index 100%
rename from jaxws/src/java.xml.soap/share/classes/com/sun/xml/internal/messaging/saaj/util/LocalStrings_it.properties
rename to jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/util/LocalStrings_it.properties
diff --git a/jaxws/src/java.xml.soap/share/classes/com/sun/xml/internal/messaging/saaj/util/LocalStrings_ja.properties b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/util/LocalStrings_ja.properties
similarity index 100%
rename from jaxws/src/java.xml.soap/share/classes/com/sun/xml/internal/messaging/saaj/util/LocalStrings_ja.properties
rename to jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/util/LocalStrings_ja.properties
diff --git a/jaxws/src/java.xml.soap/share/classes/com/sun/xml/internal/messaging/saaj/util/LocalStrings_ko.properties b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/util/LocalStrings_ko.properties
similarity index 100%
rename from jaxws/src/java.xml.soap/share/classes/com/sun/xml/internal/messaging/saaj/util/LocalStrings_ko.properties
rename to jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/util/LocalStrings_ko.properties
diff --git a/jaxws/src/java.xml.soap/share/classes/com/sun/xml/internal/messaging/saaj/util/LocalStrings_pt_BR.properties b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/util/LocalStrings_pt_BR.properties
similarity index 100%
rename from jaxws/src/java.xml.soap/share/classes/com/sun/xml/internal/messaging/saaj/util/LocalStrings_pt_BR.properties
rename to jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/util/LocalStrings_pt_BR.properties
diff --git a/jaxws/src/java.xml.soap/share/classes/com/sun/xml/internal/messaging/saaj/util/LocalStrings_zh_CN.properties b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/util/LocalStrings_zh_CN.properties
similarity index 100%
rename from jaxws/src/java.xml.soap/share/classes/com/sun/xml/internal/messaging/saaj/util/LocalStrings_zh_CN.properties
rename to jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/util/LocalStrings_zh_CN.properties
diff --git a/jaxws/src/java.xml.soap/share/classes/com/sun/xml/internal/messaging/saaj/util/LocalStrings_zh_TW.properties b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/util/LocalStrings_zh_TW.properties
similarity index 100%
rename from jaxws/src/java.xml.soap/share/classes/com/sun/xml/internal/messaging/saaj/util/LocalStrings_zh_TW.properties
rename to jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/util/LocalStrings_zh_TW.properties
diff --git a/jaxws/src/java.xml.soap/share/classes/com/sun/xml/internal/messaging/saaj/util/LogDomainConstants.java b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/util/LogDomainConstants.java
similarity index 100%
rename from jaxws/src/java.xml.soap/share/classes/com/sun/xml/internal/messaging/saaj/util/LogDomainConstants.java
rename to jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/util/LogDomainConstants.java
diff --git a/jaxws/src/java.xml.soap/share/classes/com/sun/xml/internal/messaging/saaj/util/MimeHeadersUtil.java b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/util/MimeHeadersUtil.java
similarity index 100%
rename from jaxws/src/java.xml.soap/share/classes/com/sun/xml/internal/messaging/saaj/util/MimeHeadersUtil.java
rename to jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/util/MimeHeadersUtil.java
diff --git a/jaxws/src/java.xml.soap/share/classes/com/sun/xml/internal/messaging/saaj/util/NamespaceContextIterator.java b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/util/NamespaceContextIterator.java
similarity index 100%
rename from jaxws/src/java.xml.soap/share/classes/com/sun/xml/internal/messaging/saaj/util/NamespaceContextIterator.java
rename to jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/util/NamespaceContextIterator.java
diff --git a/jaxws/src/java.xml.soap/share/classes/com/sun/xml/internal/messaging/saaj/util/ParseUtil.java b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/util/ParseUtil.java
similarity index 100%
rename from jaxws/src/java.xml.soap/share/classes/com/sun/xml/internal/messaging/saaj/util/ParseUtil.java
rename to jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/util/ParseUtil.java
diff --git a/jaxws/src/java.xml.soap/share/classes/com/sun/xml/internal/messaging/saaj/util/ParserPool.java b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/util/ParserPool.java
similarity index 100%
rename from jaxws/src/java.xml.soap/share/classes/com/sun/xml/internal/messaging/saaj/util/ParserPool.java
rename to jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/util/ParserPool.java
diff --git a/jaxws/src/java.xml.soap/share/classes/com/sun/xml/internal/messaging/saaj/util/RejectDoctypeSaxFilter.java b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/util/RejectDoctypeSaxFilter.java
similarity index 100%
rename from jaxws/src/java.xml.soap/share/classes/com/sun/xml/internal/messaging/saaj/util/RejectDoctypeSaxFilter.java
rename to jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/util/RejectDoctypeSaxFilter.java
diff --git a/jaxws/src/java.xml.soap/share/classes/com/sun/xml/internal/messaging/saaj/util/SAAJUtil.java b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/util/SAAJUtil.java
similarity index 100%
rename from jaxws/src/java.xml.soap/share/classes/com/sun/xml/internal/messaging/saaj/util/SAAJUtil.java
rename to jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/util/SAAJUtil.java
diff --git a/jaxws/src/java.xml.soap/share/classes/com/sun/xml/internal/messaging/saaj/util/TeeInputStream.java b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/util/TeeInputStream.java
similarity index 100%
rename from jaxws/src/java.xml.soap/share/classes/com/sun/xml/internal/messaging/saaj/util/TeeInputStream.java
rename to jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/util/TeeInputStream.java
diff --git a/jaxws/src/java.xml.soap/share/classes/com/sun/xml/internal/messaging/saaj/util/XMLDeclarationParser.java b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/util/XMLDeclarationParser.java
similarity index 100%
rename from jaxws/src/java.xml.soap/share/classes/com/sun/xml/internal/messaging/saaj/util/XMLDeclarationParser.java
rename to jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/util/XMLDeclarationParser.java
diff --git a/jaxws/src/java.xml.soap/share/classes/com/sun/xml/internal/messaging/saaj/util/stax/LazyEnvelopeStaxReader.java b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/util/stax/LazyEnvelopeStaxReader.java
similarity index 100%
rename from jaxws/src/java.xml.soap/share/classes/com/sun/xml/internal/messaging/saaj/util/stax/LazyEnvelopeStaxReader.java
rename to jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/util/stax/LazyEnvelopeStaxReader.java
diff --git a/jaxws/src/java.xml.soap/share/classes/com/sun/xml/internal/messaging/saaj/util/stax/SaajStaxReaderEx.java b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/util/stax/SaajStaxReaderEx.java
similarity index 100%
rename from jaxws/src/java.xml.soap/share/classes/com/sun/xml/internal/messaging/saaj/util/stax/SaajStaxReaderEx.java
rename to jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/util/stax/SaajStaxReaderEx.java
diff --git a/jaxws/src/java.xml.soap/share/classes/com/sun/xml/internal/messaging/saaj/util/stax/SaajStaxWriter.java b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/util/stax/SaajStaxWriter.java
similarity index 100%
rename from jaxws/src/java.xml.soap/share/classes/com/sun/xml/internal/messaging/saaj/util/stax/SaajStaxWriter.java
rename to jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/util/stax/SaajStaxWriter.java
diff --git a/jaxws/src/java.xml.soap/share/classes/com/sun/xml/internal/messaging/saaj/util/stax/SaajStaxWriterEx.java b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/util/stax/SaajStaxWriterEx.java
similarity index 100%
rename from jaxws/src/java.xml.soap/share/classes/com/sun/xml/internal/messaging/saaj/util/stax/SaajStaxWriterEx.java
rename to jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/util/stax/SaajStaxWriterEx.java
diff --git a/jaxws/src/java.xml.soap/share/classes/com/sun/xml/internal/messaging/saaj/util/transform/EfficientStreamingTransformer.java b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/util/transform/EfficientStreamingTransformer.java
similarity index 100%
rename from jaxws/src/java.xml.soap/share/classes/com/sun/xml/internal/messaging/saaj/util/transform/EfficientStreamingTransformer.java
rename to jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/util/transform/EfficientStreamingTransformer.java
diff --git a/jaxws/src/java.xml.soap/share/classes/javax/xml/soap/AttachmentPart.java b/jaxws/src/java.xml.ws/share/classes/javax/xml/soap/AttachmentPart.java
similarity index 100%
rename from jaxws/src/java.xml.soap/share/classes/javax/xml/soap/AttachmentPart.java
rename to jaxws/src/java.xml.ws/share/classes/javax/xml/soap/AttachmentPart.java
diff --git a/jaxws/src/java.xml.soap/share/classes/javax/xml/soap/Detail.java b/jaxws/src/java.xml.ws/share/classes/javax/xml/soap/Detail.java
similarity index 100%
rename from jaxws/src/java.xml.soap/share/classes/javax/xml/soap/Detail.java
rename to jaxws/src/java.xml.ws/share/classes/javax/xml/soap/Detail.java
diff --git a/jaxws/src/java.xml.soap/share/classes/javax/xml/soap/DetailEntry.java b/jaxws/src/java.xml.ws/share/classes/javax/xml/soap/DetailEntry.java
similarity index 100%
rename from jaxws/src/java.xml.soap/share/classes/javax/xml/soap/DetailEntry.java
rename to jaxws/src/java.xml.ws/share/classes/javax/xml/soap/DetailEntry.java
diff --git a/jaxws/src/java.xml.soap/share/classes/javax/xml/soap/FactoryFinder.java b/jaxws/src/java.xml.ws/share/classes/javax/xml/soap/FactoryFinder.java
similarity index 100%
rename from jaxws/src/java.xml.soap/share/classes/javax/xml/soap/FactoryFinder.java
rename to jaxws/src/java.xml.ws/share/classes/javax/xml/soap/FactoryFinder.java
diff --git a/jaxws/src/java.xml.soap/share/classes/javax/xml/soap/MessageFactory.java b/jaxws/src/java.xml.ws/share/classes/javax/xml/soap/MessageFactory.java
similarity index 100%
rename from jaxws/src/java.xml.soap/share/classes/javax/xml/soap/MessageFactory.java
rename to jaxws/src/java.xml.ws/share/classes/javax/xml/soap/MessageFactory.java
diff --git a/jaxws/src/java.xml.soap/share/classes/javax/xml/soap/MimeHeader.java b/jaxws/src/java.xml.ws/share/classes/javax/xml/soap/MimeHeader.java
similarity index 100%
rename from jaxws/src/java.xml.soap/share/classes/javax/xml/soap/MimeHeader.java
rename to jaxws/src/java.xml.ws/share/classes/javax/xml/soap/MimeHeader.java
diff --git a/jaxws/src/java.xml.soap/share/classes/javax/xml/soap/MimeHeaders.java b/jaxws/src/java.xml.ws/share/classes/javax/xml/soap/MimeHeaders.java
similarity index 100%
rename from jaxws/src/java.xml.soap/share/classes/javax/xml/soap/MimeHeaders.java
rename to jaxws/src/java.xml.ws/share/classes/javax/xml/soap/MimeHeaders.java
diff --git a/jaxws/src/java.xml.soap/share/classes/javax/xml/soap/Name.java b/jaxws/src/java.xml.ws/share/classes/javax/xml/soap/Name.java
similarity index 100%
rename from jaxws/src/java.xml.soap/share/classes/javax/xml/soap/Name.java
rename to jaxws/src/java.xml.ws/share/classes/javax/xml/soap/Name.java
diff --git a/jaxws/src/java.xml.soap/share/classes/javax/xml/soap/Node.java b/jaxws/src/java.xml.ws/share/classes/javax/xml/soap/Node.java
similarity index 100%
rename from jaxws/src/java.xml.soap/share/classes/javax/xml/soap/Node.java
rename to jaxws/src/java.xml.ws/share/classes/javax/xml/soap/Node.java
diff --git a/jaxws/src/java.xml.soap/share/classes/javax/xml/soap/SAAJMetaFactory.java b/jaxws/src/java.xml.ws/share/classes/javax/xml/soap/SAAJMetaFactory.java
similarity index 100%
rename from jaxws/src/java.xml.soap/share/classes/javax/xml/soap/SAAJMetaFactory.java
rename to jaxws/src/java.xml.ws/share/classes/javax/xml/soap/SAAJMetaFactory.java
diff --git a/jaxws/src/java.xml.soap/share/classes/javax/xml/soap/SAAJResult.java b/jaxws/src/java.xml.ws/share/classes/javax/xml/soap/SAAJResult.java
similarity index 100%
rename from jaxws/src/java.xml.soap/share/classes/javax/xml/soap/SAAJResult.java
rename to jaxws/src/java.xml.ws/share/classes/javax/xml/soap/SAAJResult.java
diff --git a/jaxws/src/java.xml.soap/share/classes/javax/xml/soap/SOAPBody.java b/jaxws/src/java.xml.ws/share/classes/javax/xml/soap/SOAPBody.java
similarity index 100%
rename from jaxws/src/java.xml.soap/share/classes/javax/xml/soap/SOAPBody.java
rename to jaxws/src/java.xml.ws/share/classes/javax/xml/soap/SOAPBody.java
diff --git a/jaxws/src/java.xml.soap/share/classes/javax/xml/soap/SOAPBodyElement.java b/jaxws/src/java.xml.ws/share/classes/javax/xml/soap/SOAPBodyElement.java
similarity index 100%
rename from jaxws/src/java.xml.soap/share/classes/javax/xml/soap/SOAPBodyElement.java
rename to jaxws/src/java.xml.ws/share/classes/javax/xml/soap/SOAPBodyElement.java
diff --git a/jaxws/src/java.xml.soap/share/classes/javax/xml/soap/SOAPConnection.java b/jaxws/src/java.xml.ws/share/classes/javax/xml/soap/SOAPConnection.java
similarity index 100%
rename from jaxws/src/java.xml.soap/share/classes/javax/xml/soap/SOAPConnection.java
rename to jaxws/src/java.xml.ws/share/classes/javax/xml/soap/SOAPConnection.java
diff --git a/jaxws/src/java.xml.soap/share/classes/javax/xml/soap/SOAPConnectionFactory.java b/jaxws/src/java.xml.ws/share/classes/javax/xml/soap/SOAPConnectionFactory.java
similarity index 100%
rename from jaxws/src/java.xml.soap/share/classes/javax/xml/soap/SOAPConnectionFactory.java
rename to jaxws/src/java.xml.ws/share/classes/javax/xml/soap/SOAPConnectionFactory.java
diff --git a/jaxws/src/java.xml.soap/share/classes/javax/xml/soap/SOAPConstants.java b/jaxws/src/java.xml.ws/share/classes/javax/xml/soap/SOAPConstants.java
similarity index 100%
rename from jaxws/src/java.xml.soap/share/classes/javax/xml/soap/SOAPConstants.java
rename to jaxws/src/java.xml.ws/share/classes/javax/xml/soap/SOAPConstants.java
diff --git a/jaxws/src/java.xml.soap/share/classes/javax/xml/soap/SOAPElement.java b/jaxws/src/java.xml.ws/share/classes/javax/xml/soap/SOAPElement.java
similarity index 100%
rename from jaxws/src/java.xml.soap/share/classes/javax/xml/soap/SOAPElement.java
rename to jaxws/src/java.xml.ws/share/classes/javax/xml/soap/SOAPElement.java
diff --git a/jaxws/src/java.xml.soap/share/classes/javax/xml/soap/SOAPElementFactory.java b/jaxws/src/java.xml.ws/share/classes/javax/xml/soap/SOAPElementFactory.java
similarity index 100%
rename from jaxws/src/java.xml.soap/share/classes/javax/xml/soap/SOAPElementFactory.java
rename to jaxws/src/java.xml.ws/share/classes/javax/xml/soap/SOAPElementFactory.java
diff --git a/jaxws/src/java.xml.soap/share/classes/javax/xml/soap/SOAPEnvelope.java b/jaxws/src/java.xml.ws/share/classes/javax/xml/soap/SOAPEnvelope.java
similarity index 100%
rename from jaxws/src/java.xml.soap/share/classes/javax/xml/soap/SOAPEnvelope.java
rename to jaxws/src/java.xml.ws/share/classes/javax/xml/soap/SOAPEnvelope.java
diff --git a/jaxws/src/java.xml.soap/share/classes/javax/xml/soap/SOAPException.java b/jaxws/src/java.xml.ws/share/classes/javax/xml/soap/SOAPException.java
similarity index 100%
rename from jaxws/src/java.xml.soap/share/classes/javax/xml/soap/SOAPException.java
rename to jaxws/src/java.xml.ws/share/classes/javax/xml/soap/SOAPException.java
diff --git a/jaxws/src/java.xml.soap/share/classes/javax/xml/soap/SOAPFactory.java b/jaxws/src/java.xml.ws/share/classes/javax/xml/soap/SOAPFactory.java
similarity index 100%
rename from jaxws/src/java.xml.soap/share/classes/javax/xml/soap/SOAPFactory.java
rename to jaxws/src/java.xml.ws/share/classes/javax/xml/soap/SOAPFactory.java
diff --git a/jaxws/src/java.xml.soap/share/classes/javax/xml/soap/SOAPFault.java b/jaxws/src/java.xml.ws/share/classes/javax/xml/soap/SOAPFault.java
similarity index 100%
rename from jaxws/src/java.xml.soap/share/classes/javax/xml/soap/SOAPFault.java
rename to jaxws/src/java.xml.ws/share/classes/javax/xml/soap/SOAPFault.java
diff --git a/jaxws/src/java.xml.soap/share/classes/javax/xml/soap/SOAPFaultElement.java b/jaxws/src/java.xml.ws/share/classes/javax/xml/soap/SOAPFaultElement.java
similarity index 100%
rename from jaxws/src/java.xml.soap/share/classes/javax/xml/soap/SOAPFaultElement.java
rename to jaxws/src/java.xml.ws/share/classes/javax/xml/soap/SOAPFaultElement.java
diff --git a/jaxws/src/java.xml.soap/share/classes/javax/xml/soap/SOAPHeader.java b/jaxws/src/java.xml.ws/share/classes/javax/xml/soap/SOAPHeader.java
similarity index 100%
rename from jaxws/src/java.xml.soap/share/classes/javax/xml/soap/SOAPHeader.java
rename to jaxws/src/java.xml.ws/share/classes/javax/xml/soap/SOAPHeader.java
diff --git a/jaxws/src/java.xml.soap/share/classes/javax/xml/soap/SOAPHeaderElement.java b/jaxws/src/java.xml.ws/share/classes/javax/xml/soap/SOAPHeaderElement.java
similarity index 100%
rename from jaxws/src/java.xml.soap/share/classes/javax/xml/soap/SOAPHeaderElement.java
rename to jaxws/src/java.xml.ws/share/classes/javax/xml/soap/SOAPHeaderElement.java
diff --git a/jaxws/src/java.xml.soap/share/classes/javax/xml/soap/SOAPMessage.java b/jaxws/src/java.xml.ws/share/classes/javax/xml/soap/SOAPMessage.java
similarity index 100%
rename from jaxws/src/java.xml.soap/share/classes/javax/xml/soap/SOAPMessage.java
rename to jaxws/src/java.xml.ws/share/classes/javax/xml/soap/SOAPMessage.java
diff --git a/jaxws/src/java.xml.soap/share/classes/javax/xml/soap/SOAPPart.java b/jaxws/src/java.xml.ws/share/classes/javax/xml/soap/SOAPPart.java
similarity index 100%
rename from jaxws/src/java.xml.soap/share/classes/javax/xml/soap/SOAPPart.java
rename to jaxws/src/java.xml.ws/share/classes/javax/xml/soap/SOAPPart.java
diff --git a/jaxws/src/java.xml.soap/share/classes/javax/xml/soap/Text.java b/jaxws/src/java.xml.ws/share/classes/javax/xml/soap/Text.java
similarity index 100%
rename from jaxws/src/java.xml.soap/share/classes/javax/xml/soap/Text.java
rename to jaxws/src/java.xml.ws/share/classes/javax/xml/soap/Text.java
diff --git a/jaxws/src/java.xml.soap/share/classes/javax/xml/soap/package.html b/jaxws/src/java.xml.ws/share/classes/javax/xml/soap/package.html
similarity index 100%
rename from jaxws/src/java.xml.soap/share/classes/javax/xml/soap/package.html
rename to jaxws/src/java.xml.ws/share/classes/javax/xml/soap/package.html
diff --git a/jdk/.hgtags b/jdk/.hgtags
index bcf97a6c401..7a8ce5643e2 100644
--- a/jdk/.hgtags
+++ b/jdk/.hgtags
@@ -287,3 +287,4 @@ e336cbd8b15e959e70ed02f0f5e93fa76ebd4c07 jdk9-b41
6b2314173433467245261364a52fb8e347fe6342 jdk9-b42
8c6ad41974f9ab6c33d544b088648314963f2a50 jdk9-b43
8cc4dc300041eb70a7a40e4b2431a8f4d4965ea4 jdk9-b44
+9acaa4f57b0b9e3757a7b4576ca9418a75ea8287 jdk9-b45
diff --git a/jdk/make/lib/LibCommon.gmk b/jdk/make/lib/LibCommon.gmk
index f8eb27a1139..250f8f44b2c 100644
--- a/jdk/make/lib/LibCommon.gmk
+++ b/jdk/make/lib/LibCommon.gmk
@@ -53,24 +53,21 @@ endif
# Find the default set of src dirs for a native library.
# Param 1 - module name
# Param 2 - library name
-define FindSrcDirsForLib
+FindSrcDirsForLib = \
$(call uniq, $(wildcard \
$(JDK_TOPDIR)/src/$(strip $1)/$(OPENJDK_TARGET_OS)/native/lib$(strip $2) \
$(JDK_TOPDIR)/src/$(strip $1)/$(OPENJDK_TARGET_OS_TYPE)/native/lib$(strip $2) \
$(JDK_TOPDIR)/src/$(strip $1)/share/native/lib$(strip $2)))
-endef
################################################################################
# Find lib dir for module
# Param 1 - module name
ifeq ($(OPENJDK_TARGET_OS_TYPE), unix)
- define FindLibDirForModule
- $(SUPPORT_OUTPUTDIR)/modules_libs/$(strip $1)$(OPENJDK_TARGET_CPU_LIBDIR)
- endef
+ FindLibDirForModule = \
+ $(SUPPORT_OUTPUTDIR)/modules_libs/$(strip $1)$(OPENJDK_TARGET_CPU_LIBDIR)
else
- define FindLibDirForModule
- $(SUPPORT_OUTPUTDIR)/modules_libs/$(strip $1)
- endef
+ FindLibDirForModule = \
+ $(SUPPORT_OUTPUTDIR)/modules_libs/$(strip $1)
endif
################################################################################
@@ -78,11 +75,10 @@ endif
# Param 1 - module name
# Param 2 - library name
# Param 3 - subdir for library
-define FindLib
-$(strip \
- $(call FindLibDirForModule, $(strip $1))$(strip $3)/$(LIBRARY_PREFIX)$(strip $2)$(SHARED_LIBRARY_SUFFIX) \
-)
-endef
+FindLib = \
+ $(call FindLibDirForModule, \
+ $(strip $1))$(strip $3)/$(LIBRARY_PREFIX)$(strip $2)$(SHARED_LIBRARY_SUFFIX)
+
################################################################################
# Define the header include flags needed to compile against it.
diff --git a/jdk/make/src/classes/build/tools/module/boot.modules b/jdk/make/src/classes/build/tools/module/boot.modules
index 396e13c4db3..9763b9287d4 100644
--- a/jdk/make/src/classes/build/tools/module/boot.modules
+++ b/jdk/make/src/classes/build/tools/module/boot.modules
@@ -17,10 +17,10 @@ java.security.sasl
java.smartcardio
java.sql
java.sql.rowset
+java.transaction
java.xml
java.xml.bind
java.xml.crypto
-java.xml.soap
java.xml.ws
jdk.charsets
jdk.deploy
diff --git a/jdk/src/java.base/share/classes/java/io/FilterOutputStream.java b/jdk/src/java.base/share/classes/java/io/FilterOutputStream.java
index 7d5b0c9c074..85e4dd1b281 100644
--- a/jdk/src/java.base/share/classes/java/io/FilterOutputStream.java
+++ b/jdk/src/java.base/share/classes/java/io/FilterOutputStream.java
@@ -48,6 +48,8 @@ class FilterOutputStream extends OutputStream {
*/
protected OutputStream out;
+ private boolean closed;
+
/**
* Creates an output stream filter built on top of the specified
* underlying output stream.
@@ -144,9 +146,9 @@ class FilterOutputStream extends OutputStream {
* Closes this output stream and releases any system resources
* associated with the stream.
*
- * The close method of FilterOutputStream
- * calls its flush method, and then calls the
- * close method of its underlying output stream.
+ * When not already closed, the {@code close} method of {@code
+ * FilterOutputStream} calls its {@code flush} method, and then
+ * calls the {@code close} method of its underlying output stream.
*
* @exception IOException if an I/O error occurs.
* @see java.io.FilterOutputStream#flush()
@@ -154,6 +156,9 @@ class FilterOutputStream extends OutputStream {
*/
@SuppressWarnings("try")
public void close() throws IOException {
+ if (closed)
+ return;
+ closed = true;
try (OutputStream ostream = out) {
flush();
}
diff --git a/jdk/src/java.base/share/classes/java/lang/Deprecated.java b/jdk/src/java.base/share/classes/java/lang/Deprecated.java
index 58a0691f054..7adc22edaf5 100644
--- a/jdk/src/java.base/share/classes/java/lang/Deprecated.java
+++ b/jdk/src/java.base/share/classes/java/lang/Deprecated.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2015, 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
@@ -34,9 +34,13 @@ import static java.lang.annotation.ElementType.*;
* or because a better alternative exists. Compilers warn when a
* deprecated program element is used or overridden in non-deprecated code.
*
+ *
Use of the @Deprecated annotation on a local variable
+ * declaration or on a parameter declaration or a package declaration
+ * has no effect.
+ *
* @author Neal Gafter
* @since 1.5
- * @jls 9.6.3.6 @Deprecated
+ * @jls 9.6.4.6 @Deprecated
*/
@Documented
@Retention(RetentionPolicy.RUNTIME)
diff --git a/jdk/src/java.base/share/classes/java/math/BigInteger.java b/jdk/src/java.base/share/classes/java/math/BigInteger.java
index 487ed224352..2088f63fca1 100644
--- a/jdk/src/java.base/share/classes/java/math/BigInteger.java
+++ b/jdk/src/java.base/share/classes/java/math/BigInteger.java
@@ -265,24 +265,41 @@ public class BigInteger extends Number implements Comparable {
// Constructors
/**
- * Translates a byte array containing the two's-complement binary
- * representation of a BigInteger into a BigInteger. The input array is
+ * Translates a byte sub-array containing the two's-complement binary
+ * representation of a BigInteger into a BigInteger. The sub-array is
+ * specified via an offset into the array and a length. The sub-array is
* assumed to be in big-endian byte-order: the most significant
- * byte is in the zeroth element.
+ * byte is the element at index {@code off}. The {@code val} array is
+ * assumed to be unchanged for the duration of the constructor call.
*
- * @param val big-endian two's-complement binary representation of
- * BigInteger.
+ * An {@code IndexOutOfBoundsException} is thrown if the length of the array
+ * {@code val} is non-zero and either {@code off} is negative, {@code len}
+ * is negative, or {@code off+len} is greater than the length of
+ * {@code val}.
+ *
+ * @param val byte array containing a sub-array which is the big-endian
+ * two's-complement binary representation of a BigInteger.
+ * @param off the start offset of the binary representation.
+ * @param len the number of bytes to use.
* @throws NumberFormatException {@code val} is zero bytes long.
+ * @throws IndexOutOfBoundsException if the provided array offset and
+ * length would cause an index into the byte array to be
+ * negative or greater than or equal to the array length.
+ * @since 1.9
*/
- public BigInteger(byte[] val) {
- if (val.length == 0)
+ public BigInteger(byte[] val, int off, int len) {
+ if (val.length == 0) {
throw new NumberFormatException("Zero length BigInteger");
+ } else if ((off < 0) || (off >= val.length) || (len < 0) ||
+ (len > val.length - off)) { // 0 <= off < val.length
+ throw new IndexOutOfBoundsException();
+ }
- if (val[0] < 0) {
- mag = makePositive(val);
+ if (val[off] < 0) {
+ mag = makePositive(val, off, len);
signum = -1;
} else {
- mag = stripLeadingZeroBytes(val);
+ mag = stripLeadingZeroBytes(val, off, len);
signum = (mag.length == 0 ? 0 : 1);
}
if (mag.length >= MAX_MAG_LENGTH) {
@@ -290,11 +307,28 @@ public class BigInteger extends Number implements Comparable {
}
}
+ /**
+ * Translates a byte array containing the two's-complement binary
+ * representation of a BigInteger into a BigInteger. The input array is
+ * assumed to be in big-endian byte-order: the most significant
+ * byte is in the zeroth element. The {@code val} array is assumed to be
+ * unchanged for the duration of the constructor call.
+ *
+ * @param val big-endian two's-complement binary representation of a
+ * BigInteger.
+ * @throws NumberFormatException {@code val} is zero bytes long.
+ */
+ public BigInteger(byte[] val) {
+ this(val, 0, val.length);
+ }
+
/**
* This private constructor translates an int array containing the
* two's-complement binary representation of a BigInteger into a
* BigInteger. The input array is assumed to be in big-endian
- * int-order: the most significant int is in the zeroth element.
+ * int-order: the most significant int is in the zeroth element. The
+ * {@code val} array is assumed to be unchanged for the duration of
+ * the constructor call.
*/
private BigInteger(int[] val) {
if (val.length == 0)
@@ -315,24 +349,44 @@ public class BigInteger extends Number implements Comparable {
/**
* Translates the sign-magnitude representation of a BigInteger into a
* BigInteger. The sign is represented as an integer signum value: -1 for
- * negative, 0 for zero, or 1 for positive. The magnitude is a byte array
- * in big-endian byte-order: the most significant byte is in the
- * zeroth element. A zero-length magnitude array is permissible, and will
- * result in a BigInteger value of 0, whether signum is -1, 0 or 1.
+ * negative, 0 for zero, or 1 for positive. The magnitude is a sub-array of
+ * a byte array in big-endian byte-order: the most significant byte
+ * is the element at index {@code off}. A zero value of the length
+ * {@code len} is permissible, and will result in a BigInteger value of 0,
+ * whether signum is -1, 0 or 1. The {@code magnitude} array is assumed to
+ * be unchanged for the duration of the constructor call.
+ *
+ * An {@code IndexOutOfBoundsException} is thrown if the length of the array
+ * {@code magnitude} is non-zero and either {@code off} is negative,
+ * {@code len} is negative, or {@code off+len} is greater than the length of
+ * {@code magnitude}.
*
* @param signum signum of the number (-1 for negative, 0 for zero, 1
* for positive).
* @param magnitude big-endian binary representation of the magnitude of
* the number.
+ * @param off the start offset of the binary representation.
+ * @param len the number of bytes to use.
* @throws NumberFormatException {@code signum} is not one of the three
* legal values (-1, 0, and 1), or {@code signum} is 0 and
* {@code magnitude} contains one or more non-zero bytes.
+ * @throws IndexOutOfBoundsException if the provided array offset and
+ * length would cause an index into the byte array to be
+ * negative or greater than or equal to the array length.
+ * @since 1.9
*/
- public BigInteger(int signum, byte[] magnitude) {
- this.mag = stripLeadingZeroBytes(magnitude);
-
- if (signum < -1 || signum > 1)
+ public BigInteger(int signum, byte[] magnitude, int off, int len) {
+ if (signum < -1 || signum > 1) {
throw(new NumberFormatException("Invalid signum value"));
+ } else if ((off < 0) || (len < 0) ||
+ (len > 0 &&
+ ((off >= magnitude.length) ||
+ (len > magnitude.length - off)))) { // 0 <= off < magnitude.length
+ throw new IndexOutOfBoundsException();
+ }
+
+ // stripLeadingZeroBytes() returns a zero length array if len == 0
+ this.mag = stripLeadingZeroBytes(magnitude, off, len);
if (this.mag.length == 0) {
this.signum = 0;
@@ -346,11 +400,34 @@ public class BigInteger extends Number implements Comparable {
}
}
+ /**
+ * Translates the sign-magnitude representation of a BigInteger into a
+ * BigInteger. The sign is represented as an integer signum value: -1 for
+ * negative, 0 for zero, or 1 for positive. The magnitude is a byte array
+ * in big-endian byte-order: the most significant byte is the
+ * zeroth element. A zero-length magnitude array is permissible, and will
+ * result in a BigInteger value of 0, whether signum is -1, 0 or 1. The
+ * {@code magnitude} array is assumed to be unchanged for the duration of
+ * the constructor call.
+ *
+ * @param signum signum of the number (-1 for negative, 0 for zero, 1
+ * for positive).
+ * @param magnitude big-endian binary representation of the magnitude of
+ * the number.
+ * @throws NumberFormatException {@code signum} is not one of the three
+ * legal values (-1, 0, and 1), or {@code signum} is 0 and
+ * {@code magnitude} contains one or more non-zero bytes.
+ */
+ public BigInteger(int signum, byte[] magnitude) {
+ this(signum, magnitude, 0, magnitude.length);
+ }
+
/**
* A constructor for internal use that translates the sign-magnitude
* representation of a BigInteger into a BigInteger. It checks the
* arguments and copies the magnitude so this constructor would be
- * safe for external use.
+ * safe for external use. The {@code magnitude} array is assumed to be
+ * unchanged for the duration of the constructor call.
*/
private BigInteger(int signum, int[] magnitude) {
this.mag = stripLeadingZeroInts(magnitude);
@@ -467,7 +544,9 @@ public class BigInteger extends Number implements Comparable {
/*
* Constructs a new BigInteger using a char array with radix=10.
- * Sign is precalculated outside and not allowed in the val.
+ * Sign is precalculated outside and not allowed in the val. The {@code val}
+ * array is assumed to be unchanged for the duration of the constructor
+ * call.
*/
BigInteger(char[] val, int sign, int len) {
int cursor = 0, numDigits;
@@ -1035,11 +1114,12 @@ public class BigInteger extends Number implements Comparable {
/**
* This private constructor is for internal use and assumes that its
- * arguments are correct.
+ * arguments are correct. The {@code magnitude} array is assumed to be
+ * unchanged for the duration of the constructor call.
*/
private BigInteger(byte[] magnitude, int signum) {
this.signum = (magnitude.length == 0 ? 0 : signum);
- this.mag = stripLeadingZeroBytes(magnitude);
+ this.mag = stripLeadingZeroBytes(magnitude, 0, magnitude.length);
if (mag.length >= MAX_MAG_LENGTH) {
checkRange();
}
@@ -3977,18 +4057,18 @@ public class BigInteger extends Number implements Comparable {
/**
* Returns a copy of the input array stripped of any leading zero bytes.
*/
- private static int[] stripLeadingZeroBytes(byte a[]) {
- int byteLength = a.length;
+ private static int[] stripLeadingZeroBytes(byte a[], int off, int len) {
+ int indexBound = off + len;
int keep;
// Find first nonzero byte
- for (keep = 0; keep < byteLength && a[keep] == 0; keep++)
+ for (keep = off; keep < indexBound && a[keep] == 0; keep++)
;
// Allocate new array and copy relevant part of input array
- int intLength = ((byteLength - keep) + 3) >>> 2;
+ int intLength = ((indexBound - keep) + 3) >>> 2;
int[] result = new int[intLength];
- int b = byteLength - 1;
+ int b = indexBound - 1;
for (int i = intLength-1; i >= 0; i--) {
result[i] = a[b--] & 0xff;
int bytesRemaining = b - keep + 1;
@@ -4003,27 +4083,27 @@ public class BigInteger extends Number implements Comparable {
* Takes an array a representing a negative 2's-complement number and
* returns the minimal (no leading zero bytes) unsigned whose value is -a.
*/
- private static int[] makePositive(byte a[]) {
+ private static int[] makePositive(byte a[], int off, int len) {
int keep, k;
- int byteLength = a.length;
+ int indexBound = off + len;
// Find first non-sign (0xff) byte of input
- for (keep=0; keep < byteLength && a[keep] == -1; keep++)
+ for (keep=off; keep < indexBound && a[keep] == -1; keep++)
;
/* Allocate output array. If all non-sign bytes are 0x00, we must
* allocate space for one extra output byte. */
- for (k=keep; k < byteLength && a[k] == 0; k++)
+ for (k=keep; k < indexBound && a[k] == 0; k++)
;
- int extraByte = (k == byteLength) ? 1 : 0;
- int intLength = ((byteLength - keep + extraByte) + 3) >>> 2;
+ int extraByte = (k == indexBound) ? 1 : 0;
+ int intLength = ((indexBound - keep + extraByte) + 3) >>> 2;
int result[] = new int[intLength];
/* Copy one's complement of input into output, leaving extra
* byte (if it exists) == 0x00 */
- int b = byteLength - 1;
+ int b = indexBound - 1;
for (int i = intLength-1; i >= 0; i--) {
result[i] = a[b--] & 0xff;
int numBytesToTransfer = Math.min(3, b-keep+1);
@@ -4248,7 +4328,7 @@ public class BigInteger extends Number implements Comparable {
message = "BigInteger: Signum not present in stream";
throw new java.io.StreamCorruptedException(message);
}
- int[] mag = stripLeadingZeroBytes(magnitude);
+ int[] mag = stripLeadingZeroBytes(magnitude, 0, magnitude.length);
if ((mag.length == 0) != (sign == 0)) {
String message = "BigInteger: signum-magnitude mismatch";
if (fields.defaulted("magnitude"))
diff --git a/jdk/src/java.base/share/classes/java/util/Formatter.java b/jdk/src/java.base/share/classes/java/util/Formatter.java
index 70298d5b59f..a973ee6889e 100644
--- a/jdk/src/java.base/share/classes/java/util/Formatter.java
+++ b/jdk/src/java.base/share/classes/java/util/Formatter.java
@@ -3727,29 +3727,29 @@ public final class Formatter implements Closeable, Flushable {
exp = new StringBuilder("+00");
}
}
- return;
- }
- long adjusted = -(long) scale + (len - 1);
- if (form == BigDecimalLayoutForm.DECIMAL_FLOAT) {
+ } else if (form == BigDecimalLayoutForm.DECIMAL_FLOAT) {
// count of padding zeros
- int pad = scale - len;
- if (pad >= 0) {
+
+ if (scale >= len) {
// 0.xxx form
mant.append("0.");
dot = true;
- trailingZeros(mant, pad);
+ trailingZeros(mant, scale - len);
mant.append(coeff);
} else {
- if (-pad < len) {
+ if (scale > 0) {
// xx.xx form
- mant.append(coeff, 0, -pad);
+ int pad = len - scale;
+ mant.append(coeff, 0, pad);
mant.append('.');
dot = true;
- mant.append(coeff, -pad, -pad + scale);
- } else {
+ mant.append(coeff, pad, len);
+ } else { // scale < 0
// xx form
mant.append(coeff, 0, len);
- trailingZeros(mant, -scale);
+ if (intVal.signum() != 0) {
+ trailingZeros(mant, -scale);
+ }
this.scale = 0;
}
}
@@ -3762,6 +3762,7 @@ public final class Formatter implements Closeable, Flushable {
mant.append(coeff, 1, len);
}
exp = new StringBuilder();
+ long adjusted = -(long) scale + (len - 1);
if (adjusted != 0) {
long abs = Math.abs(adjusted);
// require sign
diff --git a/jdk/src/java.base/share/classes/javax/crypto/spec/RC5ParameterSpec.java b/jdk/src/java.base/share/classes/javax/crypto/spec/RC5ParameterSpec.java
index 0eddb61f1de..5d8f09f4567 100644
--- a/jdk/src/java.base/share/classes/javax/crypto/spec/RC5ParameterSpec.java
+++ b/jdk/src/java.base/share/classes/javax/crypto/spec/RC5ParameterSpec.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2015, 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
@@ -29,7 +29,7 @@ import java.security.spec.AlgorithmParameterSpec;
/**
* This class specifies the parameters used with the
- * RC5
+ * RC5
* algorithm.
*
* The parameters consist of a version number, a rounds count, a word
@@ -37,7 +37,7 @@ import java.security.spec.AlgorithmParameterSpec;
*
*
This class can be used to initialize a Cipher object that
* implements the RC5 algorithm as supplied by
- * RSA Security Inc. ,
+ * RSA Security LLC ,
* or any parties authorized by RSA Security.
*
* @author Jan Luehe
diff --git a/jdk/src/java.base/windows/classes/sun/nio/ch/FileDispatcherImpl.java b/jdk/src/java.base/windows/classes/sun/nio/ch/FileDispatcherImpl.java
index c767a34cc08..a8c20e2bb58 100644
--- a/jdk/src/java.base/windows/classes/sun/nio/ch/FileDispatcherImpl.java
+++ b/jdk/src/java.base/windows/classes/sun/nio/ch/FileDispatcherImpl.java
@@ -123,7 +123,7 @@ class FileDispatcherImpl extends FileDispatcher {
new PrivilegedAction() {
@Override
public String run() {
- return System.getProperty("jdk.net.enableFastFileTransfer");
+ return System.getProperty("jdk.nio.enableFastFileTransfer");
}
});
boolean enable;
diff --git a/jdk/src/java.base/windows/native/libnet/NetworkInterface_winXP.c b/jdk/src/java.base/windows/native/libnet/NetworkInterface_winXP.c
index e5580c6f3dc..2308a59b44b 100644
--- a/jdk/src/java.base/windows/native/libnet/NetworkInterface_winXP.c
+++ b/jdk/src/java.base/windows/native/libnet/NetworkInterface_winXP.c
@@ -81,9 +81,17 @@ static int getAdapters (JNIEnv *env, IP_ADAPTER_ADDRESSES **adapters) {
DWORD ret, flags;
IP_ADAPTER_ADDRESSES *adapterInfo;
ULONG len;
+ char *error_msg_buf = NULL;
+ size_t error_msg_buf_size =
+ strlen("IP Helper Library GetAdaptersAddresses function failed"
+ " with error == ") + 10;
+ int _ret = 0;
+
+
adapterInfo = (IP_ADAPTER_ADDRESSES *)malloc (bufsize);
if (adapterInfo == NULL) {
- JNU_ThrowByName(env, "java/lang/OutOfMemoryError", "Native heap allocation failure");
+ JNU_ThrowByName(env, "java/lang/OutOfMemoryError",
+ "Native heap allocation failure");
return -1;
}
@@ -94,10 +102,12 @@ static int getAdapters (JNIEnv *env, IP_ADAPTER_ADDRESSES **adapters) {
ret = GetAdaptersAddresses(AF_UNSPEC, flags, NULL, adapterInfo, &len);
if (ret == ERROR_BUFFER_OVERFLOW) {
- IP_ADAPTER_ADDRESSES * newAdapterInfo = (IP_ADAPTER_ADDRESSES *) realloc (adapterInfo, len);
+ IP_ADAPTER_ADDRESSES * newAdapterInfo =
+ (IP_ADAPTER_ADDRESSES *) realloc (adapterInfo, len);
if (newAdapterInfo == NULL) {
free(adapterInfo);
- JNU_ThrowByName(env, "java/lang/OutOfMemoryError", "Native heap allocation failure");
+ JNU_ThrowByName(env, "java/lang/OutOfMemoryError",
+ "Native heap allocation failure");
return -1;
}
@@ -109,8 +119,32 @@ static int getAdapters (JNIEnv *env, IP_ADAPTER_ADDRESSES **adapters) {
if (ret != ERROR_SUCCESS) {
free (adapterInfo);
- JNU_ThrowByName(env, "java/lang/Error",
- "IP Helper Library GetAdaptersAddresses function failed");
+ if (ret == ERROR_INSUFFICIENT_BUFFER) {
+ JNU_ThrowByName(env, "java/lang/Error",
+ "IP Helper Library GetAdaptersAddresses function failed "
+ "with ERROR_INSUFFICIENT_BUFFER");
+ } else if (ret == ERROR_ADDRESS_NOT_ASSOCIATED ) {
+ JNU_ThrowByName(env, "java/lang/Error",
+ "IP Helper Library GetAdaptersAddresses function failed "
+ "with ERROR_ADDRESS_NOT_ASSOCIATED");
+ } else {
+ error_msg_buf = (char *)malloc(error_msg_buf_size);
+ if (error_msg_buf != NULL) {
+ memset(error_msg_buf, 0, error_msg_buf_size);
+ _ret = _snprintf_s(error_msg_buf, error_msg_buf_size,
+ _TRUNCATE, "IP Helper Library GetAdaptersAddresses "
+ "function failed with error == %d", ret);
+ if (_ret != -1) {
+ JNU_ThrowByName(env, "java/lang/Error", error_msg_buf);
+ } else {
+ JNU_ThrowByName(env, "java/lang/Error",
+ "IP Helper Library GetAdaptersAddresses function failure");
+ }
+ } else {
+ JNU_ThrowByName(env, "java/lang/Error",
+ "IP Helper Library GetAdaptersAddresses function failed");
+ }
+ }
return -1;
}
*adapters = adapterInfo;
@@ -126,9 +160,14 @@ IP_ADAPTER_ADDRESSES *getAdapter (JNIEnv *env, jint index) {
DWORD flags, val;
IP_ADAPTER_ADDRESSES *adapterInfo, *ptr, *ret;
ULONG len;
+ char *error_msg_buf = NULL;
+ size_t error_msg_buf_size =
+ strlen("IP Helper Library GetAdaptersAddresses function failed with error == ") + 10;
+ int _ret = 0;
adapterInfo = (IP_ADAPTER_ADDRESSES *)malloc (bufsize);
if (adapterInfo == NULL) {
- JNU_ThrowByName(env, "java/lang/OutOfMemoryError", "Native heap allocation failure");
+ JNU_ThrowByName(env, "java/lang/OutOfMemoryError",
+ "Native heap allocation failure");
return NULL;
}
len = bufsize;
@@ -137,10 +176,12 @@ IP_ADAPTER_ADDRESSES *getAdapter (JNIEnv *env, jint index) {
flags |= GAA_FLAG_INCLUDE_PREFIX;
val = GetAdaptersAddresses(AF_UNSPEC, flags, NULL, adapterInfo, &len);
if (val == ERROR_BUFFER_OVERFLOW) {
- IP_ADAPTER_ADDRESSES * newAdapterInfo = (IP_ADAPTER_ADDRESSES *) realloc (adapterInfo, len);
+ IP_ADAPTER_ADDRESSES * newAdapterInfo =
+ (IP_ADAPTER_ADDRESSES *) realloc (adapterInfo, len);
if (newAdapterInfo == NULL) {
free(adapterInfo);
- JNU_ThrowByName(env, "java/lang/OutOfMemoryError", "Native heap allocation failure");
+ JNU_ThrowByName(env, "java/lang/OutOfMemoryError",
+ "Native heap allocation failure");
return NULL;
}
@@ -152,10 +193,35 @@ IP_ADAPTER_ADDRESSES *getAdapter (JNIEnv *env, jint index) {
if (val != ERROR_SUCCESS) {
free (adapterInfo);
- JNU_ThrowByName(env, "java/lang/Error",
- "IP Helper Library GetAdaptersAddresses function failed");
+ if (val == ERROR_INSUFFICIENT_BUFFER) {
+ JNU_ThrowByName(env, "java/lang/Error",
+ "IP Helper Library GetAdaptersAddresses function failed "
+ "with ERROR_INSUFFICIENT_BUFFER");
+ } else if (val == ERROR_ADDRESS_NOT_ASSOCIATED ) {
+ JNU_ThrowByName(env, "java/lang/Error",
+ "IP Helper Library GetAdaptersAddresses function failed "
+ "with ERROR_ADDRESS_NOT_ASSOCIATED");
+ } else {
+ error_msg_buf = (char *)malloc(error_msg_buf_size);
+ if (error_msg_buf != NULL) {
+ memset(error_msg_buf, 0, error_msg_buf_size);
+ _ret = _snprintf_s(error_msg_buf, error_msg_buf_size,
+ _TRUNCATE, "IP Helper Library GetAdaptersAddresses function failed "
+ "with error == %d", val);
+ if (_ret != -1) {
+ JNU_ThrowByName(env, "java/lang/Error", error_msg_buf);
+ } else {
+ JNU_ThrowByName(env, "java/lang/Error",
+ "IP Helper Library GetAdaptersAddresses function failure");
+ }
+ } else {
+ JNU_ThrowByName(env, "java/lang/Error",
+ "IP Helper Library GetAdaptersAddresses function failed");
+ }
+ }
return NULL;
}
+
ptr = adapterInfo;
ret = NULL;
while (ptr != NULL) {
@@ -168,7 +234,8 @@ IP_ADAPTER_ADDRESSES *getAdapter (JNIEnv *env, jint index) {
ret = (IP_ADAPTER_ADDRESSES *) malloc(sizeof(IP_ADAPTER_ADDRESSES));
if (ret == NULL) {
free(adapterInfo);
- JNU_ThrowByName(env, "java/lang/OutOfMemoryError", "Native heap allocation failure");
+ JNU_ThrowByName(env, "java/lang/OutOfMemoryError",
+ "Native heap allocation failure");
return NULL;
}
diff --git a/jdk/src/java.scripting/share/classes/javax/script/ScriptEngineFactory.java b/jdk/src/java.scripting/share/classes/javax/script/ScriptEngineFactory.java
index e73c99f5203..7692a0aaec7 100644
--- a/jdk/src/java.scripting/share/classes/javax/script/ScriptEngineFactory.java
+++ b/jdk/src/java.scripting/share/classes/javax/script/ScriptEngineFactory.java
@@ -85,7 +85,7 @@ public interface ScriptEngineFactory {
public List getNames();
/**
- * Returns the name of the scripting langauge supported by this
+ * Returns the name of the scripting language supported by this
* ScriptEngine.
* @return The name of the supported language.
*/
@@ -104,14 +104,15 @@ public interface ScriptEngineFactory {
*
* ScriptEngine.ENGINE
* ScriptEngine.ENGINE_VERSION
- * ScriptEngine.NAME
* ScriptEngine.LANGUAGE
* ScriptEngine.LANGUAGE_VERSION
+ * ScriptEngine.NAME
*
*
* The values for these keys are the Strings returned by getEngineName,
- * getEngineVersion, getName, getLanguageName and
- * getLanguageVersion respectively.
+ * getEngineVersion, getLanguageName,
+ * getLanguageVersion for the first four keys respectively. For NAME, one of the Strings
+ * returned by getNames is returned.
* A reserved key, THREADING , whose value describes the behavior of the engine
* with respect to concurrent execution of scripts and maintenance of state is also defined.
* These values for the THREADING key are:
diff --git a/corba/src/java.sql/share/classes/javax/transaction/xa/XAException.java b/jdk/src/java.sql/share/classes/javax/transaction/xa/XAException.java
similarity index 93%
rename from corba/src/java.sql/share/classes/javax/transaction/xa/XAException.java
rename to jdk/src/java.sql/share/classes/javax/transaction/xa/XAException.java
index 7941e98995b..62ae7e5e8d9 100644
--- a/corba/src/java.sql/share/classes/javax/transaction/xa/XAException.java
+++ b/jdk/src/java.sql/share/classes/javax/transaction/xa/XAException.java
@@ -30,21 +30,20 @@ package javax.transaction.xa;
* Transaction Manager of an error encountered by the involved transaction.
*
*/
-public class XAException extends java.lang.Exception {
+public class XAException extends Exception {
+ //private static final long serialVersionUID = -8249683284832867751L;
/**
- * The error code with which to create the SystemException.
- *
- * @serial The error code for the exception
+ * The error code with which to create the SystemException.
+ *
+ * @serial The error code for the exception
*/
-
public int errorCode;
/**
* Create an XAException.
*/
- public XAException()
- {
+ public XAException() {
super();
}
@@ -54,8 +53,7 @@ public class XAException extends java.lang.Exception {
* @param s The String object containing the exception
* message.
*/
- public XAException(String s)
- {
+ public XAException(String s) {
super(s);
}
@@ -64,8 +62,7 @@ public class XAException extends java.lang.Exception {
*
* @param errcode The error code identifying the exception.
*/
- public XAException(int errcode)
- {
+ public XAException(int errcode) {
super();
errorCode = errcode;
}
@@ -196,6 +193,4 @@ public class XAException extends java.lang.Exception {
* The resource manager is doing work outside a global transaction.
*/
public final static int XAER_OUTSIDE = -9;
-
-
}
diff --git a/jdk/src/java.sql/share/classes/javax/transaction/xa/XAResource.java b/jdk/src/java.sql/share/classes/javax/transaction/xa/XAResource.java
new file mode 100644
index 00000000000..489818e98a5
--- /dev/null
+++ b/jdk/src/java.sql/share/classes/javax/transaction/xa/XAResource.java
@@ -0,0 +1,305 @@
+/*
+ * Copyright (c) 2000, 2001, 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 javax.transaction.xa;
+
+/**
+ * The XAResource interface is a Java mapping of the industry standard
+ * XA interface based on the X/Open CAE Specification (Distributed
+ * Transaction Processing: The XA Specification).
+ *
+ *
The XA interface defines the contract between a Resource Manager
+ * and a Transaction Manager in a distributed transaction processing
+ * (DTP) environment. A JDBC driver or a JMS provider implements
+ * this interface to support the association between a global transaction
+ * and a database or message service connection.
+ *
+ *
The XAResource interface can be supported by any transactional
+ * resource that is intended to be used by application programs in an
+ * environment where transactions are controlled by an external
+ * transaction manager. An example of such a resource is a database
+ * management system. An application may access data through multiple
+ * database connections. Each database connection is enlisted with
+ * the transaction manager as a transactional resource. The transaction
+ * manager obtains an XAResource for each connection participating
+ * in a global transaction. The transaction manager uses the
+ * start method
+ * to associate the global transaction with the resource, and it uses the
+ * end method to disassociate the transaction from
+ * the resource. The resource
+ * manager is responsible for associating the global transaction to all
+ * work performed on its data between the start and end method invocations.
+ *
+ *
At transaction commit time, the resource managers are informed by
+ * the transaction manager to prepare, commit, or rollback a transaction
+ * according to the two-phase commit protocol.
+ *
+ */
+public interface XAResource {
+
+ /**
+ * Commits the global transaction specified by xid.
+ *
+ * @param xid A global transaction identifier
+ *
+ * @param onePhase If true, the resource manager should use a one-phase
+ * commit protocol to commit the work done on behalf of xid.
+ *
+ * @exception XAException An error has occurred. Possible XAExceptions
+ * are XA_HEURHAZ, XA_HEURCOM, XA_HEURRB, XA_HEURMIX, XAER_RMERR,
+ * XAER_RMFAIL, XAER_NOTA, XAER_INVAL, or XAER_PROTO.
+ *
+ * If the resource manager did not commit the transaction and the
+ * paramether onePhase is set to true, the resource manager may throw
+ * one of the XA_RB* exceptions. Upon return, the resource manager has
+ * rolled back the branch's work and has released all held resources.
+ */
+ void commit(Xid xid, boolean onePhase) throws XAException;
+
+ /**
+ * Ends the work performed on behalf of a transaction branch.
+ * The resource manager disassociates the XA resource from the
+ * transaction branch specified and lets the transaction
+ * complete.
+ *
+ *
If TMSUSPEND is specified in the flags, the transaction branch
+ * is temporarily suspended in an incomplete state. The transaction
+ * context is in a suspended state and must be resumed via the
+ * start method with TMRESUME specified.
+ *
+ * If TMFAIL is specified, the portion of work has failed.
+ * The resource manager may mark the transaction as rollback-only
+ *
+ * If TMSUCCESS is specified, the portion of work has completed
+ * successfully.
+ *
+ * @param xid A global transaction identifier that is the same as
+ * the identifier used previously in the start method.
+ *
+ * @param flags One of TMSUCCESS, TMFAIL, or TMSUSPEND.
+ *
+ * @exception XAException An error has occurred. Possible XAException
+ * values are XAER_RMERR, XAER_RMFAILED, XAER_NOTA, XAER_INVAL,
+ * XAER_PROTO, or XA_RB*.
+ */
+ void end(Xid xid, int flags) throws XAException;
+
+ /**
+ * Tells the resource manager to forget about a heuristically
+ * completed transaction branch.
+ *
+ * @param xid A global transaction identifier.
+ *
+ * @exception XAException An error has occurred. Possible exception
+ * values are XAER_RMERR, XAER_RMFAIL, XAER_NOTA, XAER_INVAL, or
+ * XAER_PROTO.
+ */
+ void forget(Xid xid) throws XAException;
+
+ /**
+ * Obtains the current transaction timeout value set for this
+ * XAResource instance. If XAResource.setTransactionTimeout
+ * was not used prior to invoking this method, the return value
+ * is the default timeout set for the resource manager; otherwise,
+ * the value used in the previous setTransactionTimeout
+ * call is returned.
+ *
+ * @return the transaction timeout value in seconds.
+ *
+ * @exception XAException An error has occurred. Possible exception
+ * values are XAER_RMERR and XAER_RMFAIL.
+ */
+ int getTransactionTimeout() throws XAException;
+
+ /**
+ * This method is called to determine if the resource manager
+ * instance represented by the target object is the same as the
+ * resouce manager instance represented by the parameter xares .
+ *
+ * @param xares An XAResource object whose resource manager instance
+ * is to be compared with the resource manager instance of the
+ * target object.
+ *
+ * @return true if it's the same RM instance; otherwise
+ * false .
+ *
+ * @exception XAException An error has occurred. Possible exception
+ * values are XAER_RMERR and XAER_RMFAIL.
+ */
+ boolean isSameRM(XAResource xares) throws XAException;
+
+ /**
+ * Ask the resource manager to prepare for a transaction commit
+ * of the transaction specified in xid.
+ *
+ * @param xid A global transaction identifier.
+ *
+ * @exception XAException An error has occurred. Possible exception
+ * values are: XA_RB*, XAER_RMERR, XAER_RMFAIL, XAER_NOTA, XAER_INVAL,
+ * or XAER_PROTO.
+ *
+ * @return A value indicating the resource manager's vote on the
+ * outcome of the transaction. The possible values are: XA_RDONLY
+ * or XA_OK. If the resource manager wants to roll back the
+ * transaction, it should do so by raising an appropriate XAException
+ * in the prepare method.
+ */
+ int prepare(Xid xid) throws XAException;
+
+ /**
+ * Obtains a list of prepared transaction branches from a resource
+ * manager. The transaction manager calls this method during recovery
+ * to obtain the list of transaction branches that are currently in
+ * prepared or heuristically completed states.
+ *
+ * @param flag One of TMSTARTRSCAN, TMENDRSCAN, TMNOFLAGS. TMNOFLAGS
+ * must be used when no other flags are set in the parameter.
+ *
+ * @exception XAException An error has occurred. Possible values are
+ * XAER_RMERR, XAER_RMFAIL, XAER_INVAL, and XAER_PROTO.
+ *
+ * @return The resource manager returns zero or more XIDs of the
+ * transaction branches that are currently in a prepared or
+ * heuristically completed state. If an error occurs during the
+ * operation, the resource manager should throw the appropriate
+ * XAException.
+ */
+ Xid[] recover(int flag) throws XAException;
+
+ /**
+ * Informs the resource manager to roll back work done on behalf
+ * of a transaction branch.
+ *
+ * @param xid A global transaction identifier.
+ *
+ * @exception XAException An error has occurred.
+ */
+ void rollback(Xid xid) throws XAException;
+
+ /**
+ * Sets the current transaction timeout value for this XAResource
+ * instance. Once set, this timeout value is effective until
+ * setTransactionTimeout is invoked again with a different
+ * value. To reset the timeout value to the default value used by the resource
+ * manager, set the value to zero.
+ *
+ * If the timeout operation is performed successfully, the method returns
+ * true ; otherwise false . If a resource manager does not
+ * support explicitly setting the transaction timeout value, this method
+ * returns false .
+ *
+ * @param seconds The transaction timeout value in seconds.
+ *
+ * @return true if the transaction timeout value is set successfully;
+ * otherwise false .
+ *
+ * @exception XAException An error has occurred. Possible exception values
+ * are XAER_RMERR, XAER_RMFAIL, or XAER_INVAL.
+ */
+ boolean setTransactionTimeout(int seconds) throws XAException;
+
+ /**
+ * Starts work on behalf of a transaction branch specified in
+ * xid.
+ *
+ * If TMJOIN is specified, the start applies to joining a transaction
+ * previously seen by the resource manager. If TMRESUME is specified,
+ * the start applies to resuming a suspended transaction specified in the
+ * parameter xid.
+ *
+ * If neither TMJOIN nor TMRESUME is specified and the transaction
+ * specified by xid has previously been seen by the resource
+ * manager, the resource manager throws the XAException exception with
+ * XAER_DUPID error code.
+ *
+ * @param xid A global transaction identifier to be associated
+ * with the resource.
+ *
+ * @param flags One of TMNOFLAGS, TMJOIN, or TMRESUME.
+ *
+ * @exception XAException An error has occurred. Possible exceptions
+ * are XA_RB*, XAER_RMERR, XAER_RMFAIL, XAER_DUPID, XAER_OUTSIDE,
+ * XAER_NOTA, XAER_INVAL, or XAER_PROTO.
+ */
+ void start(Xid xid, int flags) throws XAException;
+
+ /**
+ * Ends a recovery scan.
+ */
+ public final static int TMENDRSCAN = 0x00800000;
+
+ /**
+ * Disassociates the caller and marks the transaction branch
+ * rollback-only.
+ */
+ public final static int TMFAIL = 0x20000000;
+
+ /**
+ * Caller is joining existing transaction branch.
+ */
+ public final static int TMJOIN = 0x00200000;
+
+ /**
+ * Use TMNOFLAGS to indicate no flags value is selected.
+ */
+ public final static int TMNOFLAGS = 0x00000000;
+
+ /**
+ * Caller is using one-phase optimization.
+ */
+ public final static int TMONEPHASE = 0x40000000;
+
+ /**
+ * Caller is resuming association with a suspended
+ * transaction branch.
+ */
+ public final static int TMRESUME = 0x08000000;
+
+ /**
+ * Starts a recovery scan.
+ */
+ public final static int TMSTARTRSCAN = 0x01000000;
+
+ /**
+ * Disassociates caller from a transaction branch.
+ */
+ public final static int TMSUCCESS = 0x04000000;
+
+ /**
+ * Caller is suspending (not ending) its association with
+ * a transaction branch.
+ */
+ public final static int TMSUSPEND = 0x02000000;
+
+ /**
+ * The transaction branch has been read-only and has been committed.
+ */
+ public final static int XA_RDONLY = 0x00000003;
+
+ /**
+ * The transaction work has been prepared normally.
+ */
+ public final static int XA_OK = 0;
+}
diff --git a/corba/src/java.sql/share/classes/javax/transaction/xa/Xid.java b/jdk/src/java.sql/share/classes/javax/transaction/xa/Xid.java
similarity index 100%
rename from corba/src/java.sql/share/classes/javax/transaction/xa/Xid.java
rename to jdk/src/java.sql/share/classes/javax/transaction/xa/Xid.java
diff --git a/corba/src/java.sql/share/classes/javax/transaction/xa/package.html b/jdk/src/java.sql/share/classes/javax/transaction/xa/package.html
similarity index 100%
rename from corba/src/java.sql/share/classes/javax/transaction/xa/package.html
rename to jdk/src/java.sql/share/classes/javax/transaction/xa/package.html
diff --git a/corba/src/java.corba/share/classes/javax/transaction/InvalidTransactionException.java b/jdk/src/java.transaction/share/classes/javax/transaction/InvalidTransactionException.java
similarity index 89%
rename from corba/src/java.corba/share/classes/javax/transaction/InvalidTransactionException.java
rename to jdk/src/java.transaction/share/classes/javax/transaction/InvalidTransactionException.java
index 268f54cb609..5d0c699b887 100644
--- a/corba/src/java.corba/share/classes/javax/transaction/InvalidTransactionException.java
+++ b/jdk/src/java.transaction/share/classes/javax/transaction/InvalidTransactionException.java
@@ -36,15 +36,14 @@ package javax.transaction;
* context. For example, this exception could be raised if an error
* occured when trying to register a resource.
*/
-public class InvalidTransactionException extends java.rmi.RemoteException
-{
- public InvalidTransactionException()
- {
+@SuppressWarnings("serial") // serialVersionUID intentionally omitted
+public class InvalidTransactionException extends java.rmi.RemoteException {
+
+ public InvalidTransactionException() {
super();
}
- public InvalidTransactionException(String msg)
- {
+ public InvalidTransactionException(String msg) {
super(msg);
}
}
diff --git a/corba/src/java.corba/share/classes/javax/transaction/TransactionRequiredException.java b/jdk/src/java.transaction/share/classes/javax/transaction/TransactionRequiredException.java
similarity index 89%
rename from corba/src/java.corba/share/classes/javax/transaction/TransactionRequiredException.java
rename to jdk/src/java.transaction/share/classes/javax/transaction/TransactionRequiredException.java
index 3a5040f0d78..ee2ccbb8040 100644
--- a/corba/src/java.corba/share/classes/javax/transaction/TransactionRequiredException.java
+++ b/jdk/src/java.transaction/share/classes/javax/transaction/TransactionRequiredException.java
@@ -35,15 +35,14 @@ package javax.transaction;
* This exception indicates that a request carried a null transaction context,
* but the target object requires an activate transaction.
*/
-public class TransactionRequiredException extends java.rmi.RemoteException
-{
- public TransactionRequiredException()
- {
+@SuppressWarnings("serial") // serialVersionUID intentionally omitted
+public class TransactionRequiredException extends java.rmi.RemoteException {
+
+ public TransactionRequiredException() {
super();
}
- public TransactionRequiredException(String msg)
- {
+ public TransactionRequiredException(String msg) {
super(msg);
}
}
diff --git a/corba/src/java.corba/share/classes/javax/transaction/TransactionRolledbackException.java b/jdk/src/java.transaction/share/classes/javax/transaction/TransactionRolledbackException.java
similarity index 89%
rename from corba/src/java.corba/share/classes/javax/transaction/TransactionRolledbackException.java
rename to jdk/src/java.transaction/share/classes/javax/transaction/TransactionRolledbackException.java
index f75cdfb70c9..73ee335beee 100644
--- a/corba/src/java.corba/share/classes/javax/transaction/TransactionRolledbackException.java
+++ b/jdk/src/java.transaction/share/classes/javax/transaction/TransactionRolledbackException.java
@@ -38,15 +38,14 @@ package javax.transaction;
* because further computation on behalf of the transaction would be
* fruitless
*/
-public class TransactionRolledbackException extends java.rmi.RemoteException
-{
- public TransactionRolledbackException()
- {
+@SuppressWarnings("serial") // serialVersionUID intentionally omitted
+public class TransactionRolledbackException extends java.rmi.RemoteException {
+
+ public TransactionRolledbackException() {
super();
}
- public TransactionRolledbackException(String msg)
- {
+ public TransactionRolledbackException(String msg) {
super(msg);
}
}
diff --git a/corba/src/java.corba/share/classes/javax/transaction/package.html b/jdk/src/java.transaction/share/classes/javax/transaction/package.html
similarity index 100%
rename from corba/src/java.corba/share/classes/javax/transaction/package.html
rename to jdk/src/java.transaction/share/classes/javax/transaction/package.html
diff --git a/jdk/src/java.xml.crypto/share/classes/org/jcp/xml/dsig/internal/dom/DOMKeyValue.java b/jdk/src/java.xml.crypto/share/classes/org/jcp/xml/dsig/internal/dom/DOMKeyValue.java
index bb7a553beb3..08aee02be10 100644
--- a/jdk/src/java.xml.crypto/share/classes/org/jcp/xml/dsig/internal/dom/DOMKeyValue.java
+++ b/jdk/src/java.xml.crypto/share/classes/org/jcp/xml/dsig/internal/dom/DOMKeyValue.java
@@ -21,7 +21,7 @@
* under the License.
*/
/*
- * Copyright (c) 2005, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2015, Oracle and/or its affiliates. All rights reserved.
*/
/*
* $Id: DOMKeyValue.java 1333415 2012-05-03 12:03:51Z coheigea $
@@ -33,20 +33,19 @@ import javax.xml.crypto.dom.DOMCryptoContext;
import javax.xml.crypto.dsig.*;
import javax.xml.crypto.dsig.keyinfo.KeyValue;
-import java.lang.reflect.InvocationTargetException;
-import java.lang.reflect.Method;
-import java.security.AccessController;
+import java.io.IOException;
+import java.math.BigInteger;
import java.security.KeyException;
import java.security.KeyFactory;
import java.security.NoSuchAlgorithmException;
-import java.security.PrivilegedActionException;
-import java.security.PrivilegedExceptionAction;
import java.security.PublicKey;
import java.security.interfaces.DSAParams;
import java.security.interfaces.DSAPublicKey;
import java.security.interfaces.ECPublicKey;
import java.security.interfaces.RSAPublicKey;
import java.security.spec.DSAPublicKeySpec;
+import java.security.spec.ECField;
+import java.security.spec.ECFieldFp;
import java.security.spec.ECParameterSpec;
import java.security.spec.ECPoint;
import java.security.spec.ECPublicKeySpec;
@@ -54,6 +53,7 @@ import java.security.spec.EllipticCurve;
import java.security.spec.InvalidKeySpecException;
import java.security.spec.KeySpec;
import java.security.spec.RSAPublicKeySpec;
+import java.util.Arrays;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
import org.w3c.dom.Node;
@@ -325,55 +325,112 @@ public abstract class DOMKeyValue extends DOMStructure implements KeyValue {
private byte[] ecPublicKey;
private KeyFactory eckf;
private ECParameterSpec ecParams;
- private Method encodePoint, decodePoint, getCurveName,
- getECParameterSpec;
+
+ // The supported curve, secp256r1
+ private static final Curve SECP256R1;
+ static {
+ final String name, oid, sfield, a, b, x, y, n;
+ name = "secp256r1 [NIST P-256, X9.62 prime256v1]";
+ oid = "1.2.840.10045.3.1.7";
+ sfield =
+ "FFFFFFFF00000001000000000000000000000000FFFFFFFFFFFFFFFFFFFFFFFF";
+ a =
+ "FFFFFFFF00000001000000000000000000000000FFFFFFFFFFFFFFFFFFFFFFFC";
+ b =
+ "5AC635D8AA3A93E7B3EBBD55769886BC651D06B0CC53B0F63BCE3C3E27D2604B";
+ x =
+ "6B17D1F2E12C4247F8BCE6E563A440F277037D812DEB33A0F4A13945D898C296";
+ y =
+ "4FE342E2FE1A7F9B8EE7EB4A7C0F9E162BCE33576B315ECECBB6406837BF51F5";
+ n =
+ "FFFFFFFF00000000FFFFFFFFFFFFFFFFBCE6FAADA7179E84F3B9CAC2FC632551";
+ final int h = 1;
+
+ BigInteger p = bigInt(sfield);
+ ECField field = new ECFieldFp(p);
+ EllipticCurve curve = new EllipticCurve(field, bigInt(a),
+ bigInt(b));
+ ECPoint g = new ECPoint(bigInt(x), bigInt(y));
+ SECP256R1 = new Curve(name, oid, curve, g, bigInt(n), h);
+ }
EC(PublicKey key) throws KeyException {
super(key);
ECPublicKey ecKey = (ECPublicKey)key;
ECPoint ecPoint = ecKey.getW();
ecParams = ecKey.getParams();
- try {
- AccessController.doPrivileged(
- new PrivilegedExceptionAction() {
- public Void run() throws
- ClassNotFoundException, NoSuchMethodException
- {
- getMethods();
- return null;
- }
- }
- );
- } catch (PrivilegedActionException pae) {
- throw new KeyException("ECKeyValue not supported",
- pae.getException());
- }
- Object[] args = new Object[] { ecPoint, ecParams.getCurve() };
- try {
- ecPublicKey = (byte[])encodePoint.invoke(null, args);
- } catch (IllegalAccessException iae) {
- throw new KeyException(iae);
- } catch (InvocationTargetException ite) {
- throw new KeyException(ite);
- }
+ ecPublicKey = encodePoint(ecPoint, ecParams.getCurve());
}
EC(Element dmElem) throws MarshalException {
super(dmElem);
}
- void getMethods() throws ClassNotFoundException, NoSuchMethodException {
- Class> c = Class.forName("sun.security.util.ECParameters");
- Class>[] params = new Class>[] { ECPoint.class,
- EllipticCurve.class };
- encodePoint = c.getMethod("encodePoint", params);
- params = new Class>[] { ECParameterSpec.class };
- getCurveName = c.getMethod("getCurveName", params);
- params = new Class>[] { byte[].class, EllipticCurve.class };
- decodePoint = c.getMethod("decodePoint", params);
- c = Class.forName("sun.security.util.NamedCurve");
- params = new Class>[] { String.class };
- getECParameterSpec = c.getMethod("getECParameterSpec", params);
+ private static ECPoint decodePoint(byte[] data, EllipticCurve curve)
+ throws IOException {
+ if ((data.length == 0) || (data[0] != 4)) {
+ throw new IOException("Only uncompressed point format " +
+ "supported");
+ }
+ // Per ANSI X9.62, an encoded point is a 1 byte type followed by
+ // ceiling(log base 2 field-size / 8) bytes of x and the same of y.
+ int n = (data.length - 1) / 2;
+ if (n != ((curve.getField().getFieldSize() + 7) >> 3)) {
+ throw new IOException("Point does not match field size");
+ }
+
+ byte[] xb = Arrays.copyOfRange(data, 1, 1 + n);
+ byte[] yb = Arrays.copyOfRange(data, n + 1, n + 1 + n);
+
+ return new ECPoint(new BigInteger(1, xb), new BigInteger(1, yb));
+ }
+
+ private static byte[] encodePoint(ECPoint point, EllipticCurve curve) {
+ // get field size in bytes (rounding up)
+ int n = (curve.getField().getFieldSize() + 7) >> 3;
+ byte[] xb = trimZeroes(point.getAffineX().toByteArray());
+ byte[] yb = trimZeroes(point.getAffineY().toByteArray());
+ if ((xb.length > n) || (yb.length > n)) {
+ throw new RuntimeException("Point coordinates do not " +
+ "match field size");
+ }
+ byte[] b = new byte[1 + (n << 1)];
+ b[0] = 4; // uncompressed
+ System.arraycopy(xb, 0, b, n - xb.length + 1, xb.length);
+ System.arraycopy(yb, 0, b, b.length - yb.length, yb.length);
+ return b;
+ }
+
+ private static byte[] trimZeroes(byte[] b) {
+ int i = 0;
+ while ((i < b.length - 1) && (b[i] == 0)) {
+ i++;
+ }
+ if (i == 0) {
+ return b;
+ }
+ return Arrays.copyOfRange(b, i, b.length);
+ }
+
+ private static String getCurveOid(ECParameterSpec params) {
+ // Check that the params represent the secp256r1 curve
+ // If so, return the object identifier of the curve
+ int fieldSize = params.getCurve().getField().getFieldSize();
+ if (SECP256R1.getCurve().getField().getFieldSize() == fieldSize
+ && SECP256R1.getCurve().equals(params.getCurve())
+ && SECP256R1.getGenerator().equals(params.getGenerator())
+ && SECP256R1.getOrder().equals(params.getOrder())
+ && SECP256R1.getCofactor() == params.getCofactor()) {
+ return SECP256R1.getObjectId();
+ }
+ return null;
+ }
+
+ private static ECParameterSpec getECParameterSpec(String oid) {
+ if (oid.equals(SECP256R1.getObjectId())) {
+ return SECP256R1;
+ }
+ return null;
}
void marshalPublicKey(Node parent, Document doc, String dsPrefix,
@@ -391,14 +448,11 @@ public abstract class DOMKeyValue extends DOMStructure implements KeyValue {
XMLDSIG_11_XMLNS,
prefix);
Object[] args = new Object[] { ecParams };
- try {
- String oid = (String) getCurveName.invoke(null, args);
- DOMUtils.setAttribute(namedCurveElem, "URI", "urn:oid:" + oid);
- } catch (IllegalAccessException iae) {
- throw new MarshalException(iae);
- } catch (InvocationTargetException ite) {
- throw new MarshalException(ite);
+ String oid = getCurveOid(ecParams);
+ if (oid == null) {
+ throw new MarshalException("Invalid ECParameterSpec");
}
+ DOMUtils.setAttribute(namedCurveElem, "URI", "urn:oid:" + oid);
String qname = (prefix == null || prefix.length() == 0)
? "xmlns" : "xmlns:" + prefix;
namedCurveElem.setAttributeNS("http://www.w3.org/2000/xmlns/",
@@ -422,21 +476,6 @@ public abstract class DOMKeyValue extends DOMStructure implements KeyValue {
("unable to create EC KeyFactory: " + e.getMessage());
}
}
- try {
- AccessController.doPrivileged(
- new PrivilegedExceptionAction() {
- public Void run() throws
- ClassNotFoundException, NoSuchMethodException
- {
- getMethods();
- return null;
- }
- }
- );
- } catch (PrivilegedActionException pae) {
- throw new MarshalException("ECKeyValue not supported",
- pae.getException());
- }
ECParameterSpec ecParams = null;
Element curElem = DOMUtils.getFirstChildElement(kvtElem);
if (curElem.getLocalName().equals("ECParameters")) {
@@ -447,14 +486,9 @@ public abstract class DOMKeyValue extends DOMStructure implements KeyValue {
// strip off "urn:oid"
if (uri.startsWith("urn:oid:")) {
String oid = uri.substring(8);
- try {
- Object[] args = new Object[] { oid };
- ecParams = (ECParameterSpec)
- getECParameterSpec.invoke(null, args);
- } catch (IllegalAccessException iae) {
- throw new MarshalException(iae);
- } catch (InvocationTargetException ite) {
- throw new MarshalException(ite);
+ ecParams = getECParameterSpec(oid);
+ if (ecParams == null) {
+ throw new MarshalException("Invalid curve OID");
}
} else {
throw new MarshalException("Invalid NamedCurve URI");
@@ -464,24 +498,43 @@ public abstract class DOMKeyValue extends DOMStructure implements KeyValue {
}
curElem = DOMUtils.getNextSiblingElement(curElem, "PublicKey");
ECPoint ecPoint = null;
+
try {
- Object[] args = new Object[] { Base64.decode(curElem),
- ecParams.getCurve() };
- ecPoint = (ECPoint)decodePoint.invoke(null, args);
+ ecPoint = decodePoint(Base64.decode(curElem),
+ ecParams.getCurve());
} catch (Base64DecodingException bde) {
throw new MarshalException("Invalid EC PublicKey", bde);
- } catch (IllegalAccessException iae) {
- throw new MarshalException(iae);
- } catch (InvocationTargetException ite) {
- throw new MarshalException(ite);
+ } catch (IOException ioe) {
+ throw new MarshalException("Invalid EC Point", ioe);
}
-/*
- ecPoint = sun.security.util.ECParameters.decodePoint(
- Base64.decode(curElem), ecParams.getCurve());
-*/
+
ECPublicKeySpec spec = new ECPublicKeySpec(ecPoint, ecParams);
return generatePublicKey(eckf, spec);
}
+
+ static final class Curve extends ECParameterSpec {
+ private final String name;
+ private final String oid;
+
+ Curve(String name, String oid, EllipticCurve curve,
+ ECPoint g, BigInteger n, int h) {
+ super(curve, g, n, h);
+ this.name = name;
+ this.oid = oid;
+ }
+
+ private String getName() {
+ return name;
+ }
+
+ private String getObjectId() {
+ return oid;
+ }
+ }
+ }
+
+ private static BigInteger bigInt(String s) {
+ return new BigInteger(s, 16);
}
static final class Unknown extends DOMKeyValue {
diff --git a/jdk/test/ProblemList.txt b/jdk/test/ProblemList.txt
index 16bdf6d2114..982e1ab15f5 100644
--- a/jdk/test/ProblemList.txt
+++ b/jdk/test/ProblemList.txt
@@ -154,6 +154,9 @@ com/sun/management/OperatingSystemMXBean/GetProcessCpuLoad.java aix-all
com/sun/management/OperatingSystemMXBean/GetSystemCpuLoad.java aix-all
javax/management/MBeanServer/OldMBeanServerTest.java aix-all
+# 8042215
+javax/management/remote/mandatory/notif/NotifReconnectDeadlockTest.java generic-all
+
############################################################################
# jdk_math
diff --git a/jdk/test/com/sun/corba/5036554/TestCorbaBug.sh b/jdk/test/com/sun/corba/5036554/TestCorbaBug.sh
index 4f0ff231a99..e8b4365b68f 100644
--- a/jdk/test/com/sun/corba/5036554/TestCorbaBug.sh
+++ b/jdk/test/com/sun/corba/5036554/TestCorbaBug.sh
@@ -75,13 +75,13 @@ ${TESTJAVA}${FS}bin${FS}java -version
mkdir bug
cp ${TESTSRC}${FS}bug.idl .
-${TESTJAVA}${FS}bin${FS}idlj bug.idl
+${COMPILEJAVA}${FS}bin${FS}idlj bug.idl
cp ${TESTSRC}${FS}JavaBug.java bug
chmod -fR 777 bug
-${TESTJAVA}${FS}bin${FS}javac -d . bug${FS}*.java
+${COMPILEJAVA}${FS}bin${FS}javac -d . bug${FS}*.java
${TESTJAVA}${FS}bin${FS}java ${TESTVMOPTS} -cp . bug/JavaBug > test.out 2>&1
diff --git a/jdk/test/com/sun/corba/cachedSocket/7056731.sh b/jdk/test/com/sun/corba/cachedSocket/7056731.sh
index 3db0f73660f..2e5e3fb8547 100644
--- a/jdk/test/com/sun/corba/cachedSocket/7056731.sh
+++ b/jdk/test/com/sun/corba/cachedSocket/7056731.sh
@@ -55,8 +55,8 @@ PORT=1052
cp -r ${TESTSRC}${FS}*.java ${TESTSRC}${FS}Hello.idl .
echo "Testing...please wait"
-${TESTJAVA}${FS}bin${FS}idlj -fall Hello.idl
-${TESTJAVA}${FS}bin${FS}javac *.java HelloApp/*.java
+${COMPILEJAVA}${FS}bin${FS}idlj -fall Hello.idl
+${COMPILEJAVA}${FS}bin${FS}javac *.java HelloApp/*.java
echo "starting orbd"
${TESTJAVA}${FS}bin${FS}orbd -ORBInitialPort $PORT -ORBInitialHost localhost &
diff --git a/jdk/test/com/sun/crypto/provider/Cipher/DES/TestUtility.java b/jdk/test/com/sun/crypto/provider/Cipher/DES/TestUtility.java
index 61efd621bdb..ffa0a5bfcb3 100644
--- a/jdk/test/com/sun/crypto/provider/Cipher/DES/TestUtility.java
+++ b/jdk/test/com/sun/crypto/provider/Cipher/DES/TestUtility.java
@@ -27,39 +27,52 @@
public class TestUtility {
- private static final String digits = "0123456789abcdef";
+ private static final String DIGITS = "0123456789abcdef";
- public TestUtility() {
+ private TestUtility() {
}
public static String hexDump(byte[] bytes) {
- StringBuffer buf = new StringBuffer (bytes.length * 2);
- int i;
+ StringBuilder buf = new StringBuilder(bytes.length * 2);
+ int i;
- buf.append (" "); // four spaces
+ buf.append(" "); // four spaces
for (i = 0; i < bytes.length; i++) {
- buf.append (digits.charAt ((bytes[i] >> 4) & 0x0f));
- buf.append (digits.charAt (bytes[i] & 0x0f));
- if (((i + 1) % 32) == 0) {
- if ((i + 1) != bytes.length)
- buf.append ("\n "); // line after four words
- } else if (((i + 1) % 4) == 0)
- buf.append (' '); // space between words
+ buf.append(DIGITS.charAt(bytes[i] >> 4 & 0x0f));
+ buf.append(DIGITS.charAt(bytes[i] & 0x0f));
+ if ((i + 1) % 32 == 0) {
+ if (i + 1 != bytes.length) {
+ buf.append("\n "); // line after four words
+ }
+ } else if ((i + 1) % 4 == 0) {
+ buf.append(' '); // space between words
+ }
}
- return buf.toString ();
+ return buf.toString();
}
+ public static String hexDump(byte[] bytes, int index) {
+ StringBuilder buf = new StringBuilder(bytes.length * 2);
+ int i;
+
+ buf.append(" "); // four spaces
+ buf.append(DIGITS.charAt(bytes[index] >> 4 & 0x0f));
+ buf.append(DIGITS.charAt(bytes[index] & 0x0f));
+ return buf.toString();
+ }
public static boolean equalsBlock(byte[] b1, byte[] b2) {
- if (b1.length != b2.length)
+ if (b1.length != b2.length) {
return false;
+ }
- for (int i=0; i 0)
throw new RuntimeException(failed + " test(s) failed - see log for details");
diff --git a/jdk/test/java/math/BigInteger/BigIntegerTest.java b/jdk/test/java/math/BigInteger/BigIntegerTest.java
index c8d63261e70..4de80fad4fd 100644
--- a/jdk/test/java/math/BigInteger/BigIntegerTest.java
+++ b/jdk/test/java/math/BigInteger/BigIntegerTest.java
@@ -23,7 +23,7 @@
/*
* @test
- * @bug 4181191 4161971 4227146 4194389 4823171 4624738 4812225 4837946
+ * @bug 4181191 4161971 4227146 4194389 4823171 4624738 4812225 4837946 4026465
* @summary tests methods in BigInteger
* @run main/timeout=400 BigIntegerTest
* @author madbot
@@ -89,6 +89,120 @@ public class BigIntegerTest {
static Random rnd = new Random();
static boolean failure = false;
+ public static void constructor() {
+ int failCount = 0;
+
+ // --- guard condition tests for array indexing ---
+
+ int arrayLength = 23;
+ int halfLength = arrayLength/2;
+ byte[] array = new byte[arrayLength];
+ rnd.nextBytes(array);
+
+ int[][] offLen = new int[][] { // offset, length, num exceptions
+ {-1, arrayLength, 1}, // negative offset
+ {0, arrayLength, 0}, // OK
+ {1, arrayLength, 1}, // length overflow
+ {arrayLength - 1, 1, 0}, // OK
+ {arrayLength, 1, 1}, // offset overflow
+ {0, -1, 1}, // negative length
+ {halfLength, arrayLength - halfLength + 1, 1} // length overflow
+ };
+
+ // two's complement
+ for (int[] ol : offLen) {
+ int numExceptions = 0;
+ try {
+ BigInteger bi = new BigInteger(array, ol[0], ol[1]);
+ } catch (IndexOutOfBoundsException e) {
+ numExceptions++;
+ }
+ if (numExceptions != ol[2]) {
+ System.err.println("IndexOutOfBoundsException did not occur for "
+ + " two's complement constructor with parameters offset "
+ + ol[0] + " and length " + ol[1]);
+ failCount++;
+ }
+ }
+
+ // sign-magnitude
+ for (int[] ol : offLen) {
+ int numExceptions = 0;
+ try {
+ BigInteger bi = new BigInteger(1, array, ol[0], ol[1]);
+ } catch (IndexOutOfBoundsException e) {
+ numExceptions++;
+ }
+ if (numExceptions != ol[2]) {
+ System.err.println("IndexOutOfBoundsException did not occur for "
+ + " sign-magnitude constructor with parameters offset "
+ + ol[0] + " and length " + ol[1]);
+ failCount++;
+ }
+ }
+
+ // --- tests for creation of zero-valued BigIntegers ---
+
+ byte[] magZeroLength = new byte[0];
+ for (int signum = -1; signum <= 1; signum++) {
+ BigInteger bi = new BigInteger(signum, magZeroLength);
+ if (bi.compareTo(BigInteger.ZERO) != 0) {
+ System.err.println("A: Zero length BigInteger != 0 for signum " + signum);
+ failCount++;
+ }
+ }
+
+ for (int signum = -1; signum <= 1; signum++) {
+ BigInteger bi = new BigInteger(signum, magZeroLength, 0, 0);
+ if (bi.compareTo(BigInteger.ZERO) != 0) {
+ System.err.println("B: Zero length BigInteger != 0 for signum " + signum);
+ failCount++;
+ }
+ }
+
+ byte[] magNonZeroLength = new byte[42];
+ rnd.nextBytes(magNonZeroLength);
+ for (int signum = -1; signum <= 1; signum++) {
+ BigInteger bi = new BigInteger(signum, magNonZeroLength, 0, 0);
+ if (bi.compareTo(BigInteger.ZERO) != 0) {
+ System.err.println("C: Zero length BigInteger != 0 for signum " + signum);
+ failCount++;
+ }
+ }
+
+ // --- tests for accurate creation of non-zero BigIntegers ---
+
+ for (int i = 0; i < SIZE; i++) {
+ // create reference value via a different code path from those tested
+ BigInteger reference = new BigInteger(2 + rnd.nextInt(336), 4, rnd);
+
+ byte[] refArray = reference.toByteArray();
+ int refLen = refArray.length;
+ int factor = rnd.nextInt(5);
+ int objLen = refArray.length + factor*rnd.nextInt(refArray.length) + 1;
+ int offset = rnd.nextInt(objLen - refLen);
+ byte[] objArray = new byte[objLen];
+ System.arraycopy(refArray, 0, objArray, offset, refLen);
+
+ BigInteger twosComp = new BigInteger(objArray, offset, refLen);
+ if (twosComp.compareTo(reference) != 0) {
+ System.err.println("Two's-complement BigInteger not equal for offset " +
+ offset + " and length " + refLen);
+ failCount++;
+ }
+
+ boolean isNegative = rnd.nextBoolean();
+ BigInteger signMag = new BigInteger(isNegative ? -1 : 1, objArray, offset, refLen);
+ if (signMag.compareTo(isNegative ? reference.negate() : reference) != 0) {
+ System.err.println("Sign-magnitude BigInteger not equal for offset " +
+ offset + " and length " + refLen);
+ failCount++;
+ }
+ }
+
+ report("Constructor", failCount);
+ }
+
public static void pow(int order) {
int failCount1 = 0;
@@ -961,6 +1075,8 @@ public class BigIntegerTest {
if (args.length >3)
order4 = (int)((Integer.parseInt(args[3]))* 3.333);
+ constructor();
+
prime();
nextProbablePrime();
diff --git a/jdk/test/java/nio/channels/FileChannel/TransferToChannel.java b/jdk/test/java/nio/channels/FileChannel/TransferToChannel.java
index 2aa1b4bd2cc..44e96337b27 100644
--- a/jdk/test/java/nio/channels/FileChannel/TransferToChannel.java
+++ b/jdk/test/java/nio/channels/FileChannel/TransferToChannel.java
@@ -25,7 +25,7 @@
* @bug 4652496
* @summary Test transferTo with different target channels
* @run main TransferToChannel
- * @run main/othervm -Djdk.net.enableFastFileTransfer TransferToChannel
+ * @run main/othervm -Djdk.nio.enableFastFileTransfer TransferToChannel
*/
import java.nio.channels.FileChannel;
diff --git a/jdk/test/java/rmi/activation/Activatable/checkActivateRef/group.security.policy b/jdk/test/java/rmi/activation/Activatable/checkActivateRef/group.security.policy
index 2130c464a88..02604b7eeb3 100644
--- a/jdk/test/java/rmi/activation/Activatable/checkActivateRef/group.security.policy
+++ b/jdk/test/java/rmi/activation/Activatable/checkActivateRef/group.security.policy
@@ -4,8 +4,8 @@
grant {
permission java.io.FilePermission "..${/}..${/}test.props", "read";
-
- // test needs to communicate with the activation system
permission java.net.SocketPermission "*:1024-", "connect,accept,listen";
+ permission java.util.PropertyPermission "test.*", "read";
+
permission java.lang.RuntimePermission "getClassLoader";
};
diff --git a/jdk/test/java/rmi/activation/Activatable/checkAnnotations/group.security.policy b/jdk/test/java/rmi/activation/Activatable/checkAnnotations/group.security.policy
index a6115faf6df..276768a15d1 100644
--- a/jdk/test/java/rmi/activation/Activatable/checkAnnotations/group.security.policy
+++ b/jdk/test/java/rmi/activation/Activatable/checkAnnotations/group.security.policy
@@ -1,10 +1,9 @@
/*
- * security policy used by activation groups.
+ * security policy used by activation groups
*/
grant {
permission java.io.FilePermission "..${/}..${/}test.props", "read";
-
- // test needs to communicate with the activation system
permission java.net.SocketPermission "*:1024-", "connect,accept,listen";
+ permission java.util.PropertyPermission "test.*", "read";
};
diff --git a/jdk/test/java/rmi/activation/Activatable/checkRegisterInLog/group.security.policy b/jdk/test/java/rmi/activation/Activatable/checkRegisterInLog/group.security.policy
index 6c8dc8a0d06..276768a15d1 100644
--- a/jdk/test/java/rmi/activation/Activatable/checkRegisterInLog/group.security.policy
+++ b/jdk/test/java/rmi/activation/Activatable/checkRegisterInLog/group.security.policy
@@ -4,10 +4,6 @@
grant {
permission java.io.FilePermission "..${/}..${/}test.props", "read";
-
- // allow remote objects to be exported on arbitrary ports.
- permission java.net.SocketPermission "*:1024-", "connect,accept";
-
- // allow exporting object with non-public remote interface
- permission java.rmi.RMIPermission "exportRemoteInterface.ActivateMe";
+ permission java.net.SocketPermission "*:1024-", "connect,accept,listen";
+ permission java.util.PropertyPermission "test.*", "read";
};
diff --git a/jdk/test/java/rmi/activation/Activatable/createPrivateActivable/group.security.policy b/jdk/test/java/rmi/activation/Activatable/createPrivateActivable/group.security.policy
index e7a403e569a..276768a15d1 100644
--- a/jdk/test/java/rmi/activation/Activatable/createPrivateActivable/group.security.policy
+++ b/jdk/test/java/rmi/activation/Activatable/createPrivateActivable/group.security.policy
@@ -1,13 +1,9 @@
/*
- * security policy used activation groups
+ * security policy used by activation groups
*/
grant {
permission java.io.FilePermission "..${/}..${/}test.props", "read";
-
- // test needs to communicate with the activation system
permission java.net.SocketPermission "*:1024-", "connect,accept,listen";
-
- // allow exporting object with non-public remote interface
- permission java.rmi.RMIPermission "exportRemoteInterface.ActivateMe";
+ permission java.util.PropertyPermission "test.*", "read";
};
diff --git a/jdk/test/java/rmi/activation/Activatable/downloadParameterClass/group.security.policy b/jdk/test/java/rmi/activation/Activatable/downloadParameterClass/group.security.policy
index 38258b4b45c..41abd5dd468 100644
--- a/jdk/test/java/rmi/activation/Activatable/downloadParameterClass/group.security.policy
+++ b/jdk/test/java/rmi/activation/Activatable/downloadParameterClass/group.security.policy
@@ -1,14 +1,15 @@
/*
- * security policy used exec'ed activation groups
+ * security policy used by activation groups
*/
grant {
+ permission java.io.FilePermission "..${/}..${/}test.props", "read";
+ permission java.net.SocketPermission "*:1024-", "connect,accept,listen";
+ permission java.util.PropertyPermission "test.*", "read";
+
// need to load custom security manager and activation group from a new codebase
permission java.io.FilePermission ".${/}codebase1", "read,write,delete";
permission java.io.FilePermission ".${/}codebase1${/}-", "read,write";
permission java.io.FilePermission ".${/}codebase2", "read,write,delete";
permission java.io.FilePermission ".${/}codebase2${/}-", "read,write,delete";
-
- // allow remote objects to be exported on arbitrary ports.
- permission java.net.SocketPermission "*:1024-", "connect,accept,listen";
};
diff --git a/jdk/test/java/rmi/activation/Activatable/elucidateNoSuchMethod/group.security.policy b/jdk/test/java/rmi/activation/Activatable/elucidateNoSuchMethod/group.security.policy
index 3cc19105e0f..bf7d8c414b9 100644
--- a/jdk/test/java/rmi/activation/Activatable/elucidateNoSuchMethod/group.security.policy
+++ b/jdk/test/java/rmi/activation/Activatable/elucidateNoSuchMethod/group.security.policy
@@ -1,12 +1,13 @@
/*
- * security policy used activation groups
+ * security policy used by activation groups
*/
grant {
+ permission java.io.FilePermission "..${/}..${/}test.props", "read";
+ permission java.net.SocketPermission "*:1024-", "connect,accept,listen";
+ permission java.util.PropertyPermission "test.*", "read";
+
// Needed because of bug#: 4182104
permission java.lang.RuntimePermission "modifyThreadGroup";
permission java.lang.RuntimePermission "modifyThread";
-
- // allow remote objects to be exported on arbitrary ports.
- permission java.net.SocketPermission "*:1024-", "connect,accept,listen";
};
diff --git a/jdk/test/java/rmi/activation/Activatable/extLoadedImpl/group.security.policy b/jdk/test/java/rmi/activation/Activatable/extLoadedImpl/group.security.policy
index 09e121a74f9..276768a15d1 100644
--- a/jdk/test/java/rmi/activation/Activatable/extLoadedImpl/group.security.policy
+++ b/jdk/test/java/rmi/activation/Activatable/extLoadedImpl/group.security.policy
@@ -1,8 +1,9 @@
/*
- * security policy used exec'ed activation groups
+ * security policy used by activation groups
*/
grant {
- // allow remote objects to be exported on arbitrary ports.
+ permission java.io.FilePermission "..${/}..${/}test.props", "read";
permission java.net.SocketPermission "*:1024-", "connect,accept,listen";
+ permission java.util.PropertyPermission "test.*", "read";
};
diff --git a/jdk/test/java/rmi/activation/Activatable/forceLogSnapshot/group.security.policy b/jdk/test/java/rmi/activation/Activatable/forceLogSnapshot/group.security.policy
index f5637355114..276768a15d1 100644
--- a/jdk/test/java/rmi/activation/Activatable/forceLogSnapshot/group.security.policy
+++ b/jdk/test/java/rmi/activation/Activatable/forceLogSnapshot/group.security.policy
@@ -3,9 +3,7 @@
*/
grant {
- // allow remote objects to be exported on arbitrary ports.
+ permission java.io.FilePermission "..${/}..${/}test.props", "read";
permission java.net.SocketPermission "*:1024-", "connect,accept,listen";
-
- // allow exporting object with non-public remote interface
- permission java.rmi.RMIPermission "exportRemoteInterface.ActivateMe";
+ permission java.util.PropertyPermission "test.*", "read";
};
diff --git a/jdk/test/java/rmi/activation/Activatable/inactiveGroup/group.security.policy b/jdk/test/java/rmi/activation/Activatable/inactiveGroup/group.security.policy
index f1d7ad2f1a0..276768a15d1 100644
--- a/jdk/test/java/rmi/activation/Activatable/inactiveGroup/group.security.policy
+++ b/jdk/test/java/rmi/activation/Activatable/inactiveGroup/group.security.policy
@@ -4,10 +4,6 @@
grant {
permission java.io.FilePermission "..${/}..${/}test.props", "read";
-
- // allow remote objects to be exported on arbitrary ports.
permission java.net.SocketPermission "*:1024-", "connect,accept,listen";
-
- // allow exporting object with non-public remote interface
- permission java.rmi.RMIPermission "exportRemoteInterface.ActivateMe";
+ permission java.util.PropertyPermission "test.*", "read";
};
diff --git a/jdk/test/java/rmi/activation/Activatable/nestedActivate/group.security.policy b/jdk/test/java/rmi/activation/Activatable/nestedActivate/group.security.policy
index cbb1d41bfe4..276768a15d1 100644
--- a/jdk/test/java/rmi/activation/Activatable/nestedActivate/group.security.policy
+++ b/jdk/test/java/rmi/activation/Activatable/nestedActivate/group.security.policy
@@ -1,13 +1,9 @@
/*
- * security policy used by test activation groups
+ * security policy used by activation groups
*/
grant {
permission java.io.FilePermission "..${/}..${/}test.props", "read";
-
- // allow remote objects to be exported on arbitrary ports.
permission java.net.SocketPermission "*:1024-", "connect,accept,listen";
-
- // allow exporting of non-public remote interface
- permission java.rmi.RMIPermission "exportRemoteInterface.ActivateMe";
+ permission java.util.PropertyPermission "test.*", "read";
};
diff --git a/jdk/test/java/rmi/activation/Activatable/nonExistentActivatable/group.security.policy b/jdk/test/java/rmi/activation/Activatable/nonExistentActivatable/group.security.policy
index a830e95dfe0..276768a15d1 100644
--- a/jdk/test/java/rmi/activation/Activatable/nonExistentActivatable/group.security.policy
+++ b/jdk/test/java/rmi/activation/Activatable/nonExistentActivatable/group.security.policy
@@ -4,7 +4,6 @@
grant {
permission java.io.FilePermission "..${/}..${/}test.props", "read";
-
- // allow remote objects to be exported on arbitrary ports.
permission java.net.SocketPermission "*:1024-", "connect,accept,listen";
+ permission java.util.PropertyPermission "test.*", "read";
};
diff --git a/jdk/test/java/rmi/activation/Activatable/restartCrashedService/group.security.policy b/jdk/test/java/rmi/activation/Activatable/restartCrashedService/group.security.policy
index ce2fdaf45df..276768a15d1 100644
--- a/jdk/test/java/rmi/activation/Activatable/restartCrashedService/group.security.policy
+++ b/jdk/test/java/rmi/activation/Activatable/restartCrashedService/group.security.policy
@@ -1,8 +1,9 @@
/*
- * security policy used by test activation groups
+ * security policy used by activation groups
*/
grant {
- // test needs to communicate with the activation system
+ permission java.io.FilePermission "..${/}..${/}test.props", "read";
permission java.net.SocketPermission "*:1024-", "connect,accept,listen";
+ permission java.util.PropertyPermission "test.*", "read";
};
diff --git a/jdk/test/java/rmi/activation/Activatable/restartLatecomer/group.security.policy b/jdk/test/java/rmi/activation/Activatable/restartLatecomer/group.security.policy
index 67f3c249496..276768a15d1 100644
--- a/jdk/test/java/rmi/activation/Activatable/restartLatecomer/group.security.policy
+++ b/jdk/test/java/rmi/activation/Activatable/restartLatecomer/group.security.policy
@@ -3,6 +3,7 @@
*/
grant {
- // allow remote objects to be exported on arbitrary ports.
+ permission java.io.FilePermission "..${/}..${/}test.props", "read";
permission java.net.SocketPermission "*:1024-", "connect,accept,listen";
+ permission java.util.PropertyPermission "test.*", "read";
};
diff --git a/jdk/test/java/rmi/activation/Activatable/restartService/group.security.policy b/jdk/test/java/rmi/activation/Activatable/restartService/group.security.policy
index 67f3c249496..276768a15d1 100644
--- a/jdk/test/java/rmi/activation/Activatable/restartService/group.security.policy
+++ b/jdk/test/java/rmi/activation/Activatable/restartService/group.security.policy
@@ -3,6 +3,7 @@
*/
grant {
- // allow remote objects to be exported on arbitrary ports.
+ permission java.io.FilePermission "..${/}..${/}test.props", "read";
permission java.net.SocketPermission "*:1024-", "connect,accept,listen";
+ permission java.util.PropertyPermission "test.*", "read";
};
diff --git a/jdk/test/java/rmi/activation/Activatable/shutdownGracefully/group.security.policy b/jdk/test/java/rmi/activation/Activatable/shutdownGracefully/group.security.policy
index e1a3f30b029..276768a15d1 100644
--- a/jdk/test/java/rmi/activation/Activatable/shutdownGracefully/group.security.policy
+++ b/jdk/test/java/rmi/activation/Activatable/shutdownGracefully/group.security.policy
@@ -1,10 +1,9 @@
/*
- * security policy used activation groups
+ * security policy used by activation groups
*/
grant {
permission java.io.FilePermission "..${/}..${/}test.props", "read";
-
- // test needs to communicate with the activation system
permission java.net.SocketPermission "*:1024-", "connect,accept,listen";
+ permission java.util.PropertyPermission "test.*", "read";
};
diff --git a/jdk/test/java/rmi/activation/Activatable/unregisterInactive/group.security.policy b/jdk/test/java/rmi/activation/Activatable/unregisterInactive/group.security.policy
index a830e95dfe0..276768a15d1 100644
--- a/jdk/test/java/rmi/activation/Activatable/unregisterInactive/group.security.policy
+++ b/jdk/test/java/rmi/activation/Activatable/unregisterInactive/group.security.policy
@@ -4,7 +4,6 @@
grant {
permission java.io.FilePermission "..${/}..${/}test.props", "read";
-
- // allow remote objects to be exported on arbitrary ports.
permission java.net.SocketPermission "*:1024-", "connect,accept,listen";
+ permission java.util.PropertyPermission "test.*", "read";
};
diff --git a/jdk/test/java/rmi/activation/ActivateFailedException/activateFails/group.security.policy b/jdk/test/java/rmi/activation/ActivateFailedException/activateFails/group.security.policy
index 543fc1d345e..276768a15d1 100644
--- a/jdk/test/java/rmi/activation/ActivateFailedException/activateFails/group.security.policy
+++ b/jdk/test/java/rmi/activation/ActivateFailedException/activateFails/group.security.policy
@@ -1,8 +1,9 @@
/*
- * security policy used activation groups
+ * security policy used by activation groups
*/
grant {
- // test needs to communicate with the activation system
+ permission java.io.FilePermission "..${/}..${/}test.props", "read";
permission java.net.SocketPermission "*:1024-", "connect,accept,listen";
+ permission java.util.PropertyPermission "test.*", "read";
};
diff --git a/jdk/test/java/rmi/activation/ActivationGroup/downloadActivationGroup/group.security.policy b/jdk/test/java/rmi/activation/ActivationGroup/downloadActivationGroup/group.security.policy
index d4b2d5ded47..b290738202a 100644
--- a/jdk/test/java/rmi/activation/ActivationGroup/downloadActivationGroup/group.security.policy
+++ b/jdk/test/java/rmi/activation/ActivationGroup/downloadActivationGroup/group.security.policy
@@ -1,10 +1,11 @@
/*
- * security policy used by downloaded activation group
+ * security policy used by activation groups
*/
grant {
permission java.io.FilePermission "..${/}..${/}test.props", "read";
+ permission java.net.SocketPermission "*:1024-", "connect,accept,listen";
+ permission java.util.PropertyPermission "test.*", "read";
permission java.lang.RuntimePermission "accessClassInPackage.sun.rmi.server";
- permission java.net.SocketPermission "*:1024-", "connect,accept,listen";
};
diff --git a/jdk/test/java/rmi/activation/ActivationSystem/modifyDescriptor/group.security.policy b/jdk/test/java/rmi/activation/ActivationSystem/modifyDescriptor/group.security.policy
index 9f404883c86..276768a15d1 100644
--- a/jdk/test/java/rmi/activation/ActivationSystem/modifyDescriptor/group.security.policy
+++ b/jdk/test/java/rmi/activation/ActivationSystem/modifyDescriptor/group.security.policy
@@ -4,10 +4,6 @@
grant {
permission java.io.FilePermission "..${/}..${/}test.props", "read";
-
- // accomodate property used by this test.
- permission java.util.PropertyPermission "test.message", "read";
-
- // test needs to communicate with the activation system
permission java.net.SocketPermission "*:1024-", "connect,accept,listen";
+ permission java.util.PropertyPermission "test.*", "read";
};
diff --git a/jdk/test/java/rmi/activation/ActivationSystem/stubClassesPermitted/group.security.policy b/jdk/test/java/rmi/activation/ActivationSystem/stubClassesPermitted/group.security.policy
index 7876a38e1fb..c99d2e288a2 100644
--- a/jdk/test/java/rmi/activation/ActivationSystem/stubClassesPermitted/group.security.policy
+++ b/jdk/test/java/rmi/activation/ActivationSystem/stubClassesPermitted/group.security.policy
@@ -1,13 +1,11 @@
/*
- * security policy used by activation groups.
+ * security policy used by activation groups
*/
grant {
permission java.io.FilePermission "..${/}..${/}test.props", "read";
-
- // give the group permission to create a class that the main test process can not create
- permission java.lang.RuntimePermission "accessClassInPackage.sun.security.provider";
-
- // test needs to communicate with the activation system
permission java.net.SocketPermission "*:1024-", "connect,accept,listen";
+ permission java.util.PropertyPermission "test.*", "read";
+
+ permission java.lang.RuntimePermission "accessClassInPackage.sun.security.provider";
};
diff --git a/jdk/test/java/rmi/activation/ActivationSystem/unregisterGroup/group.security.policy b/jdk/test/java/rmi/activation/ActivationSystem/unregisterGroup/group.security.policy
index e596baae478..276768a15d1 100644
--- a/jdk/test/java/rmi/activation/ActivationSystem/unregisterGroup/group.security.policy
+++ b/jdk/test/java/rmi/activation/ActivationSystem/unregisterGroup/group.security.policy
@@ -4,8 +4,6 @@
grant {
permission java.io.FilePermission "..${/}..${/}test.props", "read";
-
- // test needs to communicate with the activation system
permission java.net.SocketPermission "*:1024-", "connect,accept,listen";
- permission java.util.PropertyPermission "unregisterGroup.port", "read";
+ permission java.util.PropertyPermission "test.*", "read";
};
diff --git a/jdk/test/java/rmi/activation/CommandEnvironment/group.security.policy b/jdk/test/java/rmi/activation/CommandEnvironment/group.security.policy
index 479f351a1e5..276768a15d1 100644
--- a/jdk/test/java/rmi/activation/CommandEnvironment/group.security.policy
+++ b/jdk/test/java/rmi/activation/CommandEnvironment/group.security.policy
@@ -1,8 +1,9 @@
/*
- * security policy used by activation groups.
+ * security policy used by activation groups
*/
grant {
- // test needs to communicate with the activation system
+ permission java.io.FilePermission "..${/}..${/}test.props", "read";
permission java.net.SocketPermission "*:1024-", "connect,accept,listen";
+ permission java.util.PropertyPermission "test.*", "read";
};
diff --git a/jdk/test/java/rmi/server/RMISocketFactory/useSocketFactory/activatable/group.security.policy b/jdk/test/java/rmi/server/RMISocketFactory/useSocketFactory/activatable/group.security.policy
index 810baf41d4b..276768a15d1 100644
--- a/jdk/test/java/rmi/server/RMISocketFactory/useSocketFactory/activatable/group.security.policy
+++ b/jdk/test/java/rmi/server/RMISocketFactory/useSocketFactory/activatable/group.security.policy
@@ -1,11 +1,9 @@
/*
- * security policy used by the rmid process exec'ed by a running
- * instance of the test.
+ * security policy used by activation groups
*/
grant {
permission java.io.FilePermission "..${/}..${/}test.props", "read";
-
- // test needs to communicate with the activation system
permission java.net.SocketPermission "*:1024-", "connect,accept,listen";
+ permission java.util.PropertyPermission "test.*", "read";
};
diff --git a/jdk/test/java/rmi/server/RemoteServer/setLogPermission/SetLogPermission.java b/jdk/test/java/rmi/server/RemoteServer/setLogPermission/SetLogPermission.java
index 2353dab0b4b..fd6c6ad5b62 100644
--- a/jdk/test/java/rmi/server/RemoteServer/setLogPermission/SetLogPermission.java
+++ b/jdk/test/java/rmi/server/RemoteServer/setLogPermission/SetLogPermission.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2002, 2008, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2002, 2015, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -27,7 +27,7 @@
* The RemoteServer.setLog method requires
* java.util.log.LoggingPermission("control").
* @author Ann Wollrath
- * @run main/othervm/policy=java.policy SetLogPermission
+ * @run main/othervm/policy=security.policy SetLogPermission
*/
import java.rmi.server.RemoteServer;
diff --git a/jdk/test/java/rmi/server/RemoteServer/setLogPermission/java.policy b/jdk/test/java/rmi/server/RemoteServer/setLogPermission/security.policy
similarity index 100%
rename from jdk/test/java/rmi/server/RemoteServer/setLogPermission/java.policy
rename to jdk/test/java/rmi/server/RemoteServer/setLogPermission/security.policy
diff --git a/jdk/test/java/rmi/testlibrary/ActivationLibrary.java b/jdk/test/java/rmi/testlibrary/ActivationLibrary.java
index 6a7a5b753d8..75531a97017 100644
--- a/jdk/test/java/rmi/testlibrary/ActivationLibrary.java
+++ b/jdk/test/java/rmi/testlibrary/ActivationLibrary.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1998, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2015, 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
@@ -40,20 +40,6 @@ import java.rmi.registry.LocateRegistry;
* objects.
*/
public class ActivationLibrary {
- /** time safeDestroy should wait before failing on shutdown rmid */
- private static final int SAFE_WAIT_TIME;
- static {
- int slopFactor = 1;
- try {
- slopFactor = Integer.valueOf(
- TestLibrary.getExtraProperty("jcov.sleep.multiplier","1"));
- } catch (NumberFormatException ignore) {}
- SAFE_WAIT_TIME = 60000 * slopFactor;
- }
-
- private static final String SYSTEM_NAME =
- ActivationSystem.class.getName();
-
private static void mesg(Object mesg) {
System.err.println("ACTIVATION_LIBRARY: " + mesg.toString());
}
@@ -63,20 +49,19 @@ public class ActivationLibrary {
*/
public static void deactivate(Remote remote,
ActivationID id) {
- // We do as much as 50 deactivation trials, each separated by
- // at least 100 milliseconds sleep time (max sleep time of 5 secs).
- final long deactivateSleepTime = 100;
- long stopTime = System.currentTimeMillis() + deactivateSleepTime * 50;
- while (System.currentTimeMillis() < stopTime) {
+ final long POLLTIME_MS = 100L;
+ final long DEACTIVATE_TIME_MS = 30_000L;
+
+ long startTime = System.currentTimeMillis();
+ long deadline = TestLibrary.computeDeadline(startTime, DEACTIVATE_TIME_MS);
+
+ while (System.currentTimeMillis() < deadline) {
try {
if (Activatable.inactive(id) == true) {
mesg("inactive successful");
return;
} else {
- mesg("inactive trial failed. Sleeping " +
- deactivateSleepTime +
- " milliseconds before next trial");
- Thread.sleep(deactivateSleepTime);
+ Thread.sleep(POLLTIME_MS);
}
} catch (InterruptedException e) {
Thread.currentThread().interrupt();
@@ -95,7 +80,8 @@ public class ActivationLibrary {
}
}
- mesg("unable to inactivate after several attempts");
+ mesg("unable to inactivate after " +
+ (System.currentTimeMillis() - startTime) + "ms.");
mesg("unexporting object forcibly instead");
try {
diff --git a/jdk/test/java/rmi/testlibrary/JavaVM.java b/jdk/test/java/rmi/testlibrary/JavaVM.java
index b304cd25213..b0c4afd1113 100644
--- a/jdk/test/java/rmi/testlibrary/JavaVM.java
+++ b/jdk/test/java/rmi/testlibrary/JavaVM.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1998, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2015, 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
@@ -194,7 +194,7 @@ public class JavaVM {
throws InterruptedException, TimeoutException {
if (vm == null)
throw new IllegalStateException("can't wait for JavaVM that isn't running");
- long deadline = computeDeadline(System.currentTimeMillis(), timeout);
+ long deadline = TestLibrary.computeDeadline(System.currentTimeMillis(), timeout);
while (true) {
try {
@@ -218,21 +218,4 @@ public class JavaVM {
start();
return waitFor();
}
-
- /**
- * Computes a deadline from a timestamp and a timeout value.
- * Maximum timeout (before multipliers are applied) is one hour.
- */
- public static long computeDeadline(long timestamp, long timeout) {
- final long MAX_TIMEOUT_MS = 3_600_000L;
-
- if (timeout < 0L || timeout > MAX_TIMEOUT_MS) {
- throw new IllegalArgumentException("timeout " + timeout + "ms out of range");
- }
-
- // TODO apply test.timeout.factor (and possibly jcov.sleep.multiplier)
- // here instead of upstream
-
- return timestamp + timeout;
- }
}
diff --git a/jdk/test/java/rmi/testlibrary/RMID.java b/jdk/test/java/rmi/testlibrary/RMID.java
index 48fb49aa4d2..1ae6cf64bab 100644
--- a/jdk/test/java/rmi/testlibrary/RMID.java
+++ b/jdk/test/java/rmi/testlibrary/RMID.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1998, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2015, 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
@@ -249,15 +249,15 @@ public class RMID extends JavaVM {
mesg("Starting rmid on port " + port + ".");
super.start();
- int slopFactor = 1;
- try {
- slopFactor = Integer.valueOf(
- TestLibrary.getExtraProperty("jcov.sleep.multiplier","1"));
- } catch (NumberFormatException ignore) {}
- waitTime = waitTime * slopFactor;
+ // int slopFactor = 1;
+ // try {
+ // slopFactor = Integer.valueOf(
+ // TestLibrary.getExtraProperty("jcov.sleep.multiplier","1"));
+ // } catch (NumberFormatException ignore) {}
+ // waitTime = waitTime * slopFactor;
long startTime = System.currentTimeMillis();
- long deadline = computeDeadline(startTime, waitTime);
+ long deadline = TestLibrary.computeDeadline(startTime, waitTime);
while (true) {
try {
diff --git a/jdk/test/java/rmi/testlibrary/TestLibrary.java b/jdk/test/java/rmi/testlibrary/TestLibrary.java
index 7165c678e6d..a8077ed8207 100644
--- a/jdk/test/java/rmi/testlibrary/TestLibrary.java
+++ b/jdk/test/java/rmi/testlibrary/TestLibrary.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1998, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2015, 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
@@ -135,7 +135,8 @@ public class TestLibrary {
*/
public static boolean checkIfRegistryRunning(int port, int msTimeout) {
- long stopTime = System.currentTimeMillis() + msTimeout;
+ final long POLLTIME_MS = 100L;
+ long stopTime = computeDeadline(System.currentTimeMillis(), msTimeout);
do {
try {
Registry r = LocateRegistry.getRegistry(port);
@@ -145,12 +146,12 @@ public class TestLibrary {
} catch (RemoteException e) {
// problem - not ready ? Try again
try {
- Thread.sleep(500);
+ Thread.sleep(POLLTIME_MS);
} catch (InterruptedException ie) {
// not expected
}
}
- } while (stopTime > System.currentTimeMillis());
+ } while (System.currentTimeMillis() < stopTime);
return false;
}
@@ -169,6 +170,31 @@ public class TestLibrary {
}
}
+ public static double getTimeoutFactor() {
+ String prop = getProperty("test.timeout.factor", "1.0");
+ double timeoutFactor = 1.0;
+
+ try {
+ timeoutFactor = Double.parseDouble(prop);
+ } catch (NumberFormatException ignore) { }
+
+ return timeoutFactor;
+ }
+
+ /**
+ * Computes a deadline from a timestamp and a timeout value.
+ * Maximum timeout (before multipliers are applied) is one hour.
+ */
+ public static long computeDeadline(long timestamp, long timeout) {
+ final long MAX_TIMEOUT_MS = 3_600_000L;
+
+ if (timeout < 0L || timeout > MAX_TIMEOUT_MS) {
+ throw new IllegalArgumentException("timeout " + timeout + "ms out of range");
+ }
+
+ return timestamp + (long)(timeout * getTimeoutFactor());
+ }
+
/**
* Property mutators
*/
diff --git a/jdk/test/java/util/Formatter/Basic-X.java.template b/jdk/test/java/util/Formatter/Basic-X.java.template
index 47c5516be49..57d77ae887d 100644
--- a/jdk/test/java/util/Formatter/Basic-X.java.template
+++ b/jdk/test/java/util/Formatter/Basic-X.java.template
@@ -1154,6 +1154,10 @@ public class Basic$Type$ extends Basic {
test("%.5f", "0.99960", val);
test("%.6f", "0.999600", val);
+ val = new BigDecimal(BigInteger.ZERO, 6);
+ test("%.4f", "0.0000", val);
+ val = new BigDecimal(BigInteger.ZERO, -6);
+ test("%.4f", "0.0000", val);
#end[BigDecimal]
#if[float]
diff --git a/jdk/test/java/util/Formatter/Basic.java b/jdk/test/java/util/Formatter/Basic.java
index 9624def5cea..31fce5dd4e2 100644
--- a/jdk/test/java/util/Formatter/Basic.java
+++ b/jdk/test/java/util/Formatter/Basic.java
@@ -26,6 +26,7 @@
* @bug 4906370 4962433 4973103 4989961 5005818 5031150 4970931 4989491 5002937
* 5005104 5007745 5061412 5055180 5066788 5088703 6317248 6318369 6320122
* 6344623 6369500 6534606 6282094 6286592 6476425 5063507 6469160 6476168
+ * 8059175
*
* @run shell/timeout=240 Basic.sh
*/
diff --git a/jdk/test/java/util/Formatter/BasicBigDecimal.java b/jdk/test/java/util/Formatter/BasicBigDecimal.java
index 00a04f4535f..0eca6f987dd 100644
--- a/jdk/test/java/util/Formatter/BasicBigDecimal.java
+++ b/jdk/test/java/util/Formatter/BasicBigDecimal.java
@@ -1154,6 +1154,11 @@ public class BasicBigDecimal extends Basic {
test("%.5f", "0.99960", val);
test("%.6f", "0.999600", val);
+ val = new BigDecimal(BigInteger.ZERO, 6);
+ test("%.4f", "0.0000", val);
+
+ val = new BigDecimal(BigInteger.ZERO, -6);
+ test("%.4f", "0.0000", val);
diff --git a/jdk/test/javax/crypto/KeyGenerator/TestKGParity.java b/jdk/test/javax/crypto/KeyGenerator/TestKGParity.java
new file mode 100644
index 00000000000..40752152c56
--- /dev/null
+++ b/jdk/test/javax/crypto/KeyGenerator/TestKGParity.java
@@ -0,0 +1,121 @@
+/*
+ * Copyright (c) 2015, 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.
+ */
+
+import java.io.PrintStream;
+import java.lang.String;
+import java.lang.System;
+import java.security.Provider;
+import java.security.SecureRandom;
+import java.security.Security;
+import javax.crypto.KeyGenerator;
+import static java.lang.System.out;
+
+/*
+ * @test
+ * @bug 8048607
+ * @compile ../../../com/sun/crypto/provider/Cipher/DES/TestUtility.java
+ * @summary Test key generation of DES and DESEDE
+ */
+public class TestKGParity {
+
+ private static final String[] ALGORITHM_ARR = {
+ "deS", "DesEDE"
+ };
+
+ public static void main(String argv[]) throws Exception {
+
+ TestKGParity test = new TestKGParity();
+ test.run();
+ }
+
+ private void run() throws Exception {
+ Provider[] providers = Security.getProviders();
+ for (Provider p : providers) {
+ String prvName = p.getName();
+ if (prvName.startsWith("SunJCE")
+ || prvName.startsWith("SunPKCS11-")) {
+ for (String algorithm : ALGORITHM_ARR) {
+ if (!runTest(p, algorithm)) {
+ throw new RuntimeException(
+ "Test failed with provider/algorithm:"
+ + p.getName() + "/" + algorithm);
+ } else {
+ out.println("Test passed with provider/algorithm:"
+ + p.getName() + "/" + algorithm);
+ }
+ }
+ }
+ }
+ }
+
+ public boolean runTest(Provider p, String algo) throws Exception {
+ byte[] keyValue = null;
+ try {
+ // Initialization
+ SecureRandom sRdm = new SecureRandom();
+ KeyGenerator kg = KeyGenerator.getInstance(algo, p);
+ kg.init(sRdm);
+
+ // Generate a SecretKey and retrieve its value
+ keyValue = kg.generateKey().getEncoded();
+
+ // Verify its parity in the unit of byte
+ for (int i = 0; i < keyValue.length; i++) {
+ if (!checkParity(keyValue[i])) {
+ out.println("Testing: "
+ + p.getName()
+ + "/"
+ + algo
+ + " failed when verify its parity in the unit of byte:"
+ + TestUtility.hexDump(keyValue, i));
+ return false;
+ }
+ }
+ return true;
+ } catch (Exception ex) {
+ out.println("Testing: " + p.getName() + "/" + algo
+ + " failed with unexpected exception");
+ ex.printStackTrace();
+ throw ex;
+ }
+ }
+
+ private boolean checkParity(byte keyByte) {
+ boolean even = false;
+ byte[] PARITY_BIT_MASK = {
+ (byte) 0x40, (byte) 0x20, (byte) 0x10, (byte) 0x08,
+ (byte) 0x04, (byte) 0x02, (byte) 0x01
+ };
+
+ for (int i = 0; i < 7; i++) {
+ if ((keyByte & PARITY_BIT_MASK[i]) > 0) {
+ even = !even;
+ }
+ }
+ if (keyByte < 0) {
+ even = !even;
+ }
+
+ return even;
+ }
+}
diff --git a/jdk/test/javax/management/remote/mandatory/notif/NotificationBufferDeadlockTest.java b/jdk/test/javax/management/remote/mandatory/notif/NotificationBufferDeadlockTest.java
index 79b2e970ab0..e0502079951 100644
--- a/jdk/test/javax/management/remote/mandatory/notif/NotificationBufferDeadlockTest.java
+++ b/jdk/test/javax/management/remote/mandatory/notif/NotificationBufferDeadlockTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2005, 2006, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2015, 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
@@ -24,7 +24,8 @@
/*
* @test
* @bug 6239400
- * @summary Tests NotificationBuffer doesn't hold locks when adding listeners.
+ * @summary Tests NotificationBuffer doesn't hold locks when adding listeners,
+ * if test times out then deadlock is suspected.
* @author Eamonn McManus
* @run clean NotificationBufferDeadlockTest
* @run build NotificationBufferDeadlockTest
@@ -38,6 +39,7 @@ import java.net.MalformedURLException;
import java.util.List;
import java.util.Set;
import java.util.Vector;
+import java.util.concurrent.CountDownLatch;
import javax.management.*;
import javax.management.remote.*;
@@ -173,9 +175,7 @@ public class NotificationBufferDeadlockTest {
for (ObjectName name : names)
mbsc.invoke(name, "send", null, null);
- if (!countListener.waiting(MAX_WAITING_TIME)) {
- return "did not get " + names.size() + " notifs as expected\n";
- }
+ countListener.waiting();
if (!sources.containsAll(names))
return "missing names: " + sources;
@@ -202,13 +202,13 @@ public class NotificationBufferDeadlockTest {
}
};
t.start();
+ System.out.println("DeadlockTest-addNotificationListener waiting for the sending thread to die...");
try {
- t.join(5000L);
+ t.join(); //if times out here then deadlock is suspected
+ System.out.println("DeadlockTest-addNotificationListener OK.");
} catch (Exception e) {
thisFailure = "Join exception: " + e;
}
- if (t.isAlive())
- thisFailure = "Deadlock detected";
}
public void send() {
@@ -244,9 +244,9 @@ public class NotificationBufferDeadlockTest {
}
};
t.start();
- t.join(5000);
- if (t.isAlive())
- failure = "Query deadlock detected";
+ System.out.println("CreateDuringQueryInvocationHandler-createMBeanIfQuery waiting for the creating thread to die...");
+ t.join(); // if times out here then deadlock is suspected
+ System.out.println("CreateDuringQueryInvocationHandler-createMBeanIfQuery OK");
}
}
@@ -264,50 +264,30 @@ public class NotificationBufferDeadlockTest {
private static class MyListener implements NotificationListener {
public MyListener(int waitNB) {
- this.waitNB= waitNB;
+ count = new CountDownLatch(waitNB);
}
public void handleNotification(Notification n, Object h) {
- System.out.println("MyListener got: "+n.getSource()+" "+n.getType());
+ System.out.println("MyListener got: " + n.getSource() + " " + n.getType());
- synchronized(this) {
- if (TESTING_TYPE.equals(n.getType())) {
- sources.add((ObjectName) n.getSource());
-
- if (sources.size() == waitNB) {
- this.notifyAll();
- }
- }
+ if (TESTING_TYPE.equals(n.getType())) {
+ sources.add((ObjectName) n.getSource());
+ count.countDown();
}
}
- public boolean waiting(long timeout) {
- final long startTime = System.currentTimeMillis();
- long toWait = timeout;
-
- synchronized(this) {
- while(sources.size() < waitNB && toWait > 0) {
- try {
- this.wait(toWait);
- } catch (InterruptedException ire) {
- break;
- }
-
- toWait = timeout -
- (System.currentTimeMillis() - startTime);
- }
- }
-
- return sources.size() == waitNB;
+ public void waiting() throws InterruptedException {
+ System.out.println("MyListener-waiting ...");
+ count.await(); // if times out here then deadlock is suspected
+ System.out.println("MyListener-waiting done!");
}
- private final int waitNB;
+ private final CountDownLatch count;
}
static String thisFailure;
static String failure;
static int nextNameIndex;
- static final long MAX_WAITING_TIME = 10000;
private static MyListener countListener;
private static final List sources = new Vector();
diff --git a/jdk/test/javax/xml/crypto/dsig/GenerationTests.java b/jdk/test/javax/xml/crypto/dsig/GenerationTests.java
index 29261e2f17e..068cd2a86a2 100644
--- a/jdk/test/javax/xml/crypto/dsig/GenerationTests.java
+++ b/jdk/test/javax/xml/crypto/dsig/GenerationTests.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2005, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2015, 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
@@ -24,6 +24,7 @@
/**
* @test
* @bug 4635230 6283345 6303830 6824440 6867348 7094155 8038184 8038349 8046949
+ * 8046724
* @summary Basic unit tests for generating XML Signatures with JSR 105
* @compile -XDignore.symbol.file KeySelectors.java SignatureValidator.java
* X509KeySelector.java GenerationTests.java
@@ -45,6 +46,13 @@ import java.security.cert.X509CRL;
import java.security.spec.KeySpec;
import java.security.spec.DSAPrivateKeySpec;
import java.security.spec.DSAPublicKeySpec;
+import java.security.spec.ECField;
+import java.security.spec.ECFieldFp;
+import java.security.spec.ECParameterSpec;
+import java.security.spec.ECPoint;
+import java.security.spec.ECPrivateKeySpec;
+import java.security.spec.ECPublicKeySpec;
+import java.security.spec.EllipticCurve;
import java.security.spec.RSAPrivateKeySpec;
import java.security.spec.RSAPublicKeySpec;
import java.util.*;
@@ -81,9 +89,10 @@ public class GenerationTests {
private static DocumentBuilder db;
private static CanonicalizationMethod withoutComments;
private static SignatureMethod dsaSha1, dsaSha256, rsaSha1,
- rsaSha256, rsaSha384, rsaSha512;
+ rsaSha256, rsaSha384, rsaSha512,
+ ecdsaSha1;
private static DigestMethod sha1, sha256, sha384, sha512;
- private static KeyInfo dsa1024, dsa2048, rsa, rsa1024;
+ private static KeyInfo dsa1024, dsa2048, rsa, rsa1024, p256ki;
private static KeySelector kvks = new KeySelectors.KeyValueKeySelector();
private static KeySelector sks;
private static Key signingKey;
@@ -121,6 +130,7 @@ public class GenerationTests {
test_create_signature_enveloping_hmac_sha384();
test_create_signature_enveloping_hmac_sha512();
test_create_signature_enveloping_rsa();
+ test_create_signature_enveloping_p256_sha1();
test_create_signature_external_b64_dsa();
test_create_signature_external_dsa();
test_create_signature_keyname();
@@ -175,6 +185,8 @@ public class GenerationTests {
(kifac.newKeyValue(getPublicKey("RSA", 512))));
rsa1024 = kifac.newKeyInfo(Collections.singletonList
(kifac.newKeyValue(getPublicKey("RSA", 1024))));
+ p256ki = kifac.newKeyInfo(Collections.singletonList
+ (kifac.newKeyValue(getECPublicKey())));
rsaSha1 = fac.newSignatureMethod(SignatureMethod.RSA_SHA1, null);
rsaSha256 = fac.newSignatureMethod
("http://www.w3.org/2001/04/xmldsig-more#rsa-sha256", null);
@@ -182,6 +194,8 @@ public class GenerationTests {
("http://www.w3.org/2001/04/xmldsig-more#rsa-sha384", null);
rsaSha512 = fac.newSignatureMethod
("http://www.w3.org/2001/04/xmldsig-more#rsa-sha512", null);
+ ecdsaSha1 = fac.newSignatureMethod
+ ("http://www.w3.org/2001/04/xmldsig-more#ecdsa-sha1", null);
sks = new KeySelectors.SecretKeySelector("secret".getBytes("ASCII"));
httpUd = new HttpURIDereferencer();
@@ -342,6 +356,13 @@ public class GenerationTests {
System.out.println();
}
+ static void test_create_signature_enveloping_p256_sha1() throws Exception {
+ System.out.println("* Generating signature-enveloping-p256-sha1.xml");
+ test_create_signature_enveloping(sha1, ecdsaSha1, p256ki,
+ getECPrivateKey(), kvks, false);
+ System.out.println();
+ }
+
static void test_create_signature_external_b64_dsa() throws Exception {
System.out.println("* Generating signature-external-b64-dsa.xml");
test_create_signature_external(dsaSha1, dsa1024, signingKey, kvks, true);
@@ -1168,7 +1189,42 @@ public class GenerationTests {
"237008997971129772408397621801631622129297063463868593083106979716" +
"204903524890556839550490384015324575598723478554854070823335021842" +
"210112348400928769";
+ private static final String EC_X =
+ "335863644451761614592446380116804721648611739647823420286081723541" +
+ "6166183710";
+ private static final String EC_Y =
+ "951559601159729477487064127150143688502130342917782252098602422796" +
+ "95457910701";
+ private static final String EC_S =
+ "425976209773168452211813225517384419928639977904006759709292218082" +
+ "7440083936";
+ private static final ECParameterSpec EC_PARAMS;
+ static {
+ final String ec_sfield, ec_a, ec_b, ec_gx, ec_gy, ec_n;
+ ec_sfield =
+ "FFFFFFFF00000001000000000000000000000000FFFFFFFFFFFFFFFFFFFFFFFF";
+ ec_a =
+ "FFFFFFFF00000001000000000000000000000000FFFFFFFFFFFFFFFFFFFFFFFC";
+ ec_b =
+ "5AC635D8AA3A93E7B3EBBD55769886BC651D06B0CC53B0F63BCE3C3E27D2604B";
+ ec_gx =
+ "6B17D1F2E12C4247F8BCE6E563A440F277037D812DEB33A0F4A13945D898C296";
+ ec_gy =
+ "4FE342E2FE1A7F9B8EE7EB4A7C0F9E162BCE33576B315ECECBB6406837BF51F5";
+ ec_n =
+ "FFFFFFFF00000000FFFFFFFFFFFFFFFFBCE6FAADA7179E84F3B9CAC2FC632551";
+ final int ec_h = 1;
+ final ECField ec_field = new ECFieldFp(bigInt(ec_sfield));
+ final EllipticCurve ec_curve = new EllipticCurve(ec_field,
+ bigInt(ec_a), bigInt(ec_b));
+ final ECPoint ec_g = new ECPoint(bigInt(ec_gx), bigInt(ec_gy));
+ EC_PARAMS = new ECParameterSpec(ec_curve, ec_g, bigInt(ec_n), ec_h);
+ }
+
+ private static BigInteger bigInt(String s) {
+ return new BigInteger(s, 16);
+ }
private static PublicKey getPublicKey(String algo, int keysize)
throws Exception {
KeyFactory kf = KeyFactory.getInstance(algo);
@@ -1197,6 +1253,14 @@ public class GenerationTests {
return kf.generatePublic(kspec);
}
+ private static PublicKey getECPublicKey() throws Exception {
+ KeyFactory kf = KeyFactory.getInstance("EC");
+ KeySpec kspec = new ECPublicKeySpec(new ECPoint(new BigInteger(EC_X),
+ new BigInteger(EC_Y)),
+ EC_PARAMS);
+ return kf.generatePublic(kspec);
+ }
+
private static PrivateKey getPrivateKey(String algo, int keysize)
throws Exception {
KeyFactory kf = KeyFactory.getInstance(algo);
@@ -1223,6 +1287,12 @@ public class GenerationTests {
return kf.generatePrivate(kspec);
}
+ private static PrivateKey getECPrivateKey() throws Exception {
+ KeyFactory kf = KeyFactory.getInstance("EC");
+ KeySpec kspec = new ECPrivateKeySpec(new BigInteger(EC_S), EC_PARAMS);
+ return kf.generatePrivate(kspec);
+ }
+
private static SecretKey getSecretKey(final byte[] secret) {
return new SecretKey() {
public String getFormat() { return "RAW"; }
diff --git a/jdk/test/javax/xml/crypto/dsig/KeySelectors.java b/jdk/test/javax/xml/crypto/dsig/KeySelectors.java
index b8f4d324893..8f041f5f2a6 100644
--- a/jdk/test/javax/xml/crypto/dsig/KeySelectors.java
+++ b/jdk/test/javax/xml/crypto/dsig/KeySelectors.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2005, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2015, 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
@@ -166,7 +166,6 @@ class KeySelectors {
throw new KeySelectorException("No KeyValue element found!");
}
- //@@@FIXME: this should also work for key types other than DSA/RSA
static boolean algEquals(String algURI, String algName) {
if (algName.equalsIgnoreCase("DSA") &&
algURI.equals(SignatureMethod.DSA_SHA1) ||
@@ -181,6 +180,10 @@ class KeySelectors {
algURI.equals
("http://www.w3.org/2001/04/xmldsig-more#rsa-sha512"))) {
return true;
+ } else if (algName.equalsIgnoreCase("EC") &&
+ (algURI.equals
+ ("http://www.w3.org/2001/04/xmldsig-more#ecdsa-sha1"))) {
+ return true;
} else {
return false;
}
diff --git a/jdk/test/javax/xml/crypto/dsig/ValidationTests.java b/jdk/test/javax/xml/crypto/dsig/ValidationTests.java
index 5a86692f8c8..3480f23b2be 100644
--- a/jdk/test/javax/xml/crypto/dsig/ValidationTests.java
+++ b/jdk/test/javax/xml/crypto/dsig/ValidationTests.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2015, 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
@@ -23,7 +23,7 @@
/**
* @test
- * @bug 4635230 6365103 6366054 6824440 7131084
+ * @bug 4635230 6365103 6366054 6824440 7131084 8046724
* @summary Basic unit tests for validating XML Signatures with JSR 105
* @compile -XDignore.symbol.file KeySelectors.java SignatureValidator.java
* X509KeySelector.java ValidationTests.java
@@ -90,6 +90,7 @@ public class ValidationTests {
new Test("signature-enveloping-b64-dsa.xml", KVKS),
new Test("signature-enveloping-dsa.xml", KVKS),
new Test("signature-enveloping-rsa.xml", KVKS),
+ new Test("signature-enveloping-p256-sha1.xml", KVKS),
new Test("signature-enveloping-hmac-sha1.xml", SKKS),
new Test("signature-external-dsa.xml", KVKS),
new Test("signature-external-b64-dsa.xml", KVKS),
diff --git a/jdk/test/javax/xml/crypto/dsig/data/signature-enveloping-p256-sha1.xml b/jdk/test/javax/xml/crypto/dsig/data/signature-enveloping-p256-sha1.xml
new file mode 100644
index 00000000000..0ace1157be5
--- /dev/null
+++ b/jdk/test/javax/xml/crypto/dsig/data/signature-enveloping-p256-sha1.xml
@@ -0,0 +1,3 @@
+7/XTsHaBSOnJ/jXD5v0zL6VKYsk= WiF/Hd0s7BiH36Ds/1iJcbKiXOUVBSGFteuTjXwBbezR43NAwpMmMX5c1su0A9hG9rVVzE/1DOlO
+vuDVLBBblg== BAds672US3sCYunM2k2bEQLbuRxdQlNTvq+5fitOpDMe0mBdZV4J3yZaG0taziYIuAT9GJGfds+q
+xtXOCNWe/60= some text
\ No newline at end of file
diff --git a/langtools/.hgtags b/langtools/.hgtags
index c7267deceed..78871157c37 100644
--- a/langtools/.hgtags
+++ b/langtools/.hgtags
@@ -287,3 +287,4 @@ f7ce2cfa4cdbec0ae0f46080484eace66be7987a jdk9-b41
23a3a063a906a91ba696d792f0eeabf157cd2f86 jdk9-b42
6a06008aec10d32898ca665685f531c681b28f5f jdk9-b43
de2ce70d907c9f227b802cea29285bece5194cd5 jdk9-b44
+73bbdcf236b297a0c1b8875f2eeba65eaf7ade60 jdk9-b45
diff --git a/langtools/make/Tools.gmk b/langtools/make/Tools.gmk
index 7e23cd122f9..ea2452387cc 100644
--- a/langtools/make/Tools.gmk
+++ b/langtools/make/Tools.gmk
@@ -39,7 +39,7 @@ $(eval $(call SetupJavaCompilation,BUILD_TOOLS_LANGTOOLS, \
DISABLE_SJAVAC := true, \
ADD_JAVAC_FLAGS := -Xprefer:source, \
SRC := $(LANGTOOLS_TOPDIR)/make/tools, \
- INCLUDES := compileproperties, \
+ INCLUDES := compileproperties propertiesparser, \
BIN := $(BUILDTOOLS_OUTPUTDIR)/langtools_tools_classes))
all: $(BUILD_TOOLS_LANGTOOLS)
diff --git a/langtools/make/build.properties b/langtools/make/build.properties
index b224a9721d2..2a12dbec711 100644
--- a/langtools/make/build.properties
+++ b/langtools/make/build.properties
@@ -54,6 +54,9 @@ jdk.compiler.dependencies=java.base:java.compiler
jdk.javadoc.dependencies=java.base:java.compiler:jdk.compiler
jdk.dev.dependencies=java.base:java.compiler:jdk.compiler
+javac.resource.includes = \
+ com/sun/tools/javac/resources/compiler.properties
+
#test configuration:
jtreg.tests=
boot.javac.tests = tools/javac
diff --git a/langtools/make/build.xml b/langtools/make/build.xml
index 8eff38083aa..bdaae283bde 100644
--- a/langtools/make/build.xml
+++ b/langtools/make/build.xml
@@ -527,7 +527,8 @@
+ compilation.kind="@{compilation.kind}"
+ resource.includes="${javac.resource.includes}" />
-
+
+
@@ -583,6 +585,12 @@
+
+
+
+
+
@@ -644,6 +652,28 @@
+
+
+
+
+
+
+
+
+
+
+
diff --git a/langtools/make/gensrc/Gensrc-jdk.compiler.gmk b/langtools/make/gensrc/Gensrc-jdk.compiler.gmk
index 8d44ea7b3e8..04a0479fad7 100644
--- a/langtools/make/gensrc/Gensrc-jdk.compiler.gmk
+++ b/langtools/make/gensrc/Gensrc-jdk.compiler.gmk
@@ -37,4 +37,7 @@ $(eval $(call SetupVersionProperties,JAVAP_VERSION,\
$(eval $(call SetupCompileProperties,COMPILE_PROPERTIES,\
$(JAVAC_VERSION) $(JAVAH_VERSION) $(JAVAP_VERSION)))
-all: $(COMPILE_PROPERTIES)
+$(eval $(call SetupParseProperties,PARSE_PROPERTIES,\
+ com/sun/tools/javac/resources/compiler.properties))
+
+all: $(COMPILE_PROPERTIES) $(PARSE_PROPERTIES)
diff --git a/langtools/make/gensrc/GensrcCommon.gmk b/langtools/make/gensrc/GensrcCommon.gmk
index efd9d23c58d..0b38117030c 100644
--- a/langtools/make/gensrc/GensrcCommon.gmk
+++ b/langtools/make/gensrc/GensrcCommon.gmk
@@ -35,6 +35,11 @@ include JavaCompilation.gmk
TOOL_COMPILEPROPS_CMD := $(JAVA) -cp $(BUILDTOOLS_OUTPUTDIR)/langtools_tools_classes \
compileproperties.CompileProperties -quiet
+################################################################################
+# The compileprops tools compiles a properties file into an enum-like class.
+TOOL_PARSEPROPS_CMD := $(JAVA) -cp $(BUILDTOOLS_OUTPUTDIR)/langtools_tools_classes \
+ propertiesparser.PropertiesParser
+
################################################################################
# Sets up a rule that creates a version.properties file in the gensrc output
@@ -93,3 +98,32 @@ define SetupCompileProperties
endef
################################################################################
+# Parse property files in given location and generate a Java-like enum in the gensrc folder.
+# Param 1 - Variable to add targets to
+# Param 2 - Extra properties files to process
+define SetupParseProperties
+ #property file to generate
+ PARSEPROPSOURCES := $$(foreach var,$2,$$(addsuffix $$(var),$(LANGTOOLS_TOPDIR)/src/$(MODULE)/share/classes/))
+
+ PARSEPROPALLDIRS := $$(patsubst $(LANGTOOLS_TOPDIR)/src/%, \
+ $(SUPPORT_OUTPUTDIR)/gensrc/%, \
+ $$(dir $$(PARSEPROPSOURCES)))
+
+ PARSEPROPDIRS := $$(sort $$(PARSEPROPALLDIRS))
+
+ PARSEPROPCMDLINE := $$(subst _SPACE_, $$(SPACE), \
+ $$(join $$(foreach var,$$(PARSEPROPSOURCES),$$(addprefix -compile_SPACE_,$$(var))), \
+ $$(addprefix _SPACE_, $$(PARSEPROPALLDIRS))))
+
+ # Now setup the rule for the generation of the resource bundles.
+ $(SUPPORT_OUTPUTDIR)/gensrc/$(MODULE)/_the_parsed_props: $(PARSEPROPSOURCES)
+ $(CP) -r $(LANGTOOLS_TOPDIR)/make/tools/propertiesparser/resources $(BUILDTOOLS_OUTPUTDIR)/langtools_tools_classes/propertiesparser/resources
+ $(MKDIR) -p $$(@D) $$(PARSEPROPDIRS)
+ $(ECHO) Parsing $$(words $$(PARSEPROPSOURCES)) properties into enum-like class for $(MODULE)
+ $(TOOL_PARSEPROPS_CMD) $$(PARSEPROPCMDLINE)
+ $(TOUCH) $$@
+
+ $$(strip $1) += $(SUPPORT_OUTPUTDIR)/gensrc/$(MODULE)/_the_parsed_props
+endef
+
+################################################################################
diff --git a/langtools/make/intellij/build.xml b/langtools/make/intellij/build.xml
index 3494aec4443..46163bbded1 100644
--- a/langtools/make/intellij/build.xml
+++ b/langtools/make/intellij/build.xml
@@ -28,7 +28,7 @@
-
+
diff --git a/langtools/make/intellij/compiler.xml b/langtools/make/intellij/compiler.xml
index 552c480a158..6edb6d2c5af 100644
--- a/langtools/make/intellij/compiler.xml
+++ b/langtools/make/intellij/compiler.xml
@@ -5,6 +5,7 @@
+
diff --git a/langtools/make/intellij/langtools.iml b/langtools/make/intellij/langtools.iml
index 57af163ce76..88c815ff523 100644
--- a/langtools/make/intellij/langtools.iml
+++ b/langtools/make/intellij/langtools.iml
@@ -1,20 +1,22 @@
-
+
-
-
+
+
+
+
+
-
diff --git a/langtools/make/intellij/misc.xml b/langtools/make/intellij/misc.xml
index aec616acb92..5039fe35f4a 100644
--- a/langtools/make/intellij/misc.xml
+++ b/langtools/make/intellij/misc.xml
@@ -3,8 +3,8 @@
-
-
+
+
diff --git a/langtools/make/netbeans/langtools/nbproject/project.xml b/langtools/make/netbeans/langtools/nbproject/project.xml
index 9f93321fb38..806e3356102 100644
--- a/langtools/make/netbeans/langtools/nbproject/project.xml
+++ b/langtools/make/netbeans/langtools/nbproject/project.xml
@@ -478,29 +478,34 @@
${root}/src/java.base/share/classes
+ ${root}/build/bootstrap/java.base/gensrc
${root}/build/java.base/classes
1.8
${root}/src/java.compiler/share/classes
+ ${root}/build/bootstrap/java.compiler/gensrc
${root}/build/java.base/classes
${root}/build/java.compiler/classes
1.8
${root}/src/jdk.compiler/share/classes
+ ${root}/build/bootstrap/jdk.compiler/gensrc
${root}/build/java.base/classes:${root}/build/java.compiler/classes
${root}/build/jdk.compiler/classes
1.8
${root}/src/jdk.dev/share/classes
+ ${root}/build/bootstrap/jdk.dev/gensrc
${root}/build/java.base/classes:${root}/build/java.compiler/classes:${root}/build/jdk.compiler/classes
${root}/build/jdk.dev/classes
1.8
${root}/src/jdk.javadoc/share/classes
+ ${root}/build/bootstrap/jdk.javadoc/gensrc
${root}/build/java.base/classes:${root}/build/java.compiler/classes:${root}/build/jdk.compiler/classes
${root}/build/jdk.javadoc/classes
1.8
diff --git a/langtools/make/tools/anttasks/PropertiesParserTask.java b/langtools/make/tools/anttasks/PropertiesParserTask.java
new file mode 100644
index 00000000000..ec288946b10
--- /dev/null
+++ b/langtools/make/tools/anttasks/PropertiesParserTask.java
@@ -0,0 +1,92 @@
+/*
+ * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * 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 anttasks;
+
+import java.io.File;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+
+import propertiesparser.PropertiesParser;
+import propertiesparser.gen.ClassGenerator;
+import org.apache.tools.ant.BuildException;
+import org.apache.tools.ant.DirectoryScanner;
+import org.apache.tools.ant.Project;
+import org.apache.tools.ant.taskdefs.MatchingTask;
+import org.apache.tools.ant.types.Path;
+import org.apache.tools.ant.types.Resource;
+
+public class PropertiesParserTask extends MatchingTask {
+ public void addSrc(Path src) {
+ if (srcDirs == null)
+ srcDirs = new Path(getProject());
+ srcDirs.add(src);
+ }
+
+ public void setDestDir(File destDir) {
+ this.destDir = destDir;
+ }
+
+ @Override
+ public void execute() {
+ List mainOpts = new ArrayList();
+ int count = 0;
+ for (String dir : srcDirs.list()) {
+ File baseDir = getProject().resolveFile(dir);
+ DirectoryScanner s = getDirectoryScanner(baseDir);
+ for (String path : s.getIncludedFiles()) {
+ if (path.endsWith(".properties")) {
+ File srcFile = new File(baseDir, path);
+ String destPath =
+ path.substring(0, path.lastIndexOf(File.separator) + 1) +
+ ClassGenerator.toplevelName(srcFile) + ".java";
+ File destFile = new File(this.destDir, destPath);
+ File destDir = destFile.getParentFile();
+ // Arguably, the comparison in the next line should be ">", not ">="
+ // but that assumes the resolution of the last modified time is fine
+ // grained enough; in practice, it is better to use ">=".
+ if (destFile.exists() && destFile.lastModified() >= srcFile.lastModified())
+ continue;
+ destDir.mkdirs();
+ mainOpts.add("-compile");
+ mainOpts.add(srcFile.getPath());
+ mainOpts.add(destDir.getPath());
+ count++;
+ }
+ }
+ }
+ if (mainOpts.size() > 0) {
+ log("Generating " + count + " resource files to " + destDir, Project.MSG_INFO);
+ PropertiesParser pp = new PropertiesParser(msg -> log(msg, Project.MSG_INFO));
+ boolean ok = pp.run(mainOpts.toArray(new String[mainOpts.size()]));
+ if (!ok)
+ throw new BuildException("PropertiesParser failed.");
+ }
+ }
+
+ private Path srcDirs;
+ private File destDir;
+}
diff --git a/langtools/make/tools/propertiesparser/PropertiesParser.java b/langtools/make/tools/propertiesparser/PropertiesParser.java
new file mode 100644
index 00000000000..6ec748ef1a3
--- /dev/null
+++ b/langtools/make/tools/propertiesparser/PropertiesParser.java
@@ -0,0 +1,127 @@
+/*
+ * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * 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 propertiesparser;
+
+import propertiesparser.parser.MessageFile;
+import propertiesparser.gen.ClassGenerator;
+
+import java.io.BufferedWriter;
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileNotFoundException;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.io.OutputStreamWriter;
+import java.io.Writer;
+import java.lang.RuntimeException;
+import java.lang.Throwable;
+import java.text.MessageFormat;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+import java.util.Properties;
+
+/** Translates a .properties file into a .java file containing an enum-like Java class
+ * which defines static factory methods for all resource keys in a given resource file.
+ *
+ * Usage: java PropertiesParser -compile [path to .properties file] [output folder where .java file will be written]
+ *
+ * @author mcimadamore
+ */
+
+public class PropertiesParser {
+
+ public Logger logger;
+
+ public PropertiesParser(Logger logger) {
+ this.logger = logger;
+ }
+
+ public static void main(String[] args) {
+ PropertiesParser pp = new PropertiesParser(msg -> System.out.println(msg));
+ boolean ok = pp.run(args);
+ if ( !ok ) {
+ System.exit(1);
+ }
+ }
+
+ public static interface Logger {
+ void info(String msg);
+ }
+
+ public void info(String msg) {
+ logger.info(msg);
+ }
+
+ public boolean run(String[] args) {
+ Map optionsMap = parseOptions(args);
+ if (optionsMap.isEmpty()) {
+ usage();
+ return false;
+ }
+ try {
+ optionsMap.forEach((propfile, outfile) -> compilePropertyFile(propfile, outfile));
+ return true;
+ } catch (RuntimeException ex) {
+ ex.printStackTrace();
+ return false;
+ }
+ }
+
+ private void compilePropertyFile(String propertyPath, String outPath) {
+ try {
+ File propertyFile = new File(propertyPath);
+ String prefix = propertyFile.getName().split("\\.")[0];
+ MessageFile messageFile = new MessageFile(propertyFile, prefix);
+ new ClassGenerator().generateFactory(messageFile, new File(outPath));
+ } catch (Throwable ex) {
+ throw new RuntimeException(ex);
+ }
+ }
+
+ private Map parseOptions(String args[]) {
+ Map optionsMap = new HashMap<>(args.length);
+ for ( int i = 0; i < args.length ; i++ ) {
+ if ( "-compile".equals(args[i]) && i+2 < args.length ) {
+ optionsMap.put(args[++i], args[++i]);
+ } else {
+ return new HashMap<>();
+ }
+ }
+ return optionsMap;
+ }
+
+ private void usage() {
+ info("usage:");
+ info(" java PropertiesParser {-compile path_to_properties_file path_to_java_output_dir}");
+ info("");
+ info("Example:");
+ info(" java PropertiesParser -compile resources/test.properties resources");
+ }
+}
diff --git a/langtools/make/tools/propertiesparser/gen/ClassGenerator.java b/langtools/make/tools/propertiesparser/gen/ClassGenerator.java
new file mode 100644
index 00000000000..f46d10a0bee
--- /dev/null
+++ b/langtools/make/tools/propertiesparser/gen/ClassGenerator.java
@@ -0,0 +1,419 @@
+package propertiesparser.gen;
+
+import propertiesparser.parser.Message;
+import propertiesparser.parser.MessageFile;
+import propertiesparser.parser.MessageInfo;
+import propertiesparser.parser.MessageLine;
+import propertiesparser.parser.MessageType;
+import propertiesparser.parser.MessageType.CompoundType;
+import propertiesparser.parser.MessageType.CustomType;
+import propertiesparser.parser.MessageType.SimpleType;
+import propertiesparser.parser.MessageType.UnionType;
+import propertiesparser.parser.MessageType.Visitor;
+
+import java.io.File;
+import java.io.FileWriter;
+import java.io.IOException;
+import java.io.InputStream;
+import java.text.MessageFormat;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collections;
+import java.util.TreeSet;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+import java.util.Properties;
+import java.util.stream.Collectors;
+import java.util.stream.Stream;
+
+public class ClassGenerator {
+
+ /** Empty string - used to generate indentation padding. */
+ private final static String INDENT_STRING = " ";
+
+ /** Default indentation step. */
+ private final static int INDENT_WIDTH = 4;
+
+ /** File-backed property file containing basic code stubs. */
+ static Properties stubs;
+
+ static {
+ //init properties from file
+ stubs = new Properties();
+ String resourcePath = "/propertiesparser/resources/templates.properties";
+ try (InputStream in = ClassGenerator.class.getResourceAsStream(resourcePath)) {
+ stubs.load(in);
+ } catch (IOException ex) {
+ throw new AssertionError(ex);
+ }
+ }
+
+ /**
+ * Supported stubs in the property file.
+ */
+ enum StubKind {
+ TOPLEVEL("toplevel.decl"),
+ FACTORY_CLASS("nested.decl"),
+ IMPORT("import.decl"),
+ FACTORY_METHOD_DECL("factory.decl.method"),
+ FACTORY_METHOD_ARG("factory.decl.method.arg"),
+ FACTORY_METHOD_BODY("factory.decl.method.body"),
+ FACTORY_FIELD("factory.decl.field"),
+ WILDCARDS_EXTENDS("wildcards.extends"),
+ SUPPRESS_WARNINGS("suppress.warnings");
+
+ /** stub key (as it appears in the property file) */
+ String key;
+
+ StubKind(String key) {
+ this.key = key;
+ }
+
+ /**
+ * Subst a list of arguments into a given stub.
+ */
+ String format(Object... args) {
+ return MessageFormat.format((String)stubs.get(key), args);
+ }
+ }
+
+ /**
+ * Nested factory class kind. There are multiple sub-factories, one for each kind of commonly used
+ * diagnostics (i.e. error, warnings, note, fragment). An additional category is defined for
+ * those resource keys whose prefix doesn't match any predefined category.
+ */
+ enum FactoryKind {
+ ERR("err", "Error", "Errors"),
+ WARN("warn", "Warning", "Warnings"),
+ NOTE("note", "Note", "Notes"),
+ MISC("misc", "Fragment", "Fragments"),
+ OTHER(null, null, null);
+
+ /** The prefix for this factory kind (i.e. 'err'). */
+ String prefix;
+
+ /** The type of the factory method/fields in this class. */
+ String keyClazz;
+
+ /** The class name to be used for this factory. */
+ String factoryClazz;
+
+ FactoryKind(String prefix, String keyClazz, String factoryClazz) {
+ this.prefix = prefix;
+ this.keyClazz = keyClazz;
+ this.factoryClazz = factoryClazz;
+ }
+
+ /**
+ * Utility method for parsing a factory kind from a resource key prefix.
+ */
+ static FactoryKind parseFrom(String prefix) {
+ for (FactoryKind k : FactoryKind.values()) {
+ if (k.prefix == null || k.prefix.equals(prefix)) {
+ return k;
+ }
+ }
+ return null;
+ }
+ }
+
+ /**
+ * Main entry-point: generate a Java enum-like set of nested factory classes into given output
+ * folder. The factories are populated as mandated by the comments in the input resource file.
+ */
+ public void generateFactory(MessageFile messageFile, File outDir) {
+ Map>> groupedEntries =
+ messageFile.messages.entrySet().stream()
+ .collect(Collectors.groupingBy(e -> FactoryKind.parseFrom(e.getKey().split("\\.")[1])));
+ //generate nested classes
+ List nestedDecls = new ArrayList<>();
+ Set importedTypes = new TreeSet<>();
+ for (Map.Entry>> entry : groupedEntries.entrySet()) {
+ if (entry.getKey() == FactoryKind.OTHER) continue;
+ //emit members
+ String members = entry.getValue().stream()
+ .flatMap(e -> generateFactoryMethodsAndFields(e.getKey(), e.getValue()).stream())
+ .collect(Collectors.joining("\n\n"));
+ //emit nested class
+ String factoryDecl =
+ StubKind.FACTORY_CLASS.format(entry.getKey().factoryClazz, indent(members, 1));
+ nestedDecls.add(indent(factoryDecl, 1));
+ //add imports
+ entry.getValue().stream().forEach(e ->
+ importedTypes.addAll(importedTypes(e.getValue().getMessageInfo().getTypes())));
+ }
+ String clazz = StubKind.TOPLEVEL.format(
+ packageName(messageFile.file),
+ String.join("\n", generateImports(importedTypes)),
+ toplevelName(messageFile.file),
+ String.join("\n", nestedDecls));
+ try (FileWriter fw = new FileWriter(new File(outDir, toplevelName(messageFile.file) + ".java"))) {
+ fw.append(clazz);
+ } catch (Throwable ex) {
+ throw new AssertionError(ex);
+ }
+ }
+
+ /**
+ * Indent a string to a given level.
+ */
+ String indent(String s, int level) {
+ return Stream.of(s.split("\n"))
+ .map(sub -> INDENT_STRING.substring(0, level * INDENT_WIDTH) + sub)
+ .collect(Collectors.joining("\n"));
+ }
+
+ /**
+ * Retrieve package part of given file object.
+ */
+ String packageName(File file) {
+ String path = file.getAbsolutePath();
+ int begin = path.indexOf("com" + File.separatorChar);
+ String packagePath = path.substring(begin, path.lastIndexOf(File.separatorChar));
+ String packageName = packagePath.replace(File.separatorChar, '.');
+ return packageName;
+ }
+
+ /**
+ * Form the name of the toplevel factory class.
+ */
+ public static String toplevelName(File file) {
+ return Stream.of(file.getName().split("\\."))
+ .map(s -> Character.toUpperCase(s.charAt(0)) + s.substring(1))
+ .collect(Collectors.joining(""));
+ }
+
+ /**
+ * Generate a list of import declarations given a set of imported types.
+ */
+ List generateImports(Set importedTypes) {
+ List importDecls = new ArrayList<>();
+ for (String it : importedTypes) {
+ importDecls.add(StubKind.IMPORT.format(it));
+ }
+ return importDecls;
+ }
+
+ /**
+ * Generate a list of factory methods/fields to be added to a given factory nested class.
+ */
+ List generateFactoryMethodsAndFields(String key, Message msg) {
+ MessageInfo msgInfo = msg.getMessageInfo();
+ List lines = msg.getLines(false);
+ String javadoc = lines.stream()
+ .filter(ml -> !ml.isInfo() && !ml.isEmptyOrComment())
+ .map(ml -> ml.text)
+ .collect(Collectors.joining("\n *"));
+ String[] keyParts = key.split("\\.");
+ FactoryKind k = FactoryKind.parseFrom(keyParts[1]);
+ String factoryName = factoryName(key);
+ if (msgInfo.getTypes().isEmpty()) {
+ //generate field
+ String factoryField = StubKind.FACTORY_FIELD.format(k.keyClazz, factoryName,
+ "\"" + keyParts[0] + "\"",
+ "\"" + Stream.of(keyParts).skip(2).collect(Collectors.joining(".")) + "\"",
+ javadoc);
+ return Collections.singletonList(factoryField);
+ } else {
+ //generate method
+ List factoryMethods = new ArrayList<>();
+ for (List msgTypes : normalizeTypes(0, msgInfo.getTypes())) {
+ List types = generateTypes(msgTypes);
+ List argNames = argNames(types.size());
+ String suppressionString = needsSuppressWarnings(msgTypes) ?
+ StubKind.SUPPRESS_WARNINGS.format() : "";
+ String factoryMethod = StubKind.FACTORY_METHOD_DECL.format(suppressionString, k.keyClazz,
+ factoryName, argDecls(types, argNames).stream().collect(Collectors.joining(", ")),
+ indent(StubKind.FACTORY_METHOD_BODY.format(k.keyClazz,
+ "\"" + keyParts[0] + "\"",
+ "\"" + Stream.of(keyParts).skip(2).collect(Collectors.joining(".")) + "\"",
+ argNames.stream().collect(Collectors.joining(", "))), 1),
+ javadoc);
+ factoryMethods.add(factoryMethod);
+ }
+ return factoryMethods;
+ }
+ }
+
+ /**
+ * Form the name of a factory method/field given a resource key.
+ */
+ String factoryName(String key) {
+ return Stream.of(key.split("[\\.-]"))
+ .skip(2)
+ .map(s -> Character.toUpperCase(s.charAt(0)) + s.substring(1))
+ .collect(Collectors.joining(""));
+ }
+
+ /**
+ * Generate a formal parameter list given a list of types and names.
+ */
+ List argDecls(List types, List args) {
+ List argNames = new ArrayList<>();
+ for (int i = 0 ; i < types.size() ; i++) {
+ argNames.add(types.get(i) + " " + args.get(i));
+ }
+ return argNames;
+ }
+
+ /**
+ * Generate a list of formal parameter names given a size.
+ */
+ List argNames(int size) {
+ List argNames = new ArrayList<>();
+ for (int i = 0 ; i < size ; i++) {
+ argNames.add(StubKind.FACTORY_METHOD_ARG.format(i));
+ }
+ return argNames;
+ }
+
+ /**
+ * Convert a (normalized) parsed type into a string-based representation of some Java type.
+ */
+ List generateTypes(List msgTypes) {
+ return msgTypes.stream().map(t -> t.accept(stringVisitor, null)).collect(Collectors.toList());
+ }
+ //where
+ Visitor stringVisitor = new Visitor() {
+ @Override
+ public String visitCustomType(CustomType t, Void aVoid) {
+ String customType = t.typeString;
+ return customType.substring(customType.lastIndexOf('.') + 1);
+ }
+
+ @Override
+ public String visitSimpleType(SimpleType t, Void aVoid) {
+ return t.clazz;
+ }
+
+ @Override
+ public String visitCompoundType(CompoundType t, Void aVoid) {
+ return StubKind.WILDCARDS_EXTENDS.format(t.kind.clazz.clazz,
+ t.elemtype.accept(this, null));
+ }
+
+ @Override
+ public String visitUnionType(UnionType t, Void aVoid) {
+ throw new AssertionError("Union types should have been denormalized!");
+ }
+ };
+
+ /**
+ * See if any of the parsed types in the given list needs warning suppression.
+ */
+ boolean needsSuppressWarnings(List msgTypes) {
+ return msgTypes.stream().anyMatch(t -> t.accept(suppressWarningsVisitor, null));
+ }
+ //where
+ Visitor suppressWarningsVisitor = new Visitor() {
+ @Override
+ public Boolean visitCustomType(CustomType t, Void aVoid) {
+ //play safe
+ return true;
+ }
+ @Override
+ public Boolean visitSimpleType(SimpleType t, Void aVoid) {
+ switch (t) {
+ case LIST:
+ case SET:
+ return true;
+ default:
+ return false;
+ }
+ }
+
+ @Override
+ public Boolean visitCompoundType(CompoundType t, Void aVoid) {
+ return t.elemtype.accept(this, null);
+ }
+
+ @Override
+ public Boolean visitUnionType(UnionType t, Void aVoid) {
+ return needsSuppressWarnings(Arrays.asList(t.choices));
+ }
+ };
+
+ /**
+ * Retrieve a list of types that need to be imported, so that the factory body can refer
+ * to the types in the given list using simple names.
+ */
+ Set importedTypes(List msgTypes) {
+ Set imports = new TreeSet<>();
+ msgTypes.forEach(t -> t.accept(importVisitor, imports));
+ return imports;
+ }
+ //where
+ Visitor> importVisitor = new Visitor>() {
+ @Override
+ public Void visitCustomType(CustomType t, Set imports) {
+ imports.add(t.typeString);
+ return null;
+ }
+
+ @Override
+ public Void visitSimpleType(SimpleType t, Set imports) {
+ if (t.qualifier != null) {
+ imports.add(t.qualifier + "." + t.clazz);
+ }
+ return null;
+ }
+
+ @Override
+ public Void visitCompoundType(CompoundType t, Set imports) {
+ visitSimpleType(t.kind.clazz, imports);
+ t.elemtype.accept(this, imports);
+ return null;
+ }
+
+ @Override
+ public Void visitUnionType(UnionType t, Set imports) {
+ Stream.of(t.choices).forEach(c -> c.accept(this, imports));
+ return null;
+ }
+ };
+
+ /**
+ * Normalize parsed types in a comment line. If one or more types in the line contains alternatives,
+ * this routine generate a list of 'overloaded' normalized signatures.
+ */
+ List> normalizeTypes(int idx, List msgTypes) {
+ if (msgTypes.size() == idx) return Collections.singletonList(Collections.emptyList());
+ MessageType head = msgTypes.get(idx);
+ List> buf = new ArrayList<>();
+ for (MessageType alternative : head.accept(normalizeVisitor, null)) {
+ for (List rest : normalizeTypes(idx + 1, msgTypes)) {
+ List temp = new ArrayList<>(rest);
+ temp.add(0, alternative);
+ buf.add(temp);
+ }
+ }
+ return buf;
+ }
+ //where
+ Visitor, Void> normalizeVisitor = new Visitor, Void>() {
+ @Override
+ public List visitCustomType(CustomType t, Void aVoid) {
+ return Collections.singletonList(t);
+ }
+
+ @Override
+ public List visitSimpleType(SimpleType t, Void aVoid) {
+ return Collections.singletonList(t);
+ }
+
+ @Override
+ public List visitCompoundType(CompoundType t, Void aVoid) {
+ return t.elemtype.accept(this, null).stream()
+ .map(nt -> new CompoundType(t.kind, nt))
+ .collect(Collectors.toList());
+ }
+
+ @Override
+ public List visitUnionType(UnionType t, Void aVoid) {
+ return Stream.of(t.choices)
+ .flatMap(t2 -> t2.accept(this, null).stream())
+ .collect(Collectors.toList());
+ }
+ };
+}
diff --git a/langtools/make/tools/propertiesparser/parser/Message.java b/langtools/make/tools/propertiesparser/parser/Message.java
new file mode 100644
index 00000000000..4bfded31285
--- /dev/null
+++ b/langtools/make/tools/propertiesparser/parser/Message.java
@@ -0,0 +1,91 @@
+/*
+ * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * 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.
+ */
+package propertiesparser.parser;
+
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * A message within the message file.
+ * A message is a series of lines containing a "name=value" property,
+ * optionally preceded by a comment describing the use of placeholders
+ * such as {0}, {1}, etc within the property value.
+ */
+public final class Message {
+ final MessageLine firstLine;
+ private MessageInfo messageInfo;
+
+ Message(MessageLine l) {
+ firstLine = l;
+ }
+
+ /**
+ * Get the Info object for this message. It may be empty if there
+ * if no comment preceding the property specification.
+ */
+ public MessageInfo getMessageInfo() {
+ if (messageInfo == null) {
+ MessageLine l = firstLine.prev;
+ if (l != null && l.isInfo())
+ messageInfo = new MessageInfo(l.text);
+ else
+ messageInfo = MessageInfo.dummyInfo;
+ }
+ return messageInfo;
+ }
+
+ /**
+ * Get all the lines pertaining to this message.
+ */
+ public List getLines(boolean includeAllPrecedingComments) {
+ List lines = new ArrayList<>();
+ MessageLine l = firstLine;
+ if (includeAllPrecedingComments) {
+ // scan back to find end of prev message
+ while (l.prev != null && l.prev.isEmptyOrComment())
+ l = l.prev;
+ // skip leading blank lines
+ while (l.text.isEmpty())
+ l = l.next;
+ } else {
+ if (l.prev != null && l.prev.isInfo())
+ l = l.prev;
+ }
+
+ // include any preceding lines
+ for ( ; l != firstLine; l = l.next)
+ lines.add(l);
+
+ // include message lines
+ for (l = firstLine; l != null && l.hasContinuation(); l = l.next)
+ lines.add(l);
+ lines.add(l);
+
+ // include trailing blank line if present
+ l = l.next;
+ if (l != null && l.text.isEmpty())
+ lines.add(l);
+
+ return lines;
+ }
+}
diff --git a/langtools/make/tools/propertiesparser/parser/MessageFile.java b/langtools/make/tools/propertiesparser/parser/MessageFile.java
new file mode 100644
index 00000000000..45e3384ba72
--- /dev/null
+++ b/langtools/make/tools/propertiesparser/parser/MessageFile.java
@@ -0,0 +1,60 @@
+/*
+ * Copyright (c) 2010, 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * 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.
+ */
+package propertiesparser.parser;
+
+import java.io.*;
+import java.nio.file.Files;
+import java.nio.file.Paths;
+import java.util.*;
+
+/**
+ * Class to facilitate manipulating compiler.properties.
+ */
+public class MessageFile {
+
+ MessageLine firstLine;
+ public Map messages = new TreeMap<>();
+ public File file;
+ public String keyPrefix;
+
+ public MessageFile(File file, String keyPrefix) throws IOException {
+ this.file = file;
+ this.keyPrefix = keyPrefix;
+ read(file);
+ }
+
+ final void read(File in) throws IOException {
+ MessageLine currLine = null;
+ for (String line : Files.readAllLines(in.toPath())) {
+ if (currLine == null)
+ firstLine = currLine = new MessageLine(line);
+ else
+ currLine = currLine.append(line);
+ if (line.startsWith(keyPrefix + ".")) {
+ int eq = line.indexOf("=");
+ if (eq > 0)
+ messages.put(line.substring(0, eq), new Message(currLine));
+ }
+ }
+ }
+}
diff --git a/langtools/make/tools/propertiesparser/parser/MessageInfo.java b/langtools/make/tools/propertiesparser/parser/MessageInfo.java
new file mode 100644
index 00000000000..e822510a9f1
--- /dev/null
+++ b/langtools/make/tools/propertiesparser/parser/MessageInfo.java
@@ -0,0 +1,125 @@
+/*
+ * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * 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.
+ */
+package propertiesparser.parser;
+
+import propertiesparser.parser.MessageType.CompoundType;
+import propertiesparser.parser.MessageType.OrType;
+import propertiesparser.parser.MessageType.SimpleType;
+import propertiesparser.parser.MessageType.UnionType;
+
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * An object to represent the comment that may precede the property
+ * specification in a Message.
+ * The comment is modelled as a list of fields, where the fields correspond
+ * to the placeholder values (e.g. {0}, {1}, etc) within the message value.
+ */
+public final class MessageInfo {
+
+ /** The fields of the Info object. */
+ List types = new ArrayList<>();
+
+ MessageInfo(String text) throws IllegalArgumentException {
+ if (text != null) {
+ if (!text.startsWith("# "))
+ throw new IllegalArgumentException();
+ String[] segs = text.substring(2).split(", ");
+ types = new ArrayList<>();
+ for (String seg : segs) {
+ types.add(parseType(seg));
+ }
+ }
+ }
+
+ public List getTypes() {
+ return types;
+ }
+
+ boolean isEmpty() {
+ return types.isEmpty();
+ }
+
+ @Override
+ public String toString() {
+ return types.toString();
+ }
+
+ /**
+ * Split the type comment into multiple alternatives (separated by 'or') - then parse each of them
+ * individually and form an 'or' type.
+ */
+ MessageType parseType(String text) {
+ int commentStart = text.indexOf("(");
+ if (commentStart != -1) {
+ //remove optional comment
+ text = text.substring(0, commentStart);
+ }
+ text = text.substring(text.indexOf(": ") + 2);
+ String[] alternatives = text.split(" " + OrType.OR_NAME + " ");
+ MessageType[] types = new MessageType[alternatives.length];
+ for (int i = 0 ; i < alternatives.length ; i++) {
+ types[i] = parseAlternative(alternatives[i].trim());
+ }
+ return types.length > 1 ?
+ new OrType(types) : types[0];
+ }
+
+ /**
+ * Parse a subset of the type comment; valid matches are simple types, compound types,
+ * union types and custom types.
+ */
+ MessageType parseAlternative(String text) {
+ //try with custom types
+ if (text.charAt(0) == '\'') {
+ int end = text.indexOf('\'', 1);
+ return new MessageType.CustomType(text.substring(1, end));
+ }
+ //try with simple types
+ for (SimpleType st : SimpleType.values()) {
+ if (text.equals(st.kindName())) {
+ return st;
+ }
+ }
+ //try with compound types
+ for (CompoundType.Kind ck : CompoundType.Kind.values()) {
+ if (text.startsWith(ck.kindName)) {
+ MessageType elemtype = parseAlternative(text.substring(ck.kindName.length() + 1).trim());
+ return new CompoundType(ck, elemtype);
+ }
+ }
+ //try with union types
+ for (UnionType.Kind uk : UnionType.Kind.values()) {
+ if (text.startsWith(uk.kindName)) {
+ return new UnionType(uk);
+ }
+ }
+ //no match - report a warning
+ System.err.println("WARNING - unrecognized type: " + text);
+ return SimpleType.UNKNOWN;
+ }
+
+ /** Dummy message info to be used when no resource key comment is available. */
+ static final MessageInfo dummyInfo = new MessageInfo(null);
+}
diff --git a/langtools/make/tools/propertiesparser/parser/MessageLine.java b/langtools/make/tools/propertiesparser/parser/MessageLine.java
new file mode 100644
index 00000000000..b7751f9978b
--- /dev/null
+++ b/langtools/make/tools/propertiesparser/parser/MessageLine.java
@@ -0,0 +1,73 @@
+/*
+ * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * 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.
+ */
+package propertiesparser.parser;
+
+import java.util.regex.Pattern;
+
+/**
+ * A line of text within the message file.
+ * The lines form a doubly linked list for simple navigation.
+ */
+public class MessageLine {
+
+ static final Pattern emptyOrCommentPattern = Pattern.compile("( *#.*)?");
+ static final Pattern typePattern = Pattern.compile("[-\\\\'A-Z\\.a-z ]+( \\([A-Za-z 0-9]+\\))?");
+ static final Pattern infoPattern = Pattern.compile(String.format("# ([0-9]+: %s, )*[0-9]+: %s",
+ typePattern.pattern(), typePattern.pattern()));
+
+ public String text;
+ MessageLine prev;
+ MessageLine next;
+
+ MessageLine(String text) {
+ this.text = text;
+ }
+
+ public boolean isEmptyOrComment() {
+ return emptyOrCommentPattern.matcher(text).matches();
+ }
+
+ public boolean isInfo() {
+ return infoPattern.matcher(text).matches();
+ }
+
+ boolean hasContinuation() {
+ return (next != null) && text.endsWith("\\");
+ }
+
+ MessageLine append(String text) {
+ MessageLine l = new MessageLine(text);
+ append(l);
+ return l;
+ }
+
+ void append(MessageLine l) {
+ assert l.prev == null && l.next == null;
+ l.prev = this;
+ l.next = next;
+ if (next != null) {
+ next.prev = l;
+ }
+ next = l;
+ }
+}
diff --git a/langtools/make/tools/propertiesparser/parser/MessageType.java b/langtools/make/tools/propertiesparser/parser/MessageType.java
new file mode 100644
index 00000000000..6c70084349c
--- /dev/null
+++ b/langtools/make/tools/propertiesparser/parser/MessageType.java
@@ -0,0 +1,250 @@
+/*
+ * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * 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.
+ */
+
+package propertiesparser.parser;
+
+/**
+ * Common interface to all kinds of diagnostic argument types.
+ */
+public interface MessageType {
+
+ /**
+ * Visitor method.
+ */
+ R accept(Visitor v, A a);
+
+ /**
+ * The type as mentioned in the resource file.
+ */
+ String kindName();
+
+ /**
+ * A custom type is a type for which a predefined alternative does not exist. As such, it is an
+ * handy option when prototyping - but usages of custom types should be avoided in product-quality
+ * resource file comments.
+ *
+ * Example: 'com.sun.tools.javac.code.Flags.Flag'
+ */
+ public static class CustomType implements MessageType {
+
+ /** The string-based representation of this type. */
+ public String typeString;
+
+ public CustomType(String typeString) {
+ this.typeString = typeString;
+ }
+
+ @Override
+ public String kindName() {
+ return typeString;
+ }
+
+ @Override
+ public R accept(Visitor v, A a) {
+ return v.visitCustomType(this, a);
+ }
+ }
+
+ /**
+ * A predefined type. All common types mentioned in the resource file comments are meant to
+ * be included here.
+ */
+ public enum SimpleType implements MessageType {
+
+ BOOLEAN("boolean", "boolean", null),
+ FRAGMENT("fragment", "Fragment", null),
+ DIAGNOSTIC("diagnostic", "JCDiagnostic", "com.sun.tools.javac.util"),
+ MODIFIER("modifier", "Modifier", "javax.lang.model.element"),
+ FILE("file", "File", "java.io"),
+ FILE_OBJECT("file object", "JavaFileObject", "javax.tools"),
+ NAME("name", "Name", "com.sun.tools.javac.util"),
+ NUMBER("number", "int", null),
+ OPTION_NAME("option name", "Option", "com.sun.tools.javac.main"),
+ SOURCE_VERSION("source version", "Source", "com.sun.tools.javac.code"),
+ STRING("string", "String", null),
+ SYMBOL("symbol", "Symbol", "com.sun.tools.javac.code"),
+ SYMBOL_KIND("symbol kind", "Kind", "com.sun.tools.javac.code.Kinds"),
+ KIND_NAME("kind name", "KindName", "com.sun.tools.javac.code.Kinds"),
+ TOKEN("token", "TokenKind", "com.sun.tools.javac.parser.Tokens"),
+ TYPE("type", "Type", "com.sun.tools.javac.code"),
+ SET("set", "Set", "java.util"),
+ LIST("list", "List", "java.util"),
+ OBJECT("object", "Object", null),
+ UNUSED("unused", "Void", null),
+ UNKNOWN("", "UnknownType", null);
+
+ /** name of the predefined type as mentioned in the resource file. */
+ public final String kindName;
+
+ /** string-based representation of the type */
+ public final String clazz;
+
+ /** type qualifier (might be null) */
+ public final String qualifier;
+
+ SimpleType(String kindName, String clazz, String qualifier) {
+ this.kindName = kindName;
+ this.clazz = clazz;
+ this.qualifier = qualifier;
+ }
+
+ @Override
+ public String kindName() {
+ return kindName;
+ }
+
+ @Override
+ public R accept(Visitor v, A a) {
+ return v.visitSimpleType(this, a);
+ }
+ }
+
+ /**
+ * A compound type is a collection of some element type.
+ *
+ * Example: list of string
+ */
+ public static class CompoundType implements MessageType {
+
+ /**
+ * Compound type kind.
+ */
+ public enum Kind {
+ LIST("list of", SimpleType.LIST),
+ SET("set of", SimpleType.SET);
+
+ public final String kindName;
+ public final SimpleType clazz;
+
+ Kind(String kindName, SimpleType clazz) {
+ this.kindName = kindName;
+ this.clazz = clazz;
+ }
+ }
+
+ /** The compound type kind. */
+ public final Kind kind;
+
+ /** The element type. */
+ public final MessageType elemtype;
+
+ public CompoundType(Kind kind, MessageType elemtype) {
+ this.kind = kind;
+ this.elemtype = elemtype;
+ }
+
+ @Override
+ public String kindName() {
+ return kind.kindName;
+ }
+
+ @Override
+ public R accept(Visitor v, A a) {
+ return v.visitCompoundType(this, a);
+ }
+ }
+
+ /**
+ * A union type represents an alternative between two (or more) types. It can be useful to
+ * define the type of an argument which can assume multiple (unrelated) values; union types
+ * are only meant to be used in cases where the alternative comes up frequently enough in the
+ * resource file comments - in order to avoid cluttered comments.
+ *
+ * Example: message segment
+ */
+ public static class UnionType implements MessageType {
+
+ /**
+ * Union type kind.
+ */
+ public enum Kind {
+ MESSAGE_SEGMENT("message segment", SimpleType.DIAGNOSTIC, SimpleType.FRAGMENT),
+ FILE_NAME("file name", SimpleType.FILE, SimpleType.FILE_OBJECT);
+
+ final String kindName;
+ final SimpleType[] choices;
+
+ Kind(String kindName, SimpleType... choices) {
+ this.kindName = kindName;
+ this.choices = choices;
+ }
+ }
+
+ /** The union type kind. */
+ public final Kind kind;
+
+ /** The union type alternatives. */
+ public final MessageType[] choices;
+
+ UnionType(Kind kind) {
+ this(kind, kind.choices);
+ }
+
+ protected UnionType(Kind kind, MessageType[] choices) {
+ this.choices = choices;
+ this.kind = kind;
+ }
+
+ @Override
+ public String kindName() {
+ return kind.kindName;
+ }
+
+ @Override
+ public R accept(Visitor v, A a) {
+ return v.visitUnionType(this, a);
+ }
+ }
+
+ /**
+ * A subclass of union type representing 'explicit' alternatives in the resource file comments.
+ * Note: as the token 'or' is parsed with lowest priority, it is not possible, for instance,
+ * to form a compound type out of an 'or' type. In such cases a plain union type should be used
+ * instead.
+ *
+ * Examples: symbol or type
+ */
+ public static class OrType extends UnionType {
+
+ public static final String OR_NAME = "or";
+
+ @Override
+ public String kindName() {
+ return OR_NAME;
+ }
+
+ public OrType(MessageType... choices) {
+ super(null, choices);
+ }
+ }
+
+ /**
+ * Visitor class.
+ */
+ public static abstract class Visitor {
+ public abstract R visitCustomType(CustomType t, A a);
+ public abstract R visitSimpleType(SimpleType t, A a);
+ public abstract R visitCompoundType(CompoundType t, A a);
+ public abstract R visitUnionType(UnionType t, A a);
+ }
+}
diff --git a/langtools/make/tools/propertiesparser/resources/templates.properties b/langtools/make/tools/propertiesparser/resources/templates.properties
new file mode 100644
index 00000000000..f4715a5a839
--- /dev/null
+++ b/langtools/make/tools/propertiesparser/resources/templates.properties
@@ -0,0 +1,48 @@
+toplevel.decl=\
+ package {0};\n\
+ \n\
+ {1}\n\
+ import com.sun.tools.javac.util.JCDiagnostic.Error;\n\
+ import com.sun.tools.javac.util.JCDiagnostic.Warning;\n\
+ import com.sun.tools.javac.util.JCDiagnostic.Note;\n\
+ import com.sun.tools.javac.util.JCDiagnostic.Fragment;\n\
+ \n\
+ public class {2} '{'\n\
+ {3}\n\
+ '}'\n
+
+import.decl=\
+ import {0};
+
+nested.decl =\
+ public static class {0} '{'\n\
+ {1}\n\
+ '}'
+
+factory.decl.method=\
+ /**\n\
+ ' '* {5}\n\
+ ' '*/\n\
+ {0}public static {1} {2}({3}) '{'\n\
+ {4}\n\
+ '}'
+
+factory.decl.method.arg=\
+ arg{0}
+
+factory.decl.method.body=\
+ return new {0}({1}, {2}, {3});
+
+factory.decl.field=\
+ /**\n\
+ ' '* {4}\n\
+ ' '*/\n\
+ public static final {0} {1} = new {0}({2}, {3});
+
+wildcards.extends=\
+ {0} extends {1}>
+
+suppress.warnings=\
+ @SuppressWarnings("rawtypes")\n
+
+
diff --git a/langtools/src/java.compiler/share/classes/javax/tools/FileManagerUtils.java b/langtools/src/java.compiler/share/classes/javax/tools/FileManagerUtils.java
new file mode 100644
index 00000000000..fe8f6589c5d
--- /dev/null
+++ b/langtools/src/java.compiler/share/classes/javax/tools/FileManagerUtils.java
@@ -0,0 +1,76 @@
+/*
+ * Copyright (c) 2014, 2015, 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 javax.tools;
+
+import java.io.File;
+import java.nio.file.Path;
+import java.util.Iterator;
+
+/**
+ * Package-private utility methods to convert between files and paths.
+ *
+ * @since 1.9
+ */
+class FileManagerUtils {
+ private FileManagerUtils() { }
+
+ static Iterable asPaths(final Iterable extends File> files) {
+ return () -> new Iterator() {
+ Iterator extends File> iter = files.iterator();
+
+ @Override
+ public boolean hasNext() {
+ return iter.hasNext();
+ }
+
+ @Override
+ public Path next() {
+ return iter.next().toPath();
+ }
+ };
+ }
+
+ static Iterable asFiles(final Iterable extends Path> paths) {
+ return () -> new Iterator() {
+ Iterator extends Path> iter = paths.iterator();
+
+ @Override
+ public boolean hasNext() {
+ return iter.hasNext();
+ }
+
+ @Override
+ public File next() {
+ Path p = iter.next();
+ try {
+ return p.toFile();
+ } catch (UnsupportedOperationException e) {
+ throw new IllegalArgumentException(p.toString(), e);
+ }
+ }
+ };
+ }
+}
diff --git a/langtools/src/java.compiler/share/classes/javax/tools/StandardJavaFileManager.java b/langtools/src/java.compiler/share/classes/javax/tools/StandardJavaFileManager.java
index 2b1ad4b7303..9701584805c 100644
--- a/langtools/src/java.compiler/share/classes/javax/tools/StandardJavaFileManager.java
+++ b/langtools/src/java.compiler/share/classes/javax/tools/StandardJavaFileManager.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2006, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2006, 2015, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -27,13 +27,16 @@ package javax.tools;
import java.io.File;
import java.io.IOException;
-import java.util.*;
+import java.nio.file.Path;
+import java.util.Arrays;
+
+import static javax.tools.FileManagerUtils.*;
/**
- * File manager based on {@linkplain File java.io.File}. A common way
- * to obtain an instance of this class is using {@linkplain
- * JavaCompiler#getStandardFileManager
- * getStandardFileManager}, for example:
+ * File manager based on {@linkplain File java.io.File} and {@linkplain Path java.nio.file.Path}.
+ *
+ * A common way to obtain an instance of this class is using
+ * {@linkplain JavaCompiler#getStandardFileManager getStandardFileManager}, for example:
*
*
* JavaCompiler compiler = ToolProvider.getSystemJavaCompiler();
@@ -110,7 +113,7 @@ import java.util.*;
* file:///C:/Documents%20and%20Settings/UncleBob/BobsApp/Test.java
*
*
- * jar:///C:/Documents%20and%20Settings/UncleBob/lib/vendorA.jar!com/vendora/LibraryClass.class
+ * jar:///C:/Documents%20and%20Settings/UncleBob/lib/vendorA.jar!/com/vendora/LibraryClass.class
*
*
* Whereas these are not (reason in parentheses):
@@ -120,7 +123,7 @@ import java.util.*;
* and depend on the current directory)
*
*
- * jar:lib/vendorA.jar!com/vendora/LibraryClass.class
+ * jar:lib/vendorA.jar!/com/vendora/LibraryClass.class
* (the first half of the path depends on the current directory,
* whereas the component after ! is legal)
*
@@ -134,6 +137,10 @@ import java.util.*;
*
*
*
+ * All implementations of this interface must support Path objects representing
+ * files in the {@linkplain java.nio.file.FileSystems#getDefault() default file system.}
+ * It is recommended that implementations should support Path objects from any filesystem.
+ *
* @author Peter von der Ahé
* @since 1.6
*/
@@ -147,11 +154,12 @@ public interface StandardJavaFileManager extends JavaFileManager {
* @param a a file object
* @param b a file object
* @return true if the given file objects represent the same
- * canonical file or zip file entry; false otherwise
+ * canonical file, zip file entry or path; false otherwise
*
* @throws IllegalArgumentException if either of the arguments
* were created with another file manager implementation
*/
+ @Override
boolean isSameFile(FileObject a, FileObject b);
/**
@@ -165,6 +173,27 @@ public interface StandardJavaFileManager extends JavaFileManager {
Iterable extends JavaFileObject> getJavaFileObjectsFromFiles(
Iterable extends File> files);
+ /**
+ * Returns file objects representing the given paths.
+ *
+ * The default implementation converts each path to a file and calls
+ * {@link #getJavaFileObjectsFromFiles getJavaObjectsFromFiles}.
+ * IllegalArgumentException will be thrown if any of the paths
+ * cannot be converted to a file.
+ *
+ * @param paths a list of paths
+ * @return a list of file objects
+ * @throws IllegalArgumentException if the list of paths includes
+ * a directory or if this file manager does not support any of the
+ * given paths.
+ *
+ * @since 1.9
+ */
+ default Iterable extends JavaFileObject> getJavaFileObjectsFromPaths(
+ Iterable extends Path> paths) {
+ return getJavaFileObjectsFromFiles(asFiles(paths));
+ }
+
/**
* Returns file objects representing the given files.
* Convenience method equivalent to:
@@ -182,6 +211,27 @@ public interface StandardJavaFileManager extends JavaFileManager {
*/
Iterable extends JavaFileObject> getJavaFileObjects(File... files);
+ /**
+ * Returns file objects representing the given paths.
+ * Convenience method equivalent to:
+ *
+ *
+ * getJavaFileObjectsFromPaths({@linkplain java.util.Arrays#asList Arrays.asList}(paths))
+ *
+ *
+ * @param paths an array of paths
+ * @return a list of file objects
+ * @throws IllegalArgumentException if the array of files includes
+ * a directory
+ * @throws NullPointerException if the given array contains null
+ * elements
+ *
+ * @since 1.9
+ */
+ default Iterable extends JavaFileObject> getJavaFileObjects(Path... paths) {
+ return getJavaFileObjectsFromPaths(Arrays.asList(paths));
+ }
+
/**
* Returns file objects representing the given file names.
*
@@ -211,29 +261,94 @@ public interface StandardJavaFileManager extends JavaFileManager {
Iterable extends JavaFileObject> getJavaFileObjects(String... names);
/**
- * Associates the given path with the given location. Any
+ * Associates the given search path with the given location. Any
* previous value will be discarded.
*
* @param location a location
- * @param path a list of files, if {@code null} use the default
- * path for this location
+ * @param files a list of files, if {@code null} use the default
+ * search path for this location
* @see #getLocation
- * @throws IllegalArgumentException if location is an output
- * location and path does not contain exactly one element
- * @throws IOException if location is an output location and path
+ * @throws IllegalArgumentException if {@code location} is an output
+ * location and {@code files} does not contain exactly one element
+ * @throws IOException if {@code location} is an output location and
* does not represent an existing directory
*/
- void setLocation(Location location, Iterable extends File> path)
+ void setLocation(Location location, Iterable extends File> files)
throws IOException;
/**
- * Returns the path associated with the given location.
+ * Associates the given search path with the given location. Any
+ * previous value will be discarded.
+ *
+ * The default implementation converts each path to a file and calls
+ * {@link #getJavaFileObjectsFromFiles getJavaObjectsFromFiles}.
+ * IllegalArgumentException will be thrown if any of the paths
+ * cannot be converted to a file.
+ *
+ * @param location a location
+ * @param paths a list of paths, if {@code null} use the default
+ * search path for this location
+ * @see #getLocation
+ * @throws IllegalArgumentException if {@code location} is an output
+ * location and {@code paths} does not contain exactly one element
+ * or if this file manager does not support any of the given paths
+ * @throws IOException if {@code location} is an output location and
+ * {@code paths} does not represent an existing directory
+ *
+ * @since 1.9
+ */
+ default void setLocationFromPaths(Location location, Iterable extends Path> paths)
+ throws IOException {
+ setLocation(location, asFiles(paths));
+ }
+
+ /**
+ * Returns the search path associated with the given location.
*
* @param location a location
* @return a list of files or {@code null} if this location has no
- * associated path
+ * associated search path
+ * @throws IllegalStateException if any element of the search path
+ * cannot be converted to a {@linkplain File}.
+ *
* @see #setLocation
+ * @see Path#toFile
*/
Iterable extends File> getLocation(Location location);
+ /**
+ * Returns the search path associated with the given location.
+ *
+ * @param location a location
+ * @return a list of paths or {@code null} if this location has no
+ * associated search path
+ *
+ * @see #setLocationFromPaths
+ * @since 1.9
+ */
+ default Iterable extends Path> getLocationAsPaths(Location location) {
+ return asPaths(getLocation(location));
+ }
+
+ /**
+ * Returns the path, if any, underlying this file object (optional operation).
+ * File objects derived from a {@link java.nio.file.FileSystem FileSystem},
+ * including the default file system, typically have a corresponding underlying
+ * {@link java.nio.file.Path Path} object. In such cases, this method may be
+ * used to access that object.
+ *
+ * The default implementation throws {@link UnsupportedOperationException}
+ * for all files.
+ *
+ * @param file a file object
+ * @return a path representing the same underlying file system artifact
+ * @throws IllegalArgumentException if the file object does not have an underlying path
+ * @throws UnsupportedOperationException if the operation is not supported by this file manager
+ *
+ * @since 1.9
+ */
+ default Path asPath(FileObject file) {
+ throw new UnsupportedOperationException();
+ }
+
}
diff --git a/langtools/src/java.compiler/share/classes/javax/tools/ToolProvider.java b/langtools/src/java.compiler/share/classes/javax/tools/ToolProvider.java
index 46ab0c4a415..85da537519f 100644
--- a/langtools/src/java.compiler/share/classes/javax/tools/ToolProvider.java
+++ b/langtools/src/java.compiler/share/classes/javax/tools/ToolProvider.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2005, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2015, 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
@@ -92,6 +92,10 @@ public class ToolProvider {
/**
* Returns the Java™ programming language compiler provided
* with this platform.
+ * The file manager returned by calling
+ * {@link JavaCompiler#getStandardFileManager getStandardFileManager}
+ * on this compiler supports paths provided by any
+ * {@linkplain java.nio.file.FileSystem filesystem}.
* @return the compiler provided with this platform or
* {@code null} if no compiler is provided
*/
@@ -105,6 +109,10 @@ public class ToolProvider {
/**
* Returns the Java™ programming language documentation tool provided
* with this platform.
+ * The file manager returned by calling
+ * {@link DocumentationTool#getStandardFileManager getStandardFileManager}
+ * on this tool supports paths provided by any
+ * {@linkplain java.nio.file.FileSystem filesystem}.
* @return the documentation tool provided with this platform or
* {@code null} if no documentation tool is provided
*/
diff --git a/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/code/AnnoConstruct.java b/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/code/AnnoConstruct.java
index 58762a724f2..899cf827655 100644
--- a/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/code/AnnoConstruct.java
+++ b/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/code/AnnoConstruct.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2015, 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
@@ -26,6 +26,7 @@ package com.sun.tools.javac.code;
import java.lang.annotation.Annotation;
import java.lang.annotation.Inherited;
+import java.lang.annotation.Repeatable;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
@@ -183,65 +184,12 @@ public abstract class AnnoConstruct implements AnnotatedConstruct {
return c == null ? null : AnnotationProxyMaker.generateAnnotation(c, annoType);
}
- // Needed to unpack the runtime view of containing annotations
- private static final Class extends Annotation> REPEATABLE_CLASS = initRepeatable();
- private static final Method VALUE_ELEMENT_METHOD = initValueElementMethod();
-
- private static Class extends Annotation> initRepeatable() {
- try {
- // Repeatable will not be available when bootstrapping on
- // JDK 7 so use a reflective lookup instead of a class
- // literal for Repeatable.class.
- return Class.forName("java.lang.annotation.Repeatable").asSubclass(Annotation.class);
- } catch (ClassNotFoundException | SecurityException e) {
- return null;
- }
- }
-
- private static Method initValueElementMethod() {
- if (REPEATABLE_CLASS == null)
- return null;
-
- Method m = null;
- try {
- m = REPEATABLE_CLASS.getMethod("value");
- if (m != null)
- m.setAccessible(true);
- return m;
- } catch (NoSuchMethodException e) {
- return null;
- }
- }
-
-
// Helper to getAnnotationsByType
private static Class extends Annotation> getContainer(Class extends Annotation> annoType) {
- // Since we can not refer to java.lang.annotation.Repeatable until we are
- // bootstrapping with java 8 we need to get the Repeatable annotation using
- // reflective invocations instead of just using its type and element method.
- if (REPEATABLE_CLASS != null &&
- VALUE_ELEMENT_METHOD != null) {
- // Get the Repeatable instance on the annotations declaration
- Annotation repeatable = (Annotation)annoType.getAnnotation(REPEATABLE_CLASS);
- if (repeatable != null) {
- try {
- // Get the value element, it should be a class
- // indicating the containing annotation type
- @SuppressWarnings("unchecked")
- Class extends Annotation> containerType = (Class)VALUE_ELEMENT_METHOD.invoke(repeatable);
- if (containerType == null)
- return null;
-
- return containerType;
- } catch (ClassCastException | IllegalAccessException | InvocationTargetException e) {
- return null;
- }
- }
- }
- return null;
+ Repeatable repeatable = annoType.getAnnotation(Repeatable.class);
+ return (repeatable == null) ? null : repeatable.value();
}
-
// Helper to getAnnotationsByType
private static Attribute[] unpackAttributes(Attribute.Compound container) {
// We now have an instance of the container,
diff --git a/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Attr.java b/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Attr.java
index 7ea795423d0..815371baaa9 100644
--- a/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Attr.java
+++ b/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Attr.java
@@ -207,6 +207,7 @@ public class Attr extends JCTree.Visitor {
* are correct.
*
* @param tree The tree whose kind and type is checked
+ * @param found The computed type of the tree
* @param ownkind The computed kind of the tree
* @param resultInfo The expected result of the tree
*/
diff --git a/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Resolve.java b/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Resolve.java
index 65e166ff4c1..e327e286c67 100644
--- a/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Resolve.java
+++ b/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Resolve.java
@@ -39,7 +39,6 @@ import com.sun.tools.javac.comp.DeferredAttr.DeferredType;
import com.sun.tools.javac.comp.Infer.InferenceContext;
import com.sun.tools.javac.comp.Infer.FreeTypeListener;
import com.sun.tools.javac.comp.Resolve.MethodResolutionContext.Candidate;
-import com.sun.tools.javac.comp.Resolve.MethodResolutionDiagHelper.DiagnosticRewriter;
import com.sun.tools.javac.comp.Resolve.MethodResolutionDiagHelper.Template;
import com.sun.tools.javac.jvm.*;
import com.sun.tools.javac.main.Option;
@@ -55,11 +54,12 @@ import com.sun.tools.javac.util.JCDiagnostic.DiagnosticType;
import java.util.Arrays;
import java.util.Collection;
-import java.util.EnumMap;
import java.util.EnumSet;
import java.util.Iterator;
import java.util.LinkedHashMap;
import java.util.Map;
+import java.util.function.BiPredicate;
+import java.util.stream.Stream;
import javax.lang.model.element.ElementVisitor;
@@ -1008,7 +1008,7 @@ public class Resolve {
DeferredType dt = (DeferredType)found;
return dt.check(this);
} else {
- Type uResult = U(found.baseType());
+ Type uResult = U(found);
Type capturedType = pos == null || pos.getTree() == null ?
types.capture(uResult) :
checkContext.inferenceContext()
@@ -2546,17 +2546,7 @@ public class Resolve {
final JCDiagnostic details = sym.kind == WRONG_MTH ?
((InapplicableSymbolError)sym.baseSymbol()).errCandidate().snd :
null;
- sym = new InapplicableSymbolError(sym.kind, "diamondError", currentResolutionContext) {
- @Override
- JCDiagnostic getDiagnostic(DiagnosticType dkind, DiagnosticPosition pos,
- Symbol location, Type site, Name name, List argtypes, List typeargtypes) {
- String key = details == null ?
- "cant.apply.diamond" :
- "cant.apply.diamond.1";
- return diags.create(dkind, log.currentSource(), pos, key,
- diags.fragment("diamond", site.tsym), details);
- }
- };
+ sym = new DiamondError(sym, currentResolutionContext);
sym = accessMethod(sym, pos, site, names.init, true, argtypes, typeargtypes);
env.info.pendingResolutionPhase = currentResolutionContext.step;
}
@@ -3724,15 +3714,10 @@ public class Resolve {
else {
Pair c = errCandidate();
if (compactMethodDiags) {
- for (Map.Entry _entry :
- MethodResolutionDiagHelper.rewriters.entrySet()) {
- if (_entry.getKey().matches(c.snd)) {
- JCDiagnostic simpleDiag =
- _entry.getValue().rewriteDiagnostic(diags, pos,
- log.currentSource(), dkind, c.snd);
- simpleDiag.setFlag(DiagnosticFlag.COMPRESSED);
- return simpleDiag;
- }
+ JCDiagnostic simpleDiag =
+ MethodResolutionDiagHelper.rewrite(diags, pos, log.currentSource(), dkind, c.snd);
+ if (simpleDiag != null) {
+ return simpleDiag;
}
}
Symbol ws = c.fst.asMemberOf(site, types);
@@ -3765,9 +3750,8 @@ public class Resolve {
}
/**
- * ResolveError error class indicating that a set of symbols
- * (either methods, constructors or operands) is not applicable
- * given an actual arguments/type argument list.
+ * ResolveError error class indicating that a symbol (either methods, constructors or operand)
+ * is not applicable given an actual arguments/type argument list.
*/
class InapplicableSymbolsError extends InapplicableSymbolError {
@@ -3863,6 +3847,44 @@ public class Resolve {
}
}
+ /**
+ * DiamondError error class indicating that a constructor symbol is not applicable
+ * given an actual arguments/type argument list using diamond inference.
+ */
+ class DiamondError extends InapplicableSymbolError {
+
+ Symbol sym;
+
+ public DiamondError(Symbol sym, MethodResolutionContext context) {
+ super(sym.kind, "diamondError", context);
+ this.sym = sym;
+ }
+
+ JCDiagnostic getDetails() {
+ return (sym.kind == WRONG_MTH) ?
+ ((InapplicableSymbolError)sym.baseSymbol()).errCandidate().snd :
+ null;
+ }
+
+ @Override
+ JCDiagnostic getDiagnostic(DiagnosticType dkind, DiagnosticPosition pos,
+ Symbol location, Type site, Name name, List argtypes, List typeargtypes) {
+ JCDiagnostic details = getDetails();
+ if (details != null && compactMethodDiags) {
+ JCDiagnostic simpleDiag =
+ MethodResolutionDiagHelper.rewrite(diags, pos, log.currentSource(), dkind, details);
+ if (simpleDiag != null) {
+ return simpleDiag;
+ }
+ }
+ String key = details == null ?
+ "cant.apply.diamond" :
+ "cant.apply.diamond.1";
+ return diags.create(dkind, log.currentSource(), pos, key,
+ diags.fragment("diamond", site.tsym), details);
+ }
+ }
+
/**
* An InvalidSymbolError error class indicating that a symbol is not
* accessible from a given site
@@ -4146,6 +4168,28 @@ public class Resolve {
}
}
+ /**
+ * Common rewriter for all argument mismatch simplifications.
+ */
+ static class ArgMismatchRewriter implements DiagnosticRewriter {
+
+ /** the index of the subdiagnostic to be used as primary. */
+ int causeIndex;
+
+ public ArgMismatchRewriter(int causeIndex) {
+ this.causeIndex = causeIndex;
+ }
+
+ @Override
+ public JCDiagnostic rewriteDiagnostic(JCDiagnostic.Factory diags,
+ DiagnosticPosition preferedPos, DiagnosticSource preferredSource,
+ DiagnosticType preferredKind, JCDiagnostic d) {
+ JCDiagnostic cause = (JCDiagnostic)d.getArgs()[causeIndex];
+ return diags.create(preferredKind, preferredSource, d.getDiagnosticPosition(),
+ "prob.found.req", cause);
+ }
+ }
+
/** a dummy template that match any diagnostic argument */
static final Template skip = new Template("") {
@Override
@@ -4154,22 +4198,61 @@ public class Resolve {
}
};
+ /** template for matching inference-free arguments mismatch failures */
+ static final Template argMismatchTemplate = new Template(MethodCheckDiag.ARG_MISMATCH.regex(), skip);
+
+ /** template for matching inference related arguments mismatch failures */
+ static final Template inferArgMismatchTemplate = new Template(MethodCheckDiag.ARG_MISMATCH.regex(), skip, skip) {
+ @Override
+ boolean matches(Object o) {
+ if (!super.matches(o)) {
+ return false;
+ }
+ JCDiagnostic d = (JCDiagnostic)o;
+ @SuppressWarnings("unchecked")
+ List tvars = (List)d.getArgs()[0];
+ return !containsAny(d, tvars);
+ }
+
+ BiPredicate> containsPredicate = (o, ts) -> {
+ if (o instanceof Type) {
+ return ((Type)o).containsAny(ts);
+ } else if (o instanceof JCDiagnostic) {
+ return containsAny((JCDiagnostic)o, ts);
+ } else {
+ return false;
+ }
+ };
+
+ boolean containsAny(JCDiagnostic d, List ts) {
+ return Stream.of(d.getArgs())
+ .anyMatch(o -> containsPredicate.test(o, ts));
+ }
+ };
+
/** rewriter map used for method resolution simplification */
static final Map rewriters = new LinkedHashMap<>();
static {
- String argMismatchRegex = MethodCheckDiag.ARG_MISMATCH.regex();
- rewriters.put(new Template(argMismatchRegex, skip),
- new DiagnosticRewriter() {
- @Override
- public JCDiagnostic rewriteDiagnostic(JCDiagnostic.Factory diags,
- DiagnosticPosition preferedPos, DiagnosticSource preferredSource,
- DiagnosticType preferredKind, JCDiagnostic d) {
- JCDiagnostic cause = (JCDiagnostic)d.getArgs()[0];
- return diags.create(preferredKind, preferredSource, d.getDiagnosticPosition(),
- "prob.found.req", cause);
+ rewriters.put(argMismatchTemplate, new ArgMismatchRewriter(0));
+ rewriters.put(inferArgMismatchTemplate, new ArgMismatchRewriter(1));
+ }
+
+ /**
+ * Main entry point for diagnostic rewriting - given a diagnostic, see if any templates matches it,
+ * and rewrite it accordingly.
+ */
+ static JCDiagnostic rewrite(JCDiagnostic.Factory diags, DiagnosticPosition pos, DiagnosticSource source,
+ DiagnosticType dkind, JCDiagnostic d) {
+ for (Map.Entry _entry : rewriters.entrySet()) {
+ if (_entry.getKey().matches(d)) {
+ JCDiagnostic simpleDiag =
+ _entry.getValue().rewriteDiagnostic(diags, pos, source, dkind, d);
+ simpleDiag.setFlag(DiagnosticFlag.COMPRESSED);
+ return simpleDiag;
}
- });
+ }
+ return null;
}
}
diff --git a/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/TransTypes.java b/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/TransTypes.java
index 09aaed7ca24..23b712ef759 100644
--- a/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/TransTypes.java
+++ b/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/TransTypes.java
@@ -739,7 +739,9 @@ public class TransTypes extends TreeTranslator {
}
public void visitUnary(JCUnary tree) {
- tree.arg = translate(tree.arg, tree.operator.type.getParameterTypes().head);
+ tree.arg = translate(tree.arg, (tree.getTag() == Tag.NULLCHK)
+ ? tree.type
+ : tree.operator.type.getParameterTypes().head);
result = tree;
}
@@ -753,7 +755,15 @@ public class TransTypes extends TreeTranslator {
tree.clazz = translate(tree.clazz, null);
Type originalTarget = tree.type;
tree.type = erasure(tree.type);
- tree.expr = translate(tree.expr, erasure(tree.expr.type));
+ JCExpression newExpression = translate(tree.expr, erasure(tree.expr.type));
+ if (newExpression != tree.expr) {
+ JCTypeCast typeCast = newExpression.hasTag(Tag.TYPECAST)
+ ? (JCTypeCast) newExpression
+ : null;
+ tree.expr = typeCast != null && types.isSameType(typeCast.type, originalTarget, true)
+ ? typeCast.expr
+ : newExpression;
+ }
if (originalTarget.isCompound()) {
Type.IntersectionClassType ict = (Type.IntersectionClassType)originalTarget;
for (Type c : ict.getExplicitComponents()) {
diff --git a/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/file/JavacFileManager.java b/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/file/JavacFileManager.java
index 21dce052626..a028dc112f8 100644
--- a/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/file/JavacFileManager.java
+++ b/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/file/JavacFileManager.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2005, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2015, 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
@@ -101,7 +101,6 @@ public class JavacFileManager extends BaseFileManager implements StandardJavaFil
private final Set sourceOrClass =
EnumSet.of(JavaFileObject.Kind.SOURCE, JavaFileObject.Kind.CLASS);
- protected boolean mmappedIO;
protected boolean symbolFileEnabled;
protected enum SortFiles implements Comparator {
@@ -157,7 +156,6 @@ public class JavacFileManager extends BaseFileManager implements StandardJavaFil
if (contextUseOptimizedZip)
zipFileIndexCache = ZipFileIndexCache.getSharedInstance();
- mmappedIO = options.isSet("mmappedIO");
symbolFileEnabled = !options.isSet("ignore.symbol.file");
String sf = options.get("sortFiles");
@@ -177,10 +175,12 @@ public class JavacFileManager extends BaseFileManager implements StandardJavaFil
return symbolFileEnabled;
}
+ // used by tests
public JavaFileObject getFileForInput(String name) {
return getRegularFile(Paths.get(name));
}
+ // used by tests
public JavaFileObject getRegularFile(Path file) {
return new RegularFileObject(this, file);
}
@@ -195,10 +195,10 @@ public class JavacFileManager extends BaseFileManager implements StandardJavaFil
@Override @DefinedBy(Api.COMPILER)
public Iterable extends JavaFileObject> getJavaFileObjectsFromStrings(Iterable names) {
- ListBuffer files = new ListBuffer<>();
+ ListBuffer paths = new ListBuffer<>();
for (String name : names)
- files.append(new File(nullCheck(name)));
- return getJavaFileObjectsFromFiles(files.toList());
+ paths.append(Paths.get(nullCheck(name)));
+ return getJavaFileObjectsFromPaths(paths.toList());
}
@Override @DefinedBy(Api.COMPILER)
@@ -872,11 +872,30 @@ public class JavacFileManager extends BaseFileManager implements StandardJavaFil
return result;
}
+ @Override @DefinedBy(Api.COMPILER)
+ public Iterable extends JavaFileObject> getJavaFileObjectsFromPaths(
+ Iterable extends Path> paths)
+ {
+ ArrayList result;
+ if (paths instanceof Collection>)
+ result = new ArrayList<>(((Collection>)paths).size());
+ else
+ result = new ArrayList<>();
+ for (Path p: paths)
+ result.add(new RegularFileObject(this, nullCheck(p)));
+ return result;
+ }
+
@Override @DefinedBy(Api.COMPILER)
public Iterable extends JavaFileObject> getJavaFileObjects(File... files) {
return getJavaFileObjectsFromFiles(Arrays.asList(nullCheck(files)));
}
+ @Override @DefinedBy(Api.COMPILER)
+ public Iterable extends JavaFileObject> getJavaFileObjects(Path... paths) {
+ return getJavaFileObjectsFromPaths(Arrays.asList(nullCheck(paths)));
+ }
+
@Override @DefinedBy(Api.COMPILER)
public void setLocation(Location location,
Iterable extends File> searchpath)
@@ -886,13 +905,23 @@ public class JavacFileManager extends BaseFileManager implements StandardJavaFil
locations.setLocation(location, asPaths(searchpath));
}
+ @Override @DefinedBy(Api.COMPILER)
+ public void setLocationFromPaths(Location location,
+ Iterable extends Path> searchpath)
+ throws IOException
+ {
+ nullCheck(location);
+ locations.setLocation(location, nullCheck(searchpath));
+ }
+
@Override @DefinedBy(Api.COMPILER)
public Iterable extends File> getLocation(Location location) {
nullCheck(location);
return asFiles(locations.getLocation(location));
}
- private Iterable extends Path> getLocationAsPaths(Location location) {
+ @Override @DefinedBy(Api.COMPILER)
+ public Iterable extends Path> getLocationAsPaths(Location location) {
nullCheck(location);
return locations.getLocation(location);
}
@@ -905,6 +934,14 @@ public class JavacFileManager extends BaseFileManager implements StandardJavaFil
return locations.getOutputLocation(SOURCE_OUTPUT);
}
+ @Override @DefinedBy(Api.COMPILER)
+ public Path asPath(FileObject file) {
+ if (file instanceof RegularFileObject) {
+ return ((RegularFileObject) file).file;
+ } else
+ throw new IllegalArgumentException(file.getName());
+ }
+
/**
* Enforces the specification of a "relative" name as used in
* {@linkplain #getFileForInput(Location,String,String)
@@ -1010,12 +1047,12 @@ public class JavacFileManager extends BaseFileManager implements StandardJavaFil
@Override
public File next() {
- return iter.next().toFile();
+ try {
+ return iter.next().toFile();
+ } catch (UnsupportedOperationException e) {
+ throw new IllegalStateException(e);
+ }
}
};
}
-
- private static File asFile(Path path) {
- return path == null ? null : path.toFile();
- }
}
diff --git a/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/file/Locations.java b/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/file/Locations.java
index ba308dfaea2..f8011f3c226 100644
--- a/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/file/Locations.java
+++ b/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/file/Locations.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2015, 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
@@ -428,7 +428,7 @@ public class Locations {
/**
* General purpose implementation for search path locations, such as -sourcepath/SOURCE_PATH and
- * -processorPath/ANNOTATION_PROCESS_PATH. All options are treated as equivalent (i.e. aliases.)
+ * -processorPath/ANNOTATION_PROCESSOR_PATH. All options are treated as equivalent (i.e. aliases.)
* The value is an ordered set of files and/or directories.
*/
private class SimpleLocationHandler extends LocationHandler {
diff --git a/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/jvm/ClassReader.java b/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/jvm/ClassReader.java
index 10cd4bdb4c5..307119aa9bd 100644
--- a/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/jvm/ClassReader.java
+++ b/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/jvm/ClassReader.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1999, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2015, 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
@@ -1740,15 +1740,17 @@ public class ClassReader {
// The method wasn't found: emit a warning and recover
JavaFileObject prevSource = log.useSource(requestingOwner.classfile);
try {
- if (failure == null) {
- log.warning("annotation.method.not.found",
- container,
- name);
- } else {
- log.warning("annotation.method.not.found.reason",
- container,
- name,
- failure.getDetailValue());//diagnostic, if present
+ if (lintClassfile) {
+ if (failure == null) {
+ log.warning("annotation.method.not.found",
+ container,
+ name);
+ } else {
+ log.warning("annotation.method.not.found.reason",
+ container,
+ name,
+ failure.getDetailValue());//diagnostic, if present
+ }
}
} finally {
log.useSource(prevSource);
diff --git a/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/jvm/ClassWriter.java b/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/jvm/ClassWriter.java
index 7fccb889041..3721b329571 100644
--- a/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/jvm/ClassWriter.java
+++ b/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/jvm/ClassWriter.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1999, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2015, 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
@@ -1159,7 +1159,7 @@ public class ClassWriter extends ClassFile {
Assert.check(r.start_pc >= 0
&& r.start_pc <= code.cp);
databuf.appendChar(r.start_pc);
- Assert.check(r.length >= 0
+ Assert.check(r.length > 0
&& (r.start_pc + r.length) <= code.cp);
databuf.appendChar(r.length);
VarSymbol sym = var.sym;
diff --git a/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/jvm/Code.java b/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/jvm/Code.java
index 2825d2991a6..329deb81353 100644
--- a/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/jvm/Code.java
+++ b/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/jvm/Code.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1999, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2015, 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
@@ -182,8 +182,6 @@ public class Code {
final MethodSymbol meth;
- final LVTRanges lvtRanges;
-
/** Construct a code object, given the settings of the fatcode,
* debugging info switches and the CharacterRangeTable.
*/
@@ -196,8 +194,7 @@ public class Code {
CRTable crt,
Symtab syms,
Types types,
- Pool pool,
- LVTRanges lvtRanges) {
+ Pool pool) {
this.meth = meth;
this.fatcode = fatcode;
this.lineMap = lineMap;
@@ -219,7 +216,6 @@ public class Code {
state = new State();
lvar = new LocalVar[20];
this.pool = pool;
- this.lvtRanges = lvtRanges;
}
@@ -1193,7 +1189,9 @@ public class Code {
public int entryPoint(State state) {
int pc = curCP();
alive = true;
- this.state = state.dup();
+ State newState = state.dup();
+ setDefined(newState.defined);
+ this.state = newState;
Assert.check(state.stacksize <= max_stack);
if (debugCode) System.err.println("entry point " + state);
pendingStackMap = needStackMap;
@@ -1206,7 +1204,9 @@ public class Code {
public int entryPoint(State state, Type pushed) {
int pc = curCP();
alive = true;
- this.state = state.dup();
+ State newState = state.dup();
+ setDefined(newState.defined);
+ this.state = newState;
Assert.check(state.stacksize <= max_stack);
this.state.push(pushed);
if (debugCode) System.err.println("entry point " + state);
@@ -2008,27 +2008,6 @@ public class Code {
state.defined.excl(adr);
}
-
- public void closeAliveRanges(JCTree tree) {
- closeAliveRanges(tree, cp);
- }
-
- public void closeAliveRanges(JCTree tree, int closingCP) {
- List locals = lvtRanges.getVars(meth, tree);
- for (LocalVar localVar: lvar) {
- for (VarSymbol aliveLocal : locals) {
- if (localVar != null) {
- if (localVar.sym == aliveLocal && localVar.lastRange() != null) {
- char length = (char)(closingCP - localVar.lastRange().start_pc);
- if (length < Character.MAX_VALUE) {
- localVar.closeRange(length);
- }
- }
- }
- }
- }
- }
-
void adjustAliveRanges(int oldCP, int delta) {
for (LocalVar localVar: lvar) {
if (localVar != null) {
diff --git a/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/jvm/Gen.java b/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/jvm/Gen.java
index 5d4cb3f5e20..df229409a1f 100644
--- a/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/jvm/Gen.java
+++ b/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/jvm/Gen.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1999, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2015, 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
@@ -94,10 +94,6 @@ public class Gen extends JCTree.Visitor {
*/
private Pool pool;
- /** LVTRanges info.
- */
- private LVTRanges lvtRanges;
-
protected Gen(Context context) {
context.put(genKey, this);
@@ -125,9 +121,6 @@ public class Gen extends JCTree.Visitor {
options.isUnset(G_CUSTOM)
? options.isSet(G)
: options.isSet(G_CUSTOM, "vars");
- if (varDebugInfo) {
- lvtRanges = LVTRanges.instance(context);
- }
genCrt = options.isSet(XJCOV);
debugCode = options.isSet("debugcode");
allowInvokedynamic = target.hasInvokedynamic() || options.isSet("invokedynamic");
@@ -982,8 +975,7 @@ public class Gen extends JCTree.Visitor {
: null,
syms,
types,
- pool,
- varDebugInfo ? lvtRanges : null);
+ pool);
items = new Items(pool, code, syms, types);
if (code.debugCode) {
System.err.println(meth + " for body " + tree);
@@ -1086,30 +1078,14 @@ public class Gen extends JCTree.Visitor {
Chain loopDone = c.jumpFalse();
code.resolve(c.trueJumps);
genStat(body, loopEnv, CRT_STATEMENT | CRT_FLOW_TARGET);
- if (varDebugInfo) {
- checkLoopLocalVarRangeEnding(loop, body,
- LoopLocalVarRangeEndingPoint.BEFORE_STEPS);
- }
code.resolve(loopEnv.info.cont);
genStats(step, loopEnv);
- if (varDebugInfo) {
- checkLoopLocalVarRangeEnding(loop, body,
- LoopLocalVarRangeEndingPoint.AFTER_STEPS);
- }
code.resolve(code.branch(goto_), startpc);
code.resolve(loopDone);
} else {
genStat(body, loopEnv, CRT_STATEMENT | CRT_FLOW_TARGET);
- if (varDebugInfo) {
- checkLoopLocalVarRangeEnding(loop, body,
- LoopLocalVarRangeEndingPoint.BEFORE_STEPS);
- }
code.resolve(loopEnv.info.cont);
genStats(step, loopEnv);
- if (varDebugInfo) {
- checkLoopLocalVarRangeEnding(loop, body,
- LoopLocalVarRangeEndingPoint.AFTER_STEPS);
- }
CondItem c;
if (cond != null) {
code.statBegin(cond.pos);
@@ -1120,47 +1096,10 @@ public class Gen extends JCTree.Visitor {
code.resolve(c.jumpTrue(), startpc);
code.resolve(c.falseJumps);
}
- code.resolve(loopEnv.info.exit);
- if (loopEnv.info.exit != null) {
- loopEnv.info.exit.state.defined.excludeFrom(code.nextreg);
- }
- }
-
- private enum LoopLocalVarRangeEndingPoint {
- BEFORE_STEPS,
- AFTER_STEPS,
- }
-
- /**
- * Checks whether we have reached an alive range ending point for local
- * variables after a loop.
- *
- * Local variables alive range ending point for loops varies depending
- * on the loop type. The range can be closed before or after the code
- * for the steps sentences has been generated.
- *
- * - While loops has no steps so in that case the range is closed just
- * after the body of the loop.
- *
- * - For-like loops may have steps so as long as the steps sentences
- * can possibly contain non-synthetic local variables, the alive range
- * for local variables must be closed after the steps in this case.
- */
- private void checkLoopLocalVarRangeEnding(JCTree loop, JCTree body,
- LoopLocalVarRangeEndingPoint endingPoint) {
- if (varDebugInfo && lvtRanges.containsKey(code.meth, body)) {
- switch (endingPoint) {
- case BEFORE_STEPS:
- if (!loop.hasTag(FORLOOP)) {
- code.closeAliveRanges(body);
- }
- break;
- case AFTER_STEPS:
- if (loop.hasTag(FORLOOP)) {
- code.closeAliveRanges(body);
- }
- break;
- }
+ Chain exit = loopEnv.info.exit;
+ if (exit != null) {
+ code.resolve(exit);
+ exit.state.defined.excludeFrom(code.nextreg);
}
}
@@ -1171,7 +1110,11 @@ public class Gen extends JCTree.Visitor {
public void visitLabelled(JCLabeledStatement tree) {
Env localEnv = env.dup(tree, new GenContext());
genStat(tree.body, localEnv, CRT_STATEMENT);
- code.resolve(localEnv.info.exit);
+ Chain exit = localEnv.info.exit;
+ if (exit != null) {
+ code.resolve(exit);
+ exit.state.defined.excludeFrom(code.nextreg);
+ }
}
public void visitSwitch(JCSwitch tree) {
@@ -1277,13 +1220,14 @@ public class Gen extends JCTree.Visitor {
// Generate code for the statements in this case.
genStats(c.stats, switchEnv, CRT_FLOW_TARGET);
- if (varDebugInfo && lvtRanges.containsKey(code.meth, c.stats.last())) {
- code.closeAliveRanges(c.stats.last());
- }
}
// Resolve all breaks.
- code.resolve(switchEnv.info.exit);
+ Chain exit = switchEnv.info.exit;
+ if (exit != null) {
+ code.resolve(exit);
+ exit.state.defined.excludeFrom(code.nextreg);
+ }
// If we have not set the default offset, we do so now.
if (code.get4(tableBase) == -1) {
@@ -1436,9 +1380,6 @@ public class Gen extends JCTree.Visitor {
genFinalizer(env);
code.statBegin(TreeInfo.endPos(env.tree));
Chain exitChain = code.branch(goto_);
- if (varDebugInfo && lvtRanges.containsKey(code.meth, body)) {
- code.closeAliveRanges(body);
- }
endFinalizerGap(env);
if (startpc != endpc) for (List l = catchers; l.nonEmpty(); l = l.tail) {
// start off with exception on stack
@@ -1689,17 +1630,11 @@ public class Gen extends JCTree.Visitor {
code.resolve(c.trueJumps);
genStat(tree.thenpart, env, CRT_STATEMENT | CRT_FLOW_TARGET);
thenExit = code.branch(goto_);
- if (varDebugInfo && lvtRanges.containsKey(code.meth, tree.thenpart)) {
- code.closeAliveRanges(tree.thenpart, code.cp);
- }
}
if (elseChain != null) {
code.resolve(elseChain);
if (tree.elsepart != null) {
genStat(tree.elsepart, env,CRT_STATEMENT | CRT_FLOW_TARGET);
- if (varDebugInfo && lvtRanges.containsKey(code.meth, tree.elsepart)) {
- code.closeAliveRanges(tree.elsepart);
- }
}
}
code.resolve(thenExit);
@@ -2381,16 +2316,6 @@ public class Gen extends JCTree.Visitor {
localEnv.toplevel = env.toplevel;
localEnv.enclClass = cdef;
- /* We must not analyze synthetic methods
- */
- if (varDebugInfo && (cdef.sym.flags() & SYNTHETIC) == 0) {
- try {
- new LVTAssignAnalyzer().analyzeTree(localEnv);
- } catch (Throwable e) {
- throw e;
- }
- }
-
for (List l = cdef.defs; l.nonEmpty(); l = l.tail) {
genDef(l.head, localEnv);
}
@@ -2476,282 +2401,4 @@ public class Gen extends JCTree.Visitor {
}
}
- class LVTAssignAnalyzer
- extends Flow.AbstractAssignAnalyzer {
-
- final LVTBits lvtInits;
-
- /* This class is anchored to a context dependent tree. The tree can
- * vary inside the same instruction for example in the switch instruction
- * the same FlowBits instance can be anchored to the whole tree, or
- * to a given case. The aim is to always anchor the bits to the tree
- * capable of closing a DA range.
- */
- class LVTBits extends Bits {
-
- JCTree currentTree;
- private int[] oldBits = null;
- BitsState stateBeforeOp;
-
- @Override
- public void clear() {
- generalOp(null, -1, BitsOpKind.CLEAR);
- }
-
- @Override
- protected void internalReset() {
- super.internalReset();
- oldBits = null;
- }
-
- @Override
- public Bits assign(Bits someBits) {
- // bits can be null
- oldBits = bits;
- stateBeforeOp = currentState;
- super.assign(someBits);
- changed();
- return this;
- }
-
- @Override
- public void excludeFrom(int start) {
- generalOp(null, start, BitsOpKind.EXCL_RANGE);
- }
-
- @Override
- public void excl(int x) {
- Assert.check(x >= 0);
- generalOp(null, x, BitsOpKind.EXCL_BIT);
- }
-
- @Override
- public Bits andSet(Bits xs) {
- return generalOp(xs, -1, BitsOpKind.AND_SET);
- }
-
- @Override
- public Bits orSet(Bits xs) {
- return generalOp(xs, -1, BitsOpKind.OR_SET);
- }
-
- @Override
- public Bits diffSet(Bits xs) {
- return generalOp(xs, -1, BitsOpKind.DIFF_SET);
- }
-
- @Override
- public Bits xorSet(Bits xs) {
- return generalOp(xs, -1, BitsOpKind.XOR_SET);
- }
-
- private Bits generalOp(Bits xs, int i, BitsOpKind opKind) {
- Assert.check(currentState != BitsState.UNKNOWN);
- oldBits = dupBits();
- stateBeforeOp = currentState;
- switch (opKind) {
- case AND_SET:
- super.andSet(xs);
- break;
- case OR_SET:
- super.orSet(xs);
- break;
- case XOR_SET:
- super.xorSet(xs);
- break;
- case DIFF_SET:
- super.diffSet(xs);
- break;
- case CLEAR:
- super.clear();
- break;
- case EXCL_BIT:
- super.excl(i);
- break;
- case EXCL_RANGE:
- super.excludeFrom(i);
- break;
- }
- changed();
- return this;
- }
-
- /* The tree we need to anchor the bits instance to.
- */
- LVTBits at(JCTree tree) {
- this.currentTree = tree;
- return this;
- }
-
- /* If the instance should be changed but the tree is not a closing
- * tree then a reset is needed or the former tree can mistakingly be
- * used.
- */
- LVTBits resetTree() {
- this.currentTree = null;
- return this;
- }
-
- /** This method will be called after any operation that causes a change to
- * the bits. Subclasses can thus override it in order to extract information
- * from the changes produced to the bits by the given operation.
- */
- public void changed() {
- if (currentTree != null &&
- stateBeforeOp != BitsState.UNKNOWN &&
- trackTree(currentTree)) {
- List locals = lvtRanges
- .getVars(currentMethod, currentTree);
- locals = locals != null ?
- locals : List.nil();
- for (JCVariableDecl vardecl : vardecls) {
- //once the first is null, the rest will be so.
- if (vardecl == null) {
- break;
- }
- if (trackVar(vardecl.sym) && bitChanged(vardecl.sym.adr)) {
- locals = locals.prepend(vardecl.sym);
- }
- }
- if (!locals.isEmpty()) {
- lvtRanges.setEntry(currentMethod,
- currentTree, locals);
- }
- }
- }
-
- boolean bitChanged(int x) {
- boolean isMemberOfBits = isMember(x);
- int[] tmp = bits;
- bits = oldBits;
- boolean isMemberOfOldBits = isMember(x);
- bits = tmp;
- return (!isMemberOfBits && isMemberOfOldBits);
- }
-
- boolean trackVar(VarSymbol var) {
- return (var.owner.kind == MTH &&
- (var.flags() & PARAMETER) == 0 &&
- trackable(var));
- }
-
- boolean trackTree(JCTree tree) {
- switch (tree.getTag()) {
- // of course a method closes the alive range of a local variable.
- case METHODDEF:
- // for while loops we want only the body
- case WHILELOOP:
- return false;
- }
- return true;
- }
-
- }
-
- public class LVTAssignPendingExit extends
- Flow.AbstractAssignAnalyzer.AbstractAssignPendingExit {
-
- LVTAssignPendingExit(JCTree tree, final Bits inits, final Bits uninits) {
- super(tree, inits, uninits);
- }
-
- @Override
- public void resolveJump(JCTree tree) {
- lvtInits.at(tree);
- super.resolveJump(tree);
- }
- }
-
- private LVTAssignAnalyzer() {
- flow.super();
- lvtInits = new LVTBits();
- inits = lvtInits;
- }
-
- @Override
- protected void markDead(JCTree tree) {
- lvtInits.at(tree).inclRange(returnadr, nextadr);
- super.markDead(tree);
- }
-
- @Override
- protected void merge(JCTree tree) {
- lvtInits.at(tree);
- super.merge(tree);
- }
-
- boolean isSyntheticOrMandated(Symbol sym) {
- return (sym.flags() & (SYNTHETIC | MANDATED)) != 0;
- }
-
- @Override
- protected boolean trackable(VarSymbol sym) {
- if (isSyntheticOrMandated(sym)) {
- //fast check to avoid tracking synthetic or mandated variables
- return false;
- }
- return super.trackable(sym);
- }
-
- @Override
- protected void initParam(JCVariableDecl def) {
- if (!isSyntheticOrMandated(def.sym)) {
- super.initParam(def);
- }
- }
-
- @Override
- protected void assignToInits(JCTree tree, Bits bits) {
- lvtInits.at(tree);
- lvtInits.assign(bits);
- }
-
- @Override
- protected void andSetInits(JCTree tree, Bits bits) {
- lvtInits.at(tree);
- lvtInits.andSet(bits);
- }
-
- @Override
- protected void orSetInits(JCTree tree, Bits bits) {
- lvtInits.at(tree);
- lvtInits.orSet(bits);
- }
-
- @Override
- protected void exclVarFromInits(JCTree tree, int adr) {
- lvtInits.at(tree);
- lvtInits.excl(adr);
- }
-
- @Override
- protected LVTAssignPendingExit createNewPendingExit(JCTree tree, Bits inits, Bits uninits) {
- return new LVTAssignPendingExit(tree, inits, uninits);
- }
-
- MethodSymbol currentMethod;
-
- @Override
- public void visitMethodDef(JCMethodDecl tree) {
- if ((tree.sym.flags() & (SYNTHETIC | GENERATEDCONSTR)) != 0
- && (tree.sym.flags() & LAMBDA_METHOD) == 0) {
- return;
- }
- if (tree.name.equals(names.clinit)) {
- return;
- }
- boolean enumClass = (tree.sym.owner.flags() & ENUM) != 0;
- if (enumClass &&
- (tree.name.equals(names.valueOf) ||
- tree.name.equals(names.values) ||
- tree.name.equals(names.init))) {
- return;
- }
- currentMethod = tree.sym;
-
- super.visitMethodDef(tree);
- }
-
- }
-
}
diff --git a/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/jvm/LVTRanges.java b/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/jvm/LVTRanges.java
deleted file mode 100644
index 71139ee78b6..00000000000
--- a/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/jvm/LVTRanges.java
+++ /dev/null
@@ -1,129 +0,0 @@
-/*
- * 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. 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.tools.javac.jvm;
-
-import java.util.Map;
-import java.util.Map.Entry;
-import java.util.WeakHashMap;
-
-import com.sun.tools.javac.code.Symbol.MethodSymbol;
-import com.sun.tools.javac.code.Symbol.VarSymbol;
-import com.sun.tools.javac.tree.JCTree;
-import com.sun.tools.javac.util.Context;
-import com.sun.tools.javac.util.List;
-
-/** This class contains a one to many relation between a tree and a set of variables.
- * The relation implies that the given tree closes the DA (definite assignment)
- * range for the set of variables.
- *
- * This is NOT part of any supported API.
- * If you write code that depends on this, you do so at your own risk.
- * This code and its internal interfaces are subject to change or
- * deletion without notice.
- */
-public class LVTRanges {
- /** The context key for the LVT ranges. */
- protected static final Context.Key lvtRangesKey = new Context.Key<>();
-
- /** Get the LVTRanges instance for this context. */
- public static LVTRanges instance(Context context) {
- LVTRanges instance = context.get(lvtRangesKey);
- if (instance == null) {
- instance = new LVTRanges(context);
- }
- return instance;
- }
-
- private static final long serialVersionUID = 1812267524140424433L;
-
- protected Context context;
-
- protected Map>>
- aliveRangeClosingTrees = new WeakHashMap<>();
-
- public LVTRanges(Context context) {
- this.context = context;
- context.put(lvtRangesKey, this);
- }
-
- public List getVars(MethodSymbol method, JCTree tree) {
- Map> varMap = aliveRangeClosingTrees.get(method);
- return (varMap != null) ? varMap.get(tree) : null;
- }
-
- public boolean containsKey(MethodSymbol method, JCTree tree) {
- Map> varMap = aliveRangeClosingTrees.get(method);
- if (varMap == null) {
- return false;
- }
- return varMap.containsKey(tree);
- }
-
- public void setEntry(MethodSymbol method, JCTree tree, List vars) {
- Map> varMap = aliveRangeClosingTrees.get(method);
- if (varMap != null) {
- varMap.put(tree, vars);
- } else {
- varMap = new WeakHashMap<>();
- varMap.put(tree, vars);
- aliveRangeClosingTrees.put(method, varMap);
- }
- }
-
- public List removeEntry(MethodSymbol method, JCTree tree) {
- Map> varMap = aliveRangeClosingTrees.get(method);
- if (varMap != null) {
- List result = varMap.remove(tree);
- if (varMap.isEmpty()) {
- aliveRangeClosingTrees.remove(method);
- }
- return result;
- }
- return null;
- }
-
- /* This method should be used for debugging LVT related issues.
- */
- @Override
- public String toString() {
- String result = "";
- for (Entry>> mainEntry: aliveRangeClosingTrees.entrySet()) {
- result += "Method: \n" + mainEntry.getKey().flatName() + "\n";
- int i = 1;
- for (Entry> treeEntry: mainEntry.getValue().entrySet()) {
- result += " Tree " + i + ": \n" + treeEntry.getKey().toString() + "\n";
- result += " Variables closed:\n";
- for (VarSymbol var: treeEntry.getValue()) {
- result += " " + var.toString();
- }
- result += "\n";
- i++;
- }
- }
- return result;
- }
-
-}
diff --git a/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/resources/compiler.properties b/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/resources/compiler.properties
index 89eeadaeaad..c736eac1106 100644
--- a/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/resources/compiler.properties
+++ b/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/resources/compiler.properties
@@ -1,5 +1,6 @@
+
#
-# Copyright (c) 1999, 2014, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 1999, 2015, 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
@@ -26,30 +27,50 @@
# Messages in this file which use "placeholders" for values (e.g. {0}, {1})
# are preceded by a stylized comment describing the type of the corresponding
# values.
-# The types currently in use are
+# The simple types currently in use are:
#
# boolean true or false
-# file name the name of an input file; e.g. MyFile.java
-# message segment a sub-message; see compiler.misc.*
+# diagnostic a sub-message; see compiler.misc.*
+# fragment similar to 'message segment', but with more specific type
# modifier a Java modifier; e.g. public, private, protected
+# file a file URL
+# file object a file URL - similar to 'file' but typically used for source/class files, hence more specific
# name a name, typically a Java identifier
# number an integer
# option name the name of a command line option
# source version a source version number, such as 1.5, 1.6, 1.7
# string a general string
# symbol the name of a declared type
-# symbol kind a description of the kind of a declaration; see compiler.misc.kindname.*
+# symbol kind the kind of a symbol (i.e. method, variable)
+# kind name an informative description of the kind of a declaration; see compiler.misc.kindname.*
# token the name of a non-terminal in source code; see compiler.misc.token.*
# type a Java type; e.g. int, X, X
+# object a Java object (unspecified)
# unused the value is not used in this message
#
+# The following compound types are also used:
+#
# list of X a comma-separated list of items; e.g. list of type
-# X or Y alternation; e.g. message segment or type
# set of X a comma-separated collection of items; e.g. set of modifier
#
-# These may be composed: e.g. list of type or message segment
+# These may be composed:
#
-# These comments are verified by the jtreg test test/tools/javac/diags/MessageInfo,
+# list of type or message segment
+#
+# The following type aliases are supported:
+#
+# message segment --> diagnostic or fragment
+# file name --> file or file object
+#
+# Custom comments are supported in parenthesis i.e.
+#
+# number (classfile major version)
+#
+# These comments are used internally in order to generate an enum-like class declaration containing
+# a method/field for each of the diagnostic keys listed here. Those methods/fields can then be used
+# by javac code to build diagnostics in a type-safe fashion.
+#
+# In addition, these comments are verified by the jtreg test test/tools/javac/diags/MessageInfo,
# using info derived from the collected set of examples in test/tools/javac/diags/examples.
# MessageInfo can also be run as a standalone utility providing more facilities
# for manipulating this file. For more details, see MessageInfo.java.
@@ -140,7 +161,7 @@ compiler.err.array.req.but.found=\
compiler.err.attribute.value.must.be.constant=\
element value must be a constant expression
-# 0: statement type
+# 0: string (statement type)
compiler.err.bad.initializer=\
bad initializer for {0}
@@ -360,7 +381,7 @@ compiler.err.invalid.repeatable.annotation.multiple.values=\
compiler.err.invalid.repeatable.annotation.invalid.value=\
{0} is not a valid @Repeatable: invalid value element
-# 0: symbol type, 1: unused, 2: type
+# 0: symbol or type, 1: unused, 2: type
compiler.err.invalid.repeatable.annotation.value.return=\
containing annotation type ({0}) must declare an element named ''value'' of type {2}
@@ -832,7 +853,7 @@ compiler.err.warnings.and.werror=\
# Errors related to annotation processing
-# 0: symbol, 1: string, 2: stack-trace
+# 0: symbol, 1: string, 2: string (stack-trace)
compiler.err.proc.cant.access=\
cannot access {0}\n\
{1}\n\
@@ -984,15 +1005,15 @@ compiler.err.type.var.more.than.once.in.result=\
compiler.err.types.incompatible.diff.ret=\
types {0} and {1} are incompatible; both define {2}, but with unrelated return types
-# 0: kind, 1: type, 2: name, 3: list of type, 4: symbol, 5: symbol
+# 0: kind name, 1: type, 2: name, 3: list of type, 4: symbol, 5: symbol
compiler.err.types.incompatible.unrelated.defaults=\
{0} {1} inherits unrelated defaults for {2}({3}) from types {4} and {5}
-# 0: kind, 1: type, 2: name, 3: list of type, 4: symbol, 5: symbol
+# 0: kind name, 1: type, 2: name, 3: list of type, 4: symbol, 5: symbol
compiler.err.types.incompatible.abstract.default=\
{0} {1} inherits abstract and default for {2}({3}) from types {4} and {5}
-# 0: name, 1: kind, 2: symbol
+# 0: name, 1: kind name, 2: symbol
compiler.err.default.overrides.object.member=\
default method {0} in {1} {2} overrides a member of java.lang.Object
@@ -1747,11 +1768,11 @@ compiler.err.cant.access=\
cannot access {0}\n\
{1}
-# 0: class name
+# 0: name
compiler.misc.bad.class.file=\
class file is invalid for class {0}
-# 0: file name, 1: expected CP entry type, 2: constant pool index
+# 0: file name, 1: string (expected constant pool entry type), 2: number (constant pool index)
compiler.misc.bad.const.pool.entry=\
bad constant pool entry in {0}\n\
expected {1} at index {2}
@@ -1802,11 +1823,11 @@ compiler.misc.class.file.wrong.class=\
compiler.misc.class.file.not.found=\
class file for {0} not found
-# 0: classfile major version, 1: classfile minor version
+# 0: string (classfile major version), 1: string (classfile minor version)
compiler.misc.invalid.default.interface=\
default method found in version {0}.{1} classfile
-# 0: classfile major version, 1: classfile minor version
+# 0: string (classfile major version), 1: string (classfile minor version)
compiler.misc.invalid.static.interface=\
static method found in version {0}.{1} classfile
@@ -2422,7 +2443,7 @@ compiler.misc.not.applicable.method.found=\
compiler.misc.partial.inst.sig=\
partially instantiated to: {0}
-# 0: name, 1: symbol, 2: number, 3: MethodResolutionPhase, 4: list of type or message segment, 5: list of type or message segment
+# 0: name, 1: symbol, 2: number, 3: string (method resolution phase), 4: list of type or message segment, 5: list of type or message segment
compiler.note.verbose.resolve.multi=\
resolving method {0} in type {1} to candidate {2}\n\
phase: {3}\n\
@@ -2430,7 +2451,7 @@ compiler.note.verbose.resolve.multi=\
with type-args: {5}\n\
candidates:
-# 0: name, 1: symbol, 2: unused, 3: MethodResolutionPhase, 4: list of type or message segment, 5: list of type or message segment
+# 0: name, 1: symbol, 2: unused, 3: string (method resolution phase), 4: list of type or message segment, 5: list of type or message segment
compiler.note.verbose.resolve.multi.1=\
erroneous resolution for method {0} in type {1}\n\
phase: {3}\n\
diff --git a/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/tree/DCTree.java b/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/tree/DCTree.java
index cab1eaa4980..816959cd81e 100644
--- a/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/tree/DCTree.java
+++ b/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/tree/DCTree.java
@@ -329,7 +329,7 @@ public abstract class DCTree implements DocTree {
DCErroneous(String body, JCDiagnostic.Factory diags, DiagnosticSource diagSource, String code, Object... args) {
this.body = body;
- this.diag = diags.error(diagSource, this, code, args);
+ this.diag = diags.error(null, diagSource, this, code, args);
}
@Override @DefinedBy(Api.COMPILER_TREE)
diff --git a/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/util/AbstractLog.java b/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/util/AbstractLog.java
index 8acbb877778..83ecc9d1737 100644
--- a/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/util/AbstractLog.java
+++ b/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/util/AbstractLog.java
@@ -31,6 +31,9 @@ import javax.tools.JavaFileObject;
import com.sun.tools.javac.code.Lint.LintCategory;
import com.sun.tools.javac.util.JCDiagnostic.DiagnosticFlag;
+import com.sun.tools.javac.util.JCDiagnostic.Error;
+import com.sun.tools.javac.util.JCDiagnostic.Note;
+import com.sun.tools.javac.util.JCDiagnostic.Warning;
import com.sun.tools.javac.util.JCDiagnostic.DiagnosticPosition;
import com.sun.tools.javac.util.JCDiagnostic.SimpleDiagnosticPosition;
@@ -93,7 +96,15 @@ public abstract class AbstractLog {
* @param args Fields of the error message.
*/
public void error(String key, Object ... args) {
- report(diags.error(source, null, key, args));
+ error(diags.errorKey(key, args));
+ }
+
+ /** Report an error, unless another error was already reported at same
+ * source position.
+ * @param errorKey The key for the localized error message.
+ */
+ public void error(Error errorKey) {
+ report(diags.error(null, source, null, errorKey));
}
/** Report an error, unless another error was already reported at same
@@ -102,8 +113,17 @@ public abstract class AbstractLog {
* @param key The key for the localized error message.
* @param args Fields of the error message.
*/
- public void error(DiagnosticPosition pos, String key, Object ... args) {
- report(diags.error(source, pos, key, args));
+ public void error(DiagnosticPosition pos, String key, Object... args) {
+ error(pos, diags.errorKey(key, args));
+ }
+
+ /** Report an error, unless another error was already reported at same
+ * source position.
+ * @param pos The source position at which to report the error.
+ * @param errorKey The key for the localized error message.
+ */
+ public void error(DiagnosticPosition pos, Error errorKey) {
+ report(diags.error(null, source, pos, errorKey));
}
/** Report an error, unless another error was already reported at same
@@ -114,9 +134,17 @@ public abstract class AbstractLog {
* @param args Fields of the error message.
*/
public void error(DiagnosticFlag flag, DiagnosticPosition pos, String key, Object ... args) {
- JCDiagnostic d = diags.error(source, pos, key, args);
- d.setFlag(flag);
- report(d);
+ error(flag, pos, diags.errorKey(key, args));
+ }
+
+ /** Report an error, unless another error was already reported at same
+ * source position.
+ * @param flag A flag to set on the diagnostic
+ * @param pos The source position at which to report the error.
+ * @param errorKey The key for the localized error message.
+ */
+ public void error(DiagnosticFlag flag, DiagnosticPosition pos, Error errorKey) {
+ report(diags.error(flag, source, pos, errorKey));
}
/** Report an error, unless another error was already reported at same
@@ -126,7 +154,16 @@ public abstract class AbstractLog {
* @param args Fields of the error message.
*/
public void error(int pos, String key, Object ... args) {
- report(diags.error(source, wrap(pos), key, args));
+ error(pos, diags.errorKey(key, args));
+ }
+
+ /** Report an error, unless another error was already reported at same
+ * source position.
+ * @param pos The source position at which to report the error.
+ * @param errorKey The key for the localized error message.
+ */
+ public void error(int pos, Error errorKey) {
+ report(diags.error(null, source, wrap(pos), errorKey));
}
/** Report an error, unless another error was already reported at same
@@ -137,9 +174,17 @@ public abstract class AbstractLog {
* @param args Fields of the error message.
*/
public void error(DiagnosticFlag flag, int pos, String key, Object ... args) {
- JCDiagnostic d = diags.error(source, wrap(pos), key, args);
- d.setFlag(flag);
- report(d);
+ error(flag, pos, diags.errorKey(key, args));
+ }
+
+ /** Report an error, unless another error was already reported at same
+ * source position.
+ * @param flag A flag to set on the diagnostic
+ * @param pos The source position at which to report the error.
+ * @param errorKey The key for the localized error message.
+ */
+ public void error(DiagnosticFlag flag, int pos, Error errorKey) {
+ report(diags.error(flag, source, wrap(pos), errorKey));
}
/** Report a warning, unless suppressed by the -nowarn option or the
@@ -148,7 +193,15 @@ public abstract class AbstractLog {
* @param args Fields of the warning message.
*/
public void warning(String key, Object ... args) {
- report(diags.warning(source, null, key, args));
+ warning(diags.warningKey(key, args));
+ }
+
+ /** Report a warning, unless suppressed by the -nowarn option or the
+ * maximum number of warnings has been reached.
+ * @param warningKey The key for the localized warning message.
+ */
+ public void warning(Warning warningKey) {
+ report(diags.warning(null, source, null, warningKey));
}
/** Report a lint warning, unless suppressed by the -nowarn option or the
@@ -158,7 +211,16 @@ public abstract class AbstractLog {
* @param args Fields of the warning message.
*/
public void warning(LintCategory lc, String key, Object ... args) {
- report(diags.warning(lc, key, args));
+ warning(lc, diags.warningKey(key, args));
+ }
+
+ /** Report a lint warning, unless suppressed by the -nowarn option or the
+ * maximum number of warnings has been reached.
+ * @param lc The lint category for the diagnostic
+ * @param warningKey The key for the localized warning message.
+ */
+ public void warning(LintCategory lc, Warning warningKey) {
+ report(diags.warning(lc, null, null, warningKey));
}
/** Report a warning, unless suppressed by the -nowarn option or the
@@ -168,7 +230,16 @@ public abstract class AbstractLog {
* @param args Fields of the warning message.
*/
public void warning(DiagnosticPosition pos, String key, Object ... args) {
- report(diags.warning(source, pos, key, args));
+ warning(pos, diags.warningKey(key, args));
+ }
+
+ /** Report a warning, unless suppressed by the -nowarn option or the
+ * maximum number of warnings has been reached.
+ * @param pos The source position at which to report the warning.
+ * @param warningKey The key for the localized warning message.
+ */
+ public void warning(DiagnosticPosition pos, Warning warningKey) {
+ report(diags.warning(null, source, pos, warningKey));
}
/** Report a lint warning, unless suppressed by the -nowarn option or the
@@ -179,7 +250,17 @@ public abstract class AbstractLog {
* @param args Fields of the warning message.
*/
public void warning(LintCategory lc, DiagnosticPosition pos, String key, Object ... args) {
- report(diags.warning(lc, source, pos, key, args));
+ warning(lc, pos, diags.warningKey(key, args));
+ }
+
+ /** Report a lint warning, unless suppressed by the -nowarn option or the
+ * maximum number of warnings has been reached.
+ * @param lc The lint category for the diagnostic
+ * @param pos The source position at which to report the warning.
+ * @param warningKey The key for the localized warning message.
+ */
+ public void warning(LintCategory lc, DiagnosticPosition pos, Warning warningKey) {
+ report(diags.warning(lc, source, pos, warningKey));
}
/** Report a warning, unless suppressed by the -nowarn option or the
@@ -189,7 +270,16 @@ public abstract class AbstractLog {
* @param args Fields of the warning message.
*/
public void warning(int pos, String key, Object ... args) {
- report(diags.warning(source, wrap(pos), key, args));
+ warning(pos, diags.warningKey(key, args));
+ }
+
+ /** Report a warning, unless suppressed by the -nowarn option or the
+ * maximum number of warnings has been reached.
+ * @param pos The source position at which to report the warning.
+ * @param warningKey The key for the localized warning message.
+ */
+ public void warning(int pos, Warning warningKey) {
+ report(diags.warning(null, source, wrap(pos), warningKey));
}
/** Report a warning.
@@ -198,7 +288,15 @@ public abstract class AbstractLog {
* @param args Fields of the warning message.
*/
public void mandatoryWarning(DiagnosticPosition pos, String key, Object ... args) {
- report(diags.mandatoryWarning(source, pos, key, args));
+ mandatoryWarning(pos, diags.warningKey(key, args));
+ }
+
+ /** Report a warning.
+ * @param pos The source position at which to report the warning.
+ * @param warningKey The key for the localized warning message.
+ */
+ public void mandatoryWarning(DiagnosticPosition pos, Warning warningKey) {
+ report(diags.mandatoryWarning(null, source, pos, warningKey));
}
/** Report a warning.
@@ -208,7 +306,16 @@ public abstract class AbstractLog {
* @param args Fields of the warning message.
*/
public void mandatoryWarning(LintCategory lc, DiagnosticPosition pos, String key, Object ... args) {
- report(diags.mandatoryWarning(lc, source, pos, key, args));
+ mandatoryWarning(lc, pos, diags.warningKey(key, args));
+ }
+
+ /** Report a warning.
+ * @param lc The lint category for the diagnostic
+ * @param pos The source position at which to report the warning.
+ * @param warningKey The key for the localized warning message.
+ */
+ public void mandatoryWarning(LintCategory lc, DiagnosticPosition pos, Warning warningKey) {
+ report(diags.mandatoryWarning(lc, source, pos, warningKey));
}
/** Provide a non-fatal notification, unless suppressed by the -nowarn option.
@@ -216,7 +323,14 @@ public abstract class AbstractLog {
* @param args Fields of the notint an error or warning message:
*/
public void note(String key, Object ... args) {
- report(diags.note(source, null, key, args));
+ note(diags.noteKey(key, args));
+ }
+
+ /** Provide a non-fatal notification, unless suppressed by the -nowarn option.
+ * @param noteKey The key for the localized notification message.
+ */
+ public void note(Note noteKey) {
+ report(diags.note(source, null, noteKey));
}
/** Provide a non-fatal notification, unless suppressed by the -nowarn option.
@@ -224,7 +338,14 @@ public abstract class AbstractLog {
* @param args Fields of the notification message.
*/
public void note(DiagnosticPosition pos, String key, Object ... args) {
- report(diags.note(source, pos, key, args));
+ note(pos, diags.noteKey(key, args));
+ }
+
+ /** Provide a non-fatal notification, unless suppressed by the -nowarn option.
+ * @param noteKey The key for the localized notification message.
+ */
+ public void note(DiagnosticPosition pos, Note noteKey) {
+ report(diags.note(source, pos, noteKey));
}
/** Provide a non-fatal notification, unless suppressed by the -nowarn option.
@@ -232,7 +353,14 @@ public abstract class AbstractLog {
* @param args Fields of the notification message.
*/
public void note(int pos, String key, Object ... args) {
- report(diags.note(source, wrap(pos), key, args));
+ note(pos, diags.noteKey(key, args));
+ }
+
+ /** Provide a non-fatal notification, unless suppressed by the -nowarn option.
+ * @param noteKey The key for the localized notification message.
+ */
+ public void note(int pos, Note noteKey) {
+ report(diags.note(source, wrap(pos), noteKey));
}
/** Provide a non-fatal notification, unless suppressed by the -nowarn option.
@@ -240,7 +368,14 @@ public abstract class AbstractLog {
* @param args Fields of the notification message.
*/
public void note(JavaFileObject file, String key, Object ... args) {
- report(diags.note(getSource(file), null, key, args));
+ note(file, diags.noteKey(key, args));
+ }
+
+ /** Provide a non-fatal notification, unless suppressed by the -nowarn option.
+ * @param noteKey The key for the localized notification message.
+ */
+ public void note(JavaFileObject file, Note noteKey) {
+ report(diags.note(getSource(file), null, noteKey));
}
/** Provide a non-fatal notification, unless suppressed by the -nowarn option.
@@ -248,7 +383,14 @@ public abstract class AbstractLog {
* @param args Fields of the notification message.
*/
public void mandatoryNote(final JavaFileObject file, String key, Object ... args) {
- report(diags.mandatoryNote(getSource(file), key, args));
+ mandatoryNote(file, diags.noteKey(key, args));
+ }
+
+ /** Provide a non-fatal notification, unless suppressed by the -nowarn option.
+ * @param noteKey The key for the localized notification message.
+ */
+ public void mandatoryNote(final JavaFileObject file, Note noteKey) {
+ report(diags.mandatoryNote(getSource(file), noteKey));
}
protected abstract void report(JCDiagnostic diagnostic);
diff --git a/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/util/JCDiagnostic.java b/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/util/JCDiagnostic.java
index 8e3f3e2e6c0..2c8780f9b75 100644
--- a/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/util/JCDiagnostic.java
+++ b/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/util/JCDiagnostic.java
@@ -28,6 +28,7 @@ package com.sun.tools.javac.util;
import java.util.EnumSet;
import java.util.Locale;
import java.util.Set;
+import java.util.stream.Stream;
import javax.tools.Diagnostic;
import javax.tools.JavaFileObject;
@@ -92,28 +93,30 @@ public class JCDiagnostic implements Diagnostic {
}
/**
- * Create an error diagnostic.
+ * Create an error diagnostic
* @param source The source of the compilation unit, if any, in which to report the error.
* @param pos The source position at which to report the error.
* @param key The key for the localized error message.
* @param args Fields of the error message.
*/
public JCDiagnostic error(
- DiagnosticSource source, DiagnosticPosition pos, String key, Object... args) {
- return create(ERROR, null, defaultErrorFlags, source, pos, key, args);
+ DiagnosticFlag flag, DiagnosticSource source, DiagnosticPosition pos, String key, Object... args) {
+ return error(flag, source, pos, errorKey(key, args));
}
/**
- * Create a warning diagnostic that will not be hidden by the -nowarn or -Xlint:none options.
- * @param source The source of the compilation unit, if any, in which to report the warning.
- * @param pos The source position at which to report the warning.
- * @param key The key for the localized warning message.
- * @param args Fields of the warning message.
- * @see MandatoryWarningHandler
+ * Create an error diagnostic
+ * @param source The source of the compilation unit, if any, in which to report the error.
+ * @param pos The source position at which to report the error.
+ * @param errorKey The key for the localized error message.
*/
- public JCDiagnostic mandatoryWarning(
- DiagnosticSource source, DiagnosticPosition pos, String key, Object... args) {
- return create(WARNING, null, EnumSet.of(DiagnosticFlag.MANDATORY), source, pos, key, args);
+ public JCDiagnostic error(
+ DiagnosticFlag flag, DiagnosticSource source, DiagnosticPosition pos, Error errorKey) {
+ JCDiagnostic diag = create(null, defaultErrorFlags, source, pos, errorKey);
+ if (flag != null) {
+ diag.setFlag(flag);
+ }
+ return diag;
}
/**
@@ -128,31 +131,35 @@ public class JCDiagnostic implements Diagnostic {
public JCDiagnostic mandatoryWarning(
LintCategory lc,
DiagnosticSource source, DiagnosticPosition pos, String key, Object... args) {
- return create(WARNING, lc, EnumSet.of(DiagnosticFlag.MANDATORY), source, pos, key, args);
+ return mandatoryWarning(lc, source, pos, warningKey(key, args));
+ }
+
+ /**
+ * Create a warning diagnostic that will not be hidden by the -nowarn or -Xlint:none options.
+ * @param lc The lint category for the diagnostic
+ * @param source The source of the compilation unit, if any, in which to report the warning.
+ * @param pos The source position at which to report the warning.
+ * @param warningKey The key for the localized warning message.
+ * @see MandatoryWarningHandler
+ */
+ public JCDiagnostic mandatoryWarning(
+ LintCategory lc,
+ DiagnosticSource source, DiagnosticPosition pos, Warning warningKey) {
+ return create(lc, EnumSet.of(DiagnosticFlag.MANDATORY), source, pos, warningKey);
}
/**
* Create a warning diagnostic.
* @param lc The lint category for the diagnostic
+ * @param source The source of the compilation unit, if any, in which to report the warning.
+ * @param pos The source position at which to report the warning.
* @param key The key for the localized error message.
* @param args Fields of the warning message.
* @see MandatoryWarningHandler
*/
public JCDiagnostic warning(
- LintCategory lc, String key, Object... args) {
- return create(WARNING, lc, EnumSet.noneOf(DiagnosticFlag.class), null, null, key, args);
- }
-
- /**
- * Create a warning diagnostic.
- * @param source The source of the compilation unit, if any, in which to report the warning.
- * @param pos The source position at which to report the warning.
- * @param key The key for the localized warning message.
- * @param args Fields of the warning message.
- */
- public JCDiagnostic warning(
- DiagnosticSource source, DiagnosticPosition pos, String key, Object... args) {
- return create(WARNING, null, EnumSet.noneOf(DiagnosticFlag.class), source, pos, key, args);
+ LintCategory lc, DiagnosticSource source, DiagnosticPosition pos, String key, Object... args) {
+ return warning(lc, source, pos, warningKey(key, args));
}
/**
@@ -160,23 +167,32 @@ public class JCDiagnostic implements Diagnostic {
* @param lc The lint category for the diagnostic
* @param source The source of the compilation unit, if any, in which to report the warning.
* @param pos The source position at which to report the warning.
- * @param key The key for the localized warning message.
- * @param args Fields of the warning message.
+ * @param warningKey The key for the localized warning message.
* @see MandatoryWarningHandler
*/
public JCDiagnostic warning(
- LintCategory lc, DiagnosticSource source, DiagnosticPosition pos, String key, Object... args) {
- return create(WARNING, lc, EnumSet.noneOf(DiagnosticFlag.class), source, pos, key, args);
+ LintCategory lc, DiagnosticSource source, DiagnosticPosition pos, Warning warningKey) {
+ return create(lc, EnumSet.noneOf(DiagnosticFlag.class), source, pos, warningKey);
}
/**
* Create a note diagnostic that will not be hidden by the -nowarn or -Xlint:none options.
- * @param key The key for the localized message.
- * @param args Fields of the message.
+ * @param source The source of the compilation unit, if any, in which to report the warning.
+ * @param key The key for the localized warning message.
+ * @param args Fields of the warning message.
* @see MandatoryWarningHandler
*/
public JCDiagnostic mandatoryNote(DiagnosticSource source, String key, Object... args) {
- return create(NOTE, null, EnumSet.of(DiagnosticFlag.MANDATORY), source, null, key, args);
+ return mandatoryNote(source, noteKey(key, args));
+ }
+
+ /**
+ * Create a note diagnostic that will not be hidden by the -nowarn or -Xlint:none options.
+ * @param noteKey The key for the localized note message.
+ * @see MandatoryWarningHandler
+ */
+ public JCDiagnostic mandatoryNote(DiagnosticSource source, Note noteKey) {
+ return create(null, EnumSet.of(DiagnosticFlag.MANDATORY), source, null, noteKey);
}
/**
@@ -184,20 +200,20 @@ public class JCDiagnostic implements Diagnostic {
* @param key The key for the localized error message.
* @param args Fields of the message.
*/
- public JCDiagnostic note(String key, Object... args) {
- return create(NOTE, null, EnumSet.noneOf(DiagnosticFlag.class), null, null, key, args);
+ public JCDiagnostic note(
+ DiagnosticSource source, DiagnosticPosition pos, String key, Object... args) {
+ return note(source, pos, noteKey(key, args));
}
/**
* Create a note diagnostic.
* @param source The source of the compilation unit, if any, in which to report the note.
* @param pos The source position at which to report the note.
- * @param key The key for the localized message.
- * @param args Fields of the message.
+ * @param noteKey The key for the localized note message.
*/
public JCDiagnostic note(
- DiagnosticSource source, DiagnosticPosition pos, String key, Object... args) {
- return create(NOTE, null, EnumSet.noneOf(DiagnosticFlag.class), source, pos, key, args);
+ DiagnosticSource source, DiagnosticPosition pos, Note noteKey) {
+ return create(null, EnumSet.noneOf(DiagnosticFlag.class), source, pos, noteKey);
}
/**
@@ -206,7 +222,15 @@ public class JCDiagnostic implements Diagnostic {
* @param args Fields of the message.
*/
public JCDiagnostic fragment(String key, Object... args) {
- return create(FRAGMENT, null, EnumSet.noneOf(DiagnosticFlag.class), null, null, key, args);
+ return fragment(fragmentKey(key, args));
+ }
+
+ /**
+ * Create a fragment diagnostic, for use as an argument in other diagnostics
+ * @param fragmentKey The key for the localized subdiagnostic message.
+ */
+ public JCDiagnostic fragment(Fragment fragmentKey) {
+ return create(null, EnumSet.noneOf(DiagnosticFlag.class), null, null, fragmentKey);
}
/**
@@ -220,7 +244,19 @@ public class JCDiagnostic implements Diagnostic {
*/
public JCDiagnostic create(
DiagnosticType kind, DiagnosticSource source, DiagnosticPosition pos, String key, Object... args) {
- return create(kind, null, EnumSet.noneOf(DiagnosticFlag.class), source, pos, key, args);
+ return create(null, EnumSet.noneOf(DiagnosticFlag.class), source, pos, DiagnosticInfo.of(kind, prefix, key, args));
+ }
+
+ /**
+ * Create a new diagnostic of the given kind, which is not mandatory and which has
+ * no lint category.
+ * @param source The source of the compilation unit, if any, in which to report the message.
+ * @param pos The source position at which to report the message.
+ * @param diagnosticInfo The key for the localized message.
+ */
+ public JCDiagnostic create(
+ DiagnosticSource source, DiagnosticPosition pos, DiagnosticInfo diagnosticInfo) {
+ return create(null, EnumSet.noneOf(DiagnosticFlag.class), source, pos, diagnosticInfo);
}
/**
@@ -233,13 +269,59 @@ public class JCDiagnostic implements Diagnostic {
* @param key The key for the localized message.
* @param args Fields of the message.
*/
- public JCDiagnostic create(
- DiagnosticType kind, LintCategory lc, Set flags, DiagnosticSource source, DiagnosticPosition pos, String key, Object... args) {
- return new JCDiagnostic(formatter, kind, lc, flags, source, pos, qualify(kind, key), args);
+ public JCDiagnostic create(DiagnosticType kind,
+ LintCategory lc, Set flags, DiagnosticSource source, DiagnosticPosition pos, String key, Object... args) {
+ return create(lc, flags, source, pos, DiagnosticInfo.of(kind, prefix, key, args));
}
- protected String qualify(DiagnosticType t, String key) {
- return prefix + "." + t.key + "." + key;
+ /**
+ * Create a new diagnostic with given key.
+ * @param lc The lint category, if applicable, or null
+ * @param flags The set of flags for the diagnostic
+ * @param source The source of the compilation unit, if any, in which to report the message.
+ * @param pos The source position at which to report the message.
+ * @param diagnosticInfo The key for the localized message.
+ */
+ public JCDiagnostic create(
+ LintCategory lc, Set flags, DiagnosticSource source, DiagnosticPosition pos, DiagnosticInfo diagnosticInfo) {
+ return new JCDiagnostic(formatter, normalize(diagnosticInfo), lc, flags, source, pos);
+ }
+ //where
+ DiagnosticInfo normalize(DiagnosticInfo diagnosticInfo) {
+ //replace all nested FragmentKey with full-blown JCDiagnostic objects
+ return DiagnosticInfo.of(diagnosticInfo.type, diagnosticInfo.prefix, diagnosticInfo.code,
+ Stream.of(diagnosticInfo.args).map(o -> {
+ return (o instanceof Fragment) ?
+ fragment((Fragment)o) : o;
+ }).toArray());
+ }
+
+ /**
+ * Create a new error key.
+ */
+ Error errorKey(String code, Object... args) {
+ return (Error)DiagnosticInfo.of(ERROR, prefix, code, args);
+ }
+
+ /**
+ * Create a new warning key.
+ */
+ Warning warningKey(String code, Object... args) {
+ return (Warning)DiagnosticInfo.of(WARNING, prefix, code, args);
+ }
+
+ /**
+ * Create a new note key.
+ */
+ Note noteKey(String code, Object... args) {
+ return (Note)DiagnosticInfo.of(NOTE, prefix, code, args);
+ }
+
+ /**
+ * Create a new fragment key.
+ */
+ Fragment fragmentKey(String code, Object... args) {
+ return (Fragment)DiagnosticInfo.of(FRAGMENT, prefix, code, args);
}
}
@@ -254,13 +336,14 @@ public class JCDiagnostic implements Diagnostic {
@Deprecated
public static JCDiagnostic fragment(String key, Object... args) {
return new JCDiagnostic(getFragmentFormatter(),
- FRAGMENT,
+ DiagnosticInfo.of(FRAGMENT,
+ "compiler",
+ key,
+ args),
null,
EnumSet.noneOf(DiagnosticFlag.class),
null,
- null,
- "compiler." + FRAGMENT.key + "." + key,
- args);
+ null);
}
//where
@Deprecated
@@ -352,11 +435,9 @@ public class JCDiagnostic implements Diagnostic {
COMPRESSED
}
- private final DiagnosticType type;
private final DiagnosticSource source;
private final DiagnosticPosition position;
- private final String key;
- protected final Object[] args;
+ private final DiagnosticInfo diagnosticInfo;
private final Set flags;
private final LintCategory lintCategory;
@@ -390,35 +471,121 @@ public class JCDiagnostic implements Diagnostic {
}
}
+ /**
+ * A diagnostic key object encapsulates basic properties of a diagnostic, such as the resource key,
+ * the arguments and the kind associated with the diagnostic object. Diagnostic keys can be either
+ * created programmatically (by using the supplied factory method) or obtained through build-time
+ * generated factory methods.
+ */
+ public static abstract class DiagnosticInfo {
+
+ /** The diagnostic kind (i.e. error). */
+ DiagnosticType type;
+
+ /** The diagnostic prefix (i.e. 'javac'); used to compute full resource key. */
+ String prefix;
+
+ /** The diagnostic code (i.e. 'cannot.resolve.sym'); together with {@code prefix} it forms
+ * the full resource key. */
+ String code;
+
+ /** The diagnostic arguments. */
+ Object[] args;
+
+ private DiagnosticInfo(DiagnosticType type, String prefix, String code, Object... args) {
+ this.type = type;
+ this.prefix = prefix;
+ this.code = code;
+ this.args = args;
+ }
+
+ /**
+ * Compute the resource key.
+ */
+ public String key() {
+ return prefix + "." + type.key + "." + code;
+ }
+
+ /**
+ * Static factory method; build a custom diagnostic key using given kind, prefix, code and args.
+ */
+ public static DiagnosticInfo of(DiagnosticType type, String prefix, String code, Object... args) {
+ switch (type) {
+ case ERROR:
+ return new Error(prefix, code, args);
+ case WARNING:
+ return new Warning(prefix, code, args);
+ case NOTE:
+ return new Note(prefix, code, args);
+ case FRAGMENT:
+ return new Fragment(prefix, code, args);
+ default:
+ Assert.error("Wrong diagnostic type: " + type);
+ return null;
+ }
+ }
+
+ }
+
+ /**
+ * Class representing error diagnostic keys.
+ */
+ public static final class Error extends DiagnosticInfo {
+ public Error(String prefix, String key, Object... args) {
+ super(DiagnosticType.ERROR, prefix, key, args);
+ }
+ }
+
+ /**
+ * Class representing warning diagnostic keys.
+ */
+ public static final class Warning extends DiagnosticInfo {
+ public Warning(String prefix, String key, Object... args) {
+ super(DiagnosticType.WARNING, prefix, key, args);
+ }
+ }
+
+ /**
+ * Class representing note diagnostic keys.
+ */
+ public static final class Note extends DiagnosticInfo {
+ public Note(String prefix, String key, Object... args) {
+ super(DiagnosticType.NOTE, prefix, key, args);
+ }
+ }
+
+ /**
+ * Class representing fragment diagnostic keys.
+ */
+ public static final class Fragment extends DiagnosticInfo {
+ public Fragment(String prefix, String key, Object... args) {
+ super(DiagnosticType.FRAGMENT, prefix, key, args);
+ }
+ }
+
/**
* Create a diagnostic object.
* @param formatter the formatter to use for the diagnostic
- * @param dt the type of diagnostic
+ * @param diagnosticInfo the diagnostic key
* @param lc the lint category for the diagnostic
* @param source the name of the source file, or null if none.
* @param pos the character offset within the source file, if given.
- * @param key a resource key to identify the text of the diagnostic
- * @param args arguments to be included in the text of the diagnostic
*/
protected JCDiagnostic(DiagnosticFormatter formatter,
- DiagnosticType dt,
+ DiagnosticInfo diagnosticInfo,
LintCategory lc,
Set flags,
DiagnosticSource source,
- DiagnosticPosition pos,
- String key,
- Object... args) {
+ DiagnosticPosition pos) {
if (source == null && pos != null && pos.getPreferredPosition() != Position.NOPOS)
throw new IllegalArgumentException();
this.defaultFormatter = formatter;
- this.type = dt;
+ this.diagnosticInfo = diagnosticInfo;
this.lintCategory = lc;
this.flags = flags;
this.source = source;
this.position = pos;
- this.key = key;
- this.args = args;
}
/**
@@ -426,7 +593,7 @@ public class JCDiagnostic implements Diagnostic {
* @return the type of this diagnostic
*/
public DiagnosticType getType() {
- return type;
+ return diagnosticInfo.type;
}
/**
@@ -543,7 +710,7 @@ public class JCDiagnostic implements Diagnostic {
* @return the arguments to be included in the text of the diagnostic
*/
public Object[] getArgs() {
- return args;
+ return diagnosticInfo.args;
}
/**
@@ -551,7 +718,7 @@ public class JCDiagnostic implements Diagnostic {
* @return the prefix string associated with this type of diagnostic
*/
public String getPrefix() {
- return getPrefix(type);
+ return getPrefix(diagnosticInfo.type);
}
/**
@@ -567,7 +734,7 @@ public class JCDiagnostic implements Diagnostic {
*/
@Override
public String toString() {
- return defaultFormatter.format(this,Locale.getDefault());
+ return defaultFormatter.format(this, Locale.getDefault());
}
private DiagnosticFormatter defaultFormatter;
@@ -578,7 +745,7 @@ public class JCDiagnostic implements Diagnostic {
@DefinedBy(Api.COMPILER)
public Diagnostic.Kind getKind() {
- switch (type) {
+ switch (diagnosticInfo.type) {
case NOTE:
return Diagnostic.Kind.NOTE;
case WARNING:
@@ -594,7 +761,7 @@ public class JCDiagnostic implements Diagnostic {
@DefinedBy(Api.COMPILER)
public String getCode() {
- return key;
+ return diagnosticInfo.key();
}
@DefinedBy(Api.COMPILER)
@@ -605,7 +772,7 @@ public class JCDiagnostic implements Diagnostic {
public void setFlag(DiagnosticFlag flag) {
flags.add(flag);
- if (type == DiagnosticType.ERROR) {
+ if (diagnosticInfo.type == DiagnosticType.ERROR) {
switch (flag) {
case SYNTAX:
flags.remove(DiagnosticFlag.RECOVERABLE);
@@ -627,13 +794,11 @@ public class JCDiagnostic implements Diagnostic {
public MultilineDiagnostic(JCDiagnostic other, List subdiagnostics) {
super(other.defaultFormatter,
- other.getType(),
+ other.diagnosticInfo,
other.getLintCategory(),
other.flags,
other.getDiagnosticSource(),
- other.position,
- other.getCode(),
- other.getArgs());
+ other.position);
this.subdiagnostics = subdiagnostics;
}
diff --git a/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/util/Log.java b/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/util/Log.java
index 2bd1ee5b9e9..cb4cc93b284 100644
--- a/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/util/Log.java
+++ b/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/util/Log.java
@@ -535,7 +535,7 @@ public class Log extends AbstractLog {
* @param args Fields of the warning message.
*/
public void strictWarning(DiagnosticPosition pos, String key, Object ... args) {
- writeDiagnostic(diags.warning(source, pos, key, args));
+ writeDiagnostic(diags.warning(null, source, pos, key, args));
nwarnings++;
}
diff --git a/langtools/test/tools/javac/BranchToFewerDefines.java b/langtools/test/tools/javac/BranchToFewerDefines.java
new file mode 100644
index 00000000000..dabdff64d32
--- /dev/null
+++ b/langtools/test/tools/javac/BranchToFewerDefines.java
@@ -0,0 +1,111 @@
+/*
+ * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * 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 8067429
+ * @summary java.lang.VerifyError: Inconsistent stackmap frames at branch target
+ * @author srikanth
+ *
+ * @compile BranchToFewerDefines.java
+ * @run main BranchToFewerDefines
+ */
+
+public class BranchToFewerDefines {
+ public static void main(String[] args) {
+ }
+ private void problematicMethod(int p) {
+ switch (p) {
+ case 3:
+ long n;
+ while (true) {
+ if (false) {
+ break;
+ }
+ }
+ break;
+ case 2:
+ loop: while (true) {
+ while (true) {
+ int i = 4;
+ if (p != 16) {
+ return;
+ }
+ break loop;
+ }
+ }
+ break;
+ default:
+ while (true) {
+ if (false) {
+ break;
+ }
+ }
+ break;
+ }
+ long b;
+ if (p != 7) {
+ switch (p) {
+ case 1:
+ long a = 17;
+ break;
+ case 2:
+ break;
+ default:
+ break;
+ }
+ }
+ }
+ private void problematicMethod2(int p) {
+ switch (p) {
+ case 3:
+ long n;
+ {
+ int i = 4;
+ break;
+ }
+ case 2:
+ {
+ int i = 4;
+ break;
+ }
+ default:
+ {
+ int i = 4;
+ break;
+ }
+ }
+ long b;
+ if (p != 7) {
+ switch (p) {
+ case 1:
+ long a = 17;
+ break;
+ case 2:
+ break;
+ default:
+ break;
+ }
+ }
+ }
+}
diff --git a/langtools/test/tools/javac/ConstFoldTest.java b/langtools/test/tools/javac/ConstFoldTest.java
index e9b6c117472..cbc960529d2 100644
--- a/langtools/test/tools/javac/ConstFoldTest.java
+++ b/langtools/test/tools/javac/ConstFoldTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2015, 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
@@ -31,6 +31,8 @@
*/
import java.net.URL;
+import java.nio.file.Path;
+import java.nio.file.Paths;
import java.util.List;
public class ConstFoldTest {
@@ -75,9 +77,10 @@ public class ConstFoldTest {
ToolBox tb = new ToolBox();
URL url = ConstFoldTest.class.getResource("ConstFoldTest$CFTest.class");
+ Path file = Paths.get(url.toURI());
List result = tb.new JavapTask()
.options("-c")
- .classes(url.getFile())
+ .classes(file.toString())
.run()
.write(ToolBox.OutputKind.DIRECT)
.getOutputLines(ToolBox.OutputKind.DIRECT);
diff --git a/langtools/test/tools/javac/Diagnostics/6769027/T6769027.java b/langtools/test/tools/javac/Diagnostics/6769027/T6769027.java
index 2d9bf1810ef..8a7765c84ae 100644
--- a/langtools/test/tools/javac/Diagnostics/6769027/T6769027.java
+++ b/langtools/test/tools/javac/Diagnostics/6769027/T6769027.java
@@ -387,7 +387,7 @@ public class T6769027
messages.add("tester");
JCDiagnostic.Factory diags = JCDiagnostic.Factory.instance(ctx);
log.useSource(new MyFileObject("This is a source line"));
- JCDiagnostic d = diags.error(log.currentSource(),
+ JCDiagnostic d = diags.error(null, log.currentSource(),
posKind.pos(),
errorKind.key(), "Hello!");
if (multiKind != MultilineKind.NONE) {
diff --git a/langtools/test/tools/javac/Diagnostics/compressed/8067883/T8067883.java b/langtools/test/tools/javac/Diagnostics/compressed/8067883/T8067883.java
new file mode 100644
index 00000000000..506278070ed
--- /dev/null
+++ b/langtools/test/tools/javac/Diagnostics/compressed/8067883/T8067883.java
@@ -0,0 +1,29 @@
+/*
+ * @test /nodynamiccopyright/
+ * @bug 8067883
+ * @summary Javac misses some opportunities for diagnostic simplification
+ *
+ * @compile/fail/ref=T8067883a.out -Xdiags:compact -XDrawDiagnostics T8067883.java
+ * @compile/fail/ref=T8067883b.out -Xdiags:verbose -XDrawDiagnostics T8067883.java
+ *
+ */
+
+import java.util.List;
+
+class T8067883 {
+ void testMethod(List li) {
+ m(null, li);
+ m(1, li);
+ }
+
+ void testDiamond(List li) {
+ new Box<>(null, li);
+ new Box<>(1, li);
+ }
+
+ void m(List z, List ls) { }
+
+ static class Box {
+ Box(List z, List ls) { }
+ }
+}
diff --git a/langtools/test/tools/javac/Diagnostics/compressed/8067883/T8067883a.out b/langtools/test/tools/javac/Diagnostics/compressed/8067883/T8067883a.out
new file mode 100644
index 00000000000..42f316eb91a
--- /dev/null
+++ b/langtools/test/tools/javac/Diagnostics/compressed/8067883/T8067883a.out
@@ -0,0 +1,6 @@
+T8067883.java:15:17: compiler.err.prob.found.req: (compiler.misc.inconvertible.types: java.util.List, java.util.List)
+T8067883.java:16:9: compiler.err.cant.apply.symbol: kindname.method, m, java.util.List,java.util.List, int,java.util.List, kindname.class, T8067883, (compiler.misc.infer.no.conforming.assignment.exists: Z, (compiler.misc.inconvertible.types: int, java.util.List))
+T8067883.java:20:25: compiler.err.prob.found.req: (compiler.misc.inconvertible.types: java.util.List, java.util.List)
+T8067883.java:21:9: compiler.err.cant.apply.diamond.1: (compiler.misc.diamond: T8067883.Box), (compiler.misc.infer.no.conforming.assignment.exists: X, (compiler.misc.inconvertible.types: int, java.util.List))
+- compiler.note.compressed.diags
+4 errors
diff --git a/langtools/test/tools/javac/Diagnostics/compressed/8067883/T8067883b.out b/langtools/test/tools/javac/Diagnostics/compressed/8067883/T8067883b.out
new file mode 100644
index 00000000000..4b29a3c7cca
--- /dev/null
+++ b/langtools/test/tools/javac/Diagnostics/compressed/8067883/T8067883b.out
@@ -0,0 +1,5 @@
+T8067883.java:15:9: compiler.err.cant.apply.symbol: kindname.method, m, java.util.List,java.util.List, compiler.misc.type.null,java.util.List, kindname.class, T8067883, (compiler.misc.infer.no.conforming.assignment.exists: Z, (compiler.misc.inconvertible.types: java.util.List, java.util.List))
+T8067883.java:16:9: compiler.err.cant.apply.symbol: kindname.method, m, java.util.List,java.util.List, int,java.util.List, kindname.class, T8067883, (compiler.misc.infer.no.conforming.assignment.exists: Z, (compiler.misc.inconvertible.types: int, java.util.List))
+T8067883.java:20:9: compiler.err.cant.apply.diamond.1: (compiler.misc.diamond: T8067883.Box), (compiler.misc.infer.no.conforming.assignment.exists: X, (compiler.misc.inconvertible.types: java.util.List, java.util.List))
+T8067883.java:21:9: compiler.err.cant.apply.diamond.1: (compiler.misc.diamond: T8067883.Box), (compiler.misc.infer.no.conforming.assignment.exists: X, (compiler.misc.inconvertible.types: int, java.util.List))
+4 errors
diff --git a/langtools/test/tools/javac/SerialWarn.java b/langtools/test/tools/javac/SerialWarn.java
index dce066eeafc..431f6aeb176 100644
--- a/langtools/test/tools/javac/SerialWarn.java
+++ b/langtools/test/tools/javac/SerialWarn.java
@@ -1,34 +1,11 @@
/*
- * Copyright (c) 2003, 2004, 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
+ * @test /nodynamiccopyright/
* @bug 4854628
* @summary include Throwable subclasses in missing serialVersionUID warning
* @author gafter
*
* @compile -Werror SerialWarn.java
- * @compile/fail -Xlint:serial -Werror SerialWarn.java
+ * @compile/fail/ref=SerialWarn.out -XDrawDiagnostics -Xlint:serial -Werror SerialWarn.java
*/
class SerialWarn extends Throwable {}
diff --git a/langtools/test/tools/javac/SerialWarn.out b/langtools/test/tools/javac/SerialWarn.out
new file mode 100644
index 00000000000..23bf7373160
--- /dev/null
+++ b/langtools/test/tools/javac/SerialWarn.out
@@ -0,0 +1,4 @@
+SerialWarn.java:11:1: compiler.warn.missing.SVUID: SerialWarn
+- compiler.err.warnings.and.werror
+1 error
+1 warning
diff --git a/langtools/test/tools/javac/T4994049/DeprecatedYES.java b/langtools/test/tools/javac/T4994049/DeprecatedYES.java
index 4de52129b59..ec59558dcc7 100644
--- a/langtools/test/tools/javac/T4994049/DeprecatedYES.java
+++ b/langtools/test/tools/javac/T4994049/DeprecatedYES.java
@@ -1,33 +1,10 @@
/*
- * Copyright (c) 2005, 2006, 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
+ * @test /nodynamiccopyright/
* @bug 6229758
* @summary deprecatedNOT! is
* @author Peter von der Ah\u00e9
* @compile -Xlint:deprecation DeprecatedYES.java
- * @compile/fail -Werror -Xlint:deprecation DeprecatedYES.java
+ * @compile/fail/ref=DeprecatedYES.out -XDrawDiagnostics -Werror -Xlint:deprecation DeprecatedYES.java
*/
class A {
diff --git a/langtools/test/tools/javac/T4994049/DeprecatedYES.out b/langtools/test/tools/javac/T4994049/DeprecatedYES.out
new file mode 100644
index 00000000000..0750441a39c
--- /dev/null
+++ b/langtools/test/tools/javac/T4994049/DeprecatedYES.out
@@ -0,0 +1,4 @@
+DeprecatedYES.java:18:10: compiler.warn.has.been.deprecated: foo(), A
+- compiler.err.warnings.and.werror
+1 error
+1 warning
diff --git a/langtools/test/tools/javac/T6231847.java b/langtools/test/tools/javac/T6231847.java
index 25b9dede2bb..8d4ef4112e7 100644
--- a/langtools/test/tools/javac/T6231847.java
+++ b/langtools/test/tools/javac/T6231847.java
@@ -1,9 +1,8 @@
/*
- * @test /nodynamiccopyright/
+ * @test /nodynamiccopyright/
* @bug 6231847
* @summary Crash in com.sun.tools.javac.comp.Attr.visitNewClass:1352
* @author Peter von der Ah\u00e9
- * @compile/fail -XDdev T6231847.java
* @compile/fail/ref=T6231847.out -XDdev -XDrawDiagnostics T6231847.java
*/
diff --git a/langtools/test/tools/javac/T6231847.out b/langtools/test/tools/javac/T6231847.out
index 6dfc875c8ab..d2f36a92e29 100644
--- a/langtools/test/tools/javac/T6231847.out
+++ b/langtools/test/tools/javac/T6231847.out
@@ -1,9 +1,9 @@
-T6231847.java:15:21: compiler.err.anon.class.impl.intf.no.typeargs
-T6231847.java:16:30: compiler.err.anon.class.impl.intf.no.args
+T6231847.java:14:21: compiler.err.anon.class.impl.intf.no.typeargs
+T6231847.java:15:30: compiler.err.anon.class.impl.intf.no.args
+T6231847.java:16:16: compiler.err.anon.class.impl.intf.no.qual.for.new
T6231847.java:17:16: compiler.err.anon.class.impl.intf.no.qual.for.new
-T6231847.java:18:16: compiler.err.anon.class.impl.intf.no.qual.for.new
-T6231847.java:18:41: compiler.err.anon.class.impl.intf.no.args
-T6231847.java:18:23: compiler.err.anon.class.impl.intf.no.typeargs
-T6231847.java:19:16: compiler.err.qualified.new.of.static.class: T6231847.T6231847C
-T6231847.java:19:34: compiler.err.illegal.qual.not.icls: T6231847.T6231847C
+T6231847.java:17:41: compiler.err.anon.class.impl.intf.no.args
+T6231847.java:17:23: compiler.err.anon.class.impl.intf.no.typeargs
+T6231847.java:18:16: compiler.err.qualified.new.of.static.class: T6231847.T6231847C
+T6231847.java:18:34: compiler.err.illegal.qual.not.icls: T6231847.T6231847C
8 errors
diff --git a/langtools/test/tools/javac/annotations/6214965/T6214965.java b/langtools/test/tools/javac/annotations/6214965/T6214965.java
index cdac2431271..119c897897a 100644
--- a/langtools/test/tools/javac/annotations/6214965/T6214965.java
+++ b/langtools/test/tools/javac/annotations/6214965/T6214965.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2015, 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
@@ -23,9 +23,10 @@
/**
* @test
- * @bug 6214965 6365854
+ * @bug 6214965 6365854 8068639
* @summary Compiler crash on redefing nested annotation types
* @compile CompilerAnnotationTest.java CompilerAnnotationTest2.java
* @compile CompilerAnnotationTest2bad.java
- * @compile/ref=T6214965.out -XDrawDiagnostics CompilerAnnotationTest2bad.java
+ * @compile/ref=T6214965.out -XDrawDiagnostics -Xlint:classfile CompilerAnnotationTest2bad.java
+ * @compile -Werror CompilerAnnotationTest2bad.java
*/
diff --git a/langtools/test/tools/javac/annotations/6365854/T6365854.java b/langtools/test/tools/javac/annotations/6365854/T6365854.java
index daa24f651f7..d056368f23a 100644
--- a/langtools/test/tools/javac/annotations/6365854/T6365854.java
+++ b/langtools/test/tools/javac/annotations/6365854/T6365854.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2015, 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
@@ -23,7 +23,7 @@
/**
* @test
- * @bug 6365854
+ * @bug 6365854 8068639
* @summary javac crashes when compiling against an annotated class
* @compile TestAnnotation.java TestCore.java
* @clean test.annotation.TestAnnotation
@@ -33,11 +33,11 @@
*
* @compile TestAnnotation.java TestCore.java
* @clean test.annotation.TestAnnotation
- * @compile/ref=test1.out -XDrawDiagnostics T6365854.java
+ * @compile/ref=test1.out -XDrawDiagnostics -Xlint:classfile T6365854.java
* @run main T6365854
- * @compile/ref=test2.out -XDrawDiagnostics evolve/TestAnnotation.java T6365854.java
+ * @compile/ref=test2.out -XDrawDiagnostics -Xlint:classfile evolve/TestAnnotation.java T6365854.java
* @run main T6365854
- * @compile/ref=test2.out -XDrawDiagnostics T6365854.java
+ * @compile/ref=test2.out -XDrawDiagnostics -Xlint:classfile T6365854.java
* @run main T6365854
*/
diff --git a/langtools/test/tools/javac/api/file/MyStandardJavaFileManager.java b/langtools/test/tools/javac/api/file/MyStandardJavaFileManager.java
new file mode 100644
index 00000000000..738eb95060b
--- /dev/null
+++ b/langtools/test/tools/javac/api/file/MyStandardJavaFileManager.java
@@ -0,0 +1,68 @@
+/*
+ * Copyright (c) 2014, 2015, 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.
+ */
+
+import java.io.File;
+import java.io.IOException;
+import javax.tools.ForwardingJavaFileManager;
+import javax.tools.JavaFileManager;
+import javax.tools.JavaFileObject;
+import javax.tools.StandardJavaFileManager;
+
+
+class MyStandardJavaFileManager
+ extends ForwardingJavaFileManager
+ implements StandardJavaFileManager {
+ MyStandardJavaFileManager(StandardJavaFileManager delegate) {
+ super(delegate);
+ }
+
+ @Override
+ public Iterable extends JavaFileObject> getJavaFileObjectsFromFiles(Iterable extends File> files) {
+ return fileManager.getJavaFileObjectsFromFiles(files);
+ }
+
+ @Override
+ public Iterable extends JavaFileObject> getJavaFileObjects(File... files) {
+ return fileManager.getJavaFileObjects(files);
+ }
+
+ @Override
+ public Iterable extends JavaFileObject> getJavaFileObjectsFromStrings(Iterable names) {
+ return fileManager.getJavaFileObjectsFromStrings(names);
+ }
+
+ @Override
+ public Iterable extends JavaFileObject> getJavaFileObjects(String... names) {
+ return fileManager.getJavaFileObjects(names);
+ }
+
+ @Override
+ public void setLocation(JavaFileManager.Location location, Iterable extends File> files) throws IOException {
+ fileManager.setLocation(location, files);
+ }
+
+ @Override
+ public Iterable extends File> getLocation(JavaFileManager.Location location) {
+ return fileManager.getLocation(location);
+ }
+}
diff --git a/langtools/test/tools/javac/api/file/SJFM_AsPath.java b/langtools/test/tools/javac/api/file/SJFM_AsPath.java
new file mode 100644
index 00000000000..8cc91d95bc7
--- /dev/null
+++ b/langtools/test/tools/javac/api/file/SJFM_AsPath.java
@@ -0,0 +1,91 @@
+/*
+ * Copyright (c) 2014, 2015, 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 8059977
+ * @summary StandardJavaFileManager should support java.nio.file.Path.
+ * Test asPath method.
+ * @build SJFM_TestBase
+ * @run main SJFM_AsPath
+ */
+
+import java.io.IOException;
+import java.nio.file.Path;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Set;
+import javax.tools.JavaFileObject;
+import javax.tools.StandardJavaFileManager;
+
+/**
+ * For those paths which are supported by a file manager, such that
+ * a file object can encapsulate the path, verify that the underlying
+ * path can be recovered from the file object.
+ */
+public class SJFM_AsPath extends SJFM_TestBase {
+ public static void main(String... args) throws Exception {
+ new SJFM_AsPath().run();
+ }
+
+ @Test
+ void test_asPath(StandardJavaFileManager fm) throws IOException {
+ test_asPath(fm, getTestFilePaths());
+ test_asPath(fm, getTestZipPaths());
+ }
+
+ /**
+ * Tests the asPath method for a specific file manager and a series
+ * of paths.
+ *
+ * Note: instances of MyStandardJavaFileManager only support
+ * encapsulating paths for files in the default file system,
+ * and throw UnsupportedOperationException for asPath.
+ *
+ * @param fm the file manager to be tested
+ * @param paths the paths to be tested
+ * @throws IOException
+ */
+ void test_asPath(StandardJavaFileManager fm, List paths) throws IOException {
+ if (!isGetFileObjectsSupported(fm, paths))
+ return;
+ boolean expectException = (fm instanceof MyStandardJavaFileManager);
+
+ Set ref = new HashSet<>(paths);
+ for (JavaFileObject fo : fm.getJavaFileObjectsFromPaths(paths)) {
+ try {
+ Path path = fm.asPath(fo);
+ if (expectException)
+ error("expected exception not thrown: " + UnsupportedOperationException.class.getName());
+ boolean found = ref.remove(path);
+ if (!found) {
+ error("Unexpected path found: " + path + "; expected one of " + ref);
+ }
+ } catch (Exception e) {
+ if (expectException && e instanceof UnsupportedOperationException)
+ continue;
+ error("unexpected exception thrown: " + e);
+ }
+ }
+ }
+}
diff --git a/langtools/test/tools/javac/api/file/SJFM_GetFileObjects.java b/langtools/test/tools/javac/api/file/SJFM_GetFileObjects.java
new file mode 100644
index 00000000000..b8d9c947a79
--- /dev/null
+++ b/langtools/test/tools/javac/api/file/SJFM_GetFileObjects.java
@@ -0,0 +1,138 @@
+/*
+ * Copyright (c) 2014, 2015, 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 8059977
+ * @summary StandardJavaFileManager should support java.nio.file.Path.
+ * Test getFileObject methods.
+ * @build SJFM_TestBase
+ * @run main SJFM_GetFileObjects
+ */
+
+import java.io.File;
+import java.io.IOException;
+import java.nio.file.Path;
+import java.util.Collections;
+import java.util.List;
+import javax.tools.JavaFileObject;
+import javax.tools.StandardJavaFileManager;
+import javax.tools.StandardLocation;
+
+/**
+ * For those paths supported by a file manager, verify that the paths
+ * can be encapsulated by file objects, such that the file objects can
+ * be used by a tool such as javac.
+ */
+public class SJFM_GetFileObjects extends SJFM_TestBase {
+ public static void main(String... args) throws Exception {
+ new SJFM_GetFileObjects().run();
+ }
+
+ @Test
+ void test_getJavaFileObjects(StandardJavaFileManager fm) throws IOException {
+ test_getJavaFileObjects(fm, getTestFilePaths());
+ test_getJavaFileObjects(fm, getTestZipPaths());
+ }
+
+ /**
+ * Tests the getJavaFileObjects method for a specific file manager
+ * and a series of paths.
+ *
+ * Note: instances of MyStandardJavaFileManager only support
+ * encapsulating paths for files in the default file system.
+ *
+ * @param fm the file manager to be tested
+ * @param paths the paths to be tested
+ * @throws IOException
+ */
+ void test_getJavaFileObjects(StandardJavaFileManager fm, List paths) throws IOException {
+ boolean expectException = !isGetFileObjectsSupported(fm, paths);
+ try {
+ compile(fm.getJavaFileObjects(paths.toArray(new Path[paths.size()])));
+ if (expectException)
+ error("expected exception not thrown");
+ } catch (RuntimeException e) {
+ if (expectException && e instanceof IllegalArgumentException)
+ return;
+ error("unexpected exception thrown: " + e);
+ }
+ }
+
+ //----------------------------------------------------------------------------------------------
+
+ @Test
+ void test_getJavaFileObjectsFromPaths(StandardJavaFileManager fm) throws IOException {
+ test_getJavaFileObjectsFromPaths(fm, getTestFilePaths());
+ test_getJavaFileObjectsFromPaths(fm, getTestZipPaths());
+ }
+
+ /**
+ * Tests the getJavaFileObjectsFromPaths method for a specific file manager
+ * and a series of paths.
+ *
+ * Note: instances of MyStandardJavaFileManager only support
+ * encapsulating paths for files in the default file system.
+ *
+ * @param fm the file manager to be tested
+ * @param paths the paths to be tested
+ * @throws IOException
+ */
+ void test_getJavaFileObjectsFromPaths(StandardJavaFileManager fm, List paths)
+ throws IOException {
+ boolean expectException = !isGetFileObjectsSupported(fm, paths);
+ try {
+ compile(fm.getJavaFileObjectsFromPaths(paths));
+ if (expectException)
+ error("expected exception not thrown: " + IllegalArgumentException.class.getName());
+ } catch (RuntimeException e) {
+ if (expectException && e instanceof IllegalArgumentException)
+ return;
+ error("unexpected exception thrown: " + e);
+ }
+ }
+
+
+ //----------------------------------------------------------------------------------------------
+
+ /**
+ * Compiles a set of files.
+ *
+ * @param files the files to be compiled.
+ * @throws IOException
+ */
+ void compile(Iterable extends JavaFileObject> files) throws IOException {
+ String name = "compile" + (compileCount++);
+ try (StandardJavaFileManager fm = comp.getStandardFileManager(null, null, null)) {
+ File f = new File(name);
+ f.mkdirs();
+ // use setLocation(Iterable) to avoid relying on setLocationFromPaths
+ fm.setLocation(StandardLocation.CLASS_OUTPUT, Collections.singleton(f));
+ boolean ok = comp.getTask(null, fm, null, null, null, files).call();
+ if (!ok)
+ error(name + ": compilation failed");
+ }
+ }
+
+ int compileCount;
+}
diff --git a/langtools/test/tools/javac/api/file/SJFM_IsSameFile.java b/langtools/test/tools/javac/api/file/SJFM_IsSameFile.java
new file mode 100644
index 00000000000..fc6ac845c30
--- /dev/null
+++ b/langtools/test/tools/javac/api/file/SJFM_IsSameFile.java
@@ -0,0 +1,88 @@
+/*
+ * Copyright (c) 2014, 2015, 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 8059977
+ * @summary StandardJavaFileManager should support java.nio.file.Path.
+ * Test isSameFile method.
+ * @build SJFM_TestBase
+ * @run main SJFM_IsSameFile
+ */
+
+import java.nio.file.Path;
+import java.util.List;
+import java.util.concurrent.Callable;
+import javax.tools.JavaFileObject;
+import javax.tools.StandardJavaFileManager;
+
+/**
+ * For those paths which are supported by a file manager, such that
+ * a file object can encapsulate the path, verify that the underlying
+ * paths can be compared.
+ */
+public class SJFM_IsSameFile extends SJFM_TestBase {
+ public static void main(String... args) throws Exception {
+ new SJFM_IsSameFile().run();
+ }
+
+ @Test
+ void test_isSameFile(StandardJavaFileManager fm) throws Exception {
+ test_isSameFile(fm, () -> getTestFilePaths());
+ test_isSameFile(fm, () -> getTestZipPaths());
+ }
+
+ /**
+ * Tests the isSameFile method for a specific file manager
+ * and a series of paths.
+ *
+ * Note: instances of MyStandardJavaFileManager only support
+ * encapsulating paths for files in the default file system.
+ *
+ * @param fm the file manager to be tested
+ * @param paths a generator for the paths to be tested
+ * @throws IOException
+ */
+ void test_isSameFile(StandardJavaFileManager fm, Callable> paths) throws Exception {
+ if (!isGetFileObjectsSupported(fm, paths.call()))
+ return;
+
+ // use distinct paths and file objects in the following two sets
+ Iterable extends JavaFileObject> setA = fm.getJavaFileObjectsFromPaths(paths.call());
+ Iterable extends JavaFileObject> setB = fm.getJavaFileObjectsFromPaths(paths.call());
+ for (JavaFileObject a : setA) {
+ for (JavaFileObject b : setB) {
+ System.err.println("compare: a: " + a);
+ System.err.println(" b: " + b);
+ // Use the fileObject getName method to determine the expected result.
+ // For the files being tested, getName is the absolute path.
+ boolean expect = a.getName().equals(b.getName());
+ boolean actual = fm.isSameFile(a, b);
+ if (actual != expect) {
+ error("mismatch: actual:" + (actual ? "same" : "not same")
+ + ", expect:" + (expect ? "same" : "not same"));
+ }
+ }
+ }
+ }
+}
diff --git a/langtools/test/tools/javac/api/file/SJFM_Locations.java b/langtools/test/tools/javac/api/file/SJFM_Locations.java
new file mode 100644
index 00000000000..8ae341371a8
--- /dev/null
+++ b/langtools/test/tools/javac/api/file/SJFM_Locations.java
@@ -0,0 +1,179 @@
+/*
+ * Copyright (c) 2014, 2015, 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 8059977
+ * @summary StandardJavaFileManager should support java.nio.file.Path.
+ * Test get/setLocation methods.
+ * @build SJFM_TestBase
+ * @run main SJFM_Locations
+ */
+
+import java.io.File;
+import java.io.IOException;
+import java.nio.file.Path;
+import java.nio.file.Paths;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.stream.Collectors;
+import java.util.stream.Stream;
+import javax.tools.JavaFileManager;
+import javax.tools.StandardJavaFileManager;
+
+/**
+ * For those paths which are supported by a file manager, verify
+ * that setLocation can accept such paths, and that getLocation
+ * can subsequently return the same paths.
+ *
+ * In addition, for files in the default file system, verify
+ * the combinations of setting a location using files or paths
+ * and then subsequently getting the location as files or paths.
+ */
+public class SJFM_Locations extends SJFM_TestBase {
+ public static void main(String... args) throws Exception {
+ new SJFM_Locations().run();
+ }
+
+ @Test
+ void test_locations(StandardJavaFileManager fm) throws IOException {
+ test_setFiles_getFiles(fm, getTestFileDirs());
+ test_setFiles_getPaths(fm, getTestFileDirs());
+ test_setPaths_getFiles(fm, getTestFilePathDirs());
+ test_setPaths_getPaths(fm, getTestFilePathDirs());
+// test_setPaths_getPaths(fm, getTestZipPathDirs());
+ }
+
+ void test_setFiles_getFiles(StandardJavaFileManager fm, List inFiles) throws IOException {
+ System.err.println("test_setFiles_getFiles");
+ JavaFileManager.Location l = newLocation();
+ fm.setLocation(l, inFiles);
+ Iterable extends File> outFiles = fm.getLocation(l);
+ compare(inFiles, outFiles);
+ }
+
+ void test_setFiles_getPaths(StandardJavaFileManager fm, List inFiles) throws IOException {
+ System.err.println("test_setFiles_getPaths");
+ JavaFileManager.Location l = newLocation();
+ fm.setLocation(l, inFiles);
+ Iterable extends Path> outPaths = fm.getLocationAsPaths(l);
+ compare(inFiles, outPaths);
+ }
+
+ void test_setPaths_getFiles(StandardJavaFileManager fm, List inPaths) throws IOException {
+ System.err.println("test_setPaths_getFiles");
+ JavaFileManager.Location l = newLocation();
+ fm.setLocationFromPaths(l, inPaths);
+ Iterable extends File> outFiles = fm.getLocation(l);
+ compare(inPaths, outFiles);
+ }
+
+ void test_setPaths_getPaths(StandardJavaFileManager fm, List inPaths) throws IOException {
+ System.err.println("test_setPaths_getPaths");
+ JavaFileManager.Location l = newLocation();
+ fm.setLocationFromPaths(l, inPaths);
+ Iterable extends Path> outPaths = fm.getLocationAsPaths(l);
+ compare(inPaths, outPaths);
+ }
+
+ //----------------------------------------------------------------------------------------------
+
+ /**
+ * Gets a representative series of directories in the default file system,
+ * derived from the test.src directory and test.classes path.
+ *
+ * @return a list of directories, represented with {@code File}
+ * @throws IOException
+ */
+ List getTestFileDirs() throws IOException {
+ return Stream.of("test.src", "test.classes")
+ .map(s -> System.getProperty(s))
+ .flatMap(s -> Stream.of(s.split(File.pathSeparator, 0)))
+ .filter(s -> !s.isEmpty())
+ .map(s -> new File(s))
+ .collect(Collectors.toList());
+ }
+
+ /**
+ * Gets a representative series of directories in the default file system,
+ * derived from the test.src directory and test.classes path.
+ *
+ * @return a list of directories, represented with {@code Path}
+ * @throws IOException
+ */
+ List getTestFilePathDirs() throws IOException {
+ return Stream.of("test.src", "test.classes")
+ .map(s -> System.getProperty(s))
+ .flatMap(s -> Stream.of(s.split(File.pathSeparator, 0)))
+ .filter(s -> !s.isEmpty())
+ .map(s -> Paths.get(s))
+ .collect(Collectors.toList());
+ }
+
+
+ /**
+ * Compares two lists of items by comparing their individual string representations.
+ *
+ * @param in the first set of items to be compared
+ * @param out the second set of items to be compared
+ */
+ void compare(Iterable> in, Iterable> out) {
+ List ins = toString(in);
+ List outs = toString(out);
+ if (!ins.equals(outs)) {
+ error("mismatch in comparison");
+ System.err.println("in:");
+ for (String s: ins) System.err.println(s);
+ System.err.println("out:");
+ for (String s: outs) System.err.println(s);
+ }
+ }
+
+ List toString(Iterable> iter) {
+ List strings = new ArrayList<>();
+ for (Object item: iter)
+ strings.add(item.toString());
+ return strings;
+ }
+
+ /**
+ * Create an instance of a location.
+ * @return a location
+ */
+ JavaFileManager.Location newLocation() {
+ final String name = "locn" + (count++);
+ return new JavaFileManager.Location() {
+ @Override
+ public String getName() {
+ return name;
+ }
+
+ @Override
+ public boolean isOutputLocation() {
+ return false;
+ }
+ };
+ }
+
+ int count = 0;
+}
diff --git a/langtools/test/tools/javac/api/file/SJFM_TestBase.java b/langtools/test/tools/javac/api/file/SJFM_TestBase.java
new file mode 100644
index 00000000000..f94579d210d
--- /dev/null
+++ b/langtools/test/tools/javac/api/file/SJFM_TestBase.java
@@ -0,0 +1,226 @@
+/*
+ * Copyright (c) 2014, 2015, 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.
+ */
+
+import java.io.IOException;
+import java.io.OutputStream;
+import java.io.UncheckedIOException;
+import java.lang.annotation.Annotation;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.reflect.InvocationTargetException;
+import java.lang.reflect.Method;
+import java.nio.file.FileSystem;
+import java.nio.file.FileSystems;
+import java.nio.file.Files;
+import java.nio.file.Path;
+import java.nio.file.Paths;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+import java.util.stream.Collectors;
+import java.util.zip.ZipEntry;
+import java.util.zip.ZipOutputStream;
+
+import javax.tools.JavaCompiler;
+import javax.tools.StandardJavaFileManager;
+import javax.tools.ToolProvider;
+
+/**
+ * Base class for unit tests for StandardJavaFileManager.
+ */
+class SJFM_TestBase {
+
+ /** Shared compiler instance. */
+ JavaCompiler comp;
+
+ /** A list of items to be closed when the test is complete. */
+ List closeables;
+
+ /**
+ * Runs a test. This is the primary entry point and should generally be
+ * called from each test's main method.
+ * It calls all methods annotated with {@code @Test} with the instances
+ * of StandardJavaFileManager to be tested.
+ *
+ * @throws Exception if the test fails.
+ */
+ void run() throws Exception {
+ comp = ToolProvider.getSystemJavaCompiler();
+ closeables = new ArrayList<>();
+
+ try (StandardJavaFileManager systemFileManager = comp.getStandardFileManager(null, null, null);
+ StandardJavaFileManager customFileManager = new MyStandardJavaFileManager(systemFileManager)) {
+ test(systemFileManager);
+ test(customFileManager);
+ } finally {
+ for (AutoCloseable c: closeables) {
+ try {
+ c.close();
+ } catch (IOException e) {
+ error("Exception closing " + c + ": " + e);
+ }
+ }
+ }
+
+ if (errors > 0)
+ throw new Exception(errors + " errors occurred");
+ }
+
+ /**
+ * Get the file managers to be tested.
+ *
+ * Currently, two are provided:
+ *
+ * the system-provided file manager
+ * a custom file manager, which relies on the default methods provided in the
+ * StandardJavaFileManager interface
+ *
+ *
+ * @return the file managers to be tested
+ */
+ List getTestFileManagers() {
+ StandardJavaFileManager systemFileManager = comp.getStandardFileManager(null, null, null);
+ StandardJavaFileManager customFileManager = new MyStandardJavaFileManager(systemFileManager);
+ return Arrays.asList(systemFileManager, customFileManager);
+ }
+
+ /**
+ * Tests a specific file manager, by calling all methods annotated
+ * with {@code @Test} passing this file manager as an argument.
+ *
+ * @param fm the file manager to be tested
+ * @throws Exception if the test fails
+ */
+ void test(StandardJavaFileManager fm) throws Exception {
+ System.err.println("Testing " + fm);
+ for (Method m: getClass().getDeclaredMethods()) {
+ Annotation a = m.getAnnotation(Test.class);
+ if (a != null) {
+ try {
+ System.err.println("Test " + m.getName());
+ m.invoke(this, new Object[] { fm });
+ } catch (InvocationTargetException e) {
+ Throwable cause = e.getCause();
+ throw (cause instanceof Exception) ? ((Exception) cause) : e;
+ }
+ System.err.println();
+ }
+ }
+ }
+
+ /** Marker annotation for test cases. */
+ @Retention(RetentionPolicy.RUNTIME)
+ @interface Test { }
+
+ /**
+ * Returns a series of paths for artifacts in the default file system.
+ * The paths are for the .java files in the test.src directory.
+ *
+ * @return a list of paths
+ * @throws IOException
+ */
+ List getTestFilePaths() throws IOException {
+ String testSrc = System.getProperty("test.src");
+ return Files.list(Paths.get(testSrc))
+ .filter(p -> p.getFileName().toString().endsWith(".java"))
+ .collect(Collectors.toList());
+ }
+
+ private FileSystem zipfs;
+ private List zipPaths;
+
+ /**
+ * Returns a series of paths for artifacts in a non-default file system.
+ * A zip file is created containing copies of the .java files in the
+ * test.src directory. The paths that are returned refer to these files.
+ *
+ * @return a list of paths
+ * @throws IOException
+ */
+ List getTestZipPaths() throws IOException {
+ if (zipfs == null) {
+ Path testZip = createSourceZip();
+ zipfs = FileSystems.newFileSystem(testZip, null);
+ closeables.add(zipfs);
+ zipPaths = Files.list(zipfs.getRootDirectories().iterator().next())
+ .filter(p -> p.getFileName().toString().endsWith(".java"))
+ .collect(Collectors.toList());
+ }
+ return zipPaths;
+ }
+
+ /**
+ * Create a zip file containing the contents of the test.src directory.
+ *
+ * @return a path for the zip file.
+ * @throws IOException if there is a problem creating the file
+ */
+ private Path createSourceZip() throws IOException {
+ Path testSrc = Paths.get(System.getProperty("test.src"));
+ Path testZip = Paths.get("test.zip");
+ try (OutputStream os = Files.newOutputStream(testZip)) {
+ try (ZipOutputStream zos = new ZipOutputStream(os)) {
+ Files.list(testSrc)
+ .filter(p -> p.getFileName().toString().endsWith(".java"))
+ .forEach(p -> {
+ try {
+ zos.putNextEntry(new ZipEntry(p.getFileName().toString()));
+ zos.write(Files.readAllBytes(p));
+ zos.closeEntry();
+ } catch (IOException ex) {
+ throw new UncheckedIOException(ex);
+ }
+ });
+ }
+ }
+ return testZip;
+ }
+
+ /**
+ * Tests whether it is expected that a file manager will be able
+ * to create a series of file objects from a series of paths.
+ *
+ * MyStandardJavaFileManager does not support paths referring to
+ * non-default file systems.
+ *
+ * @param fm the file manager to be tested
+ * @param paths the paths to be tested
+ * @return
+ */
+ boolean isGetFileObjectsSupported(StandardJavaFileManager fm, List paths) {
+ return !(fm instanceof MyStandardJavaFileManager
+ && (paths.get(0).getFileSystem() != FileSystems.getDefault()));
+ }
+
+ /**
+ * Report an error.
+ */
+ void error(String msg) {
+ System.err.println("Error: " + msg);
+ errors++;
+ }
+
+ /** Count of errors reported. */
+ int errors;
+
+}
diff --git a/langtools/test/tools/javac/conditional/ConditionalWithFinalStrings.java b/langtools/test/tools/javac/conditional/ConditionalWithFinalStrings.java
new file mode 100644
index 00000000000..f172802440f
--- /dev/null
+++ b/langtools/test/tools/javac/conditional/ConditionalWithFinalStrings.java
@@ -0,0 +1,69 @@
+/*
+ * Copyright (c) 2015, 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 8066871
+ * @summary java.lang.VerifyError: Bad local variable type - local final String
+ * @author Srikanth Sankaran
+ *
+ * @compile -g:none ConditionalWithFinalStrings.java
+ * @run main ConditionalWithFinalStrings
+ */
+
+public class ConditionalWithFinalStrings {
+
+ interface I {
+ String foo();
+ }
+
+ static class Tmp {
+ private String value;
+ public void setValue(String tmpStr) {
+ this.value = tmpStr;
+ if (!this.value.equals("YES"))
+ throw new AssertionError();
+ }
+ }
+
+ void goo(I i) {
+ if (!i.foo().equals("YES"))
+ throw new AssertionError();
+ }
+
+ public void test() {
+ final String y = "YES";
+ final String n = "NO";
+ Tmp tmp = new Tmp();
+ tmp.setValue(true ? y : n);
+ goo (() -> y);
+
+ }
+ public static void main(String[] args) {
+ new ConditionalWithFinalStrings().test();
+ if (!id("Hello!").equals("Hello!"))
+ throw new AssertionError();
+
+ }
+ static Z id(Z z) { return z; }
+}
diff --git a/langtools/test/tools/javac/diags/MessageFile.java b/langtools/test/tools/javac/diags/MessageFile.java
index 1b22e0838de..cbf731c34ae 100644
--- a/langtools/test/tools/javac/diags/MessageFile.java
+++ b/langtools/test/tools/javac/diags/MessageFile.java
@@ -31,7 +31,9 @@ import java.util.regex.Pattern;
*/
class MessageFile {
static final Pattern emptyOrCommentPattern = Pattern.compile("( *#.*)?");
- static final Pattern infoPattern = Pattern.compile("# ([0-9]+: [-A-Za-z ]+, )*[0-9]+: [-A-Za-z ]+");
+ static final Pattern typePattern = Pattern.compile("[-\\\\'A-Z\\.a-z ]+( \\([A-Za-z 0-9]+\\))?");
+ static final Pattern infoPattern = Pattern.compile(String.format("# ([0-9]+: %s, )*[0-9]+: %s",
+ typePattern.pattern(), typePattern.pattern()));
/**
* A line of text within the message file.
diff --git a/langtools/test/tools/javac/flow/LVTHarness.java b/langtools/test/tools/javac/flow/LVTHarness.java
index a9e31f6efc0..8d9f97438be 100644
--- a/langtools/test/tools/javac/flow/LVTHarness.java
+++ b/langtools/test/tools/javac/flow/LVTHarness.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2015, 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
@@ -23,7 +23,7 @@
/*
* @test
- * @bug 7047734 8027660 8037937 8047719 8058708
+ * @bug 7047734 8027660 8037937 8047719 8058708 8064857
* @summary The LVT is not generated correctly during some try/catch scenarios
* javac crash while creating LVT entry for a local variable defined in
* an inner block
@@ -147,7 +147,7 @@ public class LVTHarness {
}
void checkMethod(ConstantPool constantPool, Method method, AliveRanges ranges)
- throws InvalidIndex, UnexpectedEntry {
+ throws InvalidIndex, UnexpectedEntry, ConstantPoolException {
Code_attribute code = (Code_attribute) method.attributes.get(Attribute.Code);
LocalVariableTable_attribute lvt =
(LocalVariableTable_attribute) (code.attributes.get(Attribute.LocalVariableTable));
@@ -169,7 +169,7 @@ public class LVTHarness {
}
if (i < infoFromRanges.size()) {
- error(infoFromLVT, infoFromRanges);
+ error(infoFromLVT, infoFromRanges, method.getName(constantPool).toString());
}
}
@@ -205,9 +205,10 @@ public class LVTHarness {
return sb.toString();
}
- protected void error(List infoFromLVT, List infoFromRanges) {
+ protected void error(List