# HG changeset patch # User lana # Date 1395784261 25200 # Node ID 08ef6549e6a26404e4609bdb59e56d3b2bdc4edc # Parent 85dbdc227c5e11429b4fc4a8ba763f50107edd6e# Parent ec3f230ed0994dea07955b7665fd62562750dc85 Merge diff -r 85dbdc227c5e -r 08ef6549e6a2 jdk/make/Tools.gmk --- a/jdk/make/Tools.gmk Wed Jul 05 19:34:04 2017 +0200 +++ b/jdk/make/Tools.gmk Tue Mar 25 14:51:01 2014 -0700 @@ -71,6 +71,7 @@ build.tools.generatecharacter.CharacterName TOOL_DTDBUILDER = $(JAVA_SMALL) -Ddtd_home=$(JDK_TOPDIR)/make/data/dtdbuilder \ + -Djava.awt.headless=true \ -cp $(JDK_OUTPUTDIR)/btclasses build.tools.dtdbuilder.DTDBuilder TOOL_GENERATEBREAKITERATORDATA = $(JAVA_SMALL) \ diff -r 85dbdc227c5e -r 08ef6549e6a2 jdk/make/lib/CoreLibraries.gmk --- a/jdk/make/lib/CoreLibraries.gmk Wed Jul 05 19:34:04 2017 +0200 +++ b/jdk/make/lib/CoreLibraries.gmk Tue Mar 25 14:51:01 2014 -0700 @@ -305,7 +305,7 @@ LDFLAGS_SUFFIX_linux := -ljvm -ljava, \ LDFLAGS_SUFFIX_solaris := -ljvm -ljava -lc, \ LDFLAGS_SUFFIX_aix := -ljvm -ljava, \ - LDFLAGS_SUFFIX_windows := advapi32.lib, \ + LDFLAGS_SUFFIX_windows := advapi32.lib jvm.lib $(WIN_JAVA_LIB), \ LDFLAGS_SUFFIX_macosx := -ljvm -framework CoreFoundation, \ VERSIONINFO_RESOURCE := $(JDK_TOPDIR)/src/windows/resource/version.rc, \ RC_FLAGS := $(RC_FLAGS) \ diff -r 85dbdc227c5e -r 08ef6549e6a2 jdk/make/lib/ServiceabilityLibraries.gmk --- a/jdk/make/lib/ServiceabilityLibraries.gmk Wed Jul 05 19:34:04 2017 +0200 +++ b/jdk/make/lib/ServiceabilityLibraries.gmk Tue Mar 25 14:51:01 2014 -0700 @@ -49,7 +49,7 @@ EXCLUDE_FILES := $(LIBATTACH_EXCLUDE_FILES), \ LANG := C, \ OPTIMIZATION := LOW, \ - CFLAGS := $(CFLAGS_JDKLIB), \ + CFLAGS := $(CFLAGS_JDKLIB) $(CFLAGS_WARNINGS_ARE_ERRORS), \ CFLAGS_windows := /Gy, \ MAPFILE := $(JDK_TOPDIR)/make/mapfiles/libattach/mapfile-$(OPENJDK_TARGET_OS), \ VERSIONINFO_RESOURCE := $(JDK_TOPDIR)/src/windows/resource/version.rc, \ @@ -79,7 +79,7 @@ $(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/transport/socket, \ LANG := C, \ OPTIMIZATION := LOW, \ - CFLAGS := $(CFLAGS_JDKLIB) -DUSE_MMAP \ + CFLAGS := $(CFLAGS_JDKLIB) $(CFLAGS_CFLAGS_WARNINGS_ARE_ERRORS) -DUSE_MMAP \ -I$(INCLUDEDIR) -I$(JDK_OUTPUTDIR)/include/$(OPENJDK_TARGET_OS) \ -I$(JDK_TOPDIR)/src/share/transport/socket \ -I$(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/transport/socket \ @@ -115,7 +115,7 @@ $(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/transport/shmem, \ LANG := C, \ OPTIMIZATION := LOW, \ - CFLAGS := $(CFLAGS_JDKLIB) -DUSE_MMAP \ + CFLAGS := $(CFLAGS_JDKLIB) $(CFLAGS_WARNINGS_ARE_ERRORS) -DUSE_MMAP \ -I$(INCLUDEDIR) -I$(JDK_OUTPUTDIR)/include/$(OPENJDK_TARGET_OS) \ -I$(JDK_TOPDIR)/src/share/transport/shmem \ -I$(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/transport/shmem \ @@ -144,7 +144,7 @@ SRC := $(JDK_TOPDIR)/src/share/back $(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/back, \ LANG := C, \ OPTIMIZATION := LOW, \ - CFLAGS := $(CFLAGS_JDKLIB) -DJDWP_LOGGING \ + CFLAGS := $(CFLAGS_JDKLIB) $(CFLAGS_WARNINGS_ARE_ERRORS) -DJDWP_LOGGING \ -I$(JDK_TOPDIR)/src/share/transport/export \ -I$(JDK_TOPDIR)/src/share/back/export \ -I$(JDK_TOPDIR)/src/share/npt \ @@ -179,7 +179,7 @@ $(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/sun/tracing/dtrace, \ LANG := C, \ OPTIMIZATION := LOW, \ - CFLAGS := $(CFLAGS_JDKLIB) \ + CFLAGS := $(CFLAGS_JDKLIB) $(CFLAGS_WARNINGS_ARE_ERRORS) \ -I$(JDK_TOPDIR)/src/share/native/sun/tracing/dtrace, \ MAPFILE := $(JDK_TOPDIR)/make/mapfiles/libjsdt/mapfile-vers, \ LDFLAGS := $(LDFLAGS_JDKLIB) \ @@ -248,7 +248,7 @@ INCLUDE_FILES := $(LIBINSTRUMENT_FILES), \ LANG := C, \ OPTIMIZATION := LOW, \ - CFLAGS := $(LIBINSTRUMENT_CFLAGS), \ + CFLAGS := $(LIBINSTRUMENT_CFLAGS) $(CFLAGS_WARNINGS_ARE_ERRORS), \ CFLAGS_debug := -DJPLIS_LOGGING, \ CFLAGS_release := -DNO_JPLIS_LOGGING, \ MAPFILE := $(JDK_TOPDIR)/make/mapfiles/libinstrument/mapfile-vers, \ @@ -316,7 +316,7 @@ EXCLUDE_FILES := $(BUILD_LIBMANAGEMENT_EXCLUDES), \ LANG := C, \ OPTIMIZATION := $(LIBMANAGEMENT_OPTIMIZATION), \ - CFLAGS := $(CFLAGS_JDKLIB) $(BUILD_LIBMANAGEMENT_CFLAGS), \ + CFLAGS := $(CFLAGS_JDKLIB) $(CFLAGS_WARNINGS_ARE_ERRORS) $(BUILD_LIBMANAGEMENT_CFLAGS), \ MAPFILE := $(JDK_TOPDIR)/make/mapfiles/libmanagement/mapfile-vers, \ LDFLAGS := $(LDFLAGS_JDKLIB) \ $(call SET_SHARED_LIBRARY_ORIGIN), \ @@ -364,7 +364,7 @@ SRC := $(BUILD_LIBHPROF_SRC), \ LANG := C, \ OPTIMIZATION := $(LIBHPROF_OPTIMIZATION), \ - CFLAGS := $(CFLAGS_JDKLIB) \ + CFLAGS := $(CFLAGS_JDKLIB) $(CFLAGS_WARNINGS_ARE_ERRORS) \ $(BUILD_LIBHPROF_CFLAGS), \ CFLAGS_debug := -DHPROF_LOGGING, \ MAPFILE := $(JDK_TOPDIR)/make/mapfiles/libhprof/mapfile-vers, \ @@ -392,7 +392,7 @@ SRC := $(JDK_TOPDIR)/src/share/demo/jvmti/java_crw_demo, \ LANG := C, \ OPTIMIZATION := LOW, \ - CFLAGS := $(CFLAGS_JDKLIB) \ + CFLAGS := $(CFLAGS_JDKLIB) $(CFLAGS_WARNINGS_ARE_ERRORS) \ -I$(JDK_TOPDIR)/src/share/demo/jvmti/java_crw_demo, \ MAPFILE := $(JDK_TOPDIR)/make/mapfiles/libjava_crw_demo/mapfile-vers, \ LDFLAGS := $(LDFLAGS_JDKLIB) \ @@ -419,7 +419,7 @@ SRC := $(JDK_TOPDIR)/src/closed/share/native/oracle/jfr, \ LANG := C, \ OPTIMIZATION := LOW, \ - CFLAGS := $(CFLAGS_JDKLIB) \ + CFLAGS := $(CFLAGS_JDKLIB) $(CFLAGS_WARNINGS_ARE_ERRORS) \ -I$(JDK_TOPDIR)/src/closed/share/javavm/export, \ MAPFILE := $(JDK_TOPDIR)/make/mapfiles/libjfr/mapfile-vers, \ LDFLAGS := $(LDFLAGS_JDKLIB) \ diff -r 85dbdc227c5e -r 08ef6549e6a2 jdk/src/share/back/SDE.c --- a/jdk/src/share/back/SDE.c Wed Jul 05 19:34:04 2017 +0200 +++ b/jdk/src/share/back/SDE.c Tue Mar 25 14:51:01 2014 -0700 @@ -48,8 +48,6 @@ #define BASE_STRATUM_NAME "Java" #define null NULL -#define true JNI_TRUE -#define false JNI_FALSE #define String char * #define private static @@ -147,7 +145,7 @@ defaultStratumId = null; defaultStratumIndex = -1; baseStratumIndex = -2; /* so as not to match -1 above */ - sourceMapIsValid = false; + sourceMapIsValid = JNI_FALSE; if (getSourceDebugExtension(clazz, &sourceDebugExtension) == JVMTI_ERROR_NONE) { @@ -667,7 +665,7 @@ jplsFilename = readLine(); defaultStratumId = readLine(); createJavaStratum(); - while (true) { + while (1) { if (sdeRead() != '*') { syntax("expected '*'"); } @@ -684,7 +682,7 @@ case 'E': /* set end points */ storeStratum("*terminator*"); - sourceMapIsValid = true; + sourceMapIsValid = JNI_TRUE; return; default: ignoreSection(); diff -r 85dbdc227c5e -r 08ef6549e6a2 jdk/src/share/back/eventFilter.c --- a/jdk/src/share/back/eventFilter.c Wed Jul 05 19:34:04 2017 +0200 +++ b/jdk/src/share/back/eventFilter.c Tue Mar 25 14:51:01 2014 -0700 @@ -288,7 +288,7 @@ >> JVMTI_VERSION_SHIFT_MAJOR; minor = (version & JVMTI_VERSION_MASK_MINOR) >> JVMTI_VERSION_SHIFT_MINOR; - return (major > 1 || major == 1 && minor >= 2); + return (major > 1 || (major == 1 && minor >= 2)) ? JNI_TRUE : JNI_FALSE; } else { return JNI_FALSE; } diff -r 85dbdc227c5e -r 08ef6549e6a2 jdk/src/share/back/eventHandler.c --- a/jdk/src/share/back/eventHandler.c Wed Jul 05 19:34:04 2017 +0200 +++ b/jdk/src/share/back/eventHandler.c Tue Mar 25 14:51:01 2014 -0700 @@ -1682,7 +1682,7 @@ eventHandler_createPermanentInternal(EventIndex ei, HandlerFunction func) { return createInternal(ei, func, NULL, - NULL, NULL, (jlocation)NULL, JNI_TRUE); + NULL, NULL, 0, JNI_TRUE); } HandlerNode * @@ -1691,7 +1691,7 @@ jthread thread) { return createInternal(ei, func, thread, - NULL, NULL, (jlocation)NULL, JNI_FALSE); + NULL, NULL, 0, JNI_FALSE); } HandlerNode * diff -r 85dbdc227c5e -r 08ef6549e6a2 jdk/src/share/back/log_messages.c --- a/jdk/src/share/back/log_messages.c Wed Jul 05 19:34:04 2017 +0200 +++ b/jdk/src/share/back/log_messages.c Tue Mar 25 14:51:01 2014 -0700 @@ -56,17 +56,24 @@ static void get_time_stamp(char *tbuf, size_t ltbuf) { - char format[MAXLEN_TIMESTAMP+1]; + char timestamp_prefix[MAXLEN_TIMESTAMP+1]; + char timestamp_postfix[MAXLEN_TIMESTAMP+1]; unsigned millisecs = 0; time_t t = 0; GETMILLSECS(millisecs); - if ( time(&t) == (time_t)(-1) ) + if ( time(&t) == (time_t)(-1) ) { t = 0; - (void)strftime(format, sizeof(format), - /* Break this string up for SCCS's sake */ - "%" "d.%" "m.%" "Y %" "T.%%.3d %" "Z", localtime(&t)); - (void)snprintf(tbuf, ltbuf, format, (int)(millisecs)); + } + /* Break this up so that the format strings are string literals + and we avoid a compiler warning. */ + (void)strftime(timestamp_prefix, sizeof(timestamp_prefix), + "%d.%m.%Y %T", localtime(&t)); + (void)strftime(timestamp_postfix, sizeof(timestamp_postfix), + "%Z", localtime(&t)); + (void)snprintf(tbuf, ltbuf, + "%s.%.3d %s", timestamp_prefix, + (int)(millisecs), timestamp_postfix); } /* Get basename of filename */ @@ -175,7 +182,7 @@ "LOC=%s;PID=%d;THR=t@%d", location_stamp, (int)processPid, - (int)tid); + (int)(intptr_t)tid); /* Construct message string. */ va_start(ap, format); diff -r 85dbdc227c5e -r 08ef6549e6a2 jdk/src/share/classes/java/time/format/DateTimeFormatter.java --- a/jdk/src/share/classes/java/time/format/DateTimeFormatter.java Wed Jul 05 19:34:04 2017 +0200 +++ b/jdk/src/share/classes/java/time/format/DateTimeFormatter.java Tue Mar 25 14:51:01 2014 -0700 @@ -1932,8 +1932,8 @@ */ private TemporalAccessor parseResolved0(final CharSequence text, final ParsePosition position) { ParsePosition pos = (position != null ? position : new ParsePosition(0)); - Parsed unresolved = parseUnresolved0(text, pos); - if (unresolved == null || pos.getErrorIndex() >= 0 || (position == null && pos.getIndex() < text.length())) { + DateTimeParseContext context = parseUnresolved0(text, pos); + if (context == null || pos.getErrorIndex() >= 0 || (position == null && pos.getIndex() < text.length())) { String abbr; if (text.length() > 64) { abbr = text.subSequence(0, 64).toString() + "..."; @@ -1948,7 +1948,7 @@ pos.getIndex(), text, pos.getIndex()); } } - return unresolved.resolve(resolverStyle, resolverFields); + return context.toResolved(resolverStyle, resolverFields); } /** @@ -1991,10 +1991,14 @@ * @throws IndexOutOfBoundsException if the position is invalid */ public TemporalAccessor parseUnresolved(CharSequence text, ParsePosition position) { - return parseUnresolved0(text, position); + DateTimeParseContext context = parseUnresolved0(text, position); + if (context == null) { + return null; + } + return context.toUnresolved(); } - private Parsed parseUnresolved0(CharSequence text, ParsePosition position) { + private DateTimeParseContext parseUnresolved0(CharSequence text, ParsePosition position) { Objects.requireNonNull(text, "text"); Objects.requireNonNull(position, "position"); DateTimeParseContext context = new DateTimeParseContext(this); @@ -2005,7 +2009,7 @@ return null; } position.setIndex(pos); // errorIndex not updated from input - return context.toParsed(); + return context; } //----------------------------------------------------------------------- @@ -2126,23 +2130,23 @@ @Override public Object parseObject(String text, ParsePosition pos) { Objects.requireNonNull(text, "text"); - Parsed unresolved; + DateTimeParseContext context; try { - unresolved = formatter.parseUnresolved0(text, pos); + context = formatter.parseUnresolved0(text, pos); } catch (IndexOutOfBoundsException ex) { if (pos.getErrorIndex() < 0) { pos.setErrorIndex(0); } return null; } - if (unresolved == null) { + if (context == null) { if (pos.getErrorIndex() < 0) { pos.setErrorIndex(0); } return null; } try { - TemporalAccessor resolved = unresolved.resolve(formatter.resolverStyle, formatter.resolverFields); + TemporalAccessor resolved = context.toResolved(formatter.resolverStyle, formatter.resolverFields); if (parseType == null) { return resolved; } diff -r 85dbdc227c5e -r 08ef6549e6a2 jdk/src/share/classes/java/time/format/DateTimeParseContext.java --- a/jdk/src/share/classes/java/time/format/DateTimeParseContext.java Wed Jul 05 19:34:04 2017 +0200 +++ b/jdk/src/share/classes/java/time/format/DateTimeParseContext.java Tue Mar 25 14:51:01 2014 -0700 @@ -64,10 +64,12 @@ import java.time.ZoneId; import java.time.chrono.Chronology; import java.time.chrono.IsoChronology; +import java.time.temporal.TemporalAccessor; import java.time.temporal.TemporalField; import java.util.ArrayList; import java.util.Locale; import java.util.Objects; +import java.util.Set; import java.util.function.Consumer; /** @@ -77,8 +79,8 @@ * It has the ability to store and retrieve the parsed values and manage optional segments. * It also provides key information to the parsing methods. *
- * Once parsing is complete, the {@link #toParsed()} is used to obtain the data.
- * It contains a method to resolve the separate parsed fields into meaningful values.
+ * Once parsing is complete, the {@link #toUnresolved()} is used to obtain the unresolved
+ * result data. The {@link #toResolved()} is used to obtain the resolved result.
*
* @implSpec
* This class is a mutable context intended for use from a single thread.
@@ -309,16 +311,27 @@
}
/**
- * Gets the result of the parse.
+ * Gets the unresolved result of the parse.
*
* @return the result of the parse, not null
*/
- Parsed toParsed() {
+ Parsed toUnresolved() {
+ return currentParsed();
+ }
+
+ /**
+ * Gets the resolved result of the parse.
+ *
+ * @return the result of the parse, not null
+ */
+ TemporalAccessor toResolved(ResolverStyle resolverStyle, Set4.0 Related Specifications
5.0 Related Documentation