From 8f734f4dcff290797f5ffc99dc13ebc97bd7d813 Mon Sep 17 00:00:00 2001 From: Jaroslav Bachorik Date: Tue, 23 Apr 2013 09:37:31 +0200 Subject: [PATCH 001/131] 8011081: Improve jhat Properly escape HTML output Reviewed-by: alanb, mschoene, sundar --- .../hat/internal/server/AllClassesQuery.java | 2 +- .../tools/hat/internal/server/ClassQuery.java | 10 +++++----- .../tools/hat/internal/server/HttpReader.java | 10 +++------- .../internal/server/InstancesCountQuery.java | 4 ++-- .../sun/tools/hat/internal/server/OQLHelp.java | 5 +---- .../sun/tools/hat/internal/server/OQLQuery.java | 15 +++------------ .../tools/hat/internal/server/QueryHandler.java | 17 +++++++++++++++-- .../hat/internal/server/RefsByTypeQuery.java | 6 +++--- 8 files changed, 33 insertions(+), 36 deletions(-) diff --git a/jdk/src/share/classes/com/sun/tools/hat/internal/server/AllClassesQuery.java b/jdk/src/share/classes/com/sun/tools/hat/internal/server/AllClassesQuery.java index d44a8fc2ecf..bdf01b8d5c6 100644 --- a/jdk/src/share/classes/com/sun/tools/hat/internal/server/AllClassesQuery.java +++ b/jdk/src/share/classes/com/sun/tools/hat/internal/server/AllClassesQuery.java @@ -84,7 +84,7 @@ class AllClassesQuery extends QueryHandler { lastPackage = pkg; printClass(clazz); if (clazz.getId() != -1) { - out.print(" [" + clazz.getIdString() + "]"); + print(" [" + clazz.getIdString() + "]"); } out.println("
"); } diff --git a/jdk/src/share/classes/com/sun/tools/hat/internal/server/ClassQuery.java b/jdk/src/share/classes/com/sun/tools/hat/internal/server/ClassQuery.java index 1d5782390ce..f13572a22cc 100644 --- a/jdk/src/share/classes/com/sun/tools/hat/internal/server/ClassQuery.java +++ b/jdk/src/share/classes/com/sun/tools/hat/internal/server/ClassQuery.java @@ -112,12 +112,12 @@ class ClassQuery extends QueryHandler { out.println("

Instances

"); printAnchorStart(); - out.print("instances/" + encodeForURL(clazz)); + print("instances/" + encodeForURL(clazz)); out.print("\">"); out.println("Exclude subclasses
"); printAnchorStart(); - out.print("allInstances/" + encodeForURL(clazz)); + print("allInstances/" + encodeForURL(clazz)); out.print("\">"); out.println("Include subclasses
"); @@ -126,19 +126,19 @@ class ClassQuery extends QueryHandler { out.println("

New Instances

"); printAnchorStart(); - out.print("newInstances/" + encodeForURL(clazz)); + print("newInstances/" + encodeForURL(clazz)); out.print("\">"); out.println("Exclude subclasses
"); printAnchorStart(); - out.print("allNewInstances/" + encodeForURL(clazz)); + print("allNewInstances/" + encodeForURL(clazz)); out.print("\">"); out.println("Include subclasses
"); } out.println("

References summary by Type

"); printAnchorStart(); - out.print("refsByType/" + encodeForURL(clazz)); + print("refsByType/" + encodeForURL(clazz)); out.print("\">"); out.println("References summary by type"); diff --git a/jdk/src/share/classes/com/sun/tools/hat/internal/server/HttpReader.java b/jdk/src/share/classes/com/sun/tools/hat/internal/server/HttpReader.java index f86c8caa8e2..f08c9875c67 100644 --- a/jdk/src/share/classes/com/sun/tools/hat/internal/server/HttpReader.java +++ b/jdk/src/share/classes/com/sun/tools/hat/internal/server/HttpReader.java @@ -41,21 +41,17 @@ package com.sun.tools.hat.internal.server; import java.net.Socket; -import java.net.ServerSocket; -import java.net.InetAddress; import java.io.InputStream; import java.io.BufferedInputStream; import java.io.IOException; -import java.io.Writer; import java.io.BufferedWriter; import java.io.PrintWriter; -import java.io.OutputStream; import java.io.OutputStreamWriter; -import java.io.BufferedOutputStream; import com.sun.tools.hat.internal.model.Snapshot; import com.sun.tools.hat.internal.oql.OQLEngine; +import com.sun.tools.hat.internal.util.Misc; public class HttpReader implements Runnable { @@ -87,7 +83,7 @@ public class HttpReader implements Runnable { outputError("Protocol error"); } int data; - StringBuffer queryBuf = new StringBuffer(); + StringBuilder queryBuf = new StringBuilder(); while ((data = in.read()) != -1 && data != ' ') { char ch = (char) data; queryBuf.append(ch); @@ -217,7 +213,7 @@ public class HttpReader implements Runnable { private void outputError(String msg) { out.println(); out.println(""); - out.println(msg); + out.println(Misc.encodeHtml(msg)); out.println(""); } diff --git a/jdk/src/share/classes/com/sun/tools/hat/internal/server/InstancesCountQuery.java b/jdk/src/share/classes/com/sun/tools/hat/internal/server/InstancesCountQuery.java index 724b549ca4b..7e87543ef99 100644 --- a/jdk/src/share/classes/com/sun/tools/hat/internal/server/InstancesCountQuery.java +++ b/jdk/src/share/classes/com/sun/tools/hat/internal/server/InstancesCountQuery.java @@ -102,7 +102,7 @@ class InstancesCountQuery extends QueryHandler { int count = clazz.getInstancesCount(false); print("" + count); printAnchorStart(); - out.print("instances/" + encodeForURL(classes[i])); + print("instances/" + encodeForURL(classes[i])); out.print("\"> "); if (count == 1) { print("instance"); @@ -121,7 +121,7 @@ class InstancesCountQuery extends QueryHandler { } print("("); printAnchorStart(); - out.print("newInstances/" + encodeForURL(classes[i])); + print("newInstances/" + encodeForURL(classes[i])); out.print("\">"); print("" + newInst + " new"); out.print(") "); diff --git a/jdk/src/share/classes/com/sun/tools/hat/internal/server/OQLHelp.java b/jdk/src/share/classes/com/sun/tools/hat/internal/server/OQLHelp.java index 6aaa909109a..730d2b7672d 100644 --- a/jdk/src/share/classes/com/sun/tools/hat/internal/server/OQLHelp.java +++ b/jdk/src/share/classes/com/sun/tools/hat/internal/server/OQLHelp.java @@ -54,10 +54,7 @@ class OQLHelp extends QueryHandler { out.print((char)ch); } } catch (Exception exp) { - out.println(exp.getMessage()); - out.println("
");
-            exp.printStackTrace(out);
-            out.println("
"); + printException(exp); } } } diff --git a/jdk/src/share/classes/com/sun/tools/hat/internal/server/OQLQuery.java b/jdk/src/share/classes/com/sun/tools/hat/internal/server/OQLQuery.java index 8e5ec5e2894..3e99bbcbb74 100644 --- a/jdk/src/share/classes/com/sun/tools/hat/internal/server/OQLQuery.java +++ b/jdk/src/share/classes/com/sun/tools/hat/internal/server/OQLQuery.java @@ -32,10 +32,7 @@ package com.sun.tools.hat.internal.server; -import com.sun.tools.hat.internal.model.*; import com.sun.tools.hat.internal.oql.*; -import com.sun.tools.hat.internal.util.ArraySorter; -import com.sun.tools.hat.internal.util.Comparer; /** * This handles Object Query Language (OQL) queries. @@ -68,7 +65,7 @@ class OQLQuery extends QueryHandler { out.println("

"); out.println(""); out.println("

"); @@ -91,10 +88,7 @@ class OQLQuery extends QueryHandler { try { out.println(engine.toHtml(o)); } catch (Exception e) { - out.println(e.getMessage()); - out.println("
");
-                             e.printStackTrace(out);
-                             out.println("
"); + printException(e); } out.println(""); return false; @@ -102,10 +96,7 @@ class OQLQuery extends QueryHandler { }); out.println(""); } catch (OQLException exp) { - out.println(exp.getMessage()); - out.println("
");
-            exp.printStackTrace(out);
-            out.println("
"); + printException(exp); } } diff --git a/jdk/src/share/classes/com/sun/tools/hat/internal/server/QueryHandler.java b/jdk/src/share/classes/com/sun/tools/hat/internal/server/QueryHandler.java index deda0f48058..9a6d93de06a 100644 --- a/jdk/src/share/classes/com/sun/tools/hat/internal/server/QueryHandler.java +++ b/jdk/src/share/classes/com/sun/tools/hat/internal/server/QueryHandler.java @@ -36,6 +36,7 @@ import java.io.PrintWriter; import com.sun.tools.hat.internal.model.*; import com.sun.tools.hat.internal.util.Misc; +import java.io.StringWriter; import java.net.URLEncoder; import java.io.UnsupportedEncodingException; @@ -96,7 +97,7 @@ abstract class QueryHandler { } protected void error(String msg) { - out.println(msg); + println(msg); } protected void printAnchorStart() { @@ -160,7 +161,6 @@ abstract class QueryHandler { out.println("null"); return; } - String name = clazz.getName(); printAnchorStart(); out.print("class/"); print(encodeForURL(clazz)); @@ -208,6 +208,15 @@ abstract class QueryHandler { } } + protected void printException(Throwable t) { + println(t.getMessage()); + out.println("
");
+        StringWriter sw = new StringWriter();
+        t.printStackTrace(new PrintWriter(sw));
+        print(sw.toString());
+        out.println("
"); + } + protected void printHex(long addr) { if (snapshot.getIdentifierSize() == 4) { out.print(Misc.toHex((int)addr)); @@ -223,4 +232,8 @@ abstract class QueryHandler { protected void print(String str) { out.print(Misc.encodeHtml(str)); } + + protected void println(String str) { + out.println(Misc.encodeHtml(str)); + } } diff --git a/jdk/src/share/classes/com/sun/tools/hat/internal/server/RefsByTypeQuery.java b/jdk/src/share/classes/com/sun/tools/hat/internal/server/RefsByTypeQuery.java index 5e7de9a8866..3337b471590 100644 --- a/jdk/src/share/classes/com/sun/tools/hat/internal/server/RefsByTypeQuery.java +++ b/jdk/src/share/classes/com/sun/tools/hat/internal/server/RefsByTypeQuery.java @@ -89,7 +89,7 @@ public class RefsByTypeQuery extends QueryHandler { out.println("

"); printClass(clazz); if (clazz.getId() != -1) { - out.println("[" + clazz.getIdString() + "]"); + println("[" + clazz.getIdString() + "]"); } out.println("

"); @@ -125,9 +125,9 @@ public class RefsByTypeQuery extends QueryHandler { JavaClass clazz = classes[i]; out.println(""); out.print(""); - out.print(clazz.getName()); + print(clazz.getName()); out.println(""); out.println(""); out.println(map.get(clazz)); From 7ca524c5cd9a36f350d8bb8ba5770df69427e706 Mon Sep 17 00:00:00 2001 From: Kumar Srinivasan Date: Tue, 7 May 2013 13:37:03 -0700 Subject: [PATCH 002/131] 8013506: Better Pack200 data handling Reviewed-by: jrose, kizune, mschoene --- jdk/src/share/native/com/sun/java/util/jar/pack/zip.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/jdk/src/share/native/com/sun/java/util/jar/pack/zip.cpp b/jdk/src/share/native/com/sun/java/util/jar/pack/zip.cpp index 93bf3301546..f7b95b47368 100644 --- a/jdk/src/share/native/com/sun/java/util/jar/pack/zip.cpp +++ b/jdk/src/share/native/com/sun/java/util/jar/pack/zip.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 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 @@ -340,6 +340,10 @@ uLong jar::get_dostime(int modtime) { struct tm sbuf; (void)memset((void*)&sbuf,0, sizeof(sbuf)); struct tm* s = gmtime_r(&t, &sbuf); + if (s == NULL) { + fprintf(u->errstrm, "Error: gmtime failure, invalid input archive\n"); + exit(2); + } modtime_cache = modtime; dostime_cache = dostime(s->tm_year + 1900, s->tm_mon + 1, s->tm_mday, s->tm_hour, s->tm_min, s->tm_sec); @@ -384,7 +388,7 @@ bool jar::deflate_bytes(bytes& head, bytes& tail) { } deflated.empty(); - zs.next_out = (uchar*) deflated.grow(len + (len/2)); + zs.next_out = (uchar*) deflated.grow(add_size(len, (len/2))); zs.avail_out = (int)deflated.size(); zs.next_in = (uchar*)head.ptr; From e8457abad47c8c47beafcdbb394bbaf88b30753e Mon Sep 17 00:00:00 2001 From: Johnny Chen Date: Thu, 9 May 2013 09:52:55 -0700 Subject: [PATCH 003/131] 8013510: Augment image writing code Reviewed-by: bae, prr --- .../com/sun/imageio/plugins/jpeg/JPEGImageReader.java | 5 +++++ .../com/sun/imageio/plugins/jpeg/JPEGImageWriter.java | 4 ++-- jdk/src/share/native/sun/awt/image/jpeg/imageioJPEG.c | 9 +++++++++ 3 files changed, 16 insertions(+), 2 deletions(-) diff --git a/jdk/src/share/classes/com/sun/imageio/plugins/jpeg/JPEGImageReader.java b/jdk/src/share/classes/com/sun/imageio/plugins/jpeg/JPEGImageReader.java index d69200c1408..0b7a865074a 100644 --- a/jdk/src/share/classes/com/sun/imageio/plugins/jpeg/JPEGImageReader.java +++ b/jdk/src/share/classes/com/sun/imageio/plugins/jpeg/JPEGImageReader.java @@ -1165,6 +1165,11 @@ public class JPEGImageReader extends ImageReader { target = imRas; } int [] bandSizes = target.getSampleModel().getSampleSize(); + for (int i = 0; i < bandSizes.length; i++) { + if (bandSizes[i] <= 0 || bandSizes[i] > 8) { + throw new IIOException("Illegal band size: should be 0 < size <= 8"); + } + } /* * If the process is sequential, and we have restart markers, diff --git a/jdk/src/share/classes/com/sun/imageio/plugins/jpeg/JPEGImageWriter.java b/jdk/src/share/classes/com/sun/imageio/plugins/jpeg/JPEGImageWriter.java index b8564176df8..d9723e7ba20 100644 --- a/jdk/src/share/classes/com/sun/imageio/plugins/jpeg/JPEGImageWriter.java +++ b/jdk/src/share/classes/com/sun/imageio/plugins/jpeg/JPEGImageWriter.java @@ -495,8 +495,8 @@ public class JPEGImageWriter extends ImageWriter { // handle <= 8-bit samples. We now check the band sizes and throw // an exception for images, such as USHORT_GRAY, with > 8 bits // per sample. - if (bandSizes[i] > 8) { - throw new IIOException("Sample size must be <= 8"); + if (bandSizes[i] <= 0 || bandSizes[i] > 8) { + throw new IIOException("Illegal band size: should be 0 < size <= 8"); } // 4450894 part 2: We expand IndexColorModel images to full 24- // or 32-bit in grabPixels() for each scanline. For indexed diff --git a/jdk/src/share/native/sun/awt/image/jpeg/imageioJPEG.c b/jdk/src/share/native/sun/awt/image/jpeg/imageioJPEG.c index 7411c34bb83..4934c748f61 100644 --- a/jdk/src/share/native/sun/awt/image/jpeg/imageioJPEG.c +++ b/jdk/src/share/native/sun/awt/image/jpeg/imageioJPEG.c @@ -2674,6 +2674,15 @@ Java_com_sun_imageio_plugins_jpeg_JPEGImageWriter_writeImage bandSize = (*env)->GetIntArrayElements(env, bandSizes, NULL); + for (i = 0; i < numBands; i++) { + if (bandSize[i] <= 0 || bandSize[i] > JPEG_BAND_SIZE) { + (*env)->ReleaseIntArrayElements(env, bandSizes, + bandSize, JNI_ABORT); + JNU_ThrowByName(env, "javax/imageio/IIOException", "Invalid Image"); + return JNI_FALSE;; + } + } + for (i = 0; i < numBands; i++) { if (bandSize[i] != JPEG_BAND_SIZE) { if (scale == NULL) { From 7dacefeca149e32a783e18398b5974d6c53bb867 Mon Sep 17 00:00:00 2001 From: Andrew Brygin Date: Tue, 14 May 2013 12:51:59 +0400 Subject: [PATCH 004/131] 8014093: Improve parsing of images Reviewed-by: prr, jgodinez --- .../native/sun/awt/image/awt_parseImage.c | 443 ++++++------------ .../native/sun/awt/image/awt_parseImage.h | 11 +- .../native/sun/awt/medialib/awt_ImagingLib.c | 114 +---- 3 files changed, 151 insertions(+), 417 deletions(-) diff --git a/jdk/src/share/native/sun/awt/image/awt_parseImage.c b/jdk/src/share/native/sun/awt/image/awt_parseImage.c index e11a8dbee8c..8d6e9a3ed80 100644 --- a/jdk/src/share/native/sun/awt/image/awt_parseImage.c +++ b/jdk/src/share/native/sun/awt/image/awt_parseImage.c @@ -873,363 +873,204 @@ setHints(JNIEnv *env, BufImageS_t *imageP) { return 1; } -/* - * This routine will fill in a buffer of data for either 1 band or all - * bands (if band == -1). - */ #define MAX_TO_GRAB (10240) -int awt_getPixelByte(JNIEnv *env, int band, RasterS_t *rasterP, - unsigned char *bufferP) { - int w = rasterP->width; - int h = rasterP->height; - int numBands = rasterP->numBands; +typedef union { + void *pv; + unsigned char *pb; + unsigned short *ps; +} PixelData_t; + + +int awt_getPixels(JNIEnv *env, RasterS_t *rasterP, void *bufferP) { + const int w = rasterP->width; + const int h = rasterP->height; + const int numBands = rasterP->numBands; int y; int i; - int maxLines = (h < MAX_TO_GRAB/w ? h : MAX_TO_GRAB/w); + int maxLines; jobject jsm; - int off; + int off = 0; jarray jdata = NULL; jobject jdatabuffer; int *dataP; - int maxBytes = w; + int maxSamples; + PixelData_t p; + + if (bufferP == NULL) { + return -1; + } + + if (rasterP->dataType != BYTE_DATA_TYPE && + rasterP->dataType != SHORT_DATA_TYPE) + { + return -1; + } + + p.pv = bufferP; + + if (!SAFE_TO_MULT(w, numBands)) { + return -1; + } + maxSamples = w * numBands; + + maxLines = maxSamples > MAX_TO_GRAB ? 1 : (MAX_TO_GRAB / maxSamples); + if (maxLines > h) { + maxLines = h; + } + + if (!SAFE_TO_MULT(maxSamples, maxLines)) { + return -1; + } + + maxSamples *= maxLines; jsm = (*env)->GetObjectField(env, rasterP->jraster, g_RasterSampleModelID); jdatabuffer = (*env)->GetObjectField(env, rasterP->jraster, g_RasterDataBufferID); - jdata = (*env)->NewIntArray(env, maxBytes*rasterP->numBands*maxLines); + + jdata = (*env)->NewIntArray(env, maxSamples); if (JNU_IsNull(env, jdata)) { JNU_ThrowOutOfMemoryError(env, "Out of Memory"); return -1; } - /* Here is the generic code */ - if (band >= 0) { - int dOff; - if (band >= numBands) { + for (y = 0; y < h; y += maxLines) { + if (y + maxLines > h) { + maxLines = h - y; + maxSamples = w * numBands * maxLines; + } + + (*env)->CallObjectMethod(env, jsm, g_SMGetPixelsMID, + 0, y, w, + maxLines, jdata, jdatabuffer); + + if ((*env)->ExceptionOccurred(env)) { (*env)->DeleteLocalRef(env, jdata); - JNU_ThrowInternalError(env, "Band out of range."); return -1; } - off = 0; - for (y=0; y < h; ) { - (*env)->CallObjectMethod(env, jsm, g_SMGetPixelsMID, - 0, y, w, - maxLines, jdata, jdatabuffer); - dataP = (int *) (*env)->GetPrimitiveArrayCritical(env, jdata, - NULL); - if (dataP == NULL) { - (*env)->DeleteLocalRef(env, jdata); - return -1; - } - dOff = band; - for (i=0; i < maxBytes; i++, dOff += numBands) { - bufferP[off++] = (unsigned char) dataP[dOff]; - } - (*env)->ReleasePrimitiveArrayCritical(env, jdata, dataP, - JNI_ABORT); - - if (y+maxLines < h) { - y += maxLines; - } - else { - y++; - maxBytes = w; - } - } - } - else { - off = 0; - maxBytes *= numBands; - for (y=0; y < h; ) { - (*env)->CallObjectMethod(env, jsm, g_SMGetPixelsMID, - 0, y, w, - maxLines, jdata, jdatabuffer); - dataP = (int *) (*env)->GetPrimitiveArrayCritical(env, jdata, - NULL); - if (dataP == NULL) { - (*env)->DeleteLocalRef(env, jdata); - return -1; - } - for (i=0; i < maxBytes; i++) { - bufferP[off++] = (unsigned char) dataP[i]; - } - - (*env)->ReleasePrimitiveArrayCritical(env, jdata, dataP, - JNI_ABORT); - - if (y+maxLines < h) { - y += maxLines; - } - else { - y++; - maxBytes = w*numBands; - } - } - - } - (*env)->DeleteLocalRef(env, jdata); - - return 0; -} -int awt_setPixelByte(JNIEnv *env, int band, RasterS_t *rasterP, - unsigned char *bufferP) { - int w = rasterP->width; - int h = rasterP->height; - int numBands = rasterP->numBands; - int y; - int i; - int maxLines = (h < MAX_TO_GRAB/w ? h : MAX_TO_GRAB/w); - jobject jsm; - int off; - jarray jdata = NULL; - jobject jdatabuffer; - int *dataP; - int maxBytes = w; - - jsm = (*env)->GetObjectField(env, rasterP->jraster, g_RasterSampleModelID); - jdatabuffer = (*env)->GetObjectField(env, rasterP->jraster, - g_RasterDataBufferID); - /* Here is the generic code */ - jdata = (*env)->NewIntArray(env, maxBytes*rasterP->numBands*maxLines); - if (JNU_IsNull(env, jdata)) { - JNU_ThrowOutOfMemoryError(env, "Out of Memory"); - return -1; - } - if (band >= 0) { - int dOff; - if (band >= numBands) { + dataP = (int *) (*env)->GetPrimitiveArrayCritical(env, jdata, + NULL); + if (dataP == NULL) { (*env)->DeleteLocalRef(env, jdata); - JNU_ThrowInternalError(env, "Band out of range."); return -1; } - off = 0; - for (y=0; y < h; y+=maxLines) { - if (y+maxLines > h) { - maxBytes = w*numBands; - maxLines = h - y; - } - dataP = (int *) (*env)->GetPrimitiveArrayCritical(env, jdata, - NULL); - if (dataP == NULL) { - (*env)->DeleteLocalRef(env, jdata); - return -1; - } - dOff = band; - for (i=0; i < maxBytes; i++, dOff += numBands) { - dataP[dOff] = bufferP[off++]; - } - (*env)->ReleasePrimitiveArrayCritical(env, jdata, dataP, - JNI_ABORT); - - (*env)->CallVoidMethod(env, jsm, g_SMSetPixelsMID, - 0, y, w, - maxLines, jdata, jdatabuffer); - } - } - else { - off = 0; - maxBytes *= numBands; - for (y=0; y < h; y+=maxLines) { - if (y+maxLines > h) { - maxBytes = w*numBands; - maxLines = h - y; + switch (rasterP->dataType) { + case BYTE_DATA_TYPE: + for (i = 0; i < maxSamples; i ++) { + p.pb[off++] = (unsigned char) dataP[i]; } - dataP = (int *) (*env)->GetPrimitiveArrayCritical(env, jdata, - NULL); - if (dataP == NULL) { - (*env)->DeleteLocalRef(env, jdata); - return -1; + break; + case SHORT_DATA_TYPE: + for (i = 0; i < maxSamples; i ++) { + p.ps[off++] = (unsigned short) dataP[i]; } - for (i=0; i < maxBytes; i++) { - dataP[i] = bufferP[off++]; - } - - (*env)->ReleasePrimitiveArrayCritical(env, jdata, dataP, - JNI_ABORT); - - (*env)->CallVoidMethod(env, jsm, g_SMSetPixelsMID, - 0, y, w, - maxLines, jdata, jdatabuffer); + break; } + (*env)->ReleasePrimitiveArrayCritical(env, jdata, dataP, + JNI_ABORT); } - (*env)->DeleteLocalRef(env, jdata); - return 0; + return 1; } -int awt_getPixelShort(JNIEnv *env, int band, RasterS_t *rasterP, - unsigned short *bufferP) { - int w = rasterP->width; - int h = rasterP->height; - int numBands = rasterP->numBands; + +int awt_setPixels(JNIEnv *env, RasterS_t *rasterP, void *bufferP) { + const int w = rasterP->width; + const int h = rasterP->height; + const int numBands = rasterP->numBands; + int y; int i; - int maxLines = (h < MAX_TO_GRAB/w ? h : MAX_TO_GRAB/w); + int maxLines; jobject jsm; - int off; + int off = 0; jarray jdata = NULL; jobject jdatabuffer; int *dataP; - int maxBytes = w*maxLines; + int maxSamples; + PixelData_t p; + + if (bufferP == NULL) { + return -1; + } + + if (rasterP->dataType != BYTE_DATA_TYPE && + rasterP->dataType != SHORT_DATA_TYPE) + { + return -1; + } + + p.pv = bufferP; + + if (!SAFE_TO_MULT(w, numBands)) { + return -1; + } + maxSamples = w * numBands; + + maxLines = maxSamples > MAX_TO_GRAB ? 1 : (MAX_TO_GRAB / maxSamples); + if (maxLines > h) { + maxLines = h; + } + + if (!SAFE_TO_MULT(maxSamples, maxLines)) { + return -1; + } + + maxSamples *= maxLines; jsm = (*env)->GetObjectField(env, rasterP->jraster, g_RasterSampleModelID); jdatabuffer = (*env)->GetObjectField(env, rasterP->jraster, g_RasterDataBufferID); - jdata = (*env)->NewIntArray(env, maxBytes*rasterP->numBands*maxLines); + + jdata = (*env)->NewIntArray(env, maxSamples); if (JNU_IsNull(env, jdata)) { JNU_ThrowOutOfMemoryError(env, "Out of Memory"); return -1; } - /* Here is the generic code */ - if (band >= 0) { - int dOff; - if (band >= numBands) { + + for (y = 0; y < h; y += maxLines) { + if (y + maxLines > h) { + maxLines = h - y; + maxSamples = w * numBands * maxLines; + } + dataP = (int *) (*env)->GetPrimitiveArrayCritical(env, jdata, + NULL); + if (dataP == NULL) { (*env)->DeleteLocalRef(env, jdata); - JNU_ThrowInternalError(env, "Band out of range."); return -1; } - off = 0; - for (y=0; y < h; y += maxLines) { - if (y+maxLines > h) { - maxBytes = w*numBands; - maxLines = h - y; - } - (*env)->CallObjectMethod(env, jsm, g_SMGetPixelsMID, - 0, y, w, - maxLines, jdata, jdatabuffer); - dataP = (int *) (*env)->GetPrimitiveArrayCritical(env, jdata, - NULL); - if (dataP == NULL) { - (*env)->DeleteLocalRef(env, jdata); - return -1; - } - dOff = band; - for (i=0; i < maxBytes; i++, dOff += numBands) { - bufferP[off++] = (unsigned short) dataP[dOff]; + switch (rasterP->dataType) { + case BYTE_DATA_TYPE: + for (i = 0; i < maxSamples; i ++) { + dataP[i] = p.pb[off++]; } - - (*env)->ReleasePrimitiveArrayCritical(env, jdata, dataP, - JNI_ABORT); - } - } - else { - off = 0; - maxBytes *= numBands; - for (y=0; y < h; y+=maxLines) { - if (y+maxLines > h) { - maxBytes = w*numBands; - maxLines = h - y; + break; + case SHORT_DATA_TYPE: + for (i = 0; i < maxSamples; i ++) { + dataP[i] = p.ps[off++]; } - (*env)->CallObjectMethod(env, jsm, g_SMGetPixelsMID, - 0, y, w, - maxLines, jdata, jdatabuffer); - dataP = (int *) (*env)->GetPrimitiveArrayCritical(env, jdata, - NULL); - if (dataP == NULL) { - (*env)->DeleteLocalRef(env, jdata); - return -1; - } - for (i=0; i < maxBytes; i++) { - bufferP[off++] = (unsigned short) dataP[i]; - } - - (*env)->ReleasePrimitiveArrayCritical(env, jdata, dataP, - JNI_ABORT); + break; } + (*env)->ReleasePrimitiveArrayCritical(env, jdata, dataP, + JNI_ABORT); + + (*env)->CallVoidMethod(env, jsm, g_SMSetPixelsMID, + 0, y, w, + maxLines, jdata, jdatabuffer); + + if ((*env)->ExceptionOccurred(env)) { + (*env)->DeleteLocalRef(env, jdata); + return -1; + } } (*env)->DeleteLocalRef(env, jdata); - return 0; -} -int awt_setPixelShort(JNIEnv *env, int band, RasterS_t *rasterP, - unsigned short *bufferP) { - int w = rasterP->width; - int h = rasterP->height; - int numBands = rasterP->numBands; - int y; - int i; - int maxLines = (h < MAX_TO_GRAB/w ? h : MAX_TO_GRAB/w); - jobject jsm; - int off; - jarray jdata = NULL; - jobject jdatabuffer; - int *dataP; - int maxBytes = w; - - jsm = (*env)->GetObjectField(env, rasterP->jraster, g_RasterSampleModelID); - jdatabuffer = (*env)->GetObjectField(env, rasterP->jraster, - g_RasterDataBufferID); - if (band >= numBands) { - JNU_ThrowInternalError(env, "Band out of range."); - return -1; - } - /* Here is the generic code */ - jdata = (*env)->NewIntArray(env, maxBytes*rasterP->numBands*maxLines); - if (JNU_IsNull(env, jdata)) { - JNU_ThrowOutOfMemoryError(env, "Out of Memory"); - return -1; - } - if (band >= 0) { - int dOff; - off = 0; - for (y=0; y < h; y+=maxLines) { - if (y+maxLines > h) { - maxBytes = w*numBands; - maxLines = h - y; - } - dataP = (int *) (*env)->GetPrimitiveArrayCritical(env, jdata, - NULL); - if (dataP == NULL) { - (*env)->DeleteLocalRef(env, jdata); - return -1; - } - dOff = band; - for (i=0; i < maxBytes; i++, dOff += numBands) { - dataP[dOff] = bufferP[off++]; - } - - (*env)->ReleasePrimitiveArrayCritical(env, jdata, dataP, - JNI_ABORT); - - (*env)->CallVoidMethod(env, jsm, g_SMSetPixelsMID, - 0, y, w, - maxLines, jdata, jdatabuffer); - } - } - else { - off = 0; - maxBytes *= numBands; - for (y=0; y < h; y+=maxLines) { - if (y+maxLines > h) { - maxBytes = w*numBands; - maxLines = h - y; - } - dataP = (int *) (*env)->GetPrimitiveArrayCritical(env, jdata, - NULL); - if (dataP == NULL) { - (*env)->DeleteLocalRef(env, jdata); - return -1; - } - for (i=0; i < maxBytes; i++) { - dataP[i] = bufferP[off++]; - } - - (*env)->ReleasePrimitiveArrayCritical(env, jdata, dataP, - JNI_ABORT); - - (*env)->CallVoidMethod(env, jsm, g_SMSetPixelsMID, - 0, y, w, - maxLines, jdata, jdatabuffer); - } - - } - - (*env)->DeleteLocalRef(env, jdata); - return 0; + + return 1; } diff --git a/jdk/src/share/native/sun/awt/image/awt_parseImage.h b/jdk/src/share/native/sun/awt/image/awt_parseImage.h index b92bb0c2833..02dfd1a2154 100644 --- a/jdk/src/share/native/sun/awt/image/awt_parseImage.h +++ b/jdk/src/share/native/sun/awt/image/awt_parseImage.h @@ -188,13 +188,8 @@ void awt_freeParsedRaster(RasterS_t *rasterP, int freeRasterP); void awt_freeParsedImage(BufImageS_t *imageP, int freeImageP); -int awt_getPixelByte(JNIEnv *env, int band, RasterS_t *rasterP, - unsigned char *bufferP); -int awt_setPixelByte(JNIEnv *env, int band, RasterS_t *rasterP, - unsigned char *bufferP); -int awt_getPixelShort(JNIEnv *env, int band, RasterS_t *rasterP, - unsigned short *bufferP); -int awt_setPixelShort(JNIEnv *env, int band, RasterS_t *rasterP, - unsigned short *bufferP); +int awt_getPixels(JNIEnv *env, RasterS_t *rasterP, void *bufferP); + +int awt_setPixels(JNIEnv *env, RasterS_t *rasterP, void *bufferP); #endif /* AWT_PARSE_IMAGE_H */ diff --git a/jdk/src/share/native/sun/awt/medialib/awt_ImagingLib.c b/jdk/src/share/native/sun/awt/medialib/awt_ImagingLib.c index 25764213888..e3af348adda 100644 --- a/jdk/src/share/native/sun/awt/medialib/awt_ImagingLib.c +++ b/jdk/src/share/native/sun/awt/medialib/awt_ImagingLib.c @@ -700,22 +700,7 @@ Java_sun_awt_image_ImagingLib_convolveRaster(JNIEnv *env, jobject this, /* Means that we couldn't write directly into the destination buffer */ if (ddata == NULL) { - unsigned char *bdataP; - unsigned short *sdataP; - - /* Punt for now */ - switch (dstRasterP->dataType) { - case BYTE_DATA_TYPE: - bdataP = (unsigned char *) mlib_ImageGetData(dst); - retStatus = (awt_setPixelByte(env, -1, dstRasterP, bdataP) >= 0) ; - break; - case SHORT_DATA_TYPE: - sdataP = (unsigned short *) mlib_ImageGetData(dst); - retStatus = (awt_setPixelShort(env, -1, dstRasterP, sdataP) >= 0) ; - break; - default: - retStatus = 0; - } + retStatus = awt_setPixels(env, dstRasterP, mlib_ImageGetData(dst)); } /* Release the pinned memory */ @@ -1119,24 +1104,9 @@ fprintf(stderr,"Flags : %d\n",dst->flags); /* Means that we couldn't write directly into the destination buffer */ if (ddata == NULL) { - unsigned char *bdataP; - unsigned short *sdataP; - /* Need to store it back into the array */ if (storeRasterArray(env, srcRasterP, dstRasterP, dst) < 0) { - /* Punt for now */ - switch (dst->type) { - case MLIB_BYTE: - bdataP = (unsigned char *) mlib_ImageGetData(dst); - retStatus = (awt_setPixelByte(env, -1, dstRasterP, bdataP) >= 0) ; - break; - case MLIB_SHORT: - sdataP = (unsigned short *) mlib_ImageGetData(dst); - retStatus = (awt_setPixelShort(env, -1, dstRasterP, sdataP) >= 0) ; - break; - default: - retStatus = 0; - } + retStatus = awt_setPixels(env, dstRasterP, mlib_ImageGetData(dst)); } } @@ -1704,21 +1674,7 @@ Java_sun_awt_image_ImagingLib_lookupByteRaster(JNIEnv *env, * the destination buffer */ if (ddata == NULL) { - unsigned char* bdataP; - unsigned short* sdataP; - - switch (dstRasterP->dataType) { - case BYTE_DATA_TYPE: - bdataP = (unsigned char *) mlib_ImageGetData(dst); - retStatus = (awt_setPixelByte(env, -1, dstRasterP, bdataP) >= 0) ; - break; - case SHORT_DATA_TYPE: - sdataP = (unsigned short *) mlib_ImageGetData(dst); - retStatus = (awt_setPixelShort(env, -1, dstRasterP, sdataP) >= 0) ; - break; - default: - retStatus = 0; - } + retStatus = awt_setPixels(env, dstRasterP, mlib_ImageGetData(dst)); } /* Release the LUT */ @@ -2298,7 +2254,6 @@ allocateRasterArray(JNIEnv *env, RasterS_t *rasterP, mlib_image **mlibImagePP, void **dataPP, int isSrc) { void *dataP; unsigned char *cDataP; - unsigned short *sdataP; int dataType = BYTE_DATA_TYPE; int width; int height; @@ -2484,8 +2439,7 @@ allocateRasterArray(JNIEnv *env, RasterS_t *rasterP, return -1; } if (isSrc) { - cDataP = (unsigned char *) mlib_ImageGetData(*mlibImagePP); - if (awt_getPixelByte(env, -1, rasterP, cDataP) < 0) { + if (awt_getPixels(env, rasterP, mlib_ImageGetData(*mlibImagePP)) < 0) { (*sMlibSysFns.deleteImageFP)(*mlibImagePP); return -1; } @@ -2499,8 +2453,7 @@ allocateRasterArray(JNIEnv *env, RasterS_t *rasterP, return -1; } if (isSrc) { - sdataP = (unsigned short *) mlib_ImageGetData(*mlibImagePP); - if (awt_getPixelShort(env, -1, rasterP, sdataP) < 0) { + if (awt_getPixels(env, rasterP, mlib_ImageGetData(*mlibImagePP)) < 0) { (*sMlibSysFns.deleteImageFP)(*mlibImagePP); return -1; } @@ -2550,60 +2503,6 @@ freeDataArray(JNIEnv *env, jobject srcJdata, mlib_image *srcmlibImP, } } -static int -storeDstArray(JNIEnv *env, BufImageS_t *srcP, BufImageS_t *dstP, - mlibHintS_t *hintP, mlib_image *mlibImP, void *ddata) { - RasterS_t *rasterP = &dstP->raster; - - /* Nothing to do since it is the same image type */ - if (srcP->imageType == dstP->imageType - && srcP->imageType != java_awt_image_BufferedImage_TYPE_CUSTOM - && srcP->imageType != java_awt_image_BufferedImage_TYPE_BYTE_INDEXED - && srcP->imageType != java_awt_image_BufferedImage_TYPE_BYTE_BINARY) { - /* REMIND: Should check the ICM LUTS to see if it is the same */ - return 0; - } - - /* These types are compatible with TYPE_INT_RGB */ - if (srcP->imageType == java_awt_image_BufferedImage_TYPE_INT_RGB - && (dstP->imageType == java_awt_image_BufferedImage_TYPE_INT_ARGB || - dstP->imageType == java_awt_image_BufferedImage_TYPE_INT_ARGB_PRE)){ - return 0; - } - - if (hintP->cvtSrcToDefault && - (srcP->cmodel.isAlphaPre == dstP->cmodel.isAlphaPre)) { - if (srcP->cmodel.isAlphaPre) { - if (dstP->imageType == - java_awt_image_BufferedImage_TYPE_INT_ARGB_PRE) - { - return 0; - } - if (!srcP->cmodel.supportsAlpha && - dstP->imageType == java_awt_image_BufferedImage_TYPE_INT_RGB){ - return 0; - } - } - else { - /* REMIND: */ - } - } - - if (dstP->cmodel.cmType == DIRECT_CM_TYPE) { - /* Just need to move bits */ - if (mlibImP->type == MLIB_BYTE) { - return awt_setPixelByte(env, -1, &dstP->raster, - (unsigned char *) mlibImP->data); - } - else if (mlibImP->type == MLIB_SHORT) { - return awt_setPixelByte(env, -1, &dstP->raster, - (unsigned char *) mlibImP->data); - } - } - - return 0; -} - #define ERR_BAD_IMAGE_LAYOUT (-2) #define CHECK_DST_ARRAY(start_offset, elements_per_pixel) \ @@ -2716,8 +2615,7 @@ storeImageArray(JNIEnv *env, BufImageS_t *srcP, BufImageS_t *dstP, } } else if (mlibImP->type == MLIB_SHORT) { - return awt_setPixelShort(env, -1, rasterP, - (unsigned short *) mlibImP->data); + return awt_setPixels(env, rasterP, mlibImP->data); } } else { From 38c8e922af160aeb9e4a054cd779d63011960bd4 Mon Sep 17 00:00:00 2001 From: Alexander Scherbatiy Date: Mon, 20 May 2013 14:39:17 +0400 Subject: [PATCH 005/131] 8013744: Better tabling for AWT Reviewed-by: art, malenkov, skoivu --- jdk/src/share/classes/javax/swing/JTable.java | 18 +++++++++++------- .../share/classes/javax/swing/UIDefaults.java | 12 +++--------- .../javax/swing/text/DefaultFormatter.java | 8 ++++++-- .../javax/swing/text/NumberFormatter.java | 6 +++++- .../classes/sun/swing/SwingLazyValue.java | 3 ++- .../classes/sun/swing/SwingUtilities2.java | 13 +++++++++++++ 6 files changed, 40 insertions(+), 20 deletions(-) diff --git a/jdk/src/share/classes/javax/swing/JTable.java b/jdk/src/share/classes/javax/swing/JTable.java index bed8e5ca93e..3bb97ddfd44 100644 --- a/jdk/src/share/classes/javax/swing/JTable.java +++ b/jdk/src/share/classes/javax/swing/JTable.java @@ -52,6 +52,7 @@ import java.text.MessageFormat; import javax.print.attribute.*; import javax.print.PrintService; +import sun.reflect.misc.ReflectUtil; import sun.swing.SwingUtilities2; import sun.swing.SwingUtilities2.Section; @@ -5462,14 +5463,15 @@ public class JTable extends JComponent implements TableModelListener, Scrollable // they have the option to replace the value with // null or use escape to restore the original. // For Strings, return "" for backward compatibility. - if ("".equals(s)) { - if (constructor.getDeclaringClass() == String.class) { - value = s; - } - return super.stopCellEditing(); - } - try { + if ("".equals(s)) { + if (constructor.getDeclaringClass() == String.class) { + value = s; + } + return super.stopCellEditing(); + } + + SwingUtilities2.checkAccess(constructor.getModifiers()); value = constructor.newInstance(new Object[]{s}); } catch (Exception e) { @@ -5493,6 +5495,8 @@ public class JTable extends JComponent implements TableModelListener, Scrollable if (type == Object.class) { type = String.class; } + ReflectUtil.checkPackageAccess(type); + SwingUtilities2.checkAccess(type.getModifiers()); constructor = type.getConstructor(argTypes); } catch (Exception e) { diff --git a/jdk/src/share/classes/javax/swing/UIDefaults.java b/jdk/src/share/classes/javax/swing/UIDefaults.java index 9f304e742c7..3bd1297dd58 100644 --- a/jdk/src/share/classes/javax/swing/UIDefaults.java +++ b/jdk/src/share/classes/javax/swing/UIDefaults.java @@ -53,6 +53,7 @@ import java.security.PrivilegedAction; import sun.reflect.misc.MethodUtil; import sun.reflect.misc.ReflectUtil; +import sun.swing.SwingUtilities2; import sun.util.CoreResourceBundleControl; /** @@ -1101,7 +1102,7 @@ public class UIDefaults extends Hashtable } ReflectUtil.checkPackageAccess(className); c = Class.forName(className, true, (ClassLoader)cl); - checkAccess(c.getModifiers()); + SwingUtilities2.checkAccess(c.getModifiers()); if (methodName != null) { Class[] types = getClassArray(args); Method m = c.getMethod(methodName, types); @@ -1109,7 +1110,7 @@ public class UIDefaults extends Hashtable } else { Class[] types = getClassArray(args); Constructor constructor = c.getConstructor(types); - checkAccess(constructor.getModifiers()); + SwingUtilities2.checkAccess(constructor.getModifiers()); return constructor.newInstance(args); } } catch(Exception e) { @@ -1124,13 +1125,6 @@ public class UIDefaults extends Hashtable }, acc); } - private void checkAccess(int modifiers) { - if(System.getSecurityManager() != null && - !Modifier.isPublic(modifiers)) { - throw new SecurityException("Resource is not accessible"); - } - } - /* * Coerce the array of class types provided into one which * looks the way the Reflection APIs expect. This is done diff --git a/jdk/src/share/classes/javax/swing/text/DefaultFormatter.java b/jdk/src/share/classes/javax/swing/text/DefaultFormatter.java index b67966ab70a..ac5bc72e76f 100644 --- a/jdk/src/share/classes/javax/swing/text/DefaultFormatter.java +++ b/jdk/src/share/classes/javax/swing/text/DefaultFormatter.java @@ -24,7 +24,8 @@ */ package javax.swing.text; -import sun.reflect.misc.ConstructorUtil; +import sun.reflect.misc.ReflectUtil; +import sun.swing.SwingUtilities2; import java.io.Serializable; import java.lang.reflect.*; @@ -247,7 +248,9 @@ public class DefaultFormatter extends JFormattedTextField.AbstractFormatter Constructor cons; try { - cons = ConstructorUtil.getConstructor(vc, new Class[]{String.class}); + ReflectUtil.checkPackageAccess(vc); + SwingUtilities2.checkAccess(vc.getModifiers()); + cons = vc.getConstructor(new Class[]{String.class}); } catch (NoSuchMethodException nsme) { cons = null; @@ -255,6 +258,7 @@ public class DefaultFormatter extends JFormattedTextField.AbstractFormatter if (cons != null) { try { + SwingUtilities2.checkAccess(cons.getModifiers()); return cons.newInstance(new Object[] { string }); } catch (Throwable ex) { throw new ParseException("Error creating instance", 0); diff --git a/jdk/src/share/classes/javax/swing/text/NumberFormatter.java b/jdk/src/share/classes/javax/swing/text/NumberFormatter.java index 9500dcc03b7..672a92e5b63 100644 --- a/jdk/src/share/classes/javax/swing/text/NumberFormatter.java +++ b/jdk/src/share/classes/javax/swing/text/NumberFormatter.java @@ -27,6 +27,8 @@ package javax.swing.text; import java.lang.reflect.*; import java.text.*; import java.util.*; +import sun.reflect.misc.ReflectUtil; +import sun.swing.SwingUtilities2; /** * NumberFormatter subclasses InternationalFormatter @@ -427,10 +429,12 @@ public class NumberFormatter extends InternationalFormatter { valueClass = value.getClass(); } try { + ReflectUtil.checkPackageAccess(valueClass); + SwingUtilities2.checkAccess(valueClass.getModifiers()); Constructor cons = valueClass.getConstructor( new Class[] { String.class }); - if (cons != null) { + SwingUtilities2.checkAccess(cons.getModifiers()); return cons.newInstance(new Object[]{string}); } } catch (Throwable ex) { } diff --git a/jdk/src/share/classes/sun/swing/SwingLazyValue.java b/jdk/src/share/classes/sun/swing/SwingLazyValue.java index 2d1aa9cf847..a9e6f2c1bc8 100644 --- a/jdk/src/share/classes/sun/swing/SwingLazyValue.java +++ b/jdk/src/share/classes/sun/swing/SwingLazyValue.java @@ -30,6 +30,7 @@ import java.lang.reflect.AccessibleObject; import java.security.AccessController; import java.security.PrivilegedAction; import javax.swing.UIDefaults; +import sun.reflect.misc.ReflectUtil; /** * SwingLazyValue is a copy of ProxyLazyValue that does not snapshot the @@ -63,7 +64,7 @@ public class SwingLazyValue implements UIDefaults.LazyValue { public Object createValue(final UIDefaults table) { try { - Object cl; + ReflectUtil.checkPackageAccess(className); Class c = Class.forName(className, true, null); if (methodName != null) { Class[] types = getClassArray(args); diff --git a/jdk/src/share/classes/sun/swing/SwingUtilities2.java b/jdk/src/share/classes/sun/swing/SwingUtilities2.java index c6134885adf..57f7bb39cdc 100644 --- a/jdk/src/share/classes/sun/swing/SwingUtilities2.java +++ b/jdk/src/share/classes/sun/swing/SwingUtilities2.java @@ -1311,6 +1311,19 @@ public class SwingUtilities2 { } } + /** + * Utility method that throws SecurityException if SecurityManager is set + * and modifiers are not public + * + * @param modifiers a set of modifiers + */ + public static void checkAccess(int modifiers) { + if (System.getSecurityManager() != null + && !Modifier.isPublic(modifiers)) { + throw new SecurityException("Resource is not accessible"); + } + } + /** * Returns true if EventQueue.getCurrentEvent() has the permissions to * access the system clipboard and if it is allowed gesture (if From 9a9e180fdd52a65f07849cdd40c72bacd150b99d Mon Sep 17 00:00:00 2001 From: Andrew Brygin Date: Mon, 20 May 2013 15:26:42 +0400 Subject: [PATCH 006/131] 8014102: Improve image conversion Reviewed-by: mschoene, prr, jgodinez --- .../native/sun/awt/medialib/awt_ImagingLib.c | 94 +++++++++++++------ 1 file changed, 63 insertions(+), 31 deletions(-) diff --git a/jdk/src/share/native/sun/awt/medialib/awt_ImagingLib.c b/jdk/src/share/native/sun/awt/medialib/awt_ImagingLib.c index e3af348adda..5b5f2acda71 100644 --- a/jdk/src/share/native/sun/awt/medialib/awt_ImagingLib.c +++ b/jdk/src/share/native/sun/awt/medialib/awt_ImagingLib.c @@ -1985,21 +1985,25 @@ expandPacked(JNIEnv *env, BufImageS_t *img, ColorModelS_t *cmP, return 0; } +#define NUM_LINES 10 + static int cvtCustomToDefault(JNIEnv *env, BufImageS_t *imageP, int component, unsigned char *dataP) { - ColorModelS_t *cmP = &imageP->cmodel; - RasterS_t *rasterP = &imageP->raster; + const RasterS_t *rasterP = &imageP->raster; + const int w = rasterP->width; + const int h = rasterP->height; + int y; - jobject jpixels = NULL; + jintArray jpixels = NULL; jint *pixels; unsigned char *dP = dataP; -#define NUM_LINES 10 - int numLines = NUM_LINES; + int numLines = h > NUM_LINES ? NUM_LINES : h; + /* it is safe to calculate the scan length, because width has been verified * on creation of the mlib image */ - int scanLength = rasterP->width * 4; + const int scanLength = w * 4; int nbytes = 0; if (!SAFE_TO_MULT(numLines, scanLength)) { @@ -2008,42 +2012,70 @@ cvtCustomToDefault(JNIEnv *env, BufImageS_t *imageP, int component, nbytes = numLines * scanLength; - for (y=0; y < rasterP->height; y+=numLines) { - /* getData, one scanline at a time */ - if (y+numLines > rasterP->height) { - numLines = rasterP->height - y; + jpixels = (*env)->NewIntArray(env, nbytes); + if (JNU_IsNull(env, jpixels)) { + JNU_ThrowOutOfMemoryError(env, "Out of Memory"); + return -1; + } + + for (y = 0; y < h; y += numLines) { + if (y + numLines > h) { + numLines = h - y; nbytes = numLines * scanLength; } - jpixels = (*env)->CallObjectMethod(env, imageP->jimage, - g_BImgGetRGBMID, 0, y, - rasterP->width, numLines, - jpixels,0, rasterP->width); - if (jpixels == NULL) { - JNU_ThrowInternalError(env, "Can't retrieve pixels."); + + (*env)->CallObjectMethod(env, imageP->jimage, + g_BImgGetRGBMID, 0, y, + w, numLines, + jpixels, 0, w); + if ((*env)->ExceptionOccurred(env)) { + (*env)->DeleteLocalRef(env, jpixels); return -1; } pixels = (*env)->GetPrimitiveArrayCritical(env, jpixels, NULL); + if (pixels == NULL) { + (*env)->DeleteLocalRef(env, jpixels); + return -1; + } + memcpy(dP, pixels, nbytes); dP += nbytes; + (*env)->ReleasePrimitiveArrayCritical(env, jpixels, pixels, JNI_ABORT); } + + /* Need to release the array */ + (*env)->DeleteLocalRef(env, jpixels); + return 0; } static int cvtDefaultToCustom(JNIEnv *env, BufImageS_t *imageP, int component, unsigned char *dataP) { - ColorModelS_t *cmP = &imageP->cmodel; - RasterS_t *rasterP = &imageP->raster; + const RasterS_t *rasterP = &imageP->raster; + const int w = rasterP->width; + const int h = rasterP->height; + int y; + jintArray jpixels = NULL; jint *pixels; unsigned char *dP = dataP; -#define NUM_LINES 10 - int numLines = NUM_LINES; - int nbytes = rasterP->width*4*NUM_LINES; - jintArray jpixels; + int numLines = h > NUM_LINES ? NUM_LINES : h; + + /* it is safe to calculate the scan length, because width has been verified + * on creation of the mlib image + */ + const int scanLength = w * 4; + + int nbytes = 0; + if (!SAFE_TO_MULT(numLines, scanLength)) { + return -1; + } + + nbytes = numLines * scanLength; jpixels = (*env)->NewIntArray(env, nbytes); if (JNU_IsNull(env, jpixels)) { @@ -2051,14 +2083,15 @@ cvtDefaultToCustom(JNIEnv *env, BufImageS_t *imageP, int component, return -1; } - for (y=0; y < rasterP->height; y+=NUM_LINES) { - if (y+numLines > rasterP->height) { - numLines = rasterP->height - y; - nbytes = rasterP->width*4*numLines; + for (y = 0; y < h; y += numLines) { + if (y + numLines > h) { + numLines = h - y; + nbytes = numLines * scanLength; } + pixels = (*env)->GetPrimitiveArrayCritical(env, jpixels, NULL); if (pixels == NULL) { - /* JNI error */ + (*env)->DeleteLocalRef(env, jpixels); return -1; } @@ -2067,12 +2100,11 @@ cvtDefaultToCustom(JNIEnv *env, BufImageS_t *imageP, int component, (*env)->ReleasePrimitiveArrayCritical(env, jpixels, pixels, 0); - /* setData, one scanline at a time */ - /* Fix 4223648, 4184283 */ (*env)->CallVoidMethod(env, imageP->jimage, g_BImgSetRGBMID, 0, y, - rasterP->width, numLines, jpixels, 0, - rasterP->width); + w, numLines, jpixels, + 0, w); if ((*env)->ExceptionOccurred(env)) { + (*env)->DeleteLocalRef(env, jpixels); return -1; } } From 5c6c0246ccc0e07d49ec855a939deb8b1ac42e54 Mon Sep 17 00:00:00 2001 From: Sergey Malenkov Date: Mon, 20 May 2013 19:49:20 +0400 Subject: [PATCH 007/131] 8012071: Better Building of Beans Reviewed-by: art, skoivu --- jdk/src/share/classes/java/beans/Beans.java | 6 ++++++ .../beans/DefaultPersistenceDelegate.java | 3 +++ .../share/classes/java/beans/MetaData.java | 19 +++++++++++-------- 3 files changed, 20 insertions(+), 8 deletions(-) diff --git a/jdk/src/share/classes/java/beans/Beans.java b/jdk/src/share/classes/java/beans/Beans.java index 2183d224167..a457fa41805 100644 --- a/jdk/src/share/classes/java/beans/Beans.java +++ b/jdk/src/share/classes/java/beans/Beans.java @@ -42,6 +42,8 @@ import java.io.ObjectInputStream; import java.io.ObjectStreamClass; import java.io.StreamCorruptedException; +import java.lang.reflect.Modifier; + import java.net.URL; import java.security.AccessController; @@ -222,6 +224,10 @@ public class Beans { throw ex; } + if (!Modifier.isPublic(cl.getModifiers())) { + throw new ClassNotFoundException("" + cl + " : no public access"); + } + /* * Try to instantiate the class. */ diff --git a/jdk/src/share/classes/java/beans/DefaultPersistenceDelegate.java b/jdk/src/share/classes/java/beans/DefaultPersistenceDelegate.java index 3c6c7c2a3d3..6891692c30b 100644 --- a/jdk/src/share/classes/java/beans/DefaultPersistenceDelegate.java +++ b/jdk/src/share/classes/java/beans/DefaultPersistenceDelegate.java @@ -221,6 +221,9 @@ public class DefaultPersistenceDelegate extends PersistenceDelegate { // Write out the properties of this instance. private void initBean(Class type, Object oldInstance, Object newInstance, Encoder out) { for (Field field : type.getFields()) { + if (!ReflectUtil.isPackageAccessible(field.getDeclaringClass())) { + continue; + } int mod = field.getModifiers(); if (Modifier.isFinal(mod) || Modifier.isStatic(mod) || Modifier.isTransient(mod)) { continue; diff --git a/jdk/src/share/classes/java/beans/MetaData.java b/jdk/src/share/classes/java/beans/MetaData.java index 61f51d4bb3f..d733b6f1eab 100644 --- a/jdk/src/share/classes/java/beans/MetaData.java +++ b/jdk/src/share/classes/java/beans/MetaData.java @@ -42,6 +42,7 @@ import java.lang.reflect.Array; import java.lang.reflect.Constructor; import java.lang.reflect.Field; import java.lang.reflect.Method; +import java.lang.reflect.Modifier; import java.lang.reflect.InvocationTargetException; import java.security.AccessController; @@ -56,7 +57,7 @@ import javax.swing.plaf.ColorUIResource; import sun.swing.PrintColorUIResource; -import java.util.Objects; +import static sun.reflect.misc.ReflectUtil.isPackageAccessible; /* * Like the Intropector, the MetaData class @@ -850,13 +851,15 @@ static final class java_awt_AWTKeyStroke_PersistenceDelegate extends Persistence static class StaticFieldsPersistenceDelegate extends PersistenceDelegate { protected void installFields(Encoder out, Class cls) { - Field fields[] = cls.getFields(); - for(int i = 0; i < fields.length; i++) { - Field field = fields[i]; - // Don't install primitives, their identity will not be preserved - // by wrapping. - if (Object.class.isAssignableFrom(field.getType())) { - out.writeExpression(new Expression(field, "get", new Object[]{null})); + if (Modifier.isPublic(cls.getModifiers()) && isPackageAccessible(cls)) { + Field fields[] = cls.getFields(); + for(int i = 0; i < fields.length; i++) { + Field field = fields[i]; + // Don't install primitives, their identity will not be preserved + // by wrapping. + if (Object.class.isAssignableFrom(field.getType())) { + out.writeExpression(new Expression(field, "get", new Object[]{null})); + } } } } From d86660d21bbc69c1991b3d7ea3ce582e080cfcdb Mon Sep 17 00:00:00 2001 From: Sergey Malenkov Date: Fri, 31 May 2013 21:25:42 +0400 Subject: [PATCH 008/131] 8012277: Improve AWT DataFlavor Reviewed-by: art, skoivu --- .../java/awt/datatransfer/DataFlavor.java | 49 ++++++++++++------- 1 file changed, 31 insertions(+), 18 deletions(-) diff --git a/jdk/src/share/classes/java/awt/datatransfer/DataFlavor.java b/jdk/src/share/classes/java/awt/datatransfer/DataFlavor.java index acbc0fe659d..3c1691545f4 100644 --- a/jdk/src/share/classes/java/awt/datatransfer/DataFlavor.java +++ b/jdk/src/share/classes/java/awt/datatransfer/DataFlavor.java @@ -30,6 +30,9 @@ import java.nio.*; import java.util.*; import sun.awt.datatransfer.DataTransferer; +import sun.reflect.misc.ReflectUtil; + +import static sun.security.util.SecurityConstants.GET_CLASSLOADER_PERMISSION; /** * A {@code DataFlavor} provides meta information about data. {@code DataFlavor} @@ -116,26 +119,36 @@ public class DataFlavor implements Externalizable, Cloneable { ClassLoader fallback) throws ClassNotFoundException { - ClassLoader systemClassLoader = (ClassLoader) - java.security.AccessController.doPrivileged( - new java.security.PrivilegedAction() { - public Object run() { - ClassLoader cl = Thread.currentThread(). - getContextClassLoader(); - return (cl != null) - ? cl - : ClassLoader.getSystemClassLoader(); - } - }); - + ReflectUtil.checkPackageAccess(className); try { - return Class.forName(className, true, systemClassLoader); - } catch (ClassNotFoundException e2) { - if (fallback != null) { - return Class.forName(className, true, fallback); - } else { - throw new ClassNotFoundException(className); + SecurityManager sm = System.getSecurityManager(); + if (sm != null) { + sm.checkPermission(GET_CLASSLOADER_PERMISSION); } + ClassLoader loader = ClassLoader.getSystemClassLoader(); + try { + // bootstrap class loader and system class loader if present + return Class.forName(className, true, loader); + } + catch (ClassNotFoundException exception) { + // thread context class loader if and only if present + loader = Thread.currentThread().getContextClassLoader(); + if (loader != null) { + try { + return Class.forName(className, true, loader); + } + catch (ClassNotFoundException e) { + // fallback to user's class loader + } + } + } + } catch (SecurityException exception) { + // ignore secured class loaders + } + if (fallback != null) { + return Class.forName(className, true, fallback); + } else { + throw new ClassNotFoundException(className); } } From 81621f63cad78c5a6ebf95d536a2e887bf253f08 Mon Sep 17 00:00:00 2001 From: Weijun Wang Date: Wed, 8 May 2013 09:21:59 +0800 Subject: [PATCH 009/131] 8014341: Better service from Kerberos servers Read incoming data safely and take care of null return value Reviewed-by: valeriep, ahgross --- jdk/src/share/classes/sun/security/krb5/KdcComm.java | 12 ++++++++---- .../sun/security/krb5/internal/NetClient.java | 10 +++++----- 2 files changed, 13 insertions(+), 9 deletions(-) diff --git a/jdk/src/share/classes/sun/security/krb5/KdcComm.java b/jdk/src/share/classes/sun/security/krb5/KdcComm.java index 80c0af48e00..c3048aaf64a 100644 --- a/jdk/src/share/classes/sun/security/krb5/KdcComm.java +++ b/jdk/src/share/classes/sun/security/krb5/KdcComm.java @@ -246,11 +246,15 @@ public final class KdcComm { savedException = e; } } - if (ibuf == null && savedException != null) { - if (savedException instanceof IOException) { - throw (IOException) savedException; + if (ibuf == null) { + if (savedException != null) { + if (savedException instanceof IOException) { + throw (IOException) savedException; + } else { + throw (KrbException) savedException; + } } else { - throw (KrbException) savedException; + throw new IOException("Cannot get a KDC reply"); } } return ibuf; diff --git a/jdk/src/share/classes/sun/security/krb5/internal/NetClient.java b/jdk/src/share/classes/sun/security/krb5/internal/NetClient.java index 1f5b15bb7e6..7502cf00e9a 100644 --- a/jdk/src/share/classes/sun/security/krb5/internal/NetClient.java +++ b/jdk/src/share/classes/sun/security/krb5/internal/NetClient.java @@ -31,6 +31,8 @@ package sun.security.krb5.internal; +import sun.misc.IOUtils; + import java.io.*; import java.net.*; @@ -100,17 +102,15 @@ class TCPClient extends NetClient { return null; } - byte data[] = new byte[len]; - count = readFully(data, len); - if (count != len) { + try { + return IOUtils.readFully(in, len, true); + } catch (IOException ioe) { if (Krb5.DEBUG) { System.out.println( ">>>DEBUG: TCPClient could not read complete packet (" + len + "/" + count + ")"); } return null; - } else { - return data; } } From c7d65c420780466e944fdf59f3a5140c73c2d8cf Mon Sep 17 00:00:00 2001 From: Weijun Wang Date: Thu, 13 Jun 2013 10:21:06 +0800 Subject: [PATCH 010/131] 8013739: Better LDAP resource management Reviewed-by: ahgross, mchung, xuelei --- .../com/sun/jndi/ldap/VersionHelper12.java | 15 ++++++++---- jdk/src/share/classes/java/lang/System.java | 4 ++++ jdk/src/share/classes/java/lang/Thread.java | 24 +++++++++++++++++-- .../classes/sun/misc/JavaLangAccess.java | 8 +++++++ 4 files changed, 44 insertions(+), 7 deletions(-) diff --git a/jdk/src/share/classes/com/sun/jndi/ldap/VersionHelper12.java b/jdk/src/share/classes/com/sun/jndi/ldap/VersionHelper12.java index 9e8854a460c..63e6bd280ba 100644 --- a/jdk/src/share/classes/com/sun/jndi/ldap/VersionHelper12.java +++ b/jdk/src/share/classes/com/sun/jndi/ldap/VersionHelper12.java @@ -25,11 +25,12 @@ package com.sun.jndi.ldap; -import java.net.URL; import java.net.URLClassLoader; import java.net.MalformedURLException; +import java.security.AccessControlContext; import java.security.AccessController; import java.security.PrivilegedAction; +import sun.misc.SharedSecrets; final class VersionHelper12 extends VersionHelper { @@ -82,12 +83,16 @@ final class VersionHelper12 extends VersionHelper { } Thread createThread(final Runnable r) { + final AccessControlContext acc = AccessController.getContext(); + // 4290486: doPrivileged is needed to create a thread in + // an environment that restricts "modifyThreadGroup". return AccessController.doPrivileged( - new PrivilegedAction() { - public Thread run() { - return new Thread(r); + new PrivilegedAction() { + public Thread run() { + return SharedSecrets.getJavaLangAccess() + .newThreadWithAcc(r, acc); + } } - } ); } } diff --git a/jdk/src/share/classes/java/lang/System.java b/jdk/src/share/classes/java/lang/System.java index 52a5e0de823..445b4e1a959 100644 --- a/jdk/src/share/classes/java/lang/System.java +++ b/jdk/src/share/classes/java/lang/System.java @@ -26,6 +26,7 @@ package java.lang; import java.io.*; import java.lang.reflect.Executable; +import java.security.AccessControlContext; import java.util.Properties; import java.util.PropertyPermission; import java.util.StringTokenizer; @@ -1251,6 +1252,9 @@ public final class System { public String newStringUnsafe(char[] chars) { return new String(chars, true); } + public Thread newThreadWithAcc(Runnable target, AccessControlContext acc) { + return new Thread(target, acc); + } }); } } diff --git a/jdk/src/share/classes/java/lang/Thread.java b/jdk/src/share/classes/java/lang/Thread.java index bb175ff89ad..d97f03d4e24 100644 --- a/jdk/src/share/classes/java/lang/Thread.java +++ b/jdk/src/share/classes/java/lang/Thread.java @@ -340,6 +340,15 @@ class Thread implements Runnable { sleep(millis); } + /** + * Initializes a Thread with the current AccessControlContext. + * @see #init(ThreadGroup,Runnable,String,long,AccessControlContext) + */ + private void init(ThreadGroup g, Runnable target, String name, + long stackSize) { + init(g, target, name, stackSize, null); + } + /** * Initializes a Thread. * @@ -348,9 +357,11 @@ class Thread implements Runnable { * @param name the name of the new Thread * @param stackSize the desired stack size for the new thread, or * zero to indicate that this parameter is to be ignored. + * @param acc the AccessControlContext to inherit, or + * AccessController.getContext() if null */ private void init(ThreadGroup g, Runnable target, String name, - long stackSize) { + long stackSize, AccessControlContext acc) { if (name == null) { throw new NullPointerException("name cannot be null"); } @@ -396,7 +407,8 @@ class Thread implements Runnable { this.contextClassLoader = parent.getContextClassLoader(); else this.contextClassLoader = parent.contextClassLoader; - this.inheritedAccessControlContext = AccessController.getContext(); + this.inheritedAccessControlContext = + acc != null ? acc : AccessController.getContext(); this.target = target; setPriority(priority); if (parent.inheritableThreadLocals != null) @@ -448,6 +460,14 @@ class Thread implements Runnable { init(null, target, "Thread-" + nextThreadNum(), 0); } + /** + * Creates a new Thread that inherits the given AccessControlContext. + * This is not a public constructor. + */ + Thread(Runnable target, AccessControlContext acc) { + init(null, target, "Thread-" + nextThreadNum(), 0, acc); + } + /** * Allocates a new {@code Thread} object. This constructor has the same * effect as {@linkplain #Thread(ThreadGroup,Runnable,String) Thread} diff --git a/jdk/src/share/classes/sun/misc/JavaLangAccess.java b/jdk/src/share/classes/sun/misc/JavaLangAccess.java index 888d4ea8c46..45222f3652e 100644 --- a/jdk/src/share/classes/sun/misc/JavaLangAccess.java +++ b/jdk/src/share/classes/sun/misc/JavaLangAccess.java @@ -27,6 +27,8 @@ package sun.misc; import java.lang.annotation.Annotation; import java.lang.reflect.Executable; +import java.security.AccessControlContext; + import sun.reflect.ConstantPool; import sun.reflect.annotation.AnnotationType; import sun.nio.ch.Interruptible; @@ -107,4 +109,10 @@ public interface JavaLangAccess { * @return a newly created string whose content is the character array */ String newStringUnsafe(char[] chars); + + /** + * Returns a new Thread with the given Runnable and an + * inherited AccessControlContext. + */ + Thread newThreadWithAcc(Runnable target, AccessControlContext acc); } From 0be0627640342d268cad10b1aa1e47fc92312162 Mon Sep 17 00:00:00 2001 From: Weijun Wang Date: Thu, 13 Jun 2013 10:31:21 +0800 Subject: [PATCH 011/131] 8015731: Subject java.security.auth.subject to improvements Reviewed-by: skoivu, mullan --- jdk/src/share/classes/javax/security/auth/Subject.java | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/jdk/src/share/classes/javax/security/auth/Subject.java b/jdk/src/share/classes/javax/security/auth/Subject.java index 1caaad400e2..1128d8c1011 100644 --- a/jdk/src/share/classes/javax/security/auth/Subject.java +++ b/jdk/src/share/classes/javax/security/auth/Subject.java @@ -1297,8 +1297,14 @@ public final class Subject implements java.io.Serializable { { ObjectInputStream.GetField fields = ois.readFields(); subject = (Subject) fields.get("this$0", null); - elements = (LinkedList) fields.get("elements", null); which = fields.get("which", 0); + + LinkedList tmp = (LinkedList) fields.get("elements", null); + if (tmp.getClass() != LinkedList.class) { + elements = new LinkedList(tmp); + } else { + elements = tmp; + } } } From 73c5ae165c4ba53d8d168683c24af3241ccb5233 Mon Sep 17 00:00:00 2001 From: Johnny Chen Date: Thu, 13 Jun 2013 12:14:37 -0700 Subject: [PATCH 012/131] 8014098: Better profile validation Reviewed-by: bae, mschoene, prr --- .../share/native/sun/java2d/cmm/lcms/cmsio0.c | 26 +++++++++++++++++-- 1 file changed, 24 insertions(+), 2 deletions(-) diff --git a/jdk/src/share/native/sun/java2d/cmm/lcms/cmsio0.c b/jdk/src/share/native/sun/java2d/cmm/lcms/cmsio0.c index 5bad907e2d7..a18d75c3b5b 100644 --- a/jdk/src/share/native/sun/java2d/cmm/lcms/cmsio0.c +++ b/jdk/src/share/native/sun/java2d/cmm/lcms/cmsio0.c @@ -1074,6 +1074,27 @@ cmsHPROFILE CMSEXPORT cmsOpenProfileFromMem(const void* MemPtr, cmsUInt32Number } +static +cmsBool SanityCheck(_cmsICCPROFILE* profile) +{ + cmsIOHANDLER* io = profile->IOhandler; + if (!io) { + return FALSE; + } + + if (!io->Seek || + !(io->Seek==NULLSeek || io->Seek==MemorySeek || io->Seek==FileSeek)) + { + return FALSE; + } + if (!io->Read || + !(io->Read==NULLRead || io->Read==MemoryRead || io->Read==FileRead)) + { + return FALSE; + } + + return TRUE; +} // Dump tag contents. If the profile is being modified, untouched tags are copied from FileOrig static @@ -1087,6 +1108,7 @@ cmsBool SaveTags(_cmsICCPROFILE* Icc, _cmsICCPROFILE* FileOrig) cmsTagTypeSignature TypeBase; cmsTagTypeHandler* TypeHandler; + if (!SanityCheck(FileOrig)) return FALSE; for (i=0; i < Icc -> TagCount; i++) { @@ -1292,8 +1314,8 @@ cmsBool CMSEXPORT cmsSaveProfileToMem(cmsHPROFILE hProfile, void *MemPtr, cmsUIn // Should we just calculate the needed space? if (MemPtr == NULL) { - *BytesNeeded = cmsSaveProfileToIOhandler(hProfile, NULL); - return TRUE; + *BytesNeeded = cmsSaveProfileToIOhandler(hProfile, NULL); + return (*BytesNeeded == 0 ? FALSE : TRUE); } // That is a real write operation From ae96f935a2cb24cf785ee38817c46fd42519bc69 Mon Sep 17 00:00:00 2001 From: Mark Sheppard Date: Fri, 14 Jun 2013 15:49:54 +0100 Subject: [PATCH 013/131] 8011157: Improve CORBA portablility Fix also reviewed by Alexander Fomin Reviewed-by: alanb, coffeys, skoivu --- jdk/make/com/sun/jmx/Makefile | 2 ++ .../modelmbean/RequiredModelMBean.java | 8 ++++++-- .../management/remote/rmi/RMIConnector.java | 18 +++++++++++++----- 3 files changed, 21 insertions(+), 7 deletions(-) diff --git a/jdk/make/com/sun/jmx/Makefile b/jdk/make/com/sun/jmx/Makefile index 62435751673..02ef6b07998 100644 --- a/jdk/make/com/sun/jmx/Makefile +++ b/jdk/make/com/sun/jmx/Makefile @@ -130,11 +130,13 @@ $(CLASSDESTDIR)/%_Stub.class: $(CLASSDESTDIR)/%.class $(RMIC) -classpath "$(CLASSDESTDIR)" \ -d $(CLASSDESTDIR) \ -iiop -v1.2 \ + -emitPermissionCheck \ $(subst /,.,$(<:$(CLASSDESTDIR)/%.class=%)) $(RMIC) $(HOTSPOT_INTERPRETER_FLAG) -classpath "$(CLASSDESTDIR)" \ -d $(CLASSDESTDIR) \ -iiop -v1.2 \ -standardPackage \ + -emitPermissionCheck \ $(subst /,.,$(<:$(CLASSDESTDIR)/%.class=%)) @$(java-vm-cleanup) diff --git a/jdk/src/share/classes/javax/management/modelmbean/RequiredModelMBean.java b/jdk/src/share/classes/javax/management/modelmbean/RequiredModelMBean.java index 6d28adaf0f7..0afd70f9423 100644 --- a/jdk/src/share/classes/javax/management/modelmbean/RequiredModelMBean.java +++ b/jdk/src/share/classes/javax/management/modelmbean/RequiredModelMBean.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 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 @@ -298,11 +298,15 @@ public class RequiredModelMBean RequiredModelMBean.class.getName(), "setModelMBeanInfo(ModelMBeanInfo)", "Setting ModelMBeanInfo to " + printModelMBeanInfo(mbi)); + int noOfNotifications = 0; + if (mbi.getNotifications() != null) { + noOfNotifications = mbi.getNotifications().length; + } MODELMBEAN_LOGGER.logp(Level.FINER, RequiredModelMBean.class.getName(), "setModelMBeanInfo(ModelMBeanInfo)", "ModelMBeanInfo notifications has " + - (mbi.getNotifications()).length + " elements"); + noOfNotifications + " elements"); } modelMBeanInfo = (ModelMBeanInfo)mbi.clone(); diff --git a/jdk/src/share/classes/javax/management/remote/rmi/RMIConnector.java b/jdk/src/share/classes/javax/management/remote/rmi/RMIConnector.java index 53e6754e6ed..4ddfb8fee38 100644 --- a/jdk/src/share/classes/javax/management/remote/rmi/RMIConnector.java +++ b/jdk/src/share/classes/javax/management/remote/rmi/RMIConnector.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 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 @@ -61,6 +61,7 @@ import java.rmi.server.RemoteRef; import java.security.AccessController; import java.security.PrivilegedAction; import java.security.PrivilegedExceptionAction; +import java.security.PrivilegedActionException; import java.security.ProtectionDomain; import java.util.Arrays; import java.util.Collections; @@ -128,7 +129,6 @@ public class RMIConnector implements JMXConnector, Serializable, JMXAddressable Map environment) { if (rmiServer == null && address == null) throw new IllegalArgumentException("rmiServer and jmxServiceURL both null"); - initTransients(); this.rmiServer = rmiServer; @@ -2370,13 +2370,21 @@ public class RMIConnector implements JMXConnector, Serializable, JMXAddressable } } - private static RMIConnection shadowIiopStub(Object stub) + private static RMIConnection shadowIiopStub(Object stub) throws InstantiationException, IllegalAccessException { - Object proxyStub = proxyStubClass.newInstance(); + Object proxyStub = null; + try { + proxyStub = AccessController.doPrivileged(new PrivilegedExceptionAction() { + public Object run() throws Exception { + return proxyStubClass.newInstance(); + } + }); + } catch (PrivilegedActionException e) { + throw new InternalError(); + } IIOPHelper.setDelegate(proxyStub, IIOPHelper.getDelegate(stub)); return (RMIConnection) proxyStub; } - private static RMIConnection getConnection(RMIServer server, Object credentials, boolean checkStub) From ccc1dc9103b704a619a638c35d93f689c6798d16 Mon Sep 17 00:00:00 2001 From: Jaroslav Bachorik Date: Thu, 20 Jun 2013 08:51:47 +0200 Subject: [PATCH 014/131] 8014085: Better serialization support in JMX classes Reviewed-by: alanb, dfuchs, skoivu --- .../management/MBeanNotificationInfo.java | 22 ++++- .../javax/management/remote/JMXPrincipal.java | 23 ++++- .../management/remote/JMXServiceURL.java | 99 +++++++++++++------ .../management/remote/NotificationResult.java | 53 +++++++--- .../remote/TargetedNotification.java | 34 +++++-- 5 files changed, 176 insertions(+), 55 deletions(-) diff --git a/jdk/src/share/classes/javax/management/MBeanNotificationInfo.java b/jdk/src/share/classes/javax/management/MBeanNotificationInfo.java index b4bbbe80292..dfa4ab1f8ff 100644 --- a/jdk/src/share/classes/javax/management/MBeanNotificationInfo.java +++ b/jdk/src/share/classes/javax/management/MBeanNotificationInfo.java @@ -25,6 +25,9 @@ package javax.management; +import java.io.IOException; +import java.io.InvalidObjectException; +import java.io.ObjectInputStream; import java.util.Arrays; /** @@ -67,7 +70,7 @@ public class MBeanNotificationInfo extends MBeanFeatureInfo implements Cloneable /** * @serial The different types of the notification. */ - private final String[] types; + private String[] types; /** @see MBeanInfo#arrayGettersSafe */ private final transient boolean arrayGettersSafe; @@ -114,9 +117,8 @@ public class MBeanNotificationInfo extends MBeanFeatureInfo implements Cloneable notifType, though it doesn't explicitly allow it either. */ - if (notifTypes == null) - notifTypes = NO_TYPES; - this.types = notifTypes; + this.types = (notifTypes != null && notifTypes.length > 0) ? + notifTypes.clone() : NO_TYPES; this.arrayGettersSafe = MBeanInfo.arrayGettersSafe(this.getClass(), MBeanNotificationInfo.class); @@ -203,4 +205,16 @@ public class MBeanNotificationInfo extends MBeanFeatureInfo implements Cloneable hash ^= types[i].hashCode(); return hash; } + + private void readObject(ObjectInputStream ois) throws IOException, ClassNotFoundException { + ObjectInputStream.GetField gf = ois.readFields(); + String[] t = (String[])gf.get("types", null); + + if (t == null) { + throw new InvalidObjectException("Trying to deserialize an invalid " + + "instance of " + MBeanNotificationInfo.class + + "[types=null]"); + } + types = t.length == 0 ? t : t.clone(); + } } diff --git a/jdk/src/share/classes/javax/management/remote/JMXPrincipal.java b/jdk/src/share/classes/javax/management/remote/JMXPrincipal.java index 258c537e277..5cb0c3739bc 100644 --- a/jdk/src/share/classes/javax/management/remote/JMXPrincipal.java +++ b/jdk/src/share/classes/javax/management/remote/JMXPrincipal.java @@ -26,6 +26,9 @@ package javax.management.remote; +import java.io.IOException; +import java.io.InvalidObjectException; +import java.io.ObjectInputStream; import java.io.Serializable; import java.security.Principal; @@ -64,9 +67,7 @@ public class JMXPrincipal implements Principal, Serializable { * null. */ public JMXPrincipal(String name) { - if (name == null) - throw new NullPointerException("illegal null input"); - + validate(name); this.name = name; } @@ -130,4 +131,20 @@ public class JMXPrincipal implements Principal, Serializable { public int hashCode() { return name.hashCode(); } + + private void readObject(ObjectInputStream ois) throws IOException, ClassNotFoundException { + ObjectInputStream.GetField gf = ois.readFields(); + String principalName = (String)gf.get("name", null); + try { + validate(principalName); + this.name = principalName; + } catch (NullPointerException e) { + throw new InvalidObjectException(e.getMessage()); + } + } + + private static void validate(String name) throws NullPointerException { + if (name == null) + throw new NullPointerException("illegal null input"); + } } diff --git a/jdk/src/share/classes/javax/management/remote/JMXServiceURL.java b/jdk/src/share/classes/javax/management/remote/JMXServiceURL.java index 143966bad68..4b1c376eda1 100644 --- a/jdk/src/share/classes/javax/management/remote/JMXServiceURL.java +++ b/jdk/src/share/classes/javax/management/remote/JMXServiceURL.java @@ -29,6 +29,9 @@ package javax.management.remote; import com.sun.jmx.remote.util.ClassLogger; import com.sun.jmx.remote.util.EnvHelp; +import java.io.IOException; +import java.io.InvalidObjectException; +import java.io.ObjectInputStream; import java.io.Serializable; import java.net.InetAddress; @@ -297,7 +300,7 @@ public class JMXServiceURL implements Serializable { If we're given an explicit host name that is illegal we have to reject it. (Bug 5057532.) */ try { - validateHost(host); + validateHost(host, port); } catch (MalformedURLException e) { if (logger.fineOn()) { logger.fine("JMXServiceURL", @@ -336,36 +339,82 @@ public class JMXServiceURL implements Serializable { validate(); } - private void validate() throws MalformedURLException { + private static final String INVALID_INSTANCE_MSG = + "Trying to deserialize an invalid instance of JMXServiceURL"; + private void readObject(ObjectInputStream inputStream) throws IOException, ClassNotFoundException { + ObjectInputStream.GetField gf = inputStream.readFields(); + String h = (String)gf.get("host", null); + int p = (int)gf.get("port", -1); + String proto = (String)gf.get("protocol", null); + String url = (String)gf.get("urlPath", null); + if (proto == null || url == null || h == null) { + StringBuilder sb = new StringBuilder(INVALID_INSTANCE_MSG).append('['); + boolean empty = true; + if (proto == null) { + sb.append("protocol=null"); + empty = false; + } + if (h == null) { + sb.append(empty ? "" : ",").append("host=null"); + empty = false; + } + if (url == null) { + sb.append(empty ? "" : ",").append("urlPath=null"); + } + sb.append(']'); + throw new InvalidObjectException(sb.toString()); + } + + if (h.contains("[") || h.contains("]")) { + throw new InvalidObjectException("Invalid host name: " + h); + } + + try { + validate(proto, h, p, url); + this.protocol = proto; + this.host = h; + this.port = p; + this.urlPath = url; + } catch (MalformedURLException e) { + throw new InvalidObjectException(INVALID_INSTANCE_MSG + ": " + + e.getMessage()); + } + + } + + private void validate(String proto, String h, int p, String url) + throws MalformedURLException { // Check protocol - - final int protoEnd = indexOfFirstNotInSet(protocol, protocolBitSet, 0); - if (protoEnd == 0 || protoEnd < protocol.length() - || !alphaBitSet.get(protocol.charAt(0))) { + final int protoEnd = indexOfFirstNotInSet(proto, protocolBitSet, 0); + if (protoEnd == 0 || protoEnd < proto.length() + || !alphaBitSet.get(proto.charAt(0))) { throw new MalformedURLException("Missing or invalid protocol " + - "name: \"" + protocol + "\""); + "name: \"" + proto + "\""); } // Check host - - validateHost(); + validateHost(h, p); // Check port - - if (port < 0) - throw new MalformedURLException("Bad port: " + port); + if (p < 0) + throw new MalformedURLException("Bad port: " + p); // Check URL path - - if (urlPath.length() > 0) { - if (!urlPath.startsWith("/") && !urlPath.startsWith(";")) - throw new MalformedURLException("Bad URL path: " + urlPath); + if (url.length() > 0) { + if (!url.startsWith("/") && !url.startsWith(";")) + throw new MalformedURLException("Bad URL path: " + url); } } - private void validateHost() throws MalformedURLException { - if (host.length() == 0) { + private void validate() throws MalformedURLException { + validate(this.protocol, this.host, this.port, this.urlPath); + } + + private static void validateHost(String h, int port) + throws MalformedURLException { + + if (h.length() == 0) { if (port != 0) { throw new MalformedURLException("Cannot give port number " + "without host name"); @@ -373,12 +422,6 @@ public class JMXServiceURL implements Serializable { return; } - validateHost(host); - } - - private static void validateHost(String h) - throws MalformedURLException { - if (isNumericIPv6Address(h)) { /* We assume J2SE >= 1.4 here. Otherwise you can't use the address anyway. We can't call @@ -663,22 +706,22 @@ public class JMXServiceURL implements Serializable { /** * The value returned by {@link #getProtocol()}. */ - private final String protocol; + private String protocol; /** * The value returned by {@link #getHost()}. */ - private final String host; + private String host; /** * The value returned by {@link #getPort()}. */ - private final int port; + private int port; /** * The value returned by {@link #getURLPath()}. */ - private final String urlPath; + private String urlPath; /** * Cached result of {@link #toString()}. diff --git a/jdk/src/share/classes/javax/management/remote/NotificationResult.java b/jdk/src/share/classes/javax/management/remote/NotificationResult.java index cbc79755099..9e7cfaac31d 100644 --- a/jdk/src/share/classes/javax/management/remote/NotificationResult.java +++ b/jdk/src/share/classes/javax/management/remote/NotificationResult.java @@ -25,6 +25,9 @@ package javax.management.remote; +import java.io.IOException; +import java.io.InvalidObjectException; +import java.io.ObjectInputStream; import java.io.Serializable; /** @@ -76,17 +79,7 @@ public class NotificationResult implements Serializable { public NotificationResult(long earliestSequenceNumber, long nextSequenceNumber, TargetedNotification[] targetedNotifications) { - if (targetedNotifications == null) { - final String msg = "Notifications null"; - throw new IllegalArgumentException(msg); - } - - if (earliestSequenceNumber < 0 || nextSequenceNumber < 0) - throw new IllegalArgumentException("Bad sequence numbers"); - /* We used to check nextSequenceNumber >= earliestSequenceNumber - here. But in fact the opposite can legitimately be true if - notifications have been lost. */ - + validate(targetedNotifications, earliestSequenceNumber, nextSequenceNumber); this.earliestSequenceNumber = earliestSequenceNumber; this.nextSequenceNumber = nextSequenceNumber; this.targetedNotifications = (targetedNotifications.length == 0 ? targetedNotifications : targetedNotifications.clone()); @@ -138,7 +131,39 @@ public class NotificationResult implements Serializable { getTargetedNotifications().length; } - private final long earliestSequenceNumber; - private final long nextSequenceNumber; - private final TargetedNotification[] targetedNotifications; + private void readObject(ObjectInputStream ois) throws IOException, ClassNotFoundException { + ObjectInputStream.GetField gf = ois.readFields(); + TargetedNotification[] tNotifs = (TargetedNotification[])gf.get("targetedNotifications", null); + long snStart = gf.get("earliestSequenceNumber", -1L); + long snNext = gf.get("nextSequenceNumber", -1L); + try { + validate(tNotifs, snStart, snNext); + + this.targetedNotifications = tNotifs.length == 0 ? tNotifs : tNotifs.clone(); + this.earliestSequenceNumber = snStart; + this.nextSequenceNumber = snNext; + } catch (IllegalArgumentException e) { + throw new InvalidObjectException(e.getMessage()); + } + } + + private long earliestSequenceNumber; + private long nextSequenceNumber; + private TargetedNotification[] targetedNotifications; + + private static void validate(TargetedNotification[] targetedNotifications, + long earliestSequenceNumber, + long nextSequenceNumber) + throws IllegalArgumentException { + if (targetedNotifications == null) { + final String msg = "Notifications null"; + throw new IllegalArgumentException(msg); + } + + if (earliestSequenceNumber < 0 || nextSequenceNumber < 0) + throw new IllegalArgumentException("Bad sequence numbers"); + /* We used to check nextSequenceNumber >= earliestSequenceNumber + here. But in fact the opposite can legitimately be true if + notifications have been lost. */ + } } diff --git a/jdk/src/share/classes/javax/management/remote/TargetedNotification.java b/jdk/src/share/classes/javax/management/remote/TargetedNotification.java index c4b58dfba90..03aa0ca6235 100644 --- a/jdk/src/share/classes/javax/management/remote/TargetedNotification.java +++ b/jdk/src/share/classes/javax/management/remote/TargetedNotification.java @@ -26,6 +26,9 @@ package javax.management.remote; +import java.io.IOException; +import java.io.InvalidObjectException; +import java.io.ObjectInputStream; import java.io.Serializable; import javax.management.Notification; @@ -73,12 +76,9 @@ public class TargetedNotification implements Serializable { */ public TargetedNotification(Notification notification, Integer listenerID) { + validate(notification, listenerID); // If we replace integer with int... // this(notification,intValue(listenerID)); - if (notification == null) throw new - IllegalArgumentException("Invalid notification: null"); - if (listenerID == null) throw new - IllegalArgumentException("Invalid listener ID: null"); this.notif = notification; this.id = listenerID; } @@ -115,13 +115,13 @@ public class TargetedNotification implements Serializable { * @serial A notification to transmit to the other side. * @see #getNotification() **/ - private final Notification notif; + private Notification notif; /** * @serial The ID of the listener to which the notification is * targeted. * @see #getListenerID() **/ - private final Integer id; + private Integer id; //private final int id; // Needed if we use int instead of Integer... @@ -130,4 +130,26 @@ public class TargetedNotification implements Serializable { // IllegalArgumentException("Invalid listener ID: null"); // return id.intValue(); // } + + private void readObject(ObjectInputStream ois) throws IOException, ClassNotFoundException { + ObjectInputStream.GetField gf = ois.readFields(); + Notification notification = (Notification)gf.get("notif", null); + Integer listenerId = (Integer)gf.get("id", null); + try { + validate(notification, listenerId); + this.notif = notification; + this.id = listenerId; + } catch (IllegalArgumentException e) { + throw new InvalidObjectException(e.getMessage()); + } + } + + private static void validate(Notification notif, Integer id) throws IllegalArgumentException { + if (notif == null) { + throw new IllegalArgumentException("Invalid notification: null"); + } + if (id == null) { + throw new IllegalArgumentException("Invalid listener ID: null"); + } + } } From d0a47b3b30d11d264021b383ecfe09ebe62a3ecb Mon Sep 17 00:00:00 2001 From: Andrew Brygin Date: Mon, 1 Jul 2013 15:17:24 +0400 Subject: [PATCH 015/131] 8017287: Better resource disposal Reviewed-by: prr, vadim, skoivu --- jdk/src/share/classes/sun/java2d/Disposer.java | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/jdk/src/share/classes/sun/java2d/Disposer.java b/jdk/src/share/classes/sun/java2d/Disposer.java index dcedfe3846e..7be5c3acc92 100644 --- a/jdk/src/share/classes/sun/java2d/Disposer.java +++ b/jdk/src/share/classes/sun/java2d/Disposer.java @@ -155,8 +155,7 @@ public class Disposer implements Runnable { rec = null; clearDeferredRecords(); } catch (Exception e) { - System.out.println("Exception while removing reference: " + e); - e.printStackTrace(); + System.out.println("Exception while removing reference."); } } } @@ -182,7 +181,6 @@ public class Disposer implements Runnable { rec.dispose(); } catch (Exception e) { System.out.println("Exception while disposing deferred rec."); - e.printStackTrace(); } } deferredRecords.clear(); @@ -233,8 +231,7 @@ public class Disposer implements Runnable { } } } catch (Exception e) { - System.out.println("Exception while removing reference: " + e); - e.printStackTrace(); + System.out.println("Exception while removing reference."); } finally { pollingQueue = false; } From 2fc3e6741814a67fe89734348d091dea3f32e529 Mon Sep 17 00:00:00 2001 From: Erik Joelsson Date: Wed, 3 Jul 2013 10:14:02 +0200 Subject: [PATCH 016/131] 8012146: Improve tool support Reviewed-by: ksrini, dholmes, alanb, anthony --- jdk/makefiles/CompileLaunchers.gmk | 6 ++---- jdk/makefiles/Images.gmk | 5 +++++ jdk/test/Makefile | 3 ++- 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/jdk/makefiles/CompileLaunchers.gmk b/jdk/makefiles/CompileLaunchers.gmk index 90348b6360f..253fe0231c8 100644 --- a/jdk/makefiles/CompileLaunchers.gmk +++ b/jdk/makefiles/CompileLaunchers.gmk @@ -52,8 +52,7 @@ endif ifeq ($(OPENJDK_TARGET_OS), macosx) ORIGIN_ARG:=$(call SET_EXECUTABLE_ORIGIN) else - ORIGIN_ARG:=$(call SET_EXECUTABLE_ORIGIN,$(ORIGIN_ROOT)/lib$(OPENJDK_TARGET_CPU_LIBDIR)/jli) \ - $(call SET_EXECUTABLE_ORIGIN,$(ORIGIN_ROOT)/jre/lib$(OPENJDK_TARGET_CPU_LIBDIR)/jli) + ORIGIN_ARG:=$(call SET_EXECUTABLE_ORIGIN,$(ORIGIN_ROOT)/lib$(OPENJDK_TARGET_CPU_LIBDIR)/jli) endif # @@ -62,8 +61,7 @@ endif # devloper documentation of JAWT and what worked with OpenJDK6. # ifneq ($(findstring $(OPENJDK_TARGET_OS), linux solaris),) - ORIGIN_ARG+=$(call SET_EXECUTABLE_ORIGIN,$(ORIGIN_ROOT)/lib$(OPENJDK_TARGET_CPU_LIBDIR)) \ - $(call SET_EXECUTABLE_ORIGIN,$(ORIGIN_ROOT)/jre/lib$(OPENJDK_TARGET_CPU_LIBDIR)) + ORIGIN_ARG+=$(call SET_EXECUTABLE_ORIGIN,$(ORIGIN_ROOT)/lib$(OPENJDK_TARGET_CPU_LIBDIR)) endif define SetupLauncher diff --git a/jdk/makefiles/Images.gmk b/jdk/makefiles/Images.gmk index d265f4cd587..492cf544ab5 100644 --- a/jdk/makefiles/Images.gmk +++ b/jdk/makefiles/Images.gmk @@ -218,6 +218,11 @@ ifeq ($(OPENJDK_TARGET_OS), linux) JDK_LIB_FILES += jexec endif +ifneq ($(findstring $(OPENJDK_TARGET_OS), linux solaris),) # If Linux or Solaris + JDK_LIB_FILES += $(LIBRARY_PREFIX)jli$(SHARED_LIBRARY_SUFFIX) \ + $(LIBRARY_PREFIX)jawt$(SHARED_LIBRARY_SUFFIX) +endif + # Find all files to copy from $(JDK_OUTPUTDIR)/lib # Jar files are not expected to be here ALL_JDKOUT_LIB_LIST := $(call not-containing,_the.,$(filter-out %.jar,\ diff --git a/jdk/test/Makefile b/jdk/test/Makefile index de6b4a783ff..aac9ef4227b 100644 --- a/jdk/test/Makefile +++ b/jdk/test/Makefile @@ -521,7 +521,8 @@ jdk_other: $(call TestDirs, \ com/sun/org/apache/xerces \ com/sun/corba \ com/sun/tracing \ - sun/usagetracker) + sun/usagetracker \ + misc) $(call RunAgentvmBatch) # Stable agentvm testruns (minus items from PROBLEM_LIST) From f0b7243841e85efcaeda0e7789f961b8201c4d9b Mon Sep 17 00:00:00 2001 From: Anthony Scarpino Date: Wed, 3 Jul 2013 15:10:11 -0700 Subject: [PATCH 017/131] 8011071: Better crypto provider handling Reviewed-by: hawtin, valeriep --- .../com/sun/crypto/provider/DHPrivateKey.java | 18 +------ .../sun/security/ec/ECPrivateKeyImpl.java | 10 +--- .../sun/security/jgss/GSSCredentialImpl.java | 4 +- .../classes/sun/security/pkcs/PKCS8Key.java | 13 +---- .../classes/sun/security/pkcs11/P11Key.java | 48 +------------------ .../sun/security/provider/DSAPrivateKey.java | 7 +-- .../security/rsa/RSAPrivateCrtKeyImpl.java | 27 +---------- .../sun/security/rsa/RSAPrivateKeyImpl.java | 9 +--- 8 files changed, 9 insertions(+), 127 deletions(-) diff --git a/jdk/src/share/classes/com/sun/crypto/provider/DHPrivateKey.java b/jdk/src/share/classes/com/sun/crypto/provider/DHPrivateKey.java index 1653a239960..cb50886f6eb 100644 --- a/jdk/src/share/classes/com/sun/crypto/provider/DHPrivateKey.java +++ b/jdk/src/share/classes/com/sun/crypto/provider/DHPrivateKey.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 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 @@ -279,22 +279,6 @@ javax.crypto.interfaces.DHPrivateKey, Serializable { return new DHParameterSpec(this.p, this.g); } - public String toString() { - String LINE_SEP = System.getProperty("line.separator"); - - StringBuffer strbuf - = new StringBuffer("SunJCE Diffie-Hellman Private Key:" - + LINE_SEP + "x:" + LINE_SEP - + Debug.toHexString(this.x) - + LINE_SEP + "p:" + LINE_SEP - + Debug.toHexString(this.p) - + LINE_SEP + "g:" + LINE_SEP - + Debug.toHexString(this.g)); - if (this.l != 0) - strbuf.append(LINE_SEP + "l:" + LINE_SEP + " " + this.l); - return strbuf.toString(); - } - private void parseKeyBits() throws InvalidKeyException { try { DerInputStream in = new DerInputStream(this.key); diff --git a/jdk/src/share/classes/sun/security/ec/ECPrivateKeyImpl.java b/jdk/src/share/classes/sun/security/ec/ECPrivateKeyImpl.java index 3bc90ce8071..b974c3ca86c 100644 --- a/jdk/src/share/classes/sun/security/ec/ECPrivateKeyImpl.java +++ b/jdk/src/share/classes/sun/security/ec/ECPrivateKeyImpl.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2006, 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 @@ -152,12 +152,4 @@ public final class ECPrivateKeyImpl extends PKCS8Key implements ECPrivateKey { throw new InvalidKeyException("Invalid EC private key", e); } } - - // return a string representation of this key for debugging - public String toString() { - return "Sun EC private key, " + params.getCurve().getField().getFieldSize() - + " bits\n private value: " - + s + "\n parameters: " + params; - } - } diff --git a/jdk/src/share/classes/sun/security/jgss/GSSCredentialImpl.java b/jdk/src/share/classes/sun/security/jgss/GSSCredentialImpl.java index 584e1784c8a..65f6847fd3e 100644 --- a/jdk/src/share/classes/sun/security/jgss/GSSCredentialImpl.java +++ b/jdk/src/share/classes/sun/security/jgss/GSSCredentialImpl.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 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 @@ -651,7 +651,7 @@ public class GSSCredentialImpl implements ExtendedGSSCredential { buffer.append(element.isAcceptorCredential() ? " Accept" : ""); buffer.append(" ["); - buffer.append(element.toString()); + buffer.append(element.getClass()); buffer.append(']'); } catch (GSSException e) { // skip to next element diff --git a/jdk/src/share/classes/sun/security/pkcs/PKCS8Key.java b/jdk/src/share/classes/sun/security/pkcs/PKCS8Key.java index c53b421da66..59512f11b6e 100644 --- a/jdk/src/share/classes/sun/security/pkcs/PKCS8Key.java +++ b/jdk/src/share/classes/sun/security/pkcs/PKCS8Key.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1996, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1996, 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 @@ -304,17 +304,6 @@ public class PKCS8Key implements PrivateKey { return encodedKey.clone(); } - /* - * Returns a printable representation of the key - */ - public String toString () - { - HexDumpEncoder encoder = new HexDumpEncoder (); - - return "algorithm = " + algid.toString () - + ", unparsed keybits = \n" + encoder.encodeBuffer (key); - } - /** * Initialize an PKCS8Key object from an input stream. The data * on that input stream must be encoded using DER, obeying the diff --git a/jdk/src/share/classes/sun/security/pkcs11/P11Key.java b/jdk/src/share/classes/sun/security/pkcs11/P11Key.java index dd0ec5f7ee1..e85d27efbb3 100644 --- a/jdk/src/share/classes/sun/security/pkcs11/P11Key.java +++ b/jdk/src/share/classes/sun/security/pkcs11/P11Key.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 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 @@ -552,27 +552,6 @@ abstract class P11Key implements Key, Length { fetchValues(); return coeff; } - public String toString() { - fetchValues(); - StringBuilder sb = new StringBuilder(super.toString()); - sb.append("\n modulus: "); - sb.append(n); - sb.append("\n public exponent: "); - sb.append(e); - sb.append("\n private exponent: "); - sb.append(d); - sb.append("\n prime p: "); - sb.append(p); - sb.append("\n prime q: "); - sb.append(q); - sb.append("\n prime exponent p: "); - sb.append(pe); - sb.append("\n prime exponent q: "); - sb.append(qe); - sb.append("\n crt coefficient: "); - sb.append(coeff); - return sb.toString(); - } } // RSA non-CRT private key @@ -628,15 +607,6 @@ abstract class P11Key implements Key, Length { fetchValues(); return d; } - public String toString() { - fetchValues(); - StringBuilder sb = new StringBuilder(super.toString()); - sb.append("\n modulus: "); - sb.append(n); - sb.append("\n private exponent: "); - sb.append(d); - return sb.toString(); - } } private static final class P11RSAPublicKey extends P11Key @@ -812,11 +782,6 @@ abstract class P11Key implements Key, Length { fetchValues(); return params; } - public String toString() { - fetchValues(); - return super.toString() + "\n x: " + x + "\n p: " + params.getP() - + "\n q: " + params.getQ() + "\n g: " + params.getG(); - } } private static final class P11DHPrivateKey extends P11Key @@ -876,11 +841,6 @@ abstract class P11Key implements Key, Length { fetchValues(); return params; } - public String toString() { - fetchValues(); - return super.toString() + "\n x: " + x + "\n p: " + params.getP() - + "\n g: " + params.getG(); - } } private static final class P11DHPublicKey extends P11Key @@ -1001,12 +961,6 @@ abstract class P11Key implements Key, Length { fetchValues(); return params; } - public String toString() { - fetchValues(); - return super.toString() - + "\n private value: " + s - + "\n parameters: " + params; - } } private static final class P11ECPublicKey extends P11Key diff --git a/jdk/src/share/classes/sun/security/provider/DSAPrivateKey.java b/jdk/src/share/classes/sun/security/provider/DSAPrivateKey.java index b521e3d2fbd..97e7ef8d7da 100644 --- a/jdk/src/share/classes/sun/security/provider/DSAPrivateKey.java +++ b/jdk/src/share/classes/sun/security/provider/DSAPrivateKey.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1996, 2002, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1996, 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 @@ -142,11 +142,6 @@ implements java.security.interfaces.DSAPrivateKey, Serializable { } } - public String toString() { - return "Sun DSA Private Key \nparameters:" + algid + "\nx: " + - Debug.toHexString(x) + "\n"; - } - protected void parseKeyBits() throws InvalidKeyException { try { DerInputStream in = new DerInputStream(key); diff --git a/jdk/src/share/classes/sun/security/rsa/RSAPrivateCrtKeyImpl.java b/jdk/src/share/classes/sun/security/rsa/RSAPrivateCrtKeyImpl.java index b289ef2efaa..7e68c427e52 100644 --- a/jdk/src/share/classes/sun/security/rsa/RSAPrivateCrtKeyImpl.java +++ b/jdk/src/share/classes/sun/security/rsa/RSAPrivateCrtKeyImpl.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 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 @@ -225,29 +225,4 @@ public final class RSAPrivateCrtKeyImpl } return b; } - - // return a string representation of this key for debugging - public String toString() { - StringBuffer sb = new StringBuffer(); - sb.append("Sun RSA private CRT key, "); - sb.append(n.bitLength()); - sb.append(" bits\n modulus: "); - sb.append(n); - sb.append("\n public exponent: "); - sb.append(e); - sb.append("\n private exponent: "); - sb.append(d); - sb.append("\n prime p: "); - sb.append(p); - sb.append("\n prime q: "); - sb.append(q); - sb.append("\n prime exponent p: "); - sb.append(pe); - sb.append("\n prime exponent q: "); - sb.append(qe); - sb.append("\n crt coefficient: "); - sb.append(coeff); - return sb.toString(); - } - } diff --git a/jdk/src/share/classes/sun/security/rsa/RSAPrivateKeyImpl.java b/jdk/src/share/classes/sun/security/rsa/RSAPrivateKeyImpl.java index f9a7c340bf4..1a7df130463 100644 --- a/jdk/src/share/classes/sun/security/rsa/RSAPrivateKeyImpl.java +++ b/jdk/src/share/classes/sun/security/rsa/RSAPrivateKeyImpl.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 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 @@ -98,11 +98,4 @@ public final class RSAPrivateKeyImpl extends PKCS8Key implements RSAPrivateKey { public BigInteger getPrivateExponent() { return d; } - - // return a string representation of this key for debugging - public String toString() { - return "Sun RSA private key, " + n.bitLength() + " bits\n modulus: " - + n + "\n private exponent: " + d; - } - } From 455cd24c9541114abe0a297a27be30c219fe399c Mon Sep 17 00:00:00 2001 From: Dmitry Samersoff Date: Mon, 8 Jul 2013 16:15:39 +0400 Subject: [PATCH 018/131] 8008589: Better MBean permission validation Better MBean permission validation Reviewed-by: skoivu, dfuchs, mchung, sjiang --- .../management/MBeanTrustPermission.java | 35 ++++++++++++++----- 1 file changed, 27 insertions(+), 8 deletions(-) diff --git a/jdk/src/share/classes/javax/management/MBeanTrustPermission.java b/jdk/src/share/classes/javax/management/MBeanTrustPermission.java index 040f0ddd653..605201a9f8d 100644 --- a/jdk/src/share/classes/javax/management/MBeanTrustPermission.java +++ b/jdk/src/share/classes/javax/management/MBeanTrustPermission.java @@ -26,6 +26,9 @@ package javax.management; import java.security.BasicPermission; +import java.io.IOException; +import java.io.InvalidObjectException; +import java.io.ObjectInputStream; /** * This permission represents "trust" in a signer or codebase. @@ -75,15 +78,31 @@ public class MBeanTrustPermission extends BasicPermission { */ public MBeanTrustPermission(String name, String actions) { super(name, actions); - /* Check that actions is a null empty string */ - if (actions != null && actions.length() > 0) - throw new IllegalArgumentException("MBeanTrustPermission " + - "actions must be null: " + - actions); + validate(name,actions); + } - if (!name.equals("register") && !name.equals("*")) - throw new IllegalArgumentException("MBeanTrustPermission: " + - "Unknown target name " + + private static void validate(String name, String actions) { + /* Check that actions is a null empty string */ + if (actions != null && actions.length() > 0) { + throw new IllegalArgumentException("MBeanTrustPermission actions must be null: " + + actions); + } + + if (!name.equals("register") && !name.equals("*")) { + throw new IllegalArgumentException("MBeanTrustPermission: Unknown target name " + "[" + name + "]"); + } + } + + private void readObject(ObjectInputStream in) + throws IOException, ClassNotFoundException { + + // Reading private fields of base class + in.defaultReadObject(); + try { + validate(super.getName(),super.getActions()); + } catch (IllegalArgumentException e) { + throw new InvalidObjectException(e.getMessage()); + } } } From c11a760a1b1481f5a2442c3d70d563fd25e8f6fc Mon Sep 17 00:00:00 2001 From: Stephen Colebourne Date: Thu, 26 Sep 2013 23:05:29 -0700 Subject: [PATCH 019/131] 8025720: Separate temporal interface layer Remove ZoneId and Chronology from TemporalField interface Reviewed-by: sherman --- .../classes/java/time/format/Parsed.java | 2 +- .../classes/java/time/temporal/IsoFields.java | 13 +++++++++-- .../java/time/temporal/JulianFields.java | 7 +++--- .../java/time/temporal/TemporalField.java | 23 +++++++++++-------- .../java/time/temporal/WeekFields.java | 9 ++++---- .../time/format/TCKDateTimeParseResolver.java | 12 ++++------ 6 files changed, 39 insertions(+), 27 deletions(-) diff --git a/jdk/src/share/classes/java/time/format/Parsed.java b/jdk/src/share/classes/java/time/format/Parsed.java index 908c7decaef..a86697a31f3 100644 --- a/jdk/src/share/classes/java/time/format/Parsed.java +++ b/jdk/src/share/classes/java/time/format/Parsed.java @@ -262,7 +262,7 @@ final class Parsed implements TemporalAccessor { while (changedCount < 50) { for (Map.Entry entry : fieldValues.entrySet()) { TemporalField targetField = entry.getKey(); - TemporalAccessor resolvedObject = targetField.resolve(fieldValues, chrono, zone, resolverStyle); + TemporalAccessor resolvedObject = targetField.resolve(fieldValues, this, resolverStyle); if (resolvedObject != null) { if (resolvedObject instanceof ChronoZonedDateTime) { ChronoZonedDateTime czdt = (ChronoZonedDateTime) resolvedObject; diff --git a/jdk/src/share/classes/java/time/temporal/IsoFields.java b/jdk/src/share/classes/java/time/temporal/IsoFields.java index bb19c299875..e8ccff15f60 100644 --- a/jdk/src/share/classes/java/time/temporal/IsoFields.java +++ b/jdk/src/share/classes/java/time/temporal/IsoFields.java @@ -69,6 +69,7 @@ import static java.time.temporal.ChronoUnit.MONTHS; import static java.time.temporal.ChronoUnit.WEEKS; import static java.time.temporal.ChronoUnit.YEARS; +import java.time.DateTimeException; import java.time.Duration; import java.time.LocalDate; import java.time.ZoneId; @@ -343,7 +344,7 @@ public final class IsoFields { } @Override public ChronoLocalDate resolve( - Map fieldValues, Chronology chronology, ZoneId zone, ResolverStyle resolverStyle) { + Map fieldValues, TemporalAccessor partialTemporal, ResolverStyle resolverStyle) { Long yearLong = fieldValues.get(YEAR); Long qoyLong = fieldValues.get(QUARTER_OF_YEAR); if (yearLong == null || qoyLong == null) { @@ -351,6 +352,7 @@ public final class IsoFields { } int y = YEAR.checkValidIntValue(yearLong); // always validate long doq = fieldValues.get(DAY_OF_QUARTER); + ensureIso(partialTemporal); LocalDate date; if (resolverStyle == ResolverStyle.LENIENT) { date = LocalDate.of(y, 1, 1).plusMonths(Math.multiplyExact(Math.subtractExact(qoyLong, 1), 3)); @@ -464,7 +466,7 @@ public final class IsoFields { } @Override public ChronoLocalDate resolve( - Map fieldValues, Chronology chronology, ZoneId zone, ResolverStyle resolverStyle) { + Map fieldValues, TemporalAccessor partialTemporal, ResolverStyle resolverStyle) { Long wbyLong = fieldValues.get(WEEK_BASED_YEAR); Long dowLong = fieldValues.get(DAY_OF_WEEK); if (wbyLong == null || dowLong == null) { @@ -472,6 +474,7 @@ public final class IsoFields { } int wby = WEEK_BASED_YEAR.range().checkValidIntValue(wbyLong, WEEK_BASED_YEAR); // always validate long wowby = fieldValues.get(WEEK_OF_WEEK_BASED_YEAR); + ensureIso(partialTemporal); LocalDate date = LocalDate.of(wby, 1, 4); if (resolverStyle == ResolverStyle.LENIENT) { long dow = dowLong; // unvalidated @@ -568,6 +571,12 @@ public final class IsoFields { return Chronology.from(temporal).equals(IsoChronology.INSTANCE); } + private static void ensureIso(TemporalAccessor temporal) { + if (isIso(temporal) == false) { + throw new DateTimeException("Resolve requires IsoChronology"); + } + } + private static ValueRange getWeekRange(LocalDate date) { int wby = getWeekBasedYear(date); date = date.withDayOfYear(1).withYear(wby); diff --git a/jdk/src/share/classes/java/time/temporal/JulianFields.java b/jdk/src/share/classes/java/time/temporal/JulianFields.java index 326f20d222f..f950d87201b 100644 --- a/jdk/src/share/classes/java/time/temporal/JulianFields.java +++ b/jdk/src/share/classes/java/time/temporal/JulianFields.java @@ -291,13 +291,14 @@ public final class JulianFields { //----------------------------------------------------------------------- @Override public ChronoLocalDate resolve( - Map fieldValues, Chronology chronology, ZoneId zone, ResolverStyle resolverStyle) { + Map fieldValues, TemporalAccessor partialTemporal, ResolverStyle resolverStyle) { long value = fieldValues.remove(this); + Chronology chrono = Chronology.from(partialTemporal); if (resolverStyle == ResolverStyle.LENIENT) { - return chronology.dateEpochDay(Math.subtractExact(value, offset)); + return chrono.dateEpochDay(Math.subtractExact(value, offset)); } range().checkValidValue(value, this); - return chronology.dateEpochDay(value - offset); + return chrono.dateEpochDay(value - offset); } //----------------------------------------------------------------------- diff --git a/jdk/src/share/classes/java/time/temporal/TemporalField.java b/jdk/src/share/classes/java/time/temporal/TemporalField.java index e757734510c..51903ede30f 100644 --- a/jdk/src/share/classes/java/time/temporal/TemporalField.java +++ b/jdk/src/share/classes/java/time/temporal/TemporalField.java @@ -62,7 +62,6 @@ package java.time.temporal; import java.time.DateTimeException; -import java.time.ZoneId; import java.time.chrono.Chronology; import java.time.format.ResolverStyle; import java.util.Locale; @@ -338,6 +337,13 @@ public interface TemporalField { * complete {@code LocalDate}. The resolve method will remove all three * fields from the map before returning the {@code LocalDate}. *

+ * A partially complete temporal is used to allow the chronology and zone + * to be queried. In general, only the chronology will be needed. + * Querying items other than the zone or chronology is undefined and + * must not be relied on. + * The behavior of other methods such as {@code get}, {@code getLong}, + * {@code range} and {@code isSupported} is unpredictable and the results undefined. + *

* If resolution should be possible, but the data is invalid, the resolver * style should be used to determine an appropriate level of leniency, which * may require throwing a {@code DateTimeException} or {@code ArithmeticException}. @@ -350,16 +356,14 @@ public interface TemporalField { * instances that can produce a date, such as {@code EPOCH_DAY}. *

* Not all {@code TemporalAccessor} implementations are accepted as return values. - * Implementations must accept {@code ChronoLocalDate}, {@code ChronoLocalDateTime}, - * {@code ChronoZonedDateTime} and {@code LocalTime}. - *

- * The zone is not normally required for resolution, but is provided for completeness. + * Implementations that call this method must accept {@code ChronoLocalDate}, + * {@code ChronoLocalDateTime}, {@code ChronoZonedDateTime} and {@code LocalTime}. *

* The default implementation must return null. * * @param fieldValues the map of fields to values, which can be updated, not null - * @param chronology the effective chronology, not null - * @param zone the effective zone, not null + * @param partialTemporal the partially complete temporal to query for zone and + * chronology; querying for other things is undefined and not recommended, not null * @param resolverStyle the requested type of resolve, not null * @return the resolved temporal object; null if resolving only * changed the map, or no resolve occurred @@ -368,8 +372,9 @@ public interface TemporalField { * by querying a field on the temporal without first checking if it is supported */ default TemporalAccessor resolve( - Map fieldValues, Chronology chronology, - ZoneId zone, ResolverStyle resolverStyle) { + Map fieldValues, + TemporalAccessor partialTemporal, + ResolverStyle resolverStyle) { return null; } diff --git a/jdk/src/share/classes/java/time/temporal/WeekFields.java b/jdk/src/share/classes/java/time/temporal/WeekFields.java index b3eb1383450..0edfa73e217 100644 --- a/jdk/src/share/classes/java/time/temporal/WeekFields.java +++ b/jdk/src/share/classes/java/time/temporal/WeekFields.java @@ -892,7 +892,7 @@ public final class WeekFields implements Serializable { @Override public ChronoLocalDate resolve( - Map fieldValues, Chronology chronology, ZoneId zone, ResolverStyle resolverStyle) { + Map fieldValues, TemporalAccessor partialTemporal, ResolverStyle resolverStyle) { final long value = fieldValues.get(this); final int newValue = Math.toIntExact(value); // broad limit makes overflow checking lighter // first convert localized day-of-week to ISO day-of-week @@ -915,19 +915,20 @@ public final class WeekFields implements Serializable { int dow = localizedDayOfWeek(isoDow); // build date + Chronology chrono = Chronology.from(partialTemporal); if (fieldValues.containsKey(YEAR)) { int year = YEAR.checkValidIntValue(fieldValues.get(YEAR)); // validate if (rangeUnit == MONTHS && fieldValues.containsKey(MONTH_OF_YEAR)) { // week-of-month long month = fieldValues.get(MONTH_OF_YEAR); // not validated yet - return resolveWoM(fieldValues, chronology, year, month, newValue, dow, resolverStyle); + return resolveWoM(fieldValues, chrono, year, month, newValue, dow, resolverStyle); } if (rangeUnit == YEARS) { // week-of-year - return resolveWoY(fieldValues, chronology, year, newValue, dow, resolverStyle); + return resolveWoY(fieldValues, chrono, year, newValue, dow, resolverStyle); } } else if ((rangeUnit == WEEK_BASED_YEARS || rangeUnit == FOREVER) && fieldValues.containsKey(weekDef.weekBasedYear) && fieldValues.containsKey(weekDef.weekOfWeekBasedYear)) { // week-of-week-based-year and year-of-week-based-year - return resolveWBY(fieldValues, chronology, dow, resolverStyle); + return resolveWBY(fieldValues, chrono, dow, resolverStyle); } return null; } diff --git a/jdk/test/java/time/tck/java/time/format/TCKDateTimeParseResolver.java b/jdk/test/java/time/tck/java/time/format/TCKDateTimeParseResolver.java index 4ef01317b2e..b99d9bb4730 100644 --- a/jdk/test/java/time/tck/java/time/format/TCKDateTimeParseResolver.java +++ b/jdk/test/java/time/tck/java/time/format/TCKDateTimeParseResolver.java @@ -927,8 +927,7 @@ public class TCKDateTimeParseResolver { } @Override public TemporalAccessor resolve( - Map fieldValues, Chronology chronology, - ZoneId zone, ResolverStyle resolverStyle) { + Map fieldValues, TemporalAccessor partialTemporal, ResolverStyle resolverStyle) { return LocalTime.MIDNIGHT.plusNanos(fieldValues.remove(this)); } }; @@ -979,8 +978,7 @@ public class TCKDateTimeParseResolver { } @Override public TemporalAccessor resolve( - Map fieldValues, Chronology chronology, - ZoneId zone, ResolverStyle resolverStyle) { + Map fieldValues, TemporalAccessor partialTemporal, ResolverStyle resolverStyle) { fieldValues.remove(this); return LocalDateTime.of(2010, 6, 30, 12, 30); } @@ -1032,8 +1030,7 @@ public class TCKDateTimeParseResolver { } @Override public TemporalAccessor resolve( - Map fieldValues, Chronology chronology, - ZoneId zone, ResolverStyle resolverStyle) { + Map fieldValues, TemporalAccessor partialTemporal, ResolverStyle resolverStyle) { return ThaiBuddhistChronology.INSTANCE.dateNow(); } }; @@ -1082,8 +1079,7 @@ public class TCKDateTimeParseResolver { } @Override public TemporalAccessor resolve( - Map fieldValues, Chronology chronology, - ZoneId zone, ResolverStyle resolverStyle) { + Map fieldValues, TemporalAccessor partialTemporal, ResolverStyle resolverStyle) { return ZonedDateTime.of(2010, 6, 30, 12, 30, 0, 0, ZoneId.of("Europe/Paris")); } }; From f2ea6795a76bbbaf4c99158d772c946b1f0b0e1e Mon Sep 17 00:00:00 2001 From: Stephen Colebourne Date: Tue, 9 Jul 2013 21:35:04 +0100 Subject: [PATCH 020/131] 8025719: Change Chronology to an interface Split Chronology and add AbstractChronology Reviewed-by: darcy --- .../java/time/chrono/AbstractChronology.java | 783 ++++++++++++++++++ .../java/time/chrono/ChronoLocalDate.java | 2 +- .../java/time/chrono/ChronoLocalDateTime.java | 2 +- .../java/time/chrono/ChronoZonedDateTime.java | 2 +- .../classes/java/time/chrono/Chronology.java | 710 ++-------------- .../java/time/chrono/HijrahChronology.java | 8 +- .../java/time/chrono/IsoChronology.java | 2 +- .../java/time/chrono/JapaneseChronology.java | 2 +- .../java/time/chrono/MinguoChronology.java | 2 +- .../share/classes/java/time/chrono/Ser.java | 4 +- .../time/chrono/ThaiBuddhistChronology.java | 2 +- .../java/time/chrono/CopticChronology.java | 8 +- 12 files changed, 864 insertions(+), 663 deletions(-) create mode 100644 jdk/src/share/classes/java/time/chrono/AbstractChronology.java diff --git a/jdk/src/share/classes/java/time/chrono/AbstractChronology.java b/jdk/src/share/classes/java/time/chrono/AbstractChronology.java new file mode 100644 index 00000000000..89b728e88c9 --- /dev/null +++ b/jdk/src/share/classes/java/time/chrono/AbstractChronology.java @@ -0,0 +1,783 @@ +/* + * Copyright (c) 2012, 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. + */ + +/* + * This file is available under and governed by the GNU General Public + * License version 2 only, as published by the Free Software Foundation. + * However, the following notice accompanied the original version of this + * file: + * + * Copyright (c) 2012, Stephen Colebourne & Michael Nascimento Santos + * + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * * Neither the name of JSR-310 nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ +package java.time.chrono; + +import static java.time.temporal.ChronoField.ALIGNED_DAY_OF_WEEK_IN_MONTH; +import static java.time.temporal.ChronoField.ALIGNED_DAY_OF_WEEK_IN_YEAR; +import static java.time.temporal.ChronoField.ALIGNED_WEEK_OF_MONTH; +import static java.time.temporal.ChronoField.ALIGNED_WEEK_OF_YEAR; +import static java.time.temporal.ChronoField.DAY_OF_MONTH; +import static java.time.temporal.ChronoField.DAY_OF_WEEK; +import static java.time.temporal.ChronoField.DAY_OF_YEAR; +import static java.time.temporal.ChronoField.EPOCH_DAY; +import static java.time.temporal.ChronoField.ERA; +import static java.time.temporal.ChronoField.MONTH_OF_YEAR; +import static java.time.temporal.ChronoField.PROLEPTIC_MONTH; +import static java.time.temporal.ChronoField.YEAR; +import static java.time.temporal.ChronoField.YEAR_OF_ERA; +import static java.time.temporal.ChronoUnit.DAYS; +import static java.time.temporal.ChronoUnit.MONTHS; +import static java.time.temporal.ChronoUnit.WEEKS; +import static java.time.temporal.TemporalAdjuster.nextOrSame; + +import java.io.DataInput; +import java.io.DataOutput; +import java.io.IOException; +import java.io.InvalidObjectException; +import java.io.ObjectStreamException; +import java.io.Serializable; +import java.time.DateTimeException; +import java.time.DayOfWeek; +import java.time.format.ResolverStyle; +import java.time.temporal.ChronoField; +import java.time.temporal.TemporalAdjuster; +import java.time.temporal.TemporalField; +import java.time.temporal.ValueRange; +import java.util.Comparator; +import java.util.HashSet; +import java.util.List; +import java.util.Locale; +import java.util.Map; +import java.util.Objects; +import java.util.ServiceLoader; +import java.util.Set; +import java.util.concurrent.ConcurrentHashMap; + +import sun.util.logging.PlatformLogger; + +/** + * An abstract implementation of a calendar system, used to organize and identify dates. + *

+ * The main date and time API is built on the ISO calendar system. + * The chronology operates behind the scenes to represent the general concept of a calendar system. + *

+ * See {@link Chronology} for more details. + * + * @implSpec + * This class is separated from the {@code Chronology} interface so that the static methods + * are not inherited. While {@code Chronology} can be implemented directly, it is strongly + * recommended to extend this abstract class instead. + *

+ * This class must be implemented with care to ensure other classes operate correctly. + * All implementations that can be instantiated must be final, immutable and thread-safe. + * Subclasses should be Serializable wherever possible. + * + * @since 1.8 + */ +public abstract class AbstractChronology implements Chronology { + + /** + * ChronoLocalDate order constant. + */ + static final Comparator DATE_ORDER = + (Comparator & Serializable) (date1, date2) -> { + return Long.compare(date1.toEpochDay(), date2.toEpochDay()); + }; + /** + * ChronoLocalDateTime order constant. + */ + static final Comparator> DATE_TIME_ORDER = + (Comparator> & Serializable) (dateTime1, dateTime2) -> { + int cmp = Long.compare(dateTime1.toLocalDate().toEpochDay(), dateTime2.toLocalDate().toEpochDay()); + if (cmp == 0) { + cmp = Long.compare(dateTime1.toLocalTime().toNanoOfDay(), dateTime2.toLocalTime().toNanoOfDay()); + } + return cmp; + }; + /** + * ChronoZonedDateTime order constant. + */ + static final Comparator> INSTANT_ORDER = + (Comparator> & Serializable) (dateTime1, dateTime2) -> { + int cmp = Long.compare(dateTime1.toEpochSecond(), dateTime2.toEpochSecond()); + if (cmp == 0) { + cmp = Long.compare(dateTime1.toLocalTime().getNano(), dateTime2.toLocalTime().getNano()); + } + return cmp; + }; + + /** + * Map of available calendars by ID. + */ + private static final ConcurrentHashMap CHRONOS_BY_ID = new ConcurrentHashMap<>(); + /** + * Map of available calendars by calendar type. + */ + private static final ConcurrentHashMap CHRONOS_BY_TYPE = new ConcurrentHashMap<>(); + + /** + * Register a Chronology by its ID and type for lookup by {@link #of(String)}. + * Chronologies must not be registered until they are completely constructed. + * Specifically, not in the constructor of Chronology. + * + * @param chrono the chronology to register; not null + * @return the already registered Chronology if any, may be null + */ + static Chronology registerChrono(Chronology chrono) { + return registerChrono(chrono, chrono.getId()); + } + + /** + * Register a Chronology by ID and type for lookup by {@link #of(String)}. + * Chronos must not be registered until they are completely constructed. + * Specifically, not in the constructor of Chronology. + * + * @param chrono the chronology to register; not null + * @param id the ID to register the chronology; not null + * @return the already registered Chronology if any, may be null + */ + static Chronology registerChrono(Chronology chrono, String id) { + Chronology prev = CHRONOS_BY_ID.putIfAbsent(id, chrono); + if (prev == null) { + String type = chrono.getCalendarType(); + if (type != null) { + CHRONOS_BY_TYPE.putIfAbsent(type, chrono); + } + } + return prev; + } + + /** + * Initialization of the maps from id and type to Chronology. + * The ServiceLoader is used to find and register any implementations + * of {@link java.time.chrono.AbstractChronology} found in the bootclass loader. + * The built-in chronologies are registered explicitly. + * Calendars configured via the Thread's context classloader are local + * to that thread and are ignored. + *

+ * The initialization is done only once using the registration + * of the IsoChronology as the test and the final step. + * Multiple threads may perform the initialization concurrently. + * Only the first registration of each Chronology is retained by the + * ConcurrentHashMap. + * @return true if the cache was initialized + */ + private static boolean initCache() { + if (CHRONOS_BY_ID.get("ISO") == null) { + // Initialization is incomplete + + // Register built-in Chronologies + registerChrono(HijrahChronology.INSTANCE); + registerChrono(JapaneseChronology.INSTANCE); + registerChrono(MinguoChronology.INSTANCE); + registerChrono(ThaiBuddhistChronology.INSTANCE); + + // Register Chronologies from the ServiceLoader + @SuppressWarnings("rawtypes") + ServiceLoader loader = ServiceLoader.load(AbstractChronology.class, null); + for (AbstractChronology chrono : loader) { + String id = chrono.getId(); + if (id.equals("ISO") || registerChrono(chrono) != null) { + // Log the attempt to replace an existing Chronology + PlatformLogger logger = PlatformLogger.getLogger("java.time.chrono"); + logger.warning("Ignoring duplicate Chronology, from ServiceLoader configuration " + id); + } + } + + // finally, register IsoChronology to mark initialization is complete + registerChrono(IsoChronology.INSTANCE); + return true; + } + return false; + } + + //----------------------------------------------------------------------- + /** + * Obtains an instance of {@code Chronology} from a locale. + *

+ * See {@link Chronology#ofLocale(Locale)}. + * + * @param locale the locale to use to obtain the calendar system, not null + * @return the calendar system associated with the locale, not null + * @throws java.time.DateTimeException if the locale-specified calendar cannot be found + */ + static Chronology ofLocale(Locale locale) { + Objects.requireNonNull(locale, "locale"); + String type = locale.getUnicodeLocaleType("ca"); + if (type == null || "iso".equals(type) || "iso8601".equals(type)) { + return IsoChronology.INSTANCE; + } + // Not pre-defined; lookup by the type + do { + Chronology chrono = CHRONOS_BY_TYPE.get(type); + if (chrono != null) { + return chrono; + } + // If not found, do the initialization (once) and repeat the lookup + } while (initCache()); + + // Look for a Chronology using ServiceLoader of the Thread's ContextClassLoader + // Application provided Chronologies must not be cached + @SuppressWarnings("rawtypes") + ServiceLoader loader = ServiceLoader.load(Chronology.class); + for (Chronology chrono : loader) { + if (type.equals(chrono.getCalendarType())) { + return chrono; + } + } + throw new DateTimeException("Unknown calendar system: " + type); + } + + //----------------------------------------------------------------------- + /** + * Obtains an instance of {@code Chronology} from a chronology ID or + * calendar system type. + *

+ * See {@link Chronology#of(String)}. + * + * @param id the chronology ID or calendar system type, not null + * @return the chronology with the identifier requested, not null + * @throws java.time.DateTimeException if the chronology cannot be found + */ + static Chronology of(String id) { + Objects.requireNonNull(id, "id"); + do { + Chronology chrono = of0(id); + if (chrono != null) { + return chrono; + } + // If not found, do the initialization (once) and repeat the lookup + } while (initCache()); + + // Look for a Chronology using ServiceLoader of the Thread's ContextClassLoader + // Application provided Chronologies must not be cached + @SuppressWarnings("rawtypes") + ServiceLoader loader = ServiceLoader.load(Chronology.class); + for (Chronology chrono : loader) { + if (id.equals(chrono.getId()) || id.equals(chrono.getCalendarType())) { + return chrono; + } + } + throw new DateTimeException("Unknown chronology: " + id); + } + + /** + * Obtains an instance of {@code Chronology} from a chronology ID or + * calendar system type. + * + * @param id the chronology ID or calendar system type, not null + * @return the chronology with the identifier requested, or {@code null} if not found + */ + private static Chronology of0(String id) { + Chronology chrono = CHRONOS_BY_ID.get(id); + if (chrono == null) { + chrono = CHRONOS_BY_TYPE.get(id); + } + return chrono; + } + + /** + * Returns the available chronologies. + *

+ * Each returned {@code Chronology} is available for use in the system. + * The set of chronologies includes the system chronologies and + * any chronologies provided by the application via ServiceLoader + * configuration. + * + * @return the independent, modifiable set of the available chronology IDs, not null + */ + static Set getAvailableChronologies() { + initCache(); // force initialization + HashSet chronos = new HashSet<>(CHRONOS_BY_ID.values()); + + /// Add in Chronologies from the ServiceLoader configuration + @SuppressWarnings("rawtypes") + ServiceLoader loader = ServiceLoader.load(Chronology.class); + for (Chronology chrono : loader) { + chronos.add(chrono); + } + return chronos; + } + + //----------------------------------------------------------------------- + /** + * Creates an instance. + */ + protected AbstractChronology() { + } + + //----------------------------------------------------------------------- + /** + * Resolves parsed {@code ChronoField} values into a date during parsing. + *

+ * Most {@code TemporalField} implementations are resolved using the + * resolve method on the field. By contrast, the {@code ChronoField} class + * defines fields that only have meaning relative to the chronology. + * As such, {@code ChronoField} date fields are resolved here in the + * context of a specific chronology. + *

+ * {@code ChronoField} instances are resolved by this method, which may + * be overridden in subclasses. + *

    + *
  • {@code EPOCH_DAY} - If present, this is converted to a date and + * all other date fields are then cross-checked against the date. + *
  • {@code PROLEPTIC_MONTH} - If present, then it is split into the + * {@code YEAR} and {@code MONTH_OF_YEAR}. If the mode is strict or smart + * then the field is validated. + *
  • {@code YEAR_OF_ERA} and {@code ERA} - If both are present, then they + * are combined to form a {@code YEAR}. In lenient mode, the {@code YEAR_OF_ERA} + * range is not validated, in smart and strict mode it is. The {@code ERA} is + * validated for range in all three modes. If only the {@code YEAR_OF_ERA} is + * present, and the mode is smart or lenient, then the last available era + * is assumed. In strict mode, no era is assumed and the {@code YEAR_OF_ERA} is + * left untouched. If only the {@code ERA} is present, then it is left untouched. + *
  • {@code YEAR}, {@code MONTH_OF_YEAR} and {@code DAY_OF_MONTH} - + * If all three are present, then they are combined to form a date. + * In all three modes, the {@code YEAR} is validated. + * If the mode is smart or strict, then the month and day are validated. + * If the mode is lenient, then the date is combined in a manner equivalent to + * creating a date on the first day of the first month in the requested year, + * then adding the difference in months, then the difference in days. + * If the mode is smart, and the day-of-month is greater than the maximum for + * the year-month, then the day-of-month is adjusted to the last day-of-month. + * If the mode is strict, then the three fields must form a valid date. + *
  • {@code YEAR} and {@code DAY_OF_YEAR} - + * If both are present, then they are combined to form a date. + * In all three modes, the {@code YEAR} is validated. + * If the mode is lenient, then the date is combined in a manner equivalent to + * creating a date on the first day of the requested year, then adding + * the difference in days. + * If the mode is smart or strict, then the two fields must form a valid date. + *
  • {@code YEAR}, {@code MONTH_OF_YEAR}, {@code ALIGNED_WEEK_OF_MONTH} and + * {@code ALIGNED_DAY_OF_WEEK_IN_MONTH} - + * If all four are present, then they are combined to form a date. + * In all three modes, the {@code YEAR} is validated. + * If the mode is lenient, then the date is combined in a manner equivalent to + * creating a date on the first day of the first month in the requested year, then adding + * the difference in months, then the difference in weeks, then in days. + * If the mode is smart or strict, then the all four fields are validated to + * their outer ranges. The date is then combined in a manner equivalent to + * creating a date on the first day of the requested year and month, then adding + * the amount in weeks and days to reach their values. If the mode is strict, + * the date is additionally validated to check that the day and week adjustment + * did not change the month. + *
  • {@code YEAR}, {@code MONTH_OF_YEAR}, {@code ALIGNED_WEEK_OF_MONTH} and + * {@code DAY_OF_WEEK} - If all four are present, then they are combined to + * form a date. The approach is the same as described above for + * years, months and weeks in {@code ALIGNED_DAY_OF_WEEK_IN_MONTH}. + * The day-of-week is adjusted as the next or same matching day-of-week once + * the years, months and weeks have been handled. + *
  • {@code YEAR}, {@code ALIGNED_WEEK_OF_YEAR} and {@code ALIGNED_DAY_OF_WEEK_IN_YEAR} - + * If all three are present, then they are combined to form a date. + * In all three modes, the {@code YEAR} is validated. + * If the mode is lenient, then the date is combined in a manner equivalent to + * creating a date on the first day of the requested year, then adding + * the difference in weeks, then in days. + * If the mode is smart or strict, then the all three fields are validated to + * their outer ranges. The date is then combined in a manner equivalent to + * creating a date on the first day of the requested year, then adding + * the amount in weeks and days to reach their values. If the mode is strict, + * the date is additionally validated to check that the day and week adjustment + * did not change the year. + *
  • {@code YEAR}, {@code ALIGNED_WEEK_OF_YEAR} and {@code DAY_OF_WEEK} - + * If all three are present, then they are combined to form a date. + * The approach is the same as described above for years and weeks in + * {@code ALIGNED_DAY_OF_WEEK_IN_YEAR}. The day-of-week is adjusted as the + * next or same matching day-of-week once the years and weeks have been handled. + *
+ *

+ * The default implementation is suitable for most calendar systems. + * If {@link java.time.temporal.ChronoField#YEAR_OF_ERA} is found without an {@link java.time.temporal.ChronoField#ERA} + * then the last era in {@link #eras()} is used. + * The implementation assumes a 7 day week, that the first day-of-month + * has the value 1, that first day-of-year has the value 1, and that the + * first of the month and year always exists. + * + * @param fieldValues the map of fields to values, which can be updated, not null + * @param resolverStyle the requested type of resolve, not null + * @return the resolved date, null if insufficient information to create a date + * @throws java.time.DateTimeException if the date cannot be resolved, typically + * because of a conflict in the input data + */ + @Override + public ChronoLocalDate resolveDate(Map fieldValues, ResolverStyle resolverStyle) { + // check epoch-day before inventing era + if (fieldValues.containsKey(EPOCH_DAY)) { + return dateEpochDay(fieldValues.remove(EPOCH_DAY)); + } + + // fix proleptic month before inventing era + resolveProlepticMonth(fieldValues, resolverStyle); + + // invent era if necessary to resolve year-of-era + ChronoLocalDate resolved = resolveYearOfEra(fieldValues, resolverStyle); + if (resolved != null) { + return resolved; + } + + // build date + if (fieldValues.containsKey(YEAR)) { + if (fieldValues.containsKey(MONTH_OF_YEAR)) { + if (fieldValues.containsKey(DAY_OF_MONTH)) { + return resolveYMD(fieldValues, resolverStyle); + } + if (fieldValues.containsKey(ALIGNED_WEEK_OF_MONTH)) { + if (fieldValues.containsKey(ALIGNED_DAY_OF_WEEK_IN_MONTH)) { + return resolveYMAA(fieldValues, resolverStyle); + } + if (fieldValues.containsKey(DAY_OF_WEEK)) { + return resolveYMAD(fieldValues, resolverStyle); + } + } + } + if (fieldValues.containsKey(DAY_OF_YEAR)) { + return resolveYD(fieldValues, resolverStyle); + } + if (fieldValues.containsKey(ALIGNED_WEEK_OF_YEAR)) { + if (fieldValues.containsKey(ALIGNED_DAY_OF_WEEK_IN_YEAR)) { + return resolveYAA(fieldValues, resolverStyle); + } + if (fieldValues.containsKey(DAY_OF_WEEK)) { + return resolveYAD(fieldValues, resolverStyle); + } + } + } + return null; + } + + void resolveProlepticMonth(Map fieldValues, ResolverStyle resolverStyle) { + Long pMonth = fieldValues.remove(PROLEPTIC_MONTH); + if (pMonth != null) { + if (resolverStyle != ResolverStyle.LENIENT) { + PROLEPTIC_MONTH.checkValidValue(pMonth); + } + // first day-of-month is likely to be safest for setting proleptic-month + // cannot add to year zero, as not all chronologies have a year zero + ChronoLocalDate chronoDate = dateNow() + .with(DAY_OF_MONTH, 1).with(PROLEPTIC_MONTH, pMonth); + addFieldValue(fieldValues, MONTH_OF_YEAR, chronoDate.get(MONTH_OF_YEAR)); + addFieldValue(fieldValues, YEAR, chronoDate.get(YEAR)); + } + } + + ChronoLocalDate resolveYearOfEra(Map fieldValues, ResolverStyle resolverStyle) { + Long yoeLong = fieldValues.remove(YEAR_OF_ERA); + if (yoeLong != null) { + Long eraLong = fieldValues.remove(ERA); + int yoe; + if (resolverStyle != ResolverStyle.LENIENT) { + yoe = range(YEAR_OF_ERA).checkValidIntValue(yoeLong, YEAR_OF_ERA); + } else { + yoe = Math.toIntExact(yoeLong); + } + if (eraLong != null) { + Era eraObj = eraOf(range(ERA).checkValidIntValue(eraLong, ERA)); + addFieldValue(fieldValues, YEAR, prolepticYear(eraObj, yoe)); + } else { + if (fieldValues.containsKey(YEAR)) { + int year = range(YEAR).checkValidIntValue(fieldValues.get(YEAR), YEAR); + ChronoLocalDate chronoDate = dateYearDay(year, 1); + addFieldValue(fieldValues, YEAR, prolepticYear(chronoDate.getEra(), yoe)); + } else if (resolverStyle == ResolverStyle.STRICT) { + // do not invent era if strict + // reinstate the field removed earlier, no cross-check issues + fieldValues.put(YEAR_OF_ERA, yoeLong); + } else { + List eras = eras(); + if (eras.isEmpty()) { + addFieldValue(fieldValues, YEAR, yoe); + } else { + Era eraObj = eras.get(eras.size() - 1); + addFieldValue(fieldValues, YEAR, prolepticYear(eraObj, yoe)); + } + } + } + } else if (fieldValues.containsKey(ERA)) { + range(ERA).checkValidValue(fieldValues.get(ERA), ERA); // always validated + } + return null; + } + + ChronoLocalDate resolveYMD(Map fieldValues, ResolverStyle resolverStyle) { + int y = range(YEAR).checkValidIntValue(fieldValues.remove(YEAR), YEAR); + if (resolverStyle == ResolverStyle.LENIENT) { + long months = Math.subtractExact(fieldValues.remove(MONTH_OF_YEAR), 1); + long days = Math.subtractExact(fieldValues.remove(DAY_OF_MONTH), 1); + return date(y, 1, 1).plus(months, MONTHS).plus(days, DAYS); + } + int moy = range(MONTH_OF_YEAR).checkValidIntValue(fieldValues.remove(MONTH_OF_YEAR), MONTH_OF_YEAR); + ValueRange domRange = range(DAY_OF_MONTH); + int dom = domRange.checkValidIntValue(fieldValues.remove(DAY_OF_MONTH), DAY_OF_MONTH); + if (resolverStyle == ResolverStyle.SMART) { // previous valid + try { + return date(y, moy, dom); + } catch (DateTimeException ex) { + return date(y, moy, 1).with(TemporalAdjuster.lastDayOfMonth()); + } + } + return date(y, moy, dom); + } + + ChronoLocalDate resolveYD(Map fieldValues, ResolverStyle resolverStyle) { + int y = range(YEAR).checkValidIntValue(fieldValues.remove(YEAR), YEAR); + if (resolverStyle == ResolverStyle.LENIENT) { + long days = Math.subtractExact(fieldValues.remove(DAY_OF_YEAR), 1); + return dateYearDay(y, 1).plus(days, DAYS); + } + int doy = range(DAY_OF_YEAR).checkValidIntValue(fieldValues.remove(DAY_OF_YEAR), DAY_OF_YEAR); + return dateYearDay(y, doy); // smart is same as strict + } + + ChronoLocalDate resolveYMAA(Map fieldValues, ResolverStyle resolverStyle) { + int y = range(YEAR).checkValidIntValue(fieldValues.remove(YEAR), YEAR); + if (resolverStyle == ResolverStyle.LENIENT) { + long months = Math.subtractExact(fieldValues.remove(MONTH_OF_YEAR), 1); + long weeks = Math.subtractExact(fieldValues.remove(ALIGNED_WEEK_OF_MONTH), 1); + long days = Math.subtractExact(fieldValues.remove(ALIGNED_DAY_OF_WEEK_IN_MONTH), 1); + return date(y, 1, 1).plus(months, MONTHS).plus(weeks, WEEKS).plus(days, DAYS); + } + int moy = range(MONTH_OF_YEAR).checkValidIntValue(fieldValues.remove(MONTH_OF_YEAR), MONTH_OF_YEAR); + int aw = range(ALIGNED_WEEK_OF_MONTH).checkValidIntValue(fieldValues.remove(ALIGNED_WEEK_OF_MONTH), ALIGNED_WEEK_OF_MONTH); + int ad = range(ALIGNED_DAY_OF_WEEK_IN_MONTH).checkValidIntValue(fieldValues.remove(ALIGNED_DAY_OF_WEEK_IN_MONTH), ALIGNED_DAY_OF_WEEK_IN_MONTH); + ChronoLocalDate date = date(y, moy, 1).plus((aw - 1) * 7 + (ad - 1), DAYS); + if (resolverStyle == ResolverStyle.STRICT && date.get(MONTH_OF_YEAR) != moy) { + throw new DateTimeException("Strict mode rejected resolved date as it is in a different month"); + } + return date; + } + + ChronoLocalDate resolveYMAD(Map fieldValues, ResolverStyle resolverStyle) { + int y = range(YEAR).checkValidIntValue(fieldValues.remove(YEAR), YEAR); + if (resolverStyle == ResolverStyle.LENIENT) { + long months = Math.subtractExact(fieldValues.remove(MONTH_OF_YEAR), 1); + long weeks = Math.subtractExact(fieldValues.remove(ALIGNED_WEEK_OF_MONTH), 1); + long dow = Math.subtractExact(fieldValues.remove(DAY_OF_WEEK), 1); + return resolveAligned(date(y, 1, 1), months, weeks, dow); + } + int moy = range(MONTH_OF_YEAR).checkValidIntValue(fieldValues.remove(MONTH_OF_YEAR), MONTH_OF_YEAR); + int aw = range(ALIGNED_WEEK_OF_MONTH).checkValidIntValue(fieldValues.remove(ALIGNED_WEEK_OF_MONTH), ALIGNED_WEEK_OF_MONTH); + int dow = range(DAY_OF_WEEK).checkValidIntValue(fieldValues.remove(DAY_OF_WEEK), DAY_OF_WEEK); + ChronoLocalDate date = date(y, moy, 1).plus((aw - 1) * 7, DAYS).with(nextOrSame(DayOfWeek.of(dow))); + if (resolverStyle == ResolverStyle.STRICT && date.get(MONTH_OF_YEAR) != moy) { + throw new DateTimeException("Strict mode rejected resolved date as it is in a different month"); + } + return date; + } + + ChronoLocalDate resolveYAA(Map fieldValues, ResolverStyle resolverStyle) { + int y = range(YEAR).checkValidIntValue(fieldValues.remove(YEAR), YEAR); + if (resolverStyle == ResolverStyle.LENIENT) { + long weeks = Math.subtractExact(fieldValues.remove(ALIGNED_WEEK_OF_YEAR), 1); + long days = Math.subtractExact(fieldValues.remove(ALIGNED_DAY_OF_WEEK_IN_YEAR), 1); + return dateYearDay(y, 1).plus(weeks, WEEKS).plus(days, DAYS); + } + int aw = range(ALIGNED_WEEK_OF_YEAR).checkValidIntValue(fieldValues.remove(ALIGNED_WEEK_OF_YEAR), ALIGNED_WEEK_OF_YEAR); + int ad = range(ALIGNED_DAY_OF_WEEK_IN_YEAR).checkValidIntValue(fieldValues.remove(ALIGNED_DAY_OF_WEEK_IN_YEAR), ALIGNED_DAY_OF_WEEK_IN_YEAR); + ChronoLocalDate date = dateYearDay(y, 1).plus((aw - 1) * 7 + (ad - 1), DAYS); + if (resolverStyle == ResolverStyle.STRICT && date.get(YEAR) != y) { + throw new DateTimeException("Strict mode rejected resolved date as it is in a different year"); + } + return date; + } + + ChronoLocalDate resolveYAD(Map fieldValues, ResolverStyle resolverStyle) { + int y = range(YEAR).checkValidIntValue(fieldValues.remove(YEAR), YEAR); + if (resolverStyle == ResolverStyle.LENIENT) { + long weeks = Math.subtractExact(fieldValues.remove(ALIGNED_WEEK_OF_YEAR), 1); + long dow = Math.subtractExact(fieldValues.remove(DAY_OF_WEEK), 1); + return resolveAligned(dateYearDay(y, 1), 0, weeks, dow); + } + int aw = range(ALIGNED_WEEK_OF_YEAR).checkValidIntValue(fieldValues.remove(ALIGNED_WEEK_OF_YEAR), ALIGNED_WEEK_OF_YEAR); + int dow = range(DAY_OF_WEEK).checkValidIntValue(fieldValues.remove(DAY_OF_WEEK), DAY_OF_WEEK); + ChronoLocalDate date = dateYearDay(y, 1).plus((aw - 1) * 7, DAYS).with(nextOrSame(DayOfWeek.of(dow))); + if (resolverStyle == ResolverStyle.STRICT && date.get(YEAR) != y) { + throw new DateTimeException("Strict mode rejected resolved date as it is in a different year"); + } + return date; + } + + ChronoLocalDate resolveAligned(ChronoLocalDate base, long months, long weeks, long dow) { + ChronoLocalDate date = base.plus(months, MONTHS).plus(weeks, WEEKS); + if (dow > 7) { + date = date.plus((dow - 1) / 7, WEEKS); + dow = ((dow - 1) % 7) + 1; + } else if (dow < 1) { + date = date.plus(Math.subtractExact(dow, 7) / 7, WEEKS); + dow = ((dow + 6) % 7) + 1; + } + return date.with(nextOrSame(DayOfWeek.of((int) dow))); + } + + /** + * Adds a field-value pair to the map, checking for conflicts. + *

+ * If the field is not already present, then the field-value pair is added to the map. + * If the field is already present and it has the same value as that specified, no action occurs. + * If the field is already present and it has a different value to that specified, then + * an exception is thrown. + * + * @param field the field to add, not null + * @param value the value to add, not null + * @throws java.time.DateTimeException if the field is already present with a different value + */ + void addFieldValue(Map fieldValues, ChronoField field, long value) { + Long old = fieldValues.get(field); // check first for better error message + if (old != null && old.longValue() != value) { + throw new DateTimeException("Conflict found: " + field + " " + old + " differs from " + field + " " + value); + } + fieldValues.put(field, value); + } + + //----------------------------------------------------------------------- + /** + * Compares this chronology to another chronology. + *

+ * The comparison order first by the chronology ID string, then by any + * additional information specific to the subclass. + * It is "consistent with equals", as defined by {@link Comparable}. + * + * @implSpec + * This implementation compares the chronology ID. + * Subclasses must compare any additional state that they store. + * + * @param other the other chronology to compare to, not null + * @return the comparator value, negative if less, positive if greater + */ + @Override + public int compareTo(Chronology other) { + return getId().compareTo(other.getId()); + } + + /** + * Checks if this chronology is equal to another chronology. + *

+ * The comparison is based on the entire state of the object. + * + * @implSpec + * This implementation checks the type and calls + * {@link #compareTo(java.time.chrono.Chronology)}. + * + * @param obj the object to check, null returns false + * @return true if this is equal to the other chronology + */ + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } + if (obj instanceof AbstractChronology) { + return compareTo((AbstractChronology) obj) == 0; + } + return false; + } + + /** + * A hash code for this chronology. + *

+ * The hash code should be based on the entire state of the object. + * + * @implSpec + * This implementation is based on the chronology ID and class. + * Subclasses should add any additional state that they store. + * + * @return a suitable hash code + */ + @Override + public int hashCode() { + return getClass().hashCode() ^ getId().hashCode(); + } + + //----------------------------------------------------------------------- + /** + * Outputs this chronology as a {@code String}, using the chronology ID. + * + * @return a string representation of this chronology, not null + */ + @Override + public String toString() { + return getId(); + } + + //----------------------------------------------------------------------- + /** + * Writes the Chronology using a + * dedicated serialized form. + *

+     *  out.writeByte(1);  // identifies this as a Chronology
+     *  out.writeUTF(getId());
+     * 
+ * + * @return the instance of {@code Ser}, not null + */ + Object writeReplace() { + return new Ser(Ser.CHRONO_TYPE, this); + } + + /** + * Defend against malicious streams. + * @return never + * @throws java.io.InvalidObjectException always + */ + private Object readResolve() throws ObjectStreamException { + throw new InvalidObjectException("Deserialization via serialization delegate"); + } + + void writeExternal(DataOutput out) throws IOException { + out.writeUTF(getId()); + } + + static Chronology readExternal(DataInput in) throws IOException { + String id = in.readUTF(); + return Chronology.of(id); + } + +} diff --git a/jdk/src/share/classes/java/time/chrono/ChronoLocalDate.java b/jdk/src/share/classes/java/time/chrono/ChronoLocalDate.java index 58e4f5d5250..da5f0e719ce 100644 --- a/jdk/src/share/classes/java/time/chrono/ChronoLocalDate.java +++ b/jdk/src/share/classes/java/time/chrono/ChronoLocalDate.java @@ -262,7 +262,7 @@ public interface ChronoLocalDate * @see #isEqual */ static Comparator timeLineOrder() { - return Chronology.DATE_ORDER; + return AbstractChronology.DATE_ORDER; } //----------------------------------------------------------------------- diff --git a/jdk/src/share/classes/java/time/chrono/ChronoLocalDateTime.java b/jdk/src/share/classes/java/time/chrono/ChronoLocalDateTime.java index 4c2ddfd31a7..353673c9dcd 100644 --- a/jdk/src/share/classes/java/time/chrono/ChronoLocalDateTime.java +++ b/jdk/src/share/classes/java/time/chrono/ChronoLocalDateTime.java @@ -136,7 +136,7 @@ public interface ChronoLocalDateTime * @see #isEqual */ static Comparator> timeLineOrder() { - return Chronology.DATE_TIME_ORDER; + return AbstractChronology.DATE_TIME_ORDER; } //----------------------------------------------------------------------- diff --git a/jdk/src/share/classes/java/time/chrono/ChronoZonedDateTime.java b/jdk/src/share/classes/java/time/chrono/ChronoZonedDateTime.java index 033ab997fdd..caec8558e6e 100644 --- a/jdk/src/share/classes/java/time/chrono/ChronoZonedDateTime.java +++ b/jdk/src/share/classes/java/time/chrono/ChronoZonedDateTime.java @@ -137,7 +137,7 @@ public interface ChronoZonedDateTime * @see #isEqual */ static Comparator> timeLineOrder() { - return Chronology.INSTANT_ORDER; + return AbstractChronology.INSTANT_ORDER; } //----------------------------------------------------------------------- diff --git a/jdk/src/share/classes/java/time/chrono/Chronology.java b/jdk/src/share/classes/java/time/chrono/Chronology.java index ed40f4138f0..22a7e69ae25 100644 --- a/jdk/src/share/classes/java/time/chrono/Chronology.java +++ b/jdk/src/share/classes/java/time/chrono/Chronology.java @@ -61,33 +61,8 @@ */ package java.time.chrono; -import static java.time.temporal.ChronoField.ALIGNED_DAY_OF_WEEK_IN_MONTH; -import static java.time.temporal.ChronoField.ALIGNED_DAY_OF_WEEK_IN_YEAR; -import static java.time.temporal.ChronoField.ALIGNED_WEEK_OF_MONTH; -import static java.time.temporal.ChronoField.ALIGNED_WEEK_OF_YEAR; -import static java.time.temporal.ChronoField.DAY_OF_MONTH; -import static java.time.temporal.ChronoField.DAY_OF_WEEK; -import static java.time.temporal.ChronoField.DAY_OF_YEAR; -import static java.time.temporal.ChronoField.EPOCH_DAY; -import static java.time.temporal.ChronoField.ERA; -import static java.time.temporal.ChronoField.MONTH_OF_YEAR; -import static java.time.temporal.ChronoField.PROLEPTIC_MONTH; -import static java.time.temporal.ChronoField.YEAR; -import static java.time.temporal.ChronoField.YEAR_OF_ERA; -import static java.time.temporal.ChronoUnit.DAYS; -import static java.time.temporal.ChronoUnit.MONTHS; -import static java.time.temporal.ChronoUnit.WEEKS; -import static java.time.temporal.TemporalAdjuster.nextOrSame; - -import java.io.DataInput; -import java.io.DataOutput; -import java.io.IOException; -import java.io.InvalidObjectException; -import java.io.ObjectStreamException; -import java.io.Serializable; import java.time.Clock; import java.time.DateTimeException; -import java.time.DayOfWeek; import java.time.Instant; import java.time.LocalDate; import java.time.LocalTime; @@ -97,28 +72,21 @@ import java.time.format.ResolverStyle; import java.time.format.TextStyle; import java.time.temporal.ChronoField; import java.time.temporal.TemporalAccessor; -import java.time.temporal.TemporalAdjuster; import java.time.temporal.TemporalField; import java.time.temporal.TemporalQuery; import java.time.temporal.UnsupportedTemporalTypeException; import java.time.temporal.ValueRange; -import java.util.Comparator; -import java.util.HashSet; import java.util.List; import java.util.Locale; import java.util.Map; import java.util.Objects; -import java.util.ServiceLoader; import java.util.Set; -import java.util.concurrent.ConcurrentHashMap; - -import sun.util.logging.PlatformLogger; /** * A calendar system, used to organize and identify dates. *

* The main date and time API is built on the ISO calendar system. - * This class operates behind the scenes to represent the general concept of a calendar system. + * The chronology operates behind the scenes to represent the general concept of a calendar system. * For example, the Japanese, Minguo, Thai Buddhist and others. *

* Most other calendar systems also operate on the shared concepts of year, month and day, @@ -179,130 +147,14 @@ import sun.util.logging.PlatformLogger; * CLDR type and, if applicable, the CLDR variant, * * @implSpec - * This class must be implemented with care to ensure other classes operate correctly. + * This interface must be implemented with care to ensure other classes operate correctly. * All implementations that can be instantiated must be final, immutable and thread-safe. * Subclasses should be Serializable wherever possible. * * @since 1.8 */ -public abstract class Chronology implements Comparable { +public interface Chronology extends Comparable { - /** - * ChronoLocalDate order constant. - */ - static final Comparator DATE_ORDER = - (Comparator & Serializable) (date1, date2) -> { - return Long.compare(date1.toEpochDay(), date2.toEpochDay()); - }; - /** - * ChronoLocalDateTime order constant. - */ - static final Comparator> DATE_TIME_ORDER = - (Comparator> & Serializable) (dateTime1, dateTime2) -> { - int cmp = Long.compare(dateTime1.toLocalDate().toEpochDay(), dateTime2.toLocalDate().toEpochDay()); - if (cmp == 0) { - cmp = Long.compare(dateTime1.toLocalTime().toNanoOfDay(), dateTime2.toLocalTime().toNanoOfDay()); - } - return cmp; - }; - /** - * ChronoZonedDateTime order constant. - */ - static final Comparator> INSTANT_ORDER = - (Comparator> & Serializable) (dateTime1, dateTime2) -> { - int cmp = Long.compare(dateTime1.toEpochSecond(), dateTime2.toEpochSecond()); - if (cmp == 0) { - cmp = Long.compare(dateTime1.toLocalTime().getNano(), dateTime2.toLocalTime().getNano()); - } - return cmp; - }; - - /** - * Map of available calendars by ID. - */ - private static final ConcurrentHashMap CHRONOS_BY_ID = new ConcurrentHashMap<>(); - /** - * Map of available calendars by calendar type. - */ - private static final ConcurrentHashMap CHRONOS_BY_TYPE = new ConcurrentHashMap<>(); - - /** - * Register a Chronology by its ID and type for lookup by {@link #of(java.lang.String)}. - * Chronologies must not be registered until they are completely constructed. - * Specifically, not in the constructor of Chronology. - * - * @param chrono the chronology to register; not null - * @return the already registered Chronology if any, may be null - */ - static Chronology registerChrono(Chronology chrono) { - return registerChrono(chrono, chrono.getId()); - } - - /** - * Register a Chronology by ID and type for lookup by {@link #of(java.lang.String)}. - * Chronos must not be registered until they are completely constructed. - * Specifically, not in the constructor of Chronology. - * - * @param chrono the chronology to register; not null - * @param id the ID to register the chronology; not null - * @return the already registered Chronology if any, may be null - */ - static Chronology registerChrono(Chronology chrono, String id) { - Chronology prev = CHRONOS_BY_ID.putIfAbsent(id, chrono); - if (prev == null) { - String type = chrono.getCalendarType(); - if (type != null) { - CHRONOS_BY_TYPE.putIfAbsent(type, chrono); - } - } - return prev; - } - - /** - * Initialization of the maps from id and type to Chronology. - * The ServiceLoader is used to find and register any implementations - * of {@link java.time.chrono.Chronology} found in the bootclass loader. - * The built-in chronologies are registered explicitly. - * Calendars configured via the Thread's context classloader are local - * to that thread and are ignored. - *

- * The initialization is done only once using the registration - * of the IsoChronology as the test and the final step. - * Multiple threads may perform the initialization concurrently. - * Only the first registration of each Chronology is retained by the - * ConcurrentHashMap. - * @return true if the cache was initialized - */ - private static boolean initCache() { - if (CHRONOS_BY_ID.get("ISO") == null) { - // Initialization is incomplete - - // Register built-in Chronologies - registerChrono(HijrahChronology.INSTANCE); - registerChrono(JapaneseChronology.INSTANCE); - registerChrono(MinguoChronology.INSTANCE); - registerChrono(ThaiBuddhistChronology.INSTANCE); - - // Register Chronologies from the ServiceLoader - @SuppressWarnings("rawtypes") - ServiceLoader loader = ServiceLoader.load(Chronology.class, null); - for (Chronology chrono : loader) { - String id = chrono.getId(); - if (id.equals("ISO") || registerChrono(chrono) != null) { - // Log the attempt to replace an existing Chronology - PlatformLogger logger = PlatformLogger.getLogger("java.time.chrono"); - logger.warning("Ignoring duplicate Chronology, from ServiceLoader configuration " + id); - } - } - - // finally, register IsoChronology to mark initialization is complete - registerChrono(IsoChronology.INSTANCE); - return true; - } - return false; - } - - //----------------------------------------------------------------------- /** * Obtains an instance of {@code Chronology} from a temporal object. *

@@ -320,7 +172,7 @@ public abstract class Chronology implements Comparable { * @return the chronology, not null * @throws DateTimeException if unable to convert to an {@code Chronology} */ - public static Chronology from(TemporalAccessor temporal) { + static Chronology from(TemporalAccessor temporal) { Objects.requireNonNull(temporal, "temporal"); Chronology obj = temporal.query(TemporalQuery.chronology()); return (obj != null ? obj : IsoChronology.INSTANCE); @@ -367,31 +219,8 @@ public abstract class Chronology implements Comparable { * @return the calendar system associated with the locale, not null * @throws DateTimeException if the locale-specified calendar cannot be found */ - public static Chronology ofLocale(Locale locale) { - Objects.requireNonNull(locale, "locale"); - String type = locale.getUnicodeLocaleType("ca"); - if (type == null || "iso".equals(type) || "iso8601".equals(type)) { - return IsoChronology.INSTANCE; - } - // Not pre-defined; lookup by the type - do { - Chronology chrono = CHRONOS_BY_TYPE.get(type); - if (chrono != null) { - return chrono; - } - // If not found, do the initialization (once) and repeat the lookup - } while (initCache()); - - // Look for a Chronology using ServiceLoader of the Thread's ContextClassLoader - // Application provided Chronologies must not be cached - @SuppressWarnings("rawtypes") - ServiceLoader loader = ServiceLoader.load(Chronology.class); - for (Chronology chrono : loader) { - if (type.equals(chrono.getCalendarType())) { - return chrono; - } - } - throw new DateTimeException("Unknown calendar system: " + type); + static Chronology ofLocale(Locale locale) { + return AbstractChronology.ofLocale(locale); } //----------------------------------------------------------------------- @@ -415,41 +244,8 @@ public abstract class Chronology implements Comparable { * @return the chronology with the identifier requested, not null * @throws DateTimeException if the chronology cannot be found */ - public static Chronology of(String id) { - Objects.requireNonNull(id, "id"); - do { - Chronology chrono = of0(id); - if (chrono != null) { - return chrono; - } - // If not found, do the initialization (once) and repeat the lookup - } while (initCache()); - - // Look for a Chronology using ServiceLoader of the Thread's ContextClassLoader - // Application provided Chronologies must not be cached - @SuppressWarnings("rawtypes") - ServiceLoader loader = ServiceLoader.load(Chronology.class); - for (Chronology chrono : loader) { - if (id.equals(chrono.getId()) || id.equals(chrono.getCalendarType())) { - return chrono; - } - } - throw new DateTimeException("Unknown chronology: " + id); - } - - /** - * Obtains an instance of {@code Chronology} from a chronology ID or - * calendar system type. - * - * @param id the chronology ID or calendar system type, not null - * @return the chronology with the identifier requested, or {@code null} if not found - */ - private static Chronology of0(String id) { - Chronology chrono = CHRONOS_BY_ID.get(id); - if (chrono == null) { - chrono = CHRONOS_BY_TYPE.get(id); - } - return chrono; + static Chronology of(String id) { + return AbstractChronology.of(id); } /** @@ -462,24 +258,8 @@ public abstract class Chronology implements Comparable { * * @return the independent, modifiable set of the available chronology IDs, not null */ - public static Set getAvailableChronologies() { - initCache(); // force initialization - HashSet chronos = new HashSet<>(CHRONOS_BY_ID.values()); - - /// Add in Chronologies from the ServiceLoader configuration - @SuppressWarnings("rawtypes") - ServiceLoader loader = ServiceLoader.load(Chronology.class); - for (Chronology chrono : loader) { - chronos.add(chrono); - } - return chronos; - } - - //----------------------------------------------------------------------- - /** - * Creates an instance. - */ - protected Chronology() { + static Set getAvailableChronologies() { + return AbstractChronology.getAvailableChronologies(); } //----------------------------------------------------------------------- @@ -492,7 +272,7 @@ public abstract class Chronology implements Comparable { * @return the chronology ID, not null * @see #getCalendarType() */ - public abstract String getId(); + String getId(); /** * Gets the calendar type of the calendar system. @@ -507,13 +287,17 @@ public abstract class Chronology implements Comparable { * @return the calendar system type, null if the calendar is not defined by CLDR/LDML * @see #getId() */ - public abstract String getCalendarType(); + String getCalendarType(); //----------------------------------------------------------------------- /** * Obtains a local date in this chronology from the era, year-of-era, * month-of-year and day-of-month fields. * + * @implSpec + * The default implementation combines the era and year-of-era into a proleptic + * year before calling {@link #date(int, int, int)}. + * * @param era the era of the correct type for the chronology, not null * @param yearOfEra the chronology year-of-era * @param month the chronology month-of-year @@ -522,7 +306,7 @@ public abstract class Chronology implements Comparable { * @throws DateTimeException if unable to create the date * @throws ClassCastException if the {@code era} is not of the correct type for the chronology */ - public ChronoLocalDate date(Era era, int yearOfEra, int month, int dayOfMonth) { + default ChronoLocalDate date(Era era, int yearOfEra, int month, int dayOfMonth) { return date(prolepticYear(era, yearOfEra), month, dayOfMonth); } @@ -536,12 +320,16 @@ public abstract class Chronology implements Comparable { * @return the local date in this chronology, not null * @throws DateTimeException if unable to create the date */ - public abstract ChronoLocalDate date(int prolepticYear, int month, int dayOfMonth); + ChronoLocalDate date(int prolepticYear, int month, int dayOfMonth); /** * Obtains a local date in this chronology from the era, year-of-era and * day-of-year fields. * + * @implSpec + * The default implementation combines the era and year-of-era into a proleptic + * year before calling {@link #dateYearDay(int, int)}. + * * @param era the era of the correct type for the chronology, not null * @param yearOfEra the chronology year-of-era * @param dayOfYear the chronology day-of-year @@ -549,7 +337,7 @@ public abstract class Chronology implements Comparable { * @throws DateTimeException if unable to create the date * @throws ClassCastException if the {@code era} is not of the correct type for the chronology */ - public ChronoLocalDate dateYearDay(Era era, int yearOfEra, int dayOfYear) { + default ChronoLocalDate dateYearDay(Era era, int yearOfEra, int dayOfYear) { return dateYearDay(prolepticYear(era, yearOfEra), dayOfYear); } @@ -562,7 +350,7 @@ public abstract class Chronology implements Comparable { * @return the local date in this chronology, not null * @throws DateTimeException if unable to create the date */ - public abstract ChronoLocalDate dateYearDay(int prolepticYear, int dayOfYear); + ChronoLocalDate dateYearDay(int prolepticYear, int dayOfYear); /** * Obtains a local date in this chronology from the epoch-day. @@ -574,7 +362,7 @@ public abstract class Chronology implements Comparable { * @return the local date in this chronology, not null * @throws DateTimeException if unable to create the date */ - public abstract ChronoLocalDate dateEpochDay(long epochDay); + ChronoLocalDate dateEpochDay(long epochDay); //----------------------------------------------------------------------- /** @@ -585,13 +373,14 @@ public abstract class Chronology implements Comparable { *

* Using this method will prevent the ability to use an alternate clock for testing * because the clock is hard-coded. - *

- * This implementation uses {@link #dateNow(Clock)}. + * + * @implSpec + * The default implementation invokes {@link #dateNow(Clock)}. * * @return the current local date using the system clock and default time-zone, not null * @throws DateTimeException if unable to create the date */ - public ChronoLocalDate dateNow() { + default ChronoLocalDate dateNow() { return dateNow(Clock.systemDefaultZone()); } @@ -604,11 +393,14 @@ public abstract class Chronology implements Comparable { * Using this method will prevent the ability to use an alternate clock for testing * because the clock is hard-coded. * + * @implSpec + * The default implementation invokes {@link #dateNow(Clock)}. + * * @param zone the zone ID to use, not null * @return the current local date using the system clock, not null * @throws DateTimeException if unable to create the date */ - public ChronoLocalDate dateNow(ZoneId zone) { + default ChronoLocalDate dateNow(ZoneId zone) { return dateNow(Clock.system(zone)); } @@ -619,11 +411,14 @@ public abstract class Chronology implements Comparable { * Using this method allows the use of an alternate clock for testing. * The alternate clock may be introduced using {@link Clock dependency injection}. * + * @implSpec + * The default implementation invokes {@link #date(TemporalAccessor)} )}. + * * @param clock the clock to use, not null * @return the current local date, not null * @throws DateTimeException if unable to create the date */ - public ChronoLocalDate dateNow(Clock clock) { + default ChronoLocalDate dateNow(Clock clock) { Objects.requireNonNull(clock, "clock"); return date(LocalDate.now(clock)); } @@ -647,7 +442,7 @@ public abstract class Chronology implements Comparable { * @throws DateTimeException if unable to create the date * @see ChronoLocalDate#from(TemporalAccessor) */ - public abstract ChronoLocalDate date(TemporalAccessor temporal); + ChronoLocalDate date(TemporalAccessor temporal); /** * Obtains a local date-time in this chronology from another temporal object. @@ -670,7 +465,7 @@ public abstract class Chronology implements Comparable { * @throws DateTimeException if unable to create the date-time * @see ChronoLocalDateTime#from(TemporalAccessor) */ - public ChronoLocalDateTime localDateTime(TemporalAccessor temporal) { + default ChronoLocalDateTime localDateTime(TemporalAccessor temporal) { try { return date(temporal).atTime(LocalTime.from(temporal)); } catch (DateTimeException ex) { @@ -702,7 +497,7 @@ public abstract class Chronology implements Comparable { * @throws DateTimeException if unable to create the date-time * @see ChronoZonedDateTime#from(TemporalAccessor) */ - public ChronoZonedDateTime zonedDateTime(TemporalAccessor temporal) { + default ChronoZonedDateTime zonedDateTime(TemporalAccessor temporal) { try { ZoneId zone = ZoneId.from(temporal); try { @@ -728,7 +523,7 @@ public abstract class Chronology implements Comparable { * @return the zoned date-time, not null * @throws DateTimeException if the result exceeds the supported range */ - public ChronoZonedDateTime zonedDateTime(Instant instant, ZoneId zone) { + default ChronoZonedDateTime zonedDateTime(Instant instant, ZoneId zone) { return ChronoZonedDateTimeImpl.ofInstant(this, instant, zone); } @@ -746,7 +541,7 @@ public abstract class Chronology implements Comparable { * @param prolepticYear the proleptic-year to check, not validated for range * @return true if the year is a leap year */ - public abstract boolean isLeapYear(long prolepticYear); + boolean isLeapYear(long prolepticYear); /** * Calculates the proleptic-year given the era and year-of-era. @@ -764,7 +559,7 @@ public abstract class Chronology implements Comparable { * such as if the year is invalid for the era * @throws ClassCastException if the {@code era} is not of the correct type for the chronology */ - public abstract int prolepticYear(Era era, int yearOfEra); + int prolepticYear(Era era, int yearOfEra); /** * Creates the chronology era object from the numeric value. @@ -785,7 +580,7 @@ public abstract class Chronology implements Comparable { * @return the calendar system era, not null * @throws DateTimeException if unable to create the era */ - public abstract Era eraOf(int eraValue); + Era eraOf(int eraValue); /** * Gets the list of eras for the chronology. @@ -796,7 +591,7 @@ public abstract class Chronology implements Comparable { * * @return the list of eras for the chronology, may be immutable, not null */ - public abstract List eras(); + List eras(); //----------------------------------------------------------------------- /** @@ -815,7 +610,7 @@ public abstract class Chronology implements Comparable { * @return the range of valid values for the field, not null * @throws DateTimeException if the range for the field cannot be obtained */ - public abstract ValueRange range(ChronoField field); + ValueRange range(ChronoField field); //----------------------------------------------------------------------- /** @@ -825,28 +620,16 @@ public abstract class Chronology implements Comparable { * suitable for presentation to the user. * The parameters control the style of the returned text and the locale. * + * @implSpec + * The default implementation behaves as the the formatter was used to + * format the chronology textual name. + * * @param style the style of the text required, not null * @param locale the locale to use, not null * @return the text value of the chronology, not null */ - public String getDisplayName(TextStyle style, Locale locale) { - return new DateTimeFormatterBuilder().appendChronologyText(style).toFormatter(locale).format(toTemporal()); - } - - /** - * Converts this chronology to a {@code TemporalAccessor}. - *

- * A {@code Chronology} can be fully represented as a {@code TemporalAccessor}. - * However, the interface is not implemented by this class as most of the - * methods on the interface have no meaning to {@code Chronology}. - *

- * The returned temporal has no supported fields, with the query method - * supporting the return of the chronology using {@link TemporalQuery#chronology()}. - * - * @return a temporal equivalent to this chronology, not null - */ - private TemporalAccessor toTemporal() { - return new TemporalAccessor() { + default String getDisplayName(TextStyle style, Locale locale) { + TemporalAccessor temporal = new TemporalAccessor() { @Override public boolean isSupported(TemporalField field) { return false; @@ -864,6 +647,7 @@ public abstract class Chronology implements Comparable { return TemporalAccessor.super.query(query); } }; + return new DateTimeFormatterBuilder().appendChronologyText(style).toFormatter(locale).format(temporal); } //----------------------------------------------------------------------- @@ -876,82 +660,8 @@ public abstract class Chronology implements Comparable { * As such, {@code ChronoField} date fields are resolved here in the * context of a specific chronology. *

- * {@code ChronoField} instances are resolved by this method, which may - * be overridden in subclasses. - *

    - *
  • {@code EPOCH_DAY} - If present, this is converted to a date and - * all other date fields are then cross-checked against the date. - *
  • {@code PROLEPTIC_MONTH} - If present, then it is split into the - * {@code YEAR} and {@code MONTH_OF_YEAR}. If the mode is strict or smart - * then the field is validated. - *
  • {@code YEAR_OF_ERA} and {@code ERA} - If both are present, then they - * are combined to form a {@code YEAR}. In lenient mode, the {@code YEAR_OF_ERA} - * range is not validated, in smart and strict mode it is. The {@code ERA} is - * validated for range in all three modes. If only the {@code YEAR_OF_ERA} is - * present, and the mode is smart or lenient, then the last available era - * is assumed. In strict mode, no era is assumed and the {@code YEAR_OF_ERA} is - * left untouched. If only the {@code ERA} is present, then it is left untouched. - *
  • {@code YEAR}, {@code MONTH_OF_YEAR} and {@code DAY_OF_MONTH} - - * If all three are present, then they are combined to form a date. - * In all three modes, the {@code YEAR} is validated. - * If the mode is smart or strict, then the month and day are validated. - * If the mode is lenient, then the date is combined in a manner equivalent to - * creating a date on the first day of the first month in the requested year, - * then adding the difference in months, then the difference in days. - * If the mode is smart, and the day-of-month is greater than the maximum for - * the year-month, then the day-of-month is adjusted to the last day-of-month. - * If the mode is strict, then the three fields must form a valid date. - *
  • {@code YEAR} and {@code DAY_OF_YEAR} - - * If both are present, then they are combined to form a date. - * In all three modes, the {@code YEAR} is validated. - * If the mode is lenient, then the date is combined in a manner equivalent to - * creating a date on the first day of the requested year, then adding - * the difference in days. - * If the mode is smart or strict, then the two fields must form a valid date. - *
  • {@code YEAR}, {@code MONTH_OF_YEAR}, {@code ALIGNED_WEEK_OF_MONTH} and - * {@code ALIGNED_DAY_OF_WEEK_IN_MONTH} - - * If all four are present, then they are combined to form a date. - * In all three modes, the {@code YEAR} is validated. - * If the mode is lenient, then the date is combined in a manner equivalent to - * creating a date on the first day of the first month in the requested year, then adding - * the difference in months, then the difference in weeks, then in days. - * If the mode is smart or strict, then the all four fields are validated to - * their outer ranges. The date is then combined in a manner equivalent to - * creating a date on the first day of the requested year and month, then adding - * the amount in weeks and days to reach their values. If the mode is strict, - * the date is additionally validated to check that the day and week adjustment - * did not change the month. - *
  • {@code YEAR}, {@code MONTH_OF_YEAR}, {@code ALIGNED_WEEK_OF_MONTH} and - * {@code DAY_OF_WEEK} - If all four are present, then they are combined to - * form a date. The approach is the same as described above for - * years, months and weeks in {@code ALIGNED_DAY_OF_WEEK_IN_MONTH}. - * The day-of-week is adjusted as the next or same matching day-of-week once - * the years, months and weeks have been handled. - *
  • {@code YEAR}, {@code ALIGNED_WEEK_OF_YEAR} and {@code ALIGNED_DAY_OF_WEEK_IN_YEAR} - - * If all three are present, then they are combined to form a date. - * In all three modes, the {@code YEAR} is validated. - * If the mode is lenient, then the date is combined in a manner equivalent to - * creating a date on the first day of the requested year, then adding - * the difference in weeks, then in days. - * If the mode is smart or strict, then the all three fields are validated to - * their outer ranges. The date is then combined in a manner equivalent to - * creating a date on the first day of the requested year, then adding - * the amount in weeks and days to reach their values. If the mode is strict, - * the date is additionally validated to check that the day and week adjustment - * did not change the year. - *
  • {@code YEAR}, {@code ALIGNED_WEEK_OF_YEAR} and {@code DAY_OF_WEEK} - - * If all three are present, then they are combined to form a date. - * The approach is the same as described above for years and weeks in - * {@code ALIGNED_DAY_OF_WEEK_IN_YEAR}. The day-of-week is adjusted as the - * next or same matching day-of-week once the years and weeks have been handled. - *
- *

- * The default implementation is suitable for most calendar systems. - * If {@link ChronoField#YEAR_OF_ERA} is found without an {@link ChronoField#ERA} - * then the last era in {@link #eras()} is used. - * The implementation assumes a 7 day week, that the first day-of-month - * has the value 1, that first day-of-year has the value 1, and that the - * first of the month and year always exists. + * The default implementation, which explains typical resolve behaviour, + * is provided in {@link AbstractChronology}. * * @param fieldValues the map of fields to values, which can be updated, not null * @param resolverStyle the requested type of resolve, not null @@ -959,233 +669,7 @@ public abstract class Chronology implements Comparable { * @throws DateTimeException if the date cannot be resolved, typically * because of a conflict in the input data */ - public ChronoLocalDate resolveDate(Map fieldValues, ResolverStyle resolverStyle) { - // check epoch-day before inventing era - if (fieldValues.containsKey(EPOCH_DAY)) { - return dateEpochDay(fieldValues.remove(EPOCH_DAY)); - } - - // fix proleptic month before inventing era - resolveProlepticMonth(fieldValues, resolverStyle); - - // invent era if necessary to resolve year-of-era - ChronoLocalDate resolved = resolveYearOfEra(fieldValues, resolverStyle); - if (resolved != null) { - return resolved; - } - - // build date - if (fieldValues.containsKey(YEAR)) { - if (fieldValues.containsKey(MONTH_OF_YEAR)) { - if (fieldValues.containsKey(DAY_OF_MONTH)) { - return resolveYMD(fieldValues, resolverStyle); - } - if (fieldValues.containsKey(ALIGNED_WEEK_OF_MONTH)) { - if (fieldValues.containsKey(ALIGNED_DAY_OF_WEEK_IN_MONTH)) { - return resolveYMAA(fieldValues, resolverStyle); - } - if (fieldValues.containsKey(DAY_OF_WEEK)) { - return resolveYMAD(fieldValues, resolverStyle); - } - } - } - if (fieldValues.containsKey(DAY_OF_YEAR)) { - return resolveYD(fieldValues, resolverStyle); - } - if (fieldValues.containsKey(ALIGNED_WEEK_OF_YEAR)) { - if (fieldValues.containsKey(ALIGNED_DAY_OF_WEEK_IN_YEAR)) { - return resolveYAA(fieldValues, resolverStyle); - } - if (fieldValues.containsKey(DAY_OF_WEEK)) { - return resolveYAD(fieldValues, resolverStyle); - } - } - } - return null; - } - - void resolveProlepticMonth(Map fieldValues, ResolverStyle resolverStyle) { - Long pMonth = fieldValues.remove(PROLEPTIC_MONTH); - if (pMonth != null) { - if (resolverStyle != ResolverStyle.LENIENT) { - PROLEPTIC_MONTH.checkValidValue(pMonth); - } - // first day-of-month is likely to be safest for setting proleptic-month - // cannot add to year zero, as not all chronologies have a year zero - ChronoLocalDate chronoDate = dateNow() - .with(DAY_OF_MONTH, 1).with(PROLEPTIC_MONTH, pMonth); - addFieldValue(fieldValues, MONTH_OF_YEAR, chronoDate.get(MONTH_OF_YEAR)); - addFieldValue(fieldValues, YEAR, chronoDate.get(YEAR)); - } - } - - ChronoLocalDate resolveYearOfEra(Map fieldValues, ResolverStyle resolverStyle) { - Long yoeLong = fieldValues.remove(YEAR_OF_ERA); - if (yoeLong != null) { - Long eraLong = fieldValues.remove(ERA); - int yoe; - if (resolverStyle != ResolverStyle.LENIENT) { - yoe = range(YEAR_OF_ERA).checkValidIntValue(yoeLong, YEAR_OF_ERA); - } else { - yoe = Math.toIntExact(yoeLong); - } - if (eraLong != null) { - Era eraObj = eraOf(range(ERA).checkValidIntValue(eraLong, ERA)); - addFieldValue(fieldValues, YEAR, prolepticYear(eraObj, yoe)); - } else { - if (fieldValues.containsKey(YEAR)) { - int year = range(YEAR).checkValidIntValue(fieldValues.get(YEAR), YEAR); - ChronoLocalDate chronoDate = dateYearDay(year, 1); - addFieldValue(fieldValues, YEAR, prolepticYear(chronoDate.getEra(), yoe)); - } else if (resolverStyle == ResolverStyle.STRICT) { - // do not invent era if strict - // reinstate the field removed earlier, no cross-check issues - fieldValues.put(YEAR_OF_ERA, yoeLong); - } else { - List eras = eras(); - if (eras.isEmpty()) { - addFieldValue(fieldValues, YEAR, yoe); - } else { - Era eraObj = eras.get(eras.size() - 1); - addFieldValue(fieldValues, YEAR, prolepticYear(eraObj, yoe)); - } - } - } - } else if (fieldValues.containsKey(ERA)) { - range(ERA).checkValidValue(fieldValues.get(ERA), ERA); // always validated - } - return null; - } - - ChronoLocalDate resolveYMD(Map fieldValues, ResolverStyle resolverStyle) { - int y = range(YEAR).checkValidIntValue(fieldValues.remove(YEAR), YEAR); - if (resolverStyle == ResolverStyle.LENIENT) { - long months = Math.subtractExact(fieldValues.remove(MONTH_OF_YEAR), 1); - long days = Math.subtractExact(fieldValues.remove(DAY_OF_MONTH), 1); - return date(y, 1, 1).plus(months, MONTHS).plus(days, DAYS); - } - int moy = range(MONTH_OF_YEAR).checkValidIntValue(fieldValues.remove(MONTH_OF_YEAR), MONTH_OF_YEAR); - ValueRange domRange = range(DAY_OF_MONTH); - int dom = domRange.checkValidIntValue(fieldValues.remove(DAY_OF_MONTH), DAY_OF_MONTH); - if (resolverStyle == ResolverStyle.SMART) { // previous valid - try { - return date(y, moy, dom); - } catch (DateTimeException ex) { - return date(y, moy, 1).with(TemporalAdjuster.lastDayOfMonth()); - } - } - return date(y, moy, dom); - } - - ChronoLocalDate resolveYD(Map fieldValues, ResolverStyle resolverStyle) { - int y = range(YEAR).checkValidIntValue(fieldValues.remove(YEAR), YEAR); - if (resolverStyle == ResolverStyle.LENIENT) { - long days = Math.subtractExact(fieldValues.remove(DAY_OF_YEAR), 1); - return dateYearDay(y, 1).plus(days, DAYS); - } - int doy = range(DAY_OF_YEAR).checkValidIntValue(fieldValues.remove(DAY_OF_YEAR), DAY_OF_YEAR); - return dateYearDay(y, doy); // smart is same as strict - } - - ChronoLocalDate resolveYMAA(Map fieldValues, ResolverStyle resolverStyle) { - int y = range(YEAR).checkValidIntValue(fieldValues.remove(YEAR), YEAR); - if (resolverStyle == ResolverStyle.LENIENT) { - long months = Math.subtractExact(fieldValues.remove(MONTH_OF_YEAR), 1); - long weeks = Math.subtractExact(fieldValues.remove(ALIGNED_WEEK_OF_MONTH), 1); - long days = Math.subtractExact(fieldValues.remove(ALIGNED_DAY_OF_WEEK_IN_MONTH), 1); - return date(y, 1, 1).plus(months, MONTHS).plus(weeks, WEEKS).plus(days, DAYS); - } - int moy = range(MONTH_OF_YEAR).checkValidIntValue(fieldValues.remove(MONTH_OF_YEAR), MONTH_OF_YEAR); - int aw = range(ALIGNED_WEEK_OF_MONTH).checkValidIntValue(fieldValues.remove(ALIGNED_WEEK_OF_MONTH), ALIGNED_WEEK_OF_MONTH); - int ad = range(ALIGNED_DAY_OF_WEEK_IN_MONTH).checkValidIntValue(fieldValues.remove(ALIGNED_DAY_OF_WEEK_IN_MONTH), ALIGNED_DAY_OF_WEEK_IN_MONTH); - ChronoLocalDate date = date(y, moy, 1).plus((aw - 1) * 7 + (ad - 1), DAYS); - if (resolverStyle == ResolverStyle.STRICT && date.get(MONTH_OF_YEAR) != moy) { - throw new DateTimeException("Strict mode rejected resolved date as it is in a different month"); - } - return date; - } - - ChronoLocalDate resolveYMAD(Map fieldValues, ResolverStyle resolverStyle) { - int y = range(YEAR).checkValidIntValue(fieldValues.remove(YEAR), YEAR); - if (resolverStyle == ResolverStyle.LENIENT) { - long months = Math.subtractExact(fieldValues.remove(MONTH_OF_YEAR), 1); - long weeks = Math.subtractExact(fieldValues.remove(ALIGNED_WEEK_OF_MONTH), 1); - long dow = Math.subtractExact(fieldValues.remove(DAY_OF_WEEK), 1); - return resolveAligned(date(y, 1, 1), months, weeks, dow); - } - int moy = range(MONTH_OF_YEAR).checkValidIntValue(fieldValues.remove(MONTH_OF_YEAR), MONTH_OF_YEAR); - int aw = range(ALIGNED_WEEK_OF_MONTH).checkValidIntValue(fieldValues.remove(ALIGNED_WEEK_OF_MONTH), ALIGNED_WEEK_OF_MONTH); - int dow = range(DAY_OF_WEEK).checkValidIntValue(fieldValues.remove(DAY_OF_WEEK), DAY_OF_WEEK); - ChronoLocalDate date = date(y, moy, 1).plus((aw - 1) * 7, DAYS).with(nextOrSame(DayOfWeek.of(dow))); - if (resolverStyle == ResolverStyle.STRICT && date.get(MONTH_OF_YEAR) != moy) { - throw new DateTimeException("Strict mode rejected resolved date as it is in a different month"); - } - return date; - } - - ChronoLocalDate resolveYAA(Map fieldValues, ResolverStyle resolverStyle) { - int y = range(YEAR).checkValidIntValue(fieldValues.remove(YEAR), YEAR); - if (resolverStyle == ResolverStyle.LENIENT) { - long weeks = Math.subtractExact(fieldValues.remove(ALIGNED_WEEK_OF_YEAR), 1); - long days = Math.subtractExact(fieldValues.remove(ALIGNED_DAY_OF_WEEK_IN_YEAR), 1); - return dateYearDay(y, 1).plus(weeks, WEEKS).plus(days, DAYS); - } - int aw = range(ALIGNED_WEEK_OF_YEAR).checkValidIntValue(fieldValues.remove(ALIGNED_WEEK_OF_YEAR), ALIGNED_WEEK_OF_YEAR); - int ad = range(ALIGNED_DAY_OF_WEEK_IN_YEAR).checkValidIntValue(fieldValues.remove(ALIGNED_DAY_OF_WEEK_IN_YEAR), ALIGNED_DAY_OF_WEEK_IN_YEAR); - ChronoLocalDate date = dateYearDay(y, 1).plus((aw - 1) * 7 + (ad - 1), DAYS); - if (resolverStyle == ResolverStyle.STRICT && date.get(YEAR) != y) { - throw new DateTimeException("Strict mode rejected resolved date as it is in a different year"); - } - return date; - } - - ChronoLocalDate resolveYAD(Map fieldValues, ResolverStyle resolverStyle) { - int y = range(YEAR).checkValidIntValue(fieldValues.remove(YEAR), YEAR); - if (resolverStyle == ResolverStyle.LENIENT) { - long weeks = Math.subtractExact(fieldValues.remove(ALIGNED_WEEK_OF_YEAR), 1); - long dow = Math.subtractExact(fieldValues.remove(DAY_OF_WEEK), 1); - return resolveAligned(dateYearDay(y, 1), 0, weeks, dow); - } - int aw = range(ALIGNED_WEEK_OF_YEAR).checkValidIntValue(fieldValues.remove(ALIGNED_WEEK_OF_YEAR), ALIGNED_WEEK_OF_YEAR); - int dow = range(DAY_OF_WEEK).checkValidIntValue(fieldValues.remove(DAY_OF_WEEK), DAY_OF_WEEK); - ChronoLocalDate date = dateYearDay(y, 1).plus((aw - 1) * 7, DAYS).with(nextOrSame(DayOfWeek.of(dow))); - if (resolverStyle == ResolverStyle.STRICT && date.get(YEAR) != y) { - throw new DateTimeException("Strict mode rejected resolved date as it is in a different year"); - } - return date; - } - - ChronoLocalDate resolveAligned(ChronoLocalDate base, long months, long weeks, long dow) { - ChronoLocalDate date = base.plus(months, MONTHS).plus(weeks, WEEKS); - if (dow > 7) { - date = date.plus((dow - 1) / 7, WEEKS); - dow = ((dow - 1) % 7) + 1; - } else if (dow < 1) { - date = date.plus(Math.subtractExact(dow, 7) / 7, WEEKS); - dow = ((dow + 6) % 7) + 1; - } - return date.with(nextOrSame(DayOfWeek.of((int) dow))); - } - - /** - * Adds a field-value pair to the map, checking for conflicts. - *

- * If the field is not already present, then the field-value pair is added to the map. - * If the field is already present and it has the same value as that specified, no action occurs. - * If the field is already present and it has a different value to that specified, then - * an exception is thrown. - * - * @param field the field to add, not null - * @param value the value to add, not null - * @throws DateTimeException if the field is already present with a different value - */ - void addFieldValue(Map fieldValues, ChronoField field, long value) { - Long old = fieldValues.get(field); // check first for better error message - if (old != null && old.longValue() != value) { - throw new DateTimeException("Conflict found: " + field + " " + old + " differs from " + field + " " + value); - } - fieldValues.put(field, value); - } + ChronoLocalDate resolveDate(Map fieldValues, ResolverStyle resolverStyle); //----------------------------------------------------------------------- /** @@ -1215,7 +699,7 @@ public abstract class Chronology implements Comparable { * @param days the number of years, may be negative * @return the period in terms of this chronology, not null */ - public ChronoPeriod period(int years, int months, int days) { + default ChronoPeriod period(int years, int months, int days) { return new ChronoPeriodImpl(this, years, months, days); } @@ -1226,107 +710,43 @@ public abstract class Chronology implements Comparable { * The comparison order first by the chronology ID string, then by any * additional information specific to the subclass. * It is "consistent with equals", as defined by {@link Comparable}. - *

- * The default implementation compares the chronology ID. - * Subclasses must compare any additional state that they store. * * @param other the other chronology to compare to, not null * @return the comparator value, negative if less, positive if greater */ @Override - public int compareTo(Chronology other) { - return getId().compareTo(other.getId()); - } + int compareTo(Chronology other); /** * Checks if this chronology is equal to another chronology. *

* The comparison is based on the entire state of the object. - *

- * The default implementation checks the type and calls {@link #compareTo(Chronology)}. * * @param obj the object to check, null returns false * @return true if this is equal to the other chronology */ @Override - public boolean equals(Object obj) { - if (this == obj) { - return true; - } - if (obj instanceof Chronology) { - return compareTo((Chronology) obj) == 0; - } - return false; - } + boolean equals(Object obj); /** * A hash code for this chronology. *

- * The default implementation is based on the ID and class. - * Subclasses should add any additional state that they store. + * The hash code should be based on the entire state of the object. * * @return a suitable hash code */ @Override - public int hashCode() { - return getClass().hashCode() ^ getId().hashCode(); - } + int hashCode(); //----------------------------------------------------------------------- /** - * Outputs this chronology as a {@code String}, using the ID. + * Outputs this chronology as a {@code String}. + *

+ * The format should include the entire state of the object. * * @return a string representation of this chronology, not null */ @Override - public String toString() { - return getId(); - } - - //----------------------------------------------------------------------- - /** - * Writes the Chronology using a - * dedicated serialized form. - * @serialData - *

-     *  out.writeByte(1);  // identifies a Chronology
-     *  out.writeUTF(getId());
-     * 
- * - * @return the instance of {@code Ser}, not null - */ - Object writeReplace() { - return new Ser(Ser.CHRONO_TYPE, this); - } - - /** - * Defend against malicious streams. - * @return never - * @throws InvalidObjectException always - */ - private Object readResolve() throws InvalidObjectException { - throw new InvalidObjectException("Deserialization via serialization delegate"); - } - - /** - * Write the Chronology id to the stream. - * @param out the output stream - * @throws IOException on any error during the write - */ - void writeExternal(DataOutput out) throws IOException { - out.writeUTF(getId()); - } - - /** - * Reads the Chronology id and creates the Chronology. - * @param in the input stream - * @return the Chronology - * @throws IOException on errors during the read - * @throws DateTimeException if the Chronology cannot be returned - */ - static Chronology readExternal(DataInput in) throws IOException { - String id = in.readUTF(); - return Chronology.of(id); - } + String toString(); } diff --git a/jdk/src/share/classes/java/time/chrono/HijrahChronology.java b/jdk/src/share/classes/java/time/chrono/HijrahChronology.java index 7d4485809c9..277b1010fe4 100644 --- a/jdk/src/share/classes/java/time/chrono/HijrahChronology.java +++ b/jdk/src/share/classes/java/time/chrono/HijrahChronology.java @@ -214,7 +214,7 @@ import sun.util.logging.PlatformLogger; * * @since 1.8 */ -public final class HijrahChronology extends Chronology implements Serializable { +public final class HijrahChronology extends AbstractChronology implements Serializable { /** * The Hijrah Calendar id. @@ -308,8 +308,8 @@ public final class HijrahChronology extends Chronology implements Serializable { try { INSTANCE = new HijrahChronology("Hijrah-umalqura"); // Register it by its aliases - Chronology.registerChrono(INSTANCE, "Hijrah"); - Chronology.registerChrono(INSTANCE, "islamic"); + AbstractChronology.registerChrono(INSTANCE, "Hijrah"); + AbstractChronology.registerChrono(INSTANCE, "islamic"); } catch (DateTimeException ex) { // Absence of Hijrah calendar is fatal to initializing this class. PlatformLogger logger = PlatformLogger.getLogger("java.time.chrono"); @@ -336,7 +336,7 @@ public final class HijrahChronology extends Chronology implements Serializable { try { // Create and register the variant HijrahChronology chrono = new HijrahChronology(id); - Chronology.registerChrono(chrono); + AbstractChronology.registerChrono(chrono); } catch (DateTimeException ex) { // Log error and continue PlatformLogger logger = PlatformLogger.getLogger("java.time.chrono"); diff --git a/jdk/src/share/classes/java/time/chrono/IsoChronology.java b/jdk/src/share/classes/java/time/chrono/IsoChronology.java index 9638f6eea4f..eb71a1fe65c 100644 --- a/jdk/src/share/classes/java/time/chrono/IsoChronology.java +++ b/jdk/src/share/classes/java/time/chrono/IsoChronology.java @@ -120,7 +120,7 @@ import java.util.Objects; * * @since 1.8 */ -public final class IsoChronology extends Chronology implements Serializable { +public final class IsoChronology extends AbstractChronology implements Serializable { /** * Singleton instance of the ISO chronology. diff --git a/jdk/src/share/classes/java/time/chrono/JapaneseChronology.java b/jdk/src/share/classes/java/time/chrono/JapaneseChronology.java index b01707e63ab..09e5b692ef2 100644 --- a/jdk/src/share/classes/java/time/chrono/JapaneseChronology.java +++ b/jdk/src/share/classes/java/time/chrono/JapaneseChronology.java @@ -120,7 +120,7 @@ import sun.util.calendar.LocalGregorianCalendar; * * @since 1.8 */ -public final class JapaneseChronology extends Chronology implements Serializable { +public final class JapaneseChronology extends AbstractChronology implements Serializable { static final LocalGregorianCalendar JCAL = (LocalGregorianCalendar) CalendarSystem.forName("japanese"); diff --git a/jdk/src/share/classes/java/time/chrono/MinguoChronology.java b/jdk/src/share/classes/java/time/chrono/MinguoChronology.java index db75a8645d6..af0be986c93 100644 --- a/jdk/src/share/classes/java/time/chrono/MinguoChronology.java +++ b/jdk/src/share/classes/java/time/chrono/MinguoChronology.java @@ -105,7 +105,7 @@ import java.util.Map; * * @since 1.8 */ -public final class MinguoChronology extends Chronology implements Serializable { +public final class MinguoChronology extends AbstractChronology implements Serializable { /** * Singleton instance for the Minguo chronology. diff --git a/jdk/src/share/classes/java/time/chrono/Ser.java b/jdk/src/share/classes/java/time/chrono/Ser.java index 5a4e3c12623..317a7696497 100644 --- a/jdk/src/share/classes/java/time/chrono/Ser.java +++ b/jdk/src/share/classes/java/time/chrono/Ser.java @@ -161,7 +161,7 @@ final class Ser implements Externalizable { out.writeByte(type); switch (type) { case CHRONO_TYPE: - ((Chronology) object).writeExternal(out); + ((AbstractChronology) object).writeExternal(out); break; case CHRONO_LOCAL_DATE_TIME_TYPE: ((ChronoLocalDateTimeImpl) object).writeExternal(out); @@ -231,7 +231,7 @@ final class Ser implements Externalizable { private static Object readInternal(byte type, ObjectInput in) throws IOException, ClassNotFoundException { switch (type) { - case CHRONO_TYPE: return Chronology.readExternal(in); + case CHRONO_TYPE: return AbstractChronology.readExternal(in); case CHRONO_LOCAL_DATE_TIME_TYPE: return ChronoLocalDateTimeImpl.readExternal(in); case CHRONO_ZONE_DATE_TIME_TYPE: return ChronoZonedDateTimeImpl.readExternal(in); case JAPANESE_DATE_TYPE: return JapaneseDate.readExternal(in); diff --git a/jdk/src/share/classes/java/time/chrono/ThaiBuddhistChronology.java b/jdk/src/share/classes/java/time/chrono/ThaiBuddhistChronology.java index 4ffd15bfcc6..c41aa34c0f1 100644 --- a/jdk/src/share/classes/java/time/chrono/ThaiBuddhistChronology.java +++ b/jdk/src/share/classes/java/time/chrono/ThaiBuddhistChronology.java @@ -106,7 +106,7 @@ import java.util.Map; * * @since 1.8 */ -public final class ThaiBuddhistChronology extends Chronology implements Serializable { +public final class ThaiBuddhistChronology extends AbstractChronology implements Serializable { /** * Singleton instance of the Buddhist chronology. diff --git a/jdk/test/java/time/tck/java/time/chrono/CopticChronology.java b/jdk/test/java/time/tck/java/time/chrono/CopticChronology.java index c111eed3658..c72b7370de8 100644 --- a/jdk/test/java/time/tck/java/time/chrono/CopticChronology.java +++ b/jdk/test/java/time/tck/java/time/chrono/CopticChronology.java @@ -59,13 +59,11 @@ package tck.java.time.chrono; import static java.time.temporal.ChronoField.EPOCH_DAY; import java.io.Serializable; - +import java.time.chrono.AbstractChronology; +import java.time.chrono.Era; import java.time.temporal.ChronoField; import java.time.temporal.TemporalAccessor; import java.time.temporal.ValueRange; -import java.time.chrono.Chronology; -import java.time.chrono.Era; - import java.util.Arrays; import java.util.List; import java.util.Locale; @@ -95,7 +93,7 @@ import java.util.Locale; *

Implementation notes

* This class is immutable and thread-safe. */ -public final class CopticChronology extends Chronology implements Serializable { +public final class CopticChronology extends AbstractChronology implements Serializable { /** * Singleton instance of the Coptic chronology. From be5469fc716a7868f4ae4b705502dbb1bee0bc03 Mon Sep 17 00:00:00 2001 From: Stuart Marks Date: Thu, 11 Jul 2013 13:32:36 -0700 Subject: [PATCH 021/131] 8014987: Augment serialization handling Reviewed-by: alanb, coffeys, skoivu --- .../classes/java/io/ObjectInputStream.java | 15 +++++++------- .../classes/java/io/ObjectOutputStream.java | 20 ++++++++++++------- 2 files changed, 21 insertions(+), 14 deletions(-) diff --git a/jdk/src/share/classes/java/io/ObjectInputStream.java b/jdk/src/share/classes/java/io/ObjectInputStream.java index ca0400539f9..0e41b08dc3e 100644 --- a/jdk/src/share/classes/java/io/ObjectInputStream.java +++ b/jdk/src/share/classes/java/io/ObjectInputStream.java @@ -490,11 +490,12 @@ public class ObjectInputStream public void defaultReadObject() throws IOException, ClassNotFoundException { - if (curContext == null) { + SerialCallbackContext ctx = curContext; + if (ctx == null) { throw new NotActiveException("not in call to readObject"); } - Object curObj = curContext.getObj(); - ObjectStreamClass curDesc = curContext.getDesc(); + Object curObj = ctx.getObj(); + ObjectStreamClass curDesc = ctx.getDesc(); bin.setBlockDataMode(false); defaultReadFields(curObj, curDesc); bin.setBlockDataMode(true); @@ -528,11 +529,12 @@ public class ObjectInputStream public ObjectInputStream.GetField readFields() throws IOException, ClassNotFoundException { - if (curContext == null) { + SerialCallbackContext ctx = curContext; + if (ctx == null) { throw new NotActiveException("not in call to readObject"); } - Object curObj = curContext.getObj(); - ObjectStreamClass curDesc = curContext.getDesc(); + Object curObj = ctx.getObj(); + ObjectStreamClass curDesc = ctx.getDesc(); bin.setBlockDataMode(false); GetFieldImpl getField = new GetFieldImpl(curDesc); getField.readFields(); @@ -1967,7 +1969,6 @@ public class ObjectInputStream private void defaultReadFields(Object obj, ObjectStreamClass desc) throws IOException { - // REMIND: is isInstance check necessary? Class cl = desc.forClass(); if (cl != null && obj != null && !cl.isInstance(obj)) { throw new ClassCastException(); diff --git a/jdk/src/share/classes/java/io/ObjectOutputStream.java b/jdk/src/share/classes/java/io/ObjectOutputStream.java index f7a94bb0342..c99aeb9cd67 100644 --- a/jdk/src/share/classes/java/io/ObjectOutputStream.java +++ b/jdk/src/share/classes/java/io/ObjectOutputStream.java @@ -430,11 +430,12 @@ public class ObjectOutputStream * OutputStream */ public void defaultWriteObject() throws IOException { - if ( curContext == null ) { + SerialCallbackContext ctx = curContext; + if (ctx == null) { throw new NotActiveException("not in call to writeObject"); } - Object curObj = curContext.getObj(); - ObjectStreamClass curDesc = curContext.getDesc(); + Object curObj = ctx.getObj(); + ObjectStreamClass curDesc = ctx.getDesc(); bout.setBlockDataMode(false); defaultWriteFields(curObj, curDesc); bout.setBlockDataMode(true); @@ -452,11 +453,12 @@ public class ObjectOutputStream */ public ObjectOutputStream.PutField putFields() throws IOException { if (curPut == null) { - if (curContext == null) { + SerialCallbackContext ctx = curContext; + if (ctx == null) { throw new NotActiveException("not in call to writeObject"); } - Object curObj = curContext.getObj(); - ObjectStreamClass curDesc = curContext.getDesc(); + Object curObj = ctx.getObj(); + ObjectStreamClass curDesc = ctx.getDesc(); curPut = new PutFieldImpl(curDesc); } return curPut; @@ -1516,7 +1518,11 @@ public class ObjectOutputStream private void defaultWriteFields(Object obj, ObjectStreamClass desc) throws IOException { - // REMIND: perform conservative isInstance check here? + Class cl = desc.forClass(); + if (cl != null && obj != null && !cl.isInstance(obj)) { + throw new ClassCastException(); + } + desc.checkDefaultSerialize(); int primDataSize = desc.getPrimDataSize(); From 79bda234fe58acb682b3be6ee3fa064d6fdcec43 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joel=20Borggr=C3=A9n-Franck?= Date: Mon, 15 Jul 2013 14:44:50 +0200 Subject: [PATCH 022/131] 8014349: (cl) Class.getDeclaredClass problematic in some class loader configurations Reviewed-by: mchung, ahgross, darcy --- jdk/src/share/classes/java/lang/Class.java | 18 +++++++++++++++++- jdk/src/share/native/java/lang/Class.c | 2 +- 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/jdk/src/share/classes/java/lang/Class.java b/jdk/src/share/classes/java/lang/Class.java index df4d457367d..eb11681ac00 100644 --- a/jdk/src/share/classes/java/lang/Class.java +++ b/jdk/src/share/classes/java/lang/Class.java @@ -1221,9 +1221,25 @@ public final class Class implements java.io.Serializable, * type, or void,then this method returns null. * * @return the declaring class for this class + * @throws SecurityException + * If a security manager, s, is present and the caller's + * class loader is not the same as or an ancestor of the class + * loader for the declaring class and invocation of {@link + * SecurityManager#checkPackageAccess s.checkPackageAccess()} + * denies access to the package of the declaring class * @since JDK1.1 */ - public native Class getDeclaringClass(); + @CallerSensitive + public Class getDeclaringClass() throws SecurityException { + final Class candidate = getDeclaringClass0(); + + if (candidate != null) + candidate.checkPackageAccess( + ClassLoader.getClassLoader(Reflection.getCallerClass()), true); + return candidate; + } + + private native Class getDeclaringClass0(); /** diff --git a/jdk/src/share/native/java/lang/Class.c b/jdk/src/share/native/java/lang/Class.c index e53d3f73b79..b0ba34349d8 100644 --- a/jdk/src/share/native/java/lang/Class.c +++ b/jdk/src/share/native/java/lang/Class.c @@ -69,7 +69,7 @@ static JNINativeMethod methods[] = { {"getDeclaredConstructors0","(Z)[" CTR, (void *)&JVM_GetClassDeclaredConstructors}, {"getProtectionDomain0", "()" PD, (void *)&JVM_GetProtectionDomain}, {"getDeclaredClasses0", "()[" CLS, (void *)&JVM_GetDeclaredClasses}, - {"getDeclaringClass", "()" CLS, (void *)&JVM_GetDeclaringClass}, + {"getDeclaringClass0", "()" CLS, (void *)&JVM_GetDeclaringClass}, {"getGenericSignature0", "()" STR, (void *)&JVM_GetClassSignature}, {"getRawAnnotations", "()" BA, (void *)&JVM_GetClassAnnotations}, {"getConstantPool", "()" CPL, (void *)&JVM_GetClassConstantPool}, From 1f1524301201ef37f3180a9b9659eb45d598afa0 Mon Sep 17 00:00:00 2001 From: Mandy Chung Date: Mon, 15 Jul 2013 20:24:39 -0700 Subject: [PATCH 023/131] 8017291: Cast Proxies Aside Reviewed-by: alanb, ahgross --- jdk/src/share/classes/java/lang/ClassLoader.java | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/jdk/src/share/classes/java/lang/ClassLoader.java b/jdk/src/share/classes/java/lang/ClassLoader.java index f26eafd980a..3735cd3a782 100644 --- a/jdk/src/share/classes/java/lang/ClassLoader.java +++ b/jdk/src/share/classes/java/lang/ClassLoader.java @@ -57,6 +57,7 @@ import sun.misc.URLClassPath; import sun.misc.VM; import sun.reflect.CallerSensitive; import sun.reflect.Reflection; +import sun.reflect.misc.ReflectUtil; import sun.security.util.SecurityConstants; /** @@ -486,6 +487,13 @@ public abstract class ClassLoader { private void checkPackageAccess(Class cls, ProtectionDomain pd) { final SecurityManager sm = System.getSecurityManager(); if (sm != null) { + if (ReflectUtil.isNonPublicProxyClass(cls)) { + for (Class intf: cls.getInterfaces()) { + checkPackageAccess(intf, pd); + } + return; + } + final String name = cls.getName(); final int i = name.lastIndexOf('.'); if (i != -1) { From fb90cdbe873ae541008c71cbc04107b6b893a660 Mon Sep 17 00:00:00 2001 From: Sergey Malenkov Date: Tue, 16 Jul 2013 21:11:54 +0400 Subject: [PATCH 024/131] 8019617: Better view of objects Reviewed-by: art, skoivu --- .../javax/swing/text/html/ObjectView.java | 28 ++++--------------- 1 file changed, 5 insertions(+), 23 deletions(-) diff --git a/jdk/src/share/classes/javax/swing/text/html/ObjectView.java b/jdk/src/share/classes/javax/swing/text/html/ObjectView.java index 4e43cfb6d70..00d3a42c3a6 100644 --- a/jdk/src/share/classes/javax/swing/text/html/ObjectView.java +++ b/jdk/src/share/classes/javax/swing/text/html/ObjectView.java @@ -31,6 +31,9 @@ import javax.swing.text.*; import java.beans.*; import java.lang.reflect.*; +import sun.reflect.misc.MethodUtil; +import sun.reflect.misc.ReflectUtil; + /** * Component decorator that implements the view interface * for <object> elements. @@ -87,6 +90,7 @@ public class ObjectView extends ComponentView { AttributeSet attr = getElement().getAttributes(); String classname = (String) attr.getAttribute(HTML.Attribute.CLASSID); try { + ReflectUtil.checkPackageAccess(classname); Class c = Class.forName(classname, true,Thread.currentThread(). getContextClassLoader()); Object o = c.newInstance(); @@ -115,28 +119,6 @@ public class ObjectView extends ComponentView { return comp; } - /** - * Get a Class object to use for loading the - * classid. If possible, the Classloader - * used to load the associated Document is used. - * This would typically be the same as the ClassLoader - * used to load the EditorKit. If the documents - * ClassLoader is null, - * Class.forName is used. - */ - private Class getClass(String classname) throws ClassNotFoundException { - Class klass; - - Class docClass = getDocument().getClass(); - ClassLoader loader = docClass.getClassLoader(); - if (loader != null) { - klass = loader.loadClass(classname); - } else { - klass = Class.forName(classname); - } - return klass; - } - /** * Initialize this component according the KEY/VALUEs passed in * via the <param> elements in the corresponding @@ -170,7 +152,7 @@ public class ObjectView extends ComponentView { } Object [] args = { value }; try { - writer.invoke(comp, args); + MethodUtil.invoke(writer, comp, args); } catch (Exception ex) { System.err.println("Invocation failed"); // invocation code From a775b1ae8d7146b5e0ac513000884a4ecf680a58 Mon Sep 17 00:00:00 2001 From: Michael McMahon Date: Thu, 18 Jul 2013 18:52:14 +0100 Subject: [PATCH 025/131] 8015743: Address internet addresses Reviewed-by: alanb, khazra, skoivu --- .../share/classes/java/net/Inet6Address.java | 496 +++++++++++------- .../share/classes/java/net/InetAddress.java | 9 +- jdk/src/share/native/java/net/Inet6Address.c | 15 +- jdk/src/share/native/java/net/net_util.c | 105 +++- jdk/src/share/native/java/net/net_util.h | 15 +- .../native/java/net/Inet6AddressImpl.c | 15 +- .../native/java/net/NetworkInterface.c | 18 +- .../native/java/net/PlainDatagramSocketImpl.c | 3 +- jdk/src/solaris/native/java/net/net_util_md.c | 8 +- .../native/java/net/Inet6AddressImpl.c | 16 +- .../native/java/net/NetworkInterface.c | 16 +- .../native/java/net/NetworkInterface_winXP.c | 12 +- .../java/net/TwoStacksPlainSocketImpl.c | 11 +- jdk/src/windows/native/java/net/net_util_md.c | 6 +- .../net/Inet6Address/serialize/Serialize.java | 181 ++++++- 15 files changed, 657 insertions(+), 269 deletions(-) diff --git a/jdk/src/share/classes/java/net/Inet6Address.java b/jdk/src/share/classes/java/net/Inet6Address.java index 4a2d4e22473..8892631bb30 100644 --- a/jdk/src/share/classes/java/net/Inet6Address.java +++ b/jdk/src/share/classes/java/net/Inet6Address.java @@ -28,7 +28,10 @@ package java.net; import java.io.IOException; import java.io.InvalidObjectException; import java.io.ObjectInputStream; +import java.io.ObjectOutputStream; +import java.io.ObjectStreamField; import java.util.Enumeration; +import java.util.Arrays; /** * This class represents an Internet Protocol version 6 (IPv6) address. @@ -177,37 +180,192 @@ class Inet6Address extends InetAddress { */ private transient int cached_scope_id; // 0 - /** - * Holds a 128-bit (16 bytes) IPv6 address. - * - * @serial - */ - byte[] ipaddress; + private class Inet6AddressHolder { - /** - * scope_id. The scope specified when the object is created. If the object - * is created with an interface name, then the scope_id is not determined - * until the time it is needed. - */ - private int scope_id; // 0 + private Inet6AddressHolder() { + ipaddress = new byte[INADDRSZ]; + } - /** - * This will be set to true when the scope_id field contains a valid - * integer scope_id. - */ - private boolean scope_id_set; // false + private Inet6AddressHolder( + byte[] ipaddress, int scope_id, boolean scope_id_set, + NetworkInterface ifname, boolean scope_ifname_set) + { + this.ipaddress = ipaddress; + this.scope_id = scope_id; + this.scope_id_set = scope_id_set; + this.scope_ifname_set = scope_ifname_set; + this.scope_ifname = ifname; + } - /** - * scoped interface. scope_id is derived from this as the scope_id of the first - * address whose scope is the same as this address for the named interface. - */ - private transient NetworkInterface scope_ifname; // null + /** + * Holds a 128-bit (16 bytes) IPv6 address. + */ + byte[] ipaddress; - /** - * set if the object is constructed with a scoped - * interface instead of a numeric scope id. - */ - private boolean scope_ifname_set; // false; + /** + * scope_id. The scope specified when the object is created. If the object + * is created with an interface name, then the scope_id is not determined + * until the time it is needed. + */ + int scope_id; // 0 + + /** + * This will be set to true when the scope_id field contains a valid + * integer scope_id. + */ + boolean scope_id_set; // false + + /** + * scoped interface. scope_id is derived from this as the scope_id of the first + * address whose scope is the same as this address for the named interface. + */ + NetworkInterface scope_ifname; // null + + /** + * set if the object is constructed with a scoped + * interface instead of a numeric scope id. + */ + boolean scope_ifname_set; // false; + + void setAddr(byte addr[]) { + if (addr.length == INADDRSZ) { // normal IPv6 address + System.arraycopy(addr, 0, ipaddress, 0, INADDRSZ); + } + } + + void init(byte addr[], int scope_id) { + setAddr(addr); + + if (scope_id >= 0) { + this.scope_id = scope_id; + this.scope_id_set = true; + } + } + + void init(byte addr[], NetworkInterface nif) + throws UnknownHostException + { + setAddr(addr); + + if (nif != null) { + this.scope_id = deriveNumericScope(ipaddress, nif); + this.scope_id_set = true; + this.scope_ifname = nif; + this.scope_ifname_set = true; + } + } + + String getHostAddress() { + String s = numericToTextFormat(ipaddress); + if (scope_ifname != null) { /* must check this first */ + s = s + "%" + scope_ifname.getName(); + } else if (scope_id_set) { + s = s + "%" + scope_id; + } + return s; + } + + public boolean equals(Object o) { + if (! (o instanceof Inet6AddressHolder)) { + return false; + } + Inet6AddressHolder that = (Inet6AddressHolder)o; + + return Arrays.equals(this.ipaddress, that.ipaddress); + } + + public int hashCode() { + if (ipaddress != null) { + + int hash = 0; + int i=0; + while (i= 0, or -1 to indicate not being set */ Inet6Address(String hostName, byte addr[], int scope_id) { - holder().hostName = hostName; - if (addr.length == INADDRSZ) { // normal IPv6 address - holder().family = IPv6; - ipaddress = addr.clone(); - } - if (scope_id >= 0) { - this.scope_id = scope_id; - scope_id_set = true; - } + holder.init(hostName, IPv6); + holder6 = new Inet6AddressHolder(); + holder6.init(addr, scope_id); } Inet6Address(String hostName, byte addr[]) { + holder6 = new Inet6AddressHolder(); try { initif (hostName, addr, null); } catch (UnknownHostException e) {} /* cant happen if ifname is null */ @@ -245,12 +397,14 @@ class Inet6Address extends InetAddress { Inet6Address (String hostName, byte addr[], NetworkInterface nif) throws UnknownHostException { + holder6 = new Inet6AddressHolder(); initif (hostName, addr, nif); } Inet6Address (String hostName, byte addr[], String ifname) throws UnknownHostException { + holder6 = new Inet6AddressHolder(); initstr (hostName, addr, ifname); } @@ -341,17 +495,13 @@ class Inet6Address extends InetAddress { private void initif(String hostName, byte addr[], NetworkInterface nif) throws UnknownHostException { - holder().hostName = hostName; + int family = -1; + holder6.init(addr, nif); + if (addr.length == INADDRSZ) { // normal IPv6 address - holder().family = IPv6; - ipaddress = addr.clone(); - } - if (nif != null) { - scope_ifname = nif; - scope_id = deriveNumericScope(nif); - scope_id_set = true; - scope_ifname_set = true; // for consistency + family = IPv6; } + holder.init(hostName, family); } /* check the two Ipv6 addresses and return false if they are both @@ -359,17 +509,22 @@ class Inet6Address extends InetAddress { * (ie. one is sitelocal and the other linklocal) * return true otherwise. */ - private boolean differentLocalAddressTypes(Inet6Address other) { - if (isLinkLocalAddress() && !other.isLinkLocalAddress()) + + private static boolean isDifferentLocalAddressType( + byte[] thisAddr, byte[] otherAddr) { + + if (Inet6Address.isLinkLocalAddress(thisAddr) && + !Inet6Address.isLinkLocalAddress(otherAddr)) { return false; - if (isSiteLocalAddress() && !other.isSiteLocalAddress()) + } + if (Inet6Address.isSiteLocalAddress(thisAddr) && + !Inet6Address.isSiteLocalAddress(otherAddr)) { return false; + } return true; } - private int deriveNumericScope(NetworkInterface ifc) - throws UnknownHostException - { + private static int deriveNumericScope (byte[] thisAddr, NetworkInterface ifc) throws UnknownHostException { Enumeration addresses = ifc.getInetAddresses(); while (addresses.hasMoreElements()) { InetAddress addr = addresses.nextElement(); @@ -378,46 +533,60 @@ class Inet6Address extends InetAddress { } Inet6Address ia6_addr = (Inet6Address)addr; /* check if site or link local prefixes match */ - if (!differentLocalAddressTypes(ia6_addr)){ + if (!isDifferentLocalAddressType(thisAddr, ia6_addr.getAddress())){ /* type not the same, so carry on searching */ continue; } /* found a matching address - return its scope_id */ - return ia6_addr.scope_id; + return ia6_addr.getScopeId(); } throw new UnknownHostException ("no scope_id found"); } - private int deriveNumericScope(String ifname) throws UnknownHostException { + private int deriveNumericScope (String ifname) throws UnknownHostException { Enumeration en; try { en = NetworkInterface.getNetworkInterfaces(); } catch (SocketException e) { - throw new UnknownHostException( - "could not enumerate local network interfaces"); + throw new UnknownHostException ("could not enumerate local network interfaces"); } while (en.hasMoreElements()) { NetworkInterface ifc = en.nextElement(); - if (ifc.getName().equals(ifname)) { - Enumeration addresses = ifc.getInetAddresses(); - while (addresses.hasMoreElements()) { - InetAddress addr = addresses.nextElement(); - if (!(addr instanceof Inet6Address)) { - continue; - } - Inet6Address ia6_addr = (Inet6Address)addr; - /* check if site or link local prefixes match */ - if (!differentLocalAddressTypes(ia6_addr)){ - /* type not the same, so carry on searching */ - continue; - } - /* found a matching address - return its scope_id */ - return ia6_addr.scope_id; - } + if (ifc.getName().equals (ifname)) { + return deriveNumericScope(holder6.ipaddress, ifc); } } - throw new UnknownHostException( - "No matching address found for interface : " +ifname); + throw new UnknownHostException ("No matching address found for interface : " +ifname); + } + + /** + * @serialField ipaddress byte[] + * @serialField scope_id int + * @serialField scope_id_set boolean + * @serialField scope_ifname_set boolean + * @serialField ifname String + */ + + private static final ObjectStreamField[] serialPersistentFields = { + new ObjectStreamField("ipaddress", byte[].class), + new ObjectStreamField("scope_id", int.class), + new ObjectStreamField("scope_id_set", boolean.class), + new ObjectStreamField("scope_ifname_set", boolean.class), + new ObjectStreamField("ifname", String.class) + }; + + private static final long FIELDS_OFFSET; + private static final sun.misc.Unsafe UNSAFE; + + static { + try { + sun.misc.Unsafe unsafe = sun.misc.Unsafe.getUnsafe(); + FIELDS_OFFSET = unsafe.objectFieldOffset( + Inet6Address.class.getDeclaredField("holder6")); + UNSAFE = unsafe; + } catch (ReflectiveOperationException e) { + throw new Error(e); + } } /** @@ -427,35 +596,41 @@ class Inet6Address extends InetAddress { */ private void readObject(ObjectInputStream s) throws IOException, ClassNotFoundException { + NetworkInterface scope_ifname = null; if (getClass().getClassLoader() != null) { throw new SecurityException ("invalid address type"); } - s.defaultReadObject(); + ObjectInputStream.GetField gf = s.readFields(); + byte[] ipaddress = (byte[])gf.get("ipaddress", null); + int scope_id = (int)gf.get("scope_id", -1); + boolean scope_id_set = (boolean)gf.get("scope_id_set", false); + boolean scope_ifname_set = (boolean)gf.get("scope_ifname_set", false); + String ifname = (String)gf.get("ifname", null); - if (ifname != null && !ifname.equals("")) { + if (ifname != null && !"".equals (ifname)) { try { scope_ifname = NetworkInterface.getByName(ifname); - if (scope_ifname != null) { - scope_ifname_set = true; - try { - scope_id = deriveNumericScope(scope_ifname); - } catch (UnknownHostException e) { - // typically should not happen, but it may be that - // the machine being used for deserialization has - // the same interface name but without IPv6 configured. - } - } else { + if (scope_ifname == null) { /* the interface does not exist on this system, so we clear * the scope information completely */ scope_id_set = false; scope_ifname_set = false; scope_id = 0; + } else { + scope_ifname_set = true; + try { + scope_id = deriveNumericScope (ipaddress, scope_ifname); + } catch (UnknownHostException e) { + // typically should not happen, but it may be that + // the machine being used for deserialization has + // the same interface name but without IPv6 configured. + } } } catch (SocketException e) {} - } + /* if ifname was not supplied, then the numeric info is used */ ipaddress = ipaddress.clone(); @@ -466,9 +641,38 @@ class Inet6Address extends InetAddress { ipaddress.length); } - if (holder().getFamily() != IPv6) { + if (holder.getFamily() != IPv6) { throw new InvalidObjectException("invalid address family type"); } + + Inet6AddressHolder h = new Inet6AddressHolder( + ipaddress, scope_id, scope_id_set, scope_ifname, scope_ifname_set + ); + + UNSAFE.putObject(this, FIELDS_OFFSET, h); + } + + /** + * default behavior is overridden in order to write the + * scope_ifname field as a String, rather than a NetworkInterface + * which is not serializable + */ + private synchronized void writeObject(ObjectOutputStream s) + throws IOException + { + String ifname = null; + + if (holder6.scope_ifname != null) { + ifname = holder6.scope_ifname.getName(); + holder6.scope_ifname_set = true; + } + ObjectOutputStream.PutField pfields = s.putFields(); + pfields.put("ipaddress", holder6.ipaddress); + pfields.put("scope_id", holder6.scope_id); + pfields.put("scope_id_set", holder6.scope_id_set); + pfields.put("scope_ifname_set", holder6.scope_ifname_set); + pfields.put("ifname", ifname); + s.writeFields(); } /** @@ -483,7 +687,7 @@ class Inet6Address extends InetAddress { */ @Override public boolean isMulticastAddress() { - return ((ipaddress[0] & 0xff) == 0xff); + return holder6.isMulticastAddress(); } /** @@ -496,11 +700,7 @@ class Inet6Address extends InetAddress { */ @Override public boolean isAnyLocalAddress() { - byte test = 0x00; - for (int i = 0; i < INADDRSZ; i++) { - test |= ipaddress[i]; - } - return (test == 0x00); + return holder6.isAnyLocalAddress(); } /** @@ -513,11 +713,7 @@ class Inet6Address extends InetAddress { */ @Override public boolean isLoopbackAddress() { - byte test = 0x00; - for (int i = 0; i < 15; i++) { - test |= ipaddress[i]; - } - return (test == 0x00) && (ipaddress[15] == 0x01); + return holder6.isLoopbackAddress(); } /** @@ -530,6 +726,11 @@ class Inet6Address extends InetAddress { */ @Override public boolean isLinkLocalAddress() { + return holder6.isLinkLocalAddress(); + } + + /* static version of above */ + static boolean isLinkLocalAddress(byte[] ipaddress) { return ((ipaddress[0] & 0xff) == 0xfe && (ipaddress[1] & 0xc0) == 0x80); } @@ -544,6 +745,11 @@ class Inet6Address extends InetAddress { */ @Override public boolean isSiteLocalAddress() { + return holder6.isSiteLocalAddress(); + } + + /* static version of above */ + static boolean isSiteLocalAddress(byte[] ipaddress) { return ((ipaddress[0] & 0xff) == 0xfe && (ipaddress[1] & 0xc0) == 0xc0); } @@ -559,8 +765,7 @@ class Inet6Address extends InetAddress { */ @Override public boolean isMCGlobal() { - return ((ipaddress[0] & 0xff) == 0xff - && (ipaddress[1] & 0x0f) == 0x0e); + return holder6.isMCGlobal(); } /** @@ -574,8 +779,7 @@ class Inet6Address extends InetAddress { */ @Override public boolean isMCNodeLocal() { - return ((ipaddress[0] & 0xff) == 0xff - && (ipaddress[1] & 0x0f) == 0x01); + return holder6.isMCNodeLocal(); } /** @@ -589,8 +793,7 @@ class Inet6Address extends InetAddress { */ @Override public boolean isMCLinkLocal() { - return ((ipaddress[0] & 0xff) == 0xff - && (ipaddress[1] & 0x0f) == 0x02); + return holder6.isMCLinkLocal(); } /** @@ -604,8 +807,7 @@ class Inet6Address extends InetAddress { */ @Override public boolean isMCSiteLocal() { - return ((ipaddress[0] & 0xff) == 0xff - && (ipaddress[1] & 0x0f) == 0x05); + return holder6.isMCSiteLocal(); } /** @@ -619,10 +821,8 @@ class Inet6Address extends InetAddress { */ @Override public boolean isMCOrgLocal() { - return ((ipaddress[0] & 0xff) == 0xff - && (ipaddress[1] & 0x0f) == 0x08); + return holder6.isMCOrgLocal(); } - /** * Returns the raw IP address of this {@code InetAddress} object. The result * is in network byte order: the highest order byte of the address is in @@ -632,7 +832,7 @@ class Inet6Address extends InetAddress { */ @Override public byte[] getAddress() { - return ipaddress.clone(); + return holder6.ipaddress.clone(); } /** @@ -644,7 +844,7 @@ class Inet6Address extends InetAddress { * @since 1.5 */ public int getScopeId() { - return scope_id; + return holder6.scope_id; } /** @@ -655,7 +855,7 @@ class Inet6Address extends InetAddress { * @since 1.5 */ public NetworkInterface getScopedInterface() { - return scope_ifname; + return holder6.scope_ifname; } /** @@ -669,13 +869,7 @@ class Inet6Address extends InetAddress { */ @Override public String getHostAddress() { - String s = numericToTextFormat(ipaddress); - if (scope_ifname != null) { /* must check this first */ - s = s + "%" + scope_ifname.getName(); - } else if (scope_id_set) { - s = s + "%" + scope_id; - } - return s; + return holder6.getHostAddress(); } /** @@ -685,25 +879,7 @@ class Inet6Address extends InetAddress { */ @Override public int hashCode() { - if (ipaddress != null) { - - int hash = 0; - int i=0; - while (iFindClass(env, "java/net/Inet6Address"); CHECK_NULL(c); ia6_class = (*env)->NewGlobalRef(env, c); CHECK_NULL(ia6_class); - ia6_ipaddressID = (*env)->GetFieldID(env, ia6_class, "ipaddress", "[B"); + ia6h_class = (*env)->FindClass(env, "java/net/Inet6Address$Inet6AddressHolder"); + CHECK_NULL(ia6h_class); + ia6_holder6ID = (*env)->GetFieldID(env, ia6_class, "holder6", "Ljava/net/Inet6Address$Inet6AddressHolder;"); + CHECK_NULL(ia6_holder6ID); + ia6_ipaddressID = (*env)->GetFieldID(env, ia6h_class, "ipaddress", "[B"); CHECK_NULL(ia6_ipaddressID); - ia6_scopeidID = (*env)->GetFieldID(env, ia6_class, "scope_id", "I"); + ia6_scopeidID = (*env)->GetFieldID(env, ia6h_class, "scope_id", "I"); CHECK_NULL(ia6_scopeidID); ia6_cachedscopeidID = (*env)->GetFieldID(env, ia6_class, "cached_scope_id", "I"); CHECK_NULL(ia6_cachedscopeidID); - ia6_scopeidsetID = (*env)->GetFieldID(env, ia6_class, "scope_id_set", "Z"); + ia6_scopeidsetID = (*env)->GetFieldID(env, ia6h_class, "scope_id_set", "Z"); CHECK_NULL(ia6_scopeidID); - ia6_scopeifnameID = (*env)->GetFieldID(env, ia6_class, "scope_ifname", "Ljava/net/NetworkInterface;"); + ia6_scopeifnameID = (*env)->GetFieldID(env, ia6h_class, "scope_ifname", "Ljava/net/NetworkInterface;"); CHECK_NULL(ia6_scopeifnameID); ia6_ctrID = (*env)->GetMethodID(env, ia6_class, "", "()V"); CHECK_NULL(ia6_ctrID); diff --git a/jdk/src/share/native/java/net/net_util.c b/jdk/src/share/native/java/net/net_util.c index 5d15f9d9b0e..d52577ce25b 100644 --- a/jdk/src/share/native/java/net/net_util.c +++ b/jdk/src/share/native/java/net/net_util.c @@ -94,6 +94,92 @@ extern jfieldID ia_holderID; extern jfieldID iac_addressID; extern jfieldID iac_familyID; +/** + * set_ methods return JNI_TRUE on success JNI_FALSE on error + * get_ methods that return +ve int return -1 on error + * get_ methods that return objects return NULL on error. + */ +jobject getInet6Address_scopeifname(JNIEnv *env, jobject iaObj) { + jobject holder; + + init(env); + holder = (*env)->GetObjectField(env, iaObj, ia6_holder6ID); + CHECK_NULL_RETURN(holder, NULL); + return (*env)->GetObjectField(env, holder, ia6_scopeifnameID); +} + +int setInet6Address_scopeifname(JNIEnv *env, jobject iaObj, jobject scopeifname) { + jobject holder; + + init(env); + holder = (*env)->GetObjectField(env, iaObj, ia6_holder6ID); + CHECK_NULL_RETURN(holder, JNI_FALSE); + (*env)->SetObjectField(env, holder, ia6_scopeifnameID, scopeifname); + return JNI_TRUE; +} + +int getInet6Address_scopeid_set(JNIEnv *env, jobject iaObj) { + jobject holder; + + init(env); + holder = (*env)->GetObjectField(env, iaObj, ia6_holder6ID); + CHECK_NULL_RETURN(holder, -1); + return (*env)->GetBooleanField(env, holder, ia6_scopeidsetID); +} + +int getInet6Address_scopeid(JNIEnv *env, jobject iaObj) { + jobject holder; + + init(env); + holder = (*env)->GetObjectField(env, iaObj, ia6_holder6ID); + CHECK_NULL_RETURN(holder, -1); + return (*env)->GetIntField(env, holder, ia6_scopeidID); +} + +int setInet6Address_scopeid(JNIEnv *env, jobject iaObj, int scopeid) { + jobject holder; + + init(env); + holder = (*env)->GetObjectField(env, iaObj, ia6_holder6ID); + CHECK_NULL_RETURN(holder, JNI_FALSE); + (*env)->SetIntField(env, holder, ia6_scopeidID, scopeid); + if (scopeid > 0) { + (*env)->SetBooleanField(env, holder, ia6_scopeidsetID, JNI_TRUE); + } + return JNI_TRUE; +} + + +int getInet6Address_ipaddress(JNIEnv *env, jobject iaObj, char *dest) { + jobject holder, addr; + jbyteArray barr; + + init(env); + holder = (*env)->GetObjectField(env, iaObj, ia6_holder6ID); + CHECK_NULL_RETURN(holder, JNI_FALSE); + addr = (*env)->GetObjectField(env, holder, ia6_ipaddressID); + CHECK_NULL_RETURN(addr, JNI_FALSE); + (*env)->GetByteArrayRegion(env, addr, 0, 16, (jbyte *)dest); + return JNI_TRUE; +} + +int setInet6Address_ipaddress(JNIEnv *env, jobject iaObj, char *address) { + jobject holder; + jbyteArray addr; + + init(env); + holder = (*env)->GetObjectField(env, iaObj, ia6_holder6ID); + CHECK_NULL_RETURN(holder, JNI_FALSE); + addr = (jbyteArray)(*env)->GetObjectField(env, holder, ia6_ipaddressID); + if (addr == NULL) { + addr = (*env)->NewByteArray(env, 16); + CHECK_NULL_RETURN(addr, JNI_FALSE); + (*env)->SetObjectField(env, holder, ia6_ipaddressID, addr); + } + (*env)->SetByteArrayRegion(env, addr, 0, 16, (jbyte *)address); + return JNI_TRUE; +} + void setInetAddress_addr(JNIEnv *env, jobject iaObj, int address) { jobject holder; init(env); @@ -167,6 +253,7 @@ NET_SockaddrToInetAddress(JNIEnv *env, struct sockaddr *him, int *port) { } else { static jclass inet6Cls = 0; jint scope; + int ret; if (inet6Cls == 0) { jclass c = (*env)->FindClass(env, "java/net/Inet6Address"); CHECK_NULL_RETURN(c, NULL); @@ -176,18 +263,11 @@ NET_SockaddrToInetAddress(JNIEnv *env, struct sockaddr *him, int *port) { } iaObj = (*env)->NewObject(env, inet6Cls, ia6_ctrID); CHECK_NULL_RETURN(iaObj, NULL); - ipaddress = (*env)->NewByteArray(env, 16); - CHECK_NULL_RETURN(ipaddress, NULL); - (*env)->SetByteArrayRegion(env, ipaddress, 0, 16, - (jbyte *)&(him6->sin6_addr)); - - (*env)->SetObjectField(env, iaObj, ia6_ipaddressID, ipaddress); - + ret = setInet6Address_ipaddress(env, iaObj, (char *)&(him6->sin6_addr)); + CHECK_NULL_RETURN(ret, NULL); setInetAddress_family(env, iaObj, IPv6); scope = getScopeID(him); - (*env)->SetIntField(env, iaObj, ia6_scopeidID, scope); - if (scope > 0) - (*env)->SetBooleanField(env, iaObj, ia6_scopeidsetID, JNI_TRUE); + setInet6Address_scopeid(env, iaObj, scope); } *port = ntohs(him6->sin6_port); } else @@ -247,9 +327,8 @@ NET_SockaddrEqualsInetAddress(JNIEnv *env, struct sockaddr *him, jobject iaObj) if (family == AF_INET) { return JNI_FALSE; } - ipaddress = (*env)->GetObjectField(env, iaObj, ia6_ipaddressID); - scope = (*env)->GetIntField(env, iaObj, ia6_scopeidID); - (*env)->GetByteArrayRegion(env, ipaddress, 0, 16, caddrCur); + scope = getInet6Address_scopeid(env, iaObj); + getInet6Address_ipaddress(env, iaObj, (char *)caddrCur); if (NET_IsEqual(caddrNew, caddrCur) && cmpScopeID(scope, him)) { return JNI_TRUE; } else { diff --git a/jdk/src/share/native/java/net/net_util.h b/jdk/src/share/native/java/net/net_util.h index 0fd5b6c427f..d38a5f52fcf 100644 --- a/jdk/src/share/native/java/net/net_util.h +++ b/jdk/src/share/native/java/net/net_util.h @@ -58,6 +58,19 @@ extern jfieldID iac_familyID; extern jfieldID iac_hostNameID; extern jfieldID ia_preferIPv6AddressID; +/** (Inet6Address accessors) + * set_ methods return JNI_TRUE on success JNI_FALSE on error + * get_ methods that return int/boolean, return -1 on error + * get_ methods that return objects return NULL on error. + */ +extern jobject getInet6Address_scopeifname(JNIEnv *env, jobject ia6Obj); +extern int setInet6Address_scopeifname(JNIEnv *env, jobject ia6Obj, jobject scopeifname); +extern int getInet6Address_scopeid_set(JNIEnv *env, jobject ia6Obj); +extern int getInet6Address_scopeid(JNIEnv *env, jobject ia6Obj); +extern int setInet6Address_scopeid(JNIEnv *env, jobject ia6Obj, int scopeid); +extern int getInet6Address_ipaddress(JNIEnv *env, jobject ia6Obj, char *dest); +extern int setInet6Address_ipaddress(JNIEnv *env, jobject ia6Obj, char *address); + extern void setInetAddress_addr(JNIEnv *env, jobject iaObj, int address); extern void setInetAddress_family(JNIEnv *env, jobject iaObj, int family); extern void setInetAddress_hostName(JNIEnv *env, jobject iaObj, jobject h); @@ -93,12 +106,12 @@ extern jfieldID dp_bufLengthID; /* Inet6Address fields */ extern jclass ia6_class; +extern jfieldID ia6_holder6ID; extern jfieldID ia6_ipaddressID; extern jfieldID ia6_scopeidID; extern jfieldID ia6_cachedscopeidID; extern jfieldID ia6_scopeidsetID; extern jfieldID ia6_scopeifnameID; -extern jfieldID ia6_scopeifnamesetID; extern jmethodID ia6_ctrID; /************************************************************************ diff --git a/jdk/src/solaris/native/java/net/Inet6AddressImpl.c b/jdk/src/solaris/native/java/net/Inet6AddressImpl.c index 4fc64867f8b..694826f3aba 100644 --- a/jdk/src/solaris/native/java/net/Inet6AddressImpl.c +++ b/jdk/src/solaris/native/java/net/Inet6AddressImpl.c @@ -120,7 +120,6 @@ static jclass ni_ia4cls; static jclass ni_ia6cls; static jmethodID ni_ia4ctrID; static jmethodID ni_ia6ctrID; -static jfieldID ni_ia6ipaddressID; static int initialized = 0; /* @@ -156,7 +155,6 @@ Java_java_net_Inet6AddressImpl_lookupAllHostAddr(JNIEnv *env, jobject this, ni_ia6cls = (*env)->NewGlobalRef(env, ni_ia6cls); ni_ia4ctrID = (*env)->GetMethodID(env, ni_ia4cls, "", "()V"); ni_ia6ctrID = (*env)->GetMethodID(env, ni_ia6cls, "", "()V"); - ni_ia6ipaddressID = (*env)->GetFieldID(env, ni_ia6cls, "ipaddress", "[B"); initialized = 1; } @@ -303,6 +301,7 @@ Java_java_net_Inet6AddressImpl_lookupAllHostAddr(JNIEnv *env, jobject this, } while (iterator != NULL) { + int ret1; if (iterator->ai_family == AF_INET) { jobject iaObj = (*env)->NewObject(env, ni_ia4cls, ni_ia4ctrID); if (IS_NULL(iaObj)) { @@ -315,26 +314,22 @@ Java_java_net_Inet6AddressImpl_lookupAllHostAddr(JNIEnv *env, jobject this, inetIndex++; } else if (iterator->ai_family == AF_INET6) { jint scope = 0; - jbyteArray ipaddress; jobject iaObj = (*env)->NewObject(env, ni_ia6cls, ni_ia6ctrID); if (IS_NULL(iaObj)) { ret = NULL; goto cleanupAndReturn; } - ipaddress = (*env)->NewByteArray(env, 16); - if (IS_NULL(ipaddress)) { + ret1 = setInet6Address_ipaddress(env, iaObj, (char *)&(((struct sockaddr_in6*)iterator->ai_addr)->sin6_addr)); + if (!ret1) { ret = NULL; goto cleanupAndReturn; } - (*env)->SetByteArrayRegion(env, ipaddress, 0, 16, - (jbyte *)&(((struct sockaddr_in6*)iterator->ai_addr)->sin6_addr)); + scope = ((struct sockaddr_in6*)iterator->ai_addr)->sin6_scope_id; if (scope != 0) { /* zero is default value, no need to set */ - (*env)->SetIntField(env, iaObj, ia6_scopeidID, scope); - (*env)->SetBooleanField(env, iaObj, ia6_scopeidsetID, JNI_TRUE); + setInet6Address_scopeid(env, iaObj, scope); } - (*env)->SetObjectField(env, iaObj, ni_ia6ipaddressID, ipaddress); setInetAddress_hostName(env, iaObj, host); (*env)->SetObjectArrayElement(env, ret, inet6Index, iaObj); inet6Index++; diff --git a/jdk/src/solaris/native/java/net/NetworkInterface.c b/jdk/src/solaris/native/java/net/NetworkInterface.c index 68633db5a18..1c999442168 100644 --- a/jdk/src/solaris/native/java/net/NetworkInterface.c +++ b/jdk/src/solaris/native/java/net/NetworkInterface.c @@ -118,7 +118,6 @@ static jclass ni_ibcls; static jmethodID ni_ia4ctrID; static jmethodID ni_ia6ctrID; static jmethodID ni_ibctrID; -static jfieldID ni_ia6ipaddressID; static jfieldID ni_ibaddressID; static jfieldID ni_ib4broadcastID; static jfieldID ni_ib4maskID; @@ -193,7 +192,6 @@ Java_java_net_NetworkInterface_init(JNIEnv *env, jclass cls) { ni_ia4ctrID = (*env)->GetMethodID(env, ni_ia4cls, "", "()V"); ni_ia6ctrID = (*env)->GetMethodID(env, ni_ia6cls, "", "()V"); ni_ibctrID = (*env)->GetMethodID(env, ni_ibcls, "", "()V"); - ni_ia6ipaddressID = (*env)->GetFieldID(env, ni_ia6cls, "ipaddress", "[B"); ni_ibaddressID = (*env)->GetFieldID(env, ni_ibcls, "address", "Ljava/net/InetAddress;"); ni_ib4broadcastID = (*env)->GetFieldID(env, ni_ibcls, "broadcast", "Ljava/net/Inet4Address;"); ni_ib4maskID = (*env)->GetFieldID(env, ni_ibcls, "maskLength", "S"); @@ -332,11 +330,9 @@ JNIEXPORT jobject JNICALL Java_java_net_NetworkInterface_getByInetAddress0 #ifdef AF_INET6 if (family == AF_INET6) { jbyte *bytes = (jbyte *)&(((struct sockaddr_in6*)addrP->addr)->sin6_addr); - jbyteArray ipaddress = (*env)->GetObjectField(env, iaObj, ni_ia6ipaddressID); jbyte caddr[16]; int i; - - (*env)->GetByteArrayRegion(env, ipaddress, 0, 16, caddr); + getInet6Address_ipaddress(env, iaObj, (char *)caddr); i = 0; while (i < 16) { if (caddr[i] != bytes[i]) { @@ -670,21 +666,17 @@ jobject createNetworkInterface(JNIEnv *env, netif *ifs) { int scope=0; iaObj = (*env)->NewObject(env, ni_ia6cls, ni_ia6ctrID); if (iaObj) { - jbyteArray ipaddress = (*env)->NewByteArray(env, 16); - if (ipaddress == NULL) { + int ret = setInet6Address_ipaddress(env, iaObj, (char *)&(((struct sockaddr_in6*)addrP->addr)->sin6_addr)); + if (ret == JNI_FALSE) { return NULL; } - (*env)->SetByteArrayRegion(env, ipaddress, 0, 16, - (jbyte *)&(((struct sockaddr_in6*)addrP->addr)->sin6_addr)); scope = ((struct sockaddr_in6*)addrP->addr)->sin6_scope_id; if (scope != 0) { /* zero is default value, no need to set */ - (*env)->SetIntField(env, iaObj, ia6_scopeidID, scope); - (*env)->SetBooleanField(env, iaObj, ia6_scopeidsetID, JNI_TRUE); - (*env)->SetObjectField(env, iaObj, ia6_scopeifnameID, netifObj); + setInet6Address_scopeid(env, iaObj, scope); + setInet6Address_scopeifname(env, iaObj, netifObj); } - (*env)->SetObjectField(env, iaObj, ni_ia6ipaddressID, ipaddress); } ibObj = (*env)->NewObject(env, ni_ibcls, ni_ibctrID); if (ibObj) { diff --git a/jdk/src/solaris/native/java/net/PlainDatagramSocketImpl.c b/jdk/src/solaris/native/java/net/PlainDatagramSocketImpl.c index 981bf534a66..09f8e5d0c61 100644 --- a/jdk/src/solaris/native/java/net/PlainDatagramSocketImpl.c +++ b/jdk/src/solaris/native/java/net/PlainDatagramSocketImpl.c @@ -2148,8 +2148,7 @@ static void mcast_join_leave(JNIEnv *env, jobject this, caddr[14] = ((address >> 8) & 0xff); caddr[15] = (address & 0xff); } else { - ipaddress = (*env)->GetObjectField(env, iaObj, ia6_ipaddressID); - (*env)->GetByteArrayRegion(env, ipaddress, 0, 16, caddr); + getInet6Address_ipaddress(env, iaObj, caddr); } memcpy((void *)&(mname6.ipv6mr_multiaddr), caddr, sizeof(struct in6_addr)); diff --git a/jdk/src/solaris/native/java/net/net_util_md.c b/jdk/src/solaris/native/java/net/net_util_md.c index 004b6aa5d92..d7ebbd5a7c9 100644 --- a/jdk/src/solaris/native/java/net/net_util_md.c +++ b/jdk/src/solaris/native/java/net/net_util_md.c @@ -782,7 +782,6 @@ NET_InetAddressToSockaddr(JNIEnv *env, jobject iaObj, int port, struct sockaddr /* needs work. 1. family 2. clean up him6 etc deallocate memory */ if (ipv6_available() && !(family == IPv4 && v4MappedAddress == JNI_FALSE)) { struct sockaddr_in6 *him6 = (struct sockaddr_in6 *)him; - jbyteArray ipaddress; jbyte caddr[16]; jint address; @@ -803,8 +802,7 @@ NET_InetAddressToSockaddr(JNIEnv *env, jobject iaObj, int port, struct sockaddr caddr[15] = (address & 0xff); } } else { - ipaddress = (*env)->GetObjectField(env, iaObj, ia6_ipaddressID); - (*env)->GetByteArrayRegion(env, ipaddress, 0, 16, caddr); + getInet6Address_ipaddress(env, iaObj, (char *)caddr); } memset((char *)him6, 0, sizeof(struct sockaddr_in6)); him6->sin6_port = htons(port); @@ -840,7 +838,7 @@ NET_InetAddressToSockaddr(JNIEnv *env, jobject iaObj, int port, struct sockaddr */ if (!cached_scope_id) { if (ia6_scopeidID) { - scope_id = (int)(*env)->GetIntField(env,iaObj,ia6_scopeidID); + scope_id = getInet6Address_scopeid(env, iaObj); } if (scope_id != 0) { /* check user-specified value for loopback case @@ -884,7 +882,7 @@ NET_InetAddressToSockaddr(JNIEnv *env, jobject iaObj, int port, struct sockaddr if (family != IPv4) { if (ia6_scopeidID) { - him6->sin6_scope_id = (int)(*env)->GetIntField(env, iaObj, ia6_scopeidID); + him6->sin6_scope_id = getInet6Address_scopeid(env, iaObj); } } #endif diff --git a/jdk/src/windows/native/java/net/Inet6AddressImpl.c b/jdk/src/windows/native/java/net/Inet6AddressImpl.c index 6f46d7eb642..c124f91f4d5 100644 --- a/jdk/src/windows/native/java/net/Inet6AddressImpl.c +++ b/jdk/src/windows/native/java/net/Inet6AddressImpl.c @@ -77,7 +77,6 @@ static jclass ni_ia4cls; static jclass ni_ia6cls; static jmethodID ni_ia4ctrID; static jmethodID ni_ia6ctrID; -static jfieldID ni_ia6ipaddressID; static int initialized = 0; JNIEXPORT jobjectArray JNICALL @@ -101,7 +100,6 @@ Java_java_net_Inet6AddressImpl_lookupAllHostAddr(JNIEnv *env, jobject this, ni_ia6cls = (*env)->NewGlobalRef(env, ni_ia6cls); ni_ia4ctrID = (*env)->GetMethodID(env, ni_ia4cls, "", "()V"); ni_ia6ctrID = (*env)->GetMethodID(env, ni_ia6cls, "", "()V"); - ni_ia6ipaddressID = (*env)->GetFieldID(env, ni_ia6cls, "ipaddress", "[B"); initialized = 1; } if (IS_NULL(host)) { @@ -242,26 +240,22 @@ Java_java_net_Inet6AddressImpl_lookupAllHostAddr(JNIEnv *env, jobject this, (*env)->SetObjectArrayElement(env, ret, inetIndex, iaObj); inetIndex ++; } else if (iterator->ai_family == AF_INET6) { - jint scope = 0; - jbyteArray ipaddress; + jint scope = 0, ret1; jobject iaObj = (*env)->NewObject(env, ni_ia6cls, ni_ia6ctrID); if (IS_NULL(iaObj)) { ret = NULL; goto cleanupAndReturn; } - ipaddress = (*env)->NewByteArray(env, 16); - if (IS_NULL(ipaddress)) { + ret1 = setInet6Address_ipaddress(env, iaObj, (jbyte *)&(((struct sockaddr_in6*)iterator->ai_addr)->sin6_addr)); + + if (ret1 == JNI_FALSE) { ret = NULL; goto cleanupAndReturn; } - (*env)->SetByteArrayRegion(env, ipaddress, 0, 16, - (jbyte *)&(((struct sockaddr_in6*)iterator->ai_addr)->sin6_addr)); scope = ((struct sockaddr_in6*)iterator->ai_addr)->sin6_scope_id; if (scope != 0) { /* zero is default value, no need to set */ - (*env)->SetIntField(env, iaObj, ia6_scopeidID, scope); - (*env)->SetBooleanField(env, iaObj, ia6_scopeidsetID, JNI_TRUE); + setInet6Address_scopeid(env, iaObj, scope); } - (*env)->SetObjectField(env, iaObj, ni_ia6ipaddressID, ipaddress); setInetAddress_hostName(env, iaObj, host); (*env)->SetObjectArrayElement(env, ret, inet6Index, iaObj); inet6Index ++; diff --git a/jdk/src/windows/native/java/net/NetworkInterface.c b/jdk/src/windows/native/java/net/NetworkInterface.c index c548930a913..edcccd4ae4c 100644 --- a/jdk/src/windows/native/java/net/NetworkInterface.c +++ b/jdk/src/windows/native/java/net/NetworkInterface.c @@ -72,8 +72,6 @@ jmethodID ni_ia4Ctor; /* Inet4Address() */ jclass ni_ia6cls; /* Inet6Address */ jmethodID ni_ia6ctrID; /* Inet6Address() */ -jfieldID ni_ia6ipaddressID; -jfieldID ni_ia6ipaddressID; jclass ni_ibcls; /* InterfaceAddress */ jmethodID ni_ibctrID; /* InterfaceAddress() */ @@ -520,7 +518,6 @@ Java_java_net_NetworkInterface_init(JNIEnv *env, jclass cls) ni_ia6cls = (*env)->FindClass(env, "java/net/Inet6Address"); ni_ia6cls = (*env)->NewGlobalRef(env, ni_ia6cls); ni_ia6ctrID = (*env)->GetMethodID(env, ni_ia6cls, "", "()V"); - ni_ia6ipaddressID = (*env)->GetFieldID(env, ni_ia6cls, "ipaddress", "[B"); ni_ibcls = (*env)->FindClass(env, "java/net/InterfaceAddress"); ni_ibcls = (*env)->NewGlobalRef(env, ni_ibcls); @@ -621,19 +618,16 @@ jobject createNetworkInterface int scope; iaObj = (*env)->NewObject(env, ni_ia6cls, ni_ia6ctrID); if (iaObj) { - jbyteArray ipaddress = (*env)->NewByteArray(env, 16); - if (ipaddress == NULL) { + int ret = setInet6Address_ipaddress(env, iaObj, (jbyte *)&(addrs->addr.him6.sin6_addr.s6_addr)); + if (ret == JNI_FALSE) { return NULL; } - (*env)->SetByteArrayRegion(env, ipaddress, 0, 16, - (jbyte *)&(addrs->addr.him6.sin6_addr.s6_addr)); + scope = addrs->addr.him6.sin6_scope_id; if (scope != 0) { /* zero is default value, no need to set */ - (*env)->SetIntField(env, iaObj, ia6_scopeidID, scope); - (*env)->SetBooleanField(env, iaObj, ia6_scopeidsetID, JNI_TRUE); - (*env)->SetObjectField(env, iaObj, ia6_scopeifnameID, netifObj); + setInet6Address_scopeid(env, iaObj, scope); + setInet6Address_scopeifname(env, iaObj, netifObj); } - (*env)->SetObjectField(env, iaObj, ni_ia6ipaddressID, ipaddress); ibObj = (*env)->NewObject(env, ni_ibcls, ni_ibctrID); if (ibObj == NULL) { free_netaddr(netaddrP); diff --git a/jdk/src/windows/native/java/net/NetworkInterface_winXP.c b/jdk/src/windows/native/java/net/NetworkInterface_winXP.c index 1078d826afa..67374a02583 100644 --- a/jdk/src/windows/native/java/net/NetworkInterface_winXP.c +++ b/jdk/src/windows/native/java/net/NetworkInterface_winXP.c @@ -544,19 +544,15 @@ static jobject createNetworkInterfaceXP(JNIEnv *env, netif *ifs) int scope; iaObj = (*env)->NewObject(env, ni_ia6cls, ni_ia6ctrID); if (iaObj) { - jbyteArray ipaddress = (*env)->NewByteArray(env, 16); - if (ipaddress == NULL) { + int ret = setInet6Address_ipaddress(env, iaObj, (jbyte *)&(addrs->addr.him6.sin6_addr.s6_addr)); + if (ret == JNI_FALSE) { return NULL; } - (*env)->SetByteArrayRegion(env, ipaddress, 0, 16, - (jbyte *)&(addrs->addr.him6.sin6_addr.s6_addr)); scope = addrs->addr.him6.sin6_scope_id; if (scope != 0) { /* zero is default value, no need to set */ - (*env)->SetIntField(env, iaObj, ia6_scopeidID, scope); - (*env)->SetBooleanField(env, iaObj, ia6_scopeidsetID, JNI_TRUE); - (*env)->SetObjectField(env, iaObj, ia6_scopeifnameID, netifObj); + setInet6Address_scopeid(env, iaObj, scope); + setInet6Address_scopeifname(env, iaObj, netifObj); } - (*env)->SetObjectField(env, iaObj, ni_ia6ipaddressID, ipaddress); ibObj = (*env)->NewObject(env, ni_ibcls, ni_ibctrID); if (ibObj == NULL) { free_netaddr(netaddrP); diff --git a/jdk/src/windows/native/java/net/TwoStacksPlainSocketImpl.c b/jdk/src/windows/native/java/net/TwoStacksPlainSocketImpl.c index 6823ddc7c7c..f535073df38 100644 --- a/jdk/src/windows/native/java/net/TwoStacksPlainSocketImpl.c +++ b/jdk/src/windows/native/java/net/TwoStacksPlainSocketImpl.c @@ -728,7 +728,6 @@ Java_java_net_TwoStacksPlainSocketImpl_socketAccept(JNIEnv *env, jobject this, setInetAddress_family(env, socketAddressObj, IPv4); (*env)->SetObjectField(env, socket, psi_addressID, socketAddressObj); } else { - jbyteArray addr; /* AF_INET6 -> Inet6Address */ if (inet6Cls == 0) { jclass c = (*env)->FindClass(env, "java/net/Inet6Address"); @@ -751,14 +750,10 @@ Java_java_net_TwoStacksPlainSocketImpl_socketAccept(JNIEnv *env, jobject this, NET_SocketClose(fd); return; } - addr = (*env)->GetObjectField (env, socketAddressObj, ia6_ipaddressID); - (*env)->SetByteArrayRegion (env, addr, 0, 16, (const char *)&him.him6.sin6_addr); + setInet6Address_ipaddress(env, socketAddressObj, (const char *)&him.him6.sin6_addr); setInetAddress_family(env, socketAddressObj, IPv6); - scope = him.him6.sin6_scope_id; - (*env)->SetIntField(env, socketAddressObj, ia6_scopeidID, scope); - if(scope>0) { - (*env)->SetBooleanField(env, socketAddressObj, ia6_scopeidsetID, JNI_TRUE); - } + setInet6Address_scopeid(env, socketAddressObj, him.him6.sin6_scope_id); + } /* fields common to AF_INET and AF_INET6 */ diff --git a/jdk/src/windows/native/java/net/net_util_md.c b/jdk/src/windows/native/java/net/net_util_md.c index 4e5cb50b0bc..6ddb2bcfd78 100644 --- a/jdk/src/windows/native/java/net/net_util_md.c +++ b/jdk/src/windows/native/java/net/net_util_md.c @@ -851,7 +851,6 @@ NET_InetAddressToSockaddr(JNIEnv *env, jobject iaObj, int port, struct sockaddr family = (iafam == IPv4)? AF_INET : AF_INET6; if (ipv6_available() && !(family == AF_INET && v4MappedAddress == JNI_FALSE)) { struct SOCKADDR_IN6 *him6 = (struct SOCKADDR_IN6 *)him; - jbyteArray ipaddress; jbyte caddr[16]; jint address, scopeid = 0; jint cached_scope_id = 0; @@ -872,10 +871,9 @@ NET_InetAddressToSockaddr(JNIEnv *env, jobject iaObj, int port, struct sockaddr caddr[15] = (address & 0xff); } } else { - ipaddress = (*env)->GetObjectField(env, iaObj, ia6_ipaddressID); - scopeid = (jint)(*env)->GetIntField(env, iaObj, ia6_scopeidID); + getInet6Address_ipaddress(env, iaObj, (char *)caddr); + scopeid = getInet6Address_scopeid(env, iaObj); cached_scope_id = (jint)(*env)->GetIntField(env, iaObj, ia6_cachedscopeidID); - (*env)->GetByteArrayRegion(env, ipaddress, 0, 16, caddr); } memset((char *)him6, 0, sizeof(struct SOCKADDR_IN6)); diff --git a/jdk/test/java/net/Inet6Address/serialize/Serialize.java b/jdk/test/java/net/Inet6Address/serialize/Serialize.java index c563c8b115a..f7c6fe735fb 100644 --- a/jdk/test/java/net/Inet6Address/serialize/Serialize.java +++ b/jdk/test/java/net/Inet6Address/serialize/Serialize.java @@ -94,7 +94,26 @@ public class Serialize { } finally { ois.close(); } - System.out.println(nobj); + + nobj = (Inet6Address)InetAddress.getByAddress("foo.com", new byte[] { + (byte)0xfe,(byte)0x80,(byte)0,(byte)0,(byte)0,(byte)0,(byte)0,(byte)0, + (byte)0,(byte)0,(byte)0,(byte)0,(byte)0,(byte)0,(byte)0,(byte)1 + }); + if (!test1(nobj, addr1)) { + throw new RuntimeException("failed with " + nobj.toString()); + } + nobj = (Inet6Address)InetAddress.getByAddress("x.bar.com", new byte[] { + (byte)0xfe,(byte)0xC0,(byte)0,(byte)0,(byte)0,(byte)0,(byte)0,(byte)0, + (byte)0,(byte)0,(byte)0,(byte)0,(byte)0,(byte)0,(byte)0,(byte)1 + }); + if (!test1(nobj, addr2)) { + throw new RuntimeException("failed with " + nobj.toString()); + } + nobj = (Inet6Address)InetAddress.getByName("::1"); + if (!test1(nobj, addr3)) { + throw new RuntimeException("failed with " + nobj.toString()); + } + System.out.println("All tests passed"); } @@ -113,4 +132,162 @@ public class Serialize { return false; } } - } + + static boolean test1 (Inet6Address obj, byte[] buf) throws Exception { + ObjectInputStream ois = new ObjectInputStream(new ByteArrayInputStream(buf)); + Inet6Address nobj = (Inet6Address) ois.readObject(); + ois.close(); + + if (nobj.equals(obj)) { + return true; + } else { + return false; + } + } + + // Inet6Address instances serialized with JDK 6 + + static byte[] addr1 = { + (byte)0xac,(byte)0xed,(byte)0x00,(byte)0x05,(byte)0x73,(byte)0x72, + (byte)0x00,(byte)0x15,(byte)0x6a,(byte)0x61,(byte)0x76,(byte)0x61, + (byte)0x2e,(byte)0x6e,(byte)0x65,(byte)0x74,(byte)0x2e,(byte)0x49, + (byte)0x6e,(byte)0x65,(byte)0x74,(byte)0x36,(byte)0x41,(byte)0x64, + (byte)0x64,(byte)0x72,(byte)0x65,(byte)0x73,(byte)0x73,(byte)0x5f, + (byte)0x7c,(byte)0x20,(byte)0x81,(byte)0x52,(byte)0x2c,(byte)0x80, + (byte)0x21,(byte)0x03,(byte)0x00,(byte)0x05,(byte)0x49,(byte)0x00, + (byte)0x08,(byte)0x73,(byte)0x63,(byte)0x6f,(byte)0x70,(byte)0x65, + (byte)0x5f,(byte)0x69,(byte)0x64,(byte)0x5a,(byte)0x00,(byte)0x0c, + (byte)0x73,(byte)0x63,(byte)0x6f,(byte)0x70,(byte)0x65,(byte)0x5f, + (byte)0x69,(byte)0x64,(byte)0x5f,(byte)0x73,(byte)0x65,(byte)0x74, + (byte)0x5a,(byte)0x00,(byte)0x10,(byte)0x73,(byte)0x63,(byte)0x6f, + (byte)0x70,(byte)0x65,(byte)0x5f,(byte)0x69,(byte)0x66,(byte)0x6e, + (byte)0x61,(byte)0x6d,(byte)0x65,(byte)0x5f,(byte)0x73,(byte)0x65, + (byte)0x74,(byte)0x4c,(byte)0x00,(byte)0x06,(byte)0x69,(byte)0x66, + (byte)0x6e,(byte)0x61,(byte)0x6d,(byte)0x65,(byte)0x74,(byte)0x00, + (byte)0x12,(byte)0x4c,(byte)0x6a,(byte)0x61,(byte)0x76,(byte)0x61, + (byte)0x2f,(byte)0x6c,(byte)0x61,(byte)0x6e,(byte)0x67,(byte)0x2f, + (byte)0x53,(byte)0x74,(byte)0x72,(byte)0x69,(byte)0x6e,(byte)0x67, + (byte)0x3b,(byte)0x5b,(byte)0x00,(byte)0x09,(byte)0x69,(byte)0x70, + (byte)0x61,(byte)0x64,(byte)0x64,(byte)0x72,(byte)0x65,(byte)0x73, + (byte)0x73,(byte)0x74,(byte)0x00,(byte)0x02,(byte)0x5b,(byte)0x42, + (byte)0x78,(byte)0x72,(byte)0x00,(byte)0x14,(byte)0x6a,(byte)0x61, + (byte)0x76,(byte)0x61,(byte)0x2e,(byte)0x6e,(byte)0x65,(byte)0x74, + (byte)0x2e,(byte)0x49,(byte)0x6e,(byte)0x65,(byte)0x74,(byte)0x41, + (byte)0x64,(byte)0x64,(byte)0x72,(byte)0x65,(byte)0x73,(byte)0x73, + (byte)0x2d,(byte)0x9b,(byte)0x57,(byte)0xaf,(byte)0x9f,(byte)0xe3, + (byte)0xeb,(byte)0xdb,(byte)0x02,(byte)0x00,(byte)0x03,(byte)0x49, + (byte)0x00,(byte)0x07,(byte)0x61,(byte)0x64,(byte)0x64,(byte)0x72, + (byte)0x65,(byte)0x73,(byte)0x73,(byte)0x49,(byte)0x00,(byte)0x06, + (byte)0x66,(byte)0x61,(byte)0x6d,(byte)0x69,(byte)0x6c,(byte)0x79, + (byte)0x4c,(byte)0x00,(byte)0x08,(byte)0x68,(byte)0x6f,(byte)0x73, + (byte)0x74,(byte)0x4e,(byte)0x61,(byte)0x6d,(byte)0x65,(byte)0x71, + (byte)0x00,(byte)0x7e,(byte)0x00,(byte)0x01,(byte)0x78,(byte)0x70, + (byte)0x00,(byte)0x00,(byte)0x00,(byte)0x00,(byte)0x00,(byte)0x00, + (byte)0x00,(byte)0x02,(byte)0x74,(byte)0x00,(byte)0x07,(byte)0x66, + (byte)0x6f,(byte)0x6f,(byte)0x2e,(byte)0x63,(byte)0x6f,(byte)0x6d, + (byte)0x00,(byte)0x00,(byte)0x00,(byte)0x00,(byte)0x00,(byte)0x00, + (byte)0x70,(byte)0x75,(byte)0x72,(byte)0x00,(byte)0x02,(byte)0x5b, + (byte)0x42,(byte)0xac,(byte)0xf3,(byte)0x17,(byte)0xf8,(byte)0x06, + (byte)0x08,(byte)0x54,(byte)0xe0,(byte)0x02,(byte)0x00,(byte)0x00, + (byte)0x78,(byte)0x70,(byte)0x00,(byte)0x00,(byte)0x00,(byte)0x10, + (byte)0xfe,(byte)0x80,(byte)0x00,(byte)0x00,(byte)0x00,(byte)0x00, + (byte)0x00,(byte)0x00,(byte)0x00,(byte)0x00,(byte)0x00,(byte)0x00, + (byte)0x00,(byte)0x00,(byte)0x00,(byte)0x01,(byte)0x78 + }; + + static byte[] addr2 = { + (byte)0xac,(byte)0xed,(byte)0x00,(byte)0x05,(byte)0x73,(byte)0x72, + (byte)0x00,(byte)0x15,(byte)0x6a,(byte)0x61,(byte)0x76,(byte)0x61, + (byte)0x2e,(byte)0x6e,(byte)0x65,(byte)0x74,(byte)0x2e,(byte)0x49, + (byte)0x6e,(byte)0x65,(byte)0x74,(byte)0x36,(byte)0x41,(byte)0x64, + (byte)0x64,(byte)0x72,(byte)0x65,(byte)0x73,(byte)0x73,(byte)0x5f, + (byte)0x7c,(byte)0x20,(byte)0x81,(byte)0x52,(byte)0x2c,(byte)0x80, + (byte)0x21,(byte)0x03,(byte)0x00,(byte)0x05,(byte)0x49,(byte)0x00, + (byte)0x08,(byte)0x73,(byte)0x63,(byte)0x6f,(byte)0x70,(byte)0x65, + (byte)0x5f,(byte)0x69,(byte)0x64,(byte)0x5a,(byte)0x00,(byte)0x0c, + (byte)0x73,(byte)0x63,(byte)0x6f,(byte)0x70,(byte)0x65,(byte)0x5f, + (byte)0x69,(byte)0x64,(byte)0x5f,(byte)0x73,(byte)0x65,(byte)0x74, + (byte)0x5a,(byte)0x00,(byte)0x10,(byte)0x73,(byte)0x63,(byte)0x6f, + (byte)0x70,(byte)0x65,(byte)0x5f,(byte)0x69,(byte)0x66,(byte)0x6e, + (byte)0x61,(byte)0x6d,(byte)0x65,(byte)0x5f,(byte)0x73,(byte)0x65, + (byte)0x74,(byte)0x4c,(byte)0x00,(byte)0x06,(byte)0x69,(byte)0x66, + (byte)0x6e,(byte)0x61,(byte)0x6d,(byte)0x65,(byte)0x74,(byte)0x00, + (byte)0x12,(byte)0x4c,(byte)0x6a,(byte)0x61,(byte)0x76,(byte)0x61, + (byte)0x2f,(byte)0x6c,(byte)0x61,(byte)0x6e,(byte)0x67,(byte)0x2f, + (byte)0x53,(byte)0x74,(byte)0x72,(byte)0x69,(byte)0x6e,(byte)0x67, + (byte)0x3b,(byte)0x5b,(byte)0x00,(byte)0x09,(byte)0x69,(byte)0x70, + (byte)0x61,(byte)0x64,(byte)0x64,(byte)0x72,(byte)0x65,(byte)0x73, + (byte)0x73,(byte)0x74,(byte)0x00,(byte)0x02,(byte)0x5b,(byte)0x42, + (byte)0x78,(byte)0x72,(byte)0x00,(byte)0x14,(byte)0x6a,(byte)0x61, + (byte)0x76,(byte)0x61,(byte)0x2e,(byte)0x6e,(byte)0x65,(byte)0x74, + (byte)0x2e,(byte)0x49,(byte)0x6e,(byte)0x65,(byte)0x74,(byte)0x41, + (byte)0x64,(byte)0x64,(byte)0x72,(byte)0x65,(byte)0x73,(byte)0x73, + (byte)0x2d,(byte)0x9b,(byte)0x57,(byte)0xaf,(byte)0x9f,(byte)0xe3, + (byte)0xeb,(byte)0xdb,(byte)0x02,(byte)0x00,(byte)0x03,(byte)0x49, + (byte)0x00,(byte)0x07,(byte)0x61,(byte)0x64,(byte)0x64,(byte)0x72, + (byte)0x65,(byte)0x73,(byte)0x73,(byte)0x49,(byte)0x00,(byte)0x06, + (byte)0x66,(byte)0x61,(byte)0x6d,(byte)0x69,(byte)0x6c,(byte)0x79, + (byte)0x4c,(byte)0x00,(byte)0x08,(byte)0x68,(byte)0x6f,(byte)0x73, + (byte)0x74,(byte)0x4e,(byte)0x61,(byte)0x6d,(byte)0x65,(byte)0x71, + (byte)0x00,(byte)0x7e,(byte)0x00,(byte)0x01,(byte)0x78,(byte)0x70, + (byte)0x00,(byte)0x00,(byte)0x00,(byte)0x00,(byte)0x00,(byte)0x00, + (byte)0x00,(byte)0x02,(byte)0x74,(byte)0x00,(byte)0x09,(byte)0x78, + (byte)0x2e,(byte)0x62,(byte)0x61,(byte)0x72,(byte)0x2e,(byte)0x63, + (byte)0x6f,(byte)0x6d,(byte)0x00,(byte)0x00,(byte)0x00,(byte)0x00, + (byte)0x00,(byte)0x00,(byte)0x70,(byte)0x75,(byte)0x72,(byte)0x00, + (byte)0x02,(byte)0x5b,(byte)0x42,(byte)0xac,(byte)0xf3,(byte)0x17, + (byte)0xf8,(byte)0x06,(byte)0x08,(byte)0x54,(byte)0xe0,(byte)0x02, + (byte)0x00,(byte)0x00,(byte)0x78,(byte)0x70,(byte)0x00,(byte)0x00, + (byte)0x00,(byte)0x10,(byte)0xfe,(byte)0xc0,(byte)0x00,(byte)0x00, + (byte)0x00,(byte)0x00,(byte)0x00,(byte)0x00,(byte)0x00,(byte)0x00, + (byte)0x00,(byte)0x00,(byte)0x00,(byte)0x00,(byte)0x00,(byte)0x01, + (byte)0x78 + }; + + static byte[] addr3 = { + (byte)0xac,(byte)0xed,(byte)0x00,(byte)0x05,(byte)0x73,(byte)0x72, + (byte)0x00,(byte)0x15,(byte)0x6a,(byte)0x61,(byte)0x76,(byte)0x61, + (byte)0x2e,(byte)0x6e,(byte)0x65,(byte)0x74,(byte)0x2e,(byte)0x49, + (byte)0x6e,(byte)0x65,(byte)0x74,(byte)0x36,(byte)0x41,(byte)0x64, + (byte)0x64,(byte)0x72,(byte)0x65,(byte)0x73,(byte)0x73,(byte)0x5f, + (byte)0x7c,(byte)0x20,(byte)0x81,(byte)0x52,(byte)0x2c,(byte)0x80, + (byte)0x21,(byte)0x03,(byte)0x00,(byte)0x05,(byte)0x49,(byte)0x00, + (byte)0x08,(byte)0x73,(byte)0x63,(byte)0x6f,(byte)0x70,(byte)0x65, + (byte)0x5f,(byte)0x69,(byte)0x64,(byte)0x5a,(byte)0x00,(byte)0x0c, + (byte)0x73,(byte)0x63,(byte)0x6f,(byte)0x70,(byte)0x65,(byte)0x5f, + (byte)0x69,(byte)0x64,(byte)0x5f,(byte)0x73,(byte)0x65,(byte)0x74, + (byte)0x5a,(byte)0x00,(byte)0x10,(byte)0x73,(byte)0x63,(byte)0x6f, + (byte)0x70,(byte)0x65,(byte)0x5f,(byte)0x69,(byte)0x66,(byte)0x6e, + (byte)0x61,(byte)0x6d,(byte)0x65,(byte)0x5f,(byte)0x73,(byte)0x65, + (byte)0x74,(byte)0x4c,(byte)0x00,(byte)0x06,(byte)0x69,(byte)0x66, + (byte)0x6e,(byte)0x61,(byte)0x6d,(byte)0x65,(byte)0x74,(byte)0x00, + (byte)0x12,(byte)0x4c,(byte)0x6a,(byte)0x61,(byte)0x76,(byte)0x61, + (byte)0x2f,(byte)0x6c,(byte)0x61,(byte)0x6e,(byte)0x67,(byte)0x2f, + (byte)0x53,(byte)0x74,(byte)0x72,(byte)0x69,(byte)0x6e,(byte)0x67, + (byte)0x3b,(byte)0x5b,(byte)0x00,(byte)0x09,(byte)0x69,(byte)0x70, + (byte)0x61,(byte)0x64,(byte)0x64,(byte)0x72,(byte)0x65,(byte)0x73, + (byte)0x73,(byte)0x74,(byte)0x00,(byte)0x02,(byte)0x5b,(byte)0x42, + (byte)0x78,(byte)0x72,(byte)0x00,(byte)0x14,(byte)0x6a,(byte)0x61, + (byte)0x76,(byte)0x61,(byte)0x2e,(byte)0x6e,(byte)0x65,(byte)0x74, + (byte)0x2e,(byte)0x49,(byte)0x6e,(byte)0x65,(byte)0x74,(byte)0x41, + (byte)0x64,(byte)0x64,(byte)0x72,(byte)0x65,(byte)0x73,(byte)0x73, + (byte)0x2d,(byte)0x9b,(byte)0x57,(byte)0xaf,(byte)0x9f,(byte)0xe3, + (byte)0xeb,(byte)0xdb,(byte)0x02,(byte)0x00,(byte)0x03,(byte)0x49, + (byte)0x00,(byte)0x07,(byte)0x61,(byte)0x64,(byte)0x64,(byte)0x72, + (byte)0x65,(byte)0x73,(byte)0x73,(byte)0x49,(byte)0x00,(byte)0x06, + (byte)0x66,(byte)0x61,(byte)0x6d,(byte)0x69,(byte)0x6c,(byte)0x79, + (byte)0x4c,(byte)0x00,(byte)0x08,(byte)0x68,(byte)0x6f,(byte)0x73, + (byte)0x74,(byte)0x4e,(byte)0x61,(byte)0x6d,(byte)0x65,(byte)0x71, + (byte)0x00,(byte)0x7e,(byte)0x00,(byte)0x01,(byte)0x78,(byte)0x70, + (byte)0x00,(byte)0x00,(byte)0x00,(byte)0x00,(byte)0x00,(byte)0x00, + (byte)0x00,(byte)0x02,(byte)0x70,(byte)0x00,(byte)0x00,(byte)0x00, + (byte)0x00,(byte)0x00,(byte)0x00,(byte)0x70,(byte)0x75,(byte)0x72, + (byte)0x00,(byte)0x02,(byte)0x5b,(byte)0x42,(byte)0xac,(byte)0xf3, + (byte)0x17,(byte)0xf8,(byte)0x06,(byte)0x08,(byte)0x54,(byte)0xe0, + (byte)0x02,(byte)0x00,(byte)0x00,(byte)0x78,(byte)0x70,(byte)0x00, + (byte)0x00,(byte)0x00,(byte)0x10,(byte)0x00,(byte)0x00,(byte)0x00, + (byte)0x00,(byte)0x00,(byte)0x00,(byte)0x00,(byte)0x00,(byte)0x00, + (byte)0x00,(byte)0x00,(byte)0x00,(byte)0x00,(byte)0x00,(byte)0x00, + (byte)0x01,(byte)0x78 + }; +} From 3d9f33759d5c2e1d6e6d8438d8ae78416bfac086 Mon Sep 17 00:00:00 2001 From: Masayoshi Okutsu Date: Fri, 19 Jul 2013 12:14:34 +0900 Subject: [PATCH 026/131] 8001029: Add new date/time capability Reviewed-by: mchung, hawtin --- jdk/src/share/classes/java/util/TimeZone.java | 140 +++++------------- .../util/TimeZone/SetDefaultSecurityTest.java | 67 +++++++++ 2 files changed, 107 insertions(+), 100 deletions(-) create mode 100644 jdk/test/java/util/TimeZone/SetDefaultSecurityTest.java diff --git a/jdk/src/share/classes/java/util/TimeZone.java b/jdk/src/share/classes/java/util/TimeZone.java index ba4abb91f2c..3075bff157a 100644 --- a/jdk/src/share/classes/java/util/TimeZone.java +++ b/jdk/src/share/classes/java/util/TimeZone.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1996, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1996, 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 @@ -39,13 +39,9 @@ package java.util; import java.io.Serializable; -import java.lang.ref.SoftReference; import java.security.AccessController; import java.security.PrivilegedAction; import java.time.ZoneId; -import java.util.concurrent.ConcurrentHashMap; -import sun.misc.JavaAWTAccess; -import sun.misc.SharedSecrets; import sun.security.action.GetPropertyAction; import sun.util.calendar.ZoneInfo; import sun.util.calendar.ZoneInfoFile; @@ -596,11 +592,26 @@ abstract public class TimeZone implements Serializable, Cloneable { private static native String getSystemGMTOffsetID(); /** - * Gets the default TimeZone for this host. - * The source of the default TimeZone - * may vary with implementation. - * @return a default TimeZone. - * @see #setDefault + * Gets the default {@code TimeZone} of the Java virtual machine. If the + * cached default {@code TimeZone} is available, its clone is returned. + * Otherwise, the method takes the following steps to determine the default + * time zone. + * + *

    + *
  • Use the {@code user.timezone} property value as the default + * time zone ID if it's available.
  • + *
  • Detect the platform time zone ID. The source of the + * platform time zone and ID mapping may vary with implementation.
  • + *
  • Use {@code GMT} as the last resort if the given or detected + * time zone ID is unknown.
  • + *
+ * + *

The default {@code TimeZone} created from the ID is cached, + * and its clone is returned. The {@code user.timezone} property + * value is set to the ID upon return. + * + * @return the default {@code TimeZone} + * @see #setDefault(TimeZone) */ public static TimeZone getDefault() { return (TimeZone) getDefaultRef().clone(); @@ -611,14 +622,11 @@ abstract public class TimeZone implements Serializable, Cloneable { * method doesn't create a clone. */ static TimeZone getDefaultRef() { - TimeZone defaultZone = getDefaultInAppContext(); + TimeZone defaultZone = defaultTimeZone; if (defaultZone == null) { - defaultZone = defaultTimeZone; - if (defaultZone == null) { - // Need to initialize the default time zone. - defaultZone = setDefaultZone(); - assert defaultZone != null; - } + // Need to initialize the default time zone. + defaultZone = setDefaultZone(); + assert defaultZone != null; } // Don't clone here. return defaultZone; @@ -676,95 +684,27 @@ abstract public class TimeZone implements Serializable, Cloneable { return tz; } - private static boolean hasPermission() { - boolean hasPermission = true; - SecurityManager sm = System.getSecurityManager(); - if (sm != null) { - try { - sm.checkPermission(new PropertyPermission - ("user.timezone", "write")); - } catch (SecurityException e) { - hasPermission = false; - } - } - return hasPermission; - } - /** - * Sets the TimeZone that is - * returned by the getDefault method. If zone - * is null, reset the default to the value it had originally when the - * VM first started. - * @param zone the new default time zone + * Sets the {@code TimeZone} that is returned by the {@code getDefault} + * method. {@code zone} is cached. If {@code zone} is null, the cached + * default {@code TimeZone} is cleared. This method doesn't change the value + * of the {@code user.timezone} property. + * + * @param zone the new default {@code TimeZone}, or null + * @throws SecurityException if the security manager's {@code checkPermission} + * denies {@code PropertyPermission("user.timezone", + * "write")} * @see #getDefault + * @see PropertyPermission */ public static void setDefault(TimeZone zone) { - if (hasPermission()) { - synchronized (TimeZone.class) { - defaultTimeZone = zone; - setDefaultInAppContext(null); - } - } else { - setDefaultInAppContext(zone); - } - } - - /** - * Returns the default TimeZone in an AppContext if any AppContext - * has ever used. null is returned if any AppContext hasn't been - * used or if the AppContext doesn't have the default TimeZone. - * - * Note that javaAWTAccess may be null if sun.awt.AppContext class hasn't - * been loaded. If so, it implies that AWTSecurityManager is not our - * SecurityManager and we can use a local static variable. - * This works around a build time issue. - */ - private static TimeZone getDefaultInAppContext() { - // JavaAWTAccess provides access implementation-private methods without using reflection. - JavaAWTAccess javaAWTAccess = SharedSecrets.getJavaAWTAccess(); - - if (javaAWTAccess == null) { - return mainAppContextDefault; - } else { - if (!javaAWTAccess.isDisposed()) { - TimeZone tz = (TimeZone) - javaAWTAccess.get(TimeZone.class); - if (tz == null && javaAWTAccess.isMainAppContext()) { - return mainAppContextDefault; - } else { - return tz; - } - } - } - return null; - } - - /** - * Sets the default TimeZone in the AppContext to the given - * tz. null is handled special: do nothing if any AppContext - * hasn't been used, remove the default TimeZone in the - * AppContext otherwise. - * - * Note that javaAWTAccess may be null if sun.awt.AppContext class hasn't - * been loaded. If so, it implies that AWTSecurityManager is not our - * SecurityManager and we can use a local static variable. - * This works around a build time issue. - */ - private static void setDefaultInAppContext(TimeZone tz) { - // JavaAWTAccess provides access implementation-private methods without using reflection. - JavaAWTAccess javaAWTAccess = SharedSecrets.getJavaAWTAccess(); - - if (javaAWTAccess == null) { - mainAppContextDefault = tz; - } else { - if (!javaAWTAccess.isDisposed()) { - javaAWTAccess.put(TimeZone.class, tz); - if (javaAWTAccess.isMainAppContext()) { - mainAppContextDefault = null; - } - } + SecurityManager sm = System.getSecurityManager(); + if (sm != null) { + sm.checkPermission(new PropertyPermission + ("user.timezone", "write")); } + defaultTimeZone = zone; } /** diff --git a/jdk/test/java/util/TimeZone/SetDefaultSecurityTest.java b/jdk/test/java/util/TimeZone/SetDefaultSecurityTest.java new file mode 100644 index 00000000000..e749ffe9420 --- /dev/null +++ b/jdk/test/java/util/TimeZone/SetDefaultSecurityTest.java @@ -0,0 +1,67 @@ +/* + * 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. + */ + +/* + * @test + * @bug 8001029 + * @summary Make sure that TimeZone.setDefault throws a SecurityException if the + * security manager doesn't permit. + * @run main/othervm SetDefaultSecurityTest + */ + +import java.util.SimpleTimeZone; +import java.util.TimeZone; + +public class SetDefaultSecurityTest { + static final TimeZone NOWHERE = new SimpleTimeZone(Integer.MAX_VALUE, "Nowhere"); + + public static void main(String[] args) { + TimeZone defaultZone = TimeZone.getDefault(); + + // Make sure that TimeZone.setDefault works for trusted code + TimeZone.setDefault(NOWHERE); + if (!NOWHERE.equals(TimeZone.getDefault())) { + new RuntimeException("TimeZone.setDefault doesn't work for trusted code."); + } + // Restore defaultZone + TimeZone.setDefault(defaultZone); + if (!defaultZone.equals(TimeZone.getDefault())) { + new RuntimeException("TimeZone.setDefault doesn't restore defaultZone."); + } + + // Install a SecurityManager. + System.setSecurityManager(new SecurityManager()); + try { + TimeZone.setDefault(NOWHERE); + throw new RuntimeException("TimeZone.setDefault doesn't throw a SecurityException."); + } catch (SecurityException se) { + // OK + } + TimeZone tz = TimeZone.getDefault(); + if (!defaultZone.equals(tz)) { + throw new RuntimeException("Default TimeZone changed: " + tz); + } + } +} From 20511649934fed3e8094b69b5375107b965c62a9 Mon Sep 17 00:00:00 2001 From: Shanliang Jiang Date: Fri, 19 Jul 2013 13:35:01 +0200 Subject: [PATCH 027/131] 8014534: Better profiling support Validation of parameters Reviewed-by: sspitsyn, skoivu, mchung --- .../com/sun/demo/jvmti/hprof/Tracker.java | 26 ++++++++++++++++-- jdk/src/share/demo/jvmti/hprof/hprof_class.c | 14 ++++++++-- jdk/src/share/demo/jvmti/hprof/hprof_event.c | 27 ++++++++++++++----- 3 files changed, 57 insertions(+), 10 deletions(-) diff --git a/jdk/src/share/classes/com/sun/demo/jvmti/hprof/Tracker.java b/jdk/src/share/classes/com/sun/demo/jvmti/hprof/Tracker.java index f2e33d72454..96950870be2 100644 --- a/jdk/src/share/classes/com/sun/demo/jvmti/hprof/Tracker.java +++ b/jdk/src/share/classes/com/sun/demo/jvmti/hprof/Tracker.java @@ -53,7 +53,10 @@ public class Tracker { public static void ObjectInit(Object obj) { - if ( engaged != 0 ) { + if ( engaged != 0) { + if (obj == null) { + throw new IllegalArgumentException("Null object."); + } nativeObjectInit(Thread.currentThread(), obj); } } @@ -66,7 +69,10 @@ public class Tracker { public static void NewArray(Object obj) { - if ( engaged != 0 ) { + if ( engaged != 0) { + if (obj == null) { + throw new IllegalArgumentException("Null object."); + } nativeNewArray(Thread.currentThread(), obj); } } @@ -82,6 +88,14 @@ public class Tracker { public static void CallSite(int cnum, int mnum) { if ( engaged != 0 ) { + if (cnum < 0) { + throw new IllegalArgumentException("Negative class index"); + } + + if (mnum < 0) { + throw new IllegalArgumentException("Negative method index"); + } + nativeCallSite(Thread.currentThread(), cnum, mnum); } } @@ -95,6 +109,14 @@ public class Tracker { public static void ReturnSite(int cnum, int mnum) { if ( engaged != 0 ) { + if (cnum < 0) { + throw new IllegalArgumentException("Negative class index"); + } + + if (mnum < 0) { + throw new IllegalArgumentException("Negative method index"); + } + nativeReturnSite(Thread.currentThread(), cnum, mnum); } } diff --git a/jdk/src/share/demo/jvmti/hprof/hprof_class.c b/jdk/src/share/demo/jvmti/hprof/hprof_class.c index f25f53ad934..fb16784476f 100644 --- a/jdk/src/share/demo/jvmti/hprof/hprof_class.c +++ b/jdk/src/share/demo/jvmti/hprof/hprof_class.c @@ -527,7 +527,12 @@ class_get_methodID(JNIEnv *env, ClassIndex index, MethodIndex mnum) jmethodID method; info = get_info(index); - HPROF_ASSERT(mnum < info->method_count); + if (mnum >= info->method_count) { + jclass newExcCls = (*env)->FindClass(env, "java/lang/IllegalArgumentException"); + (*env)->ThrowNew(env, newExcCls, "Illegal mnum"); + + return NULL; + } method = info->method[mnum].method_id; if ( method == NULL ) { char * name; @@ -535,7 +540,12 @@ class_get_methodID(JNIEnv *env, ClassIndex index, MethodIndex mnum) jclass clazz; name = (char *)string_get(info->method[mnum].name_index); - HPROF_ASSERT(name!=NULL); + if (name==NULL) { + jclass newExcCls = (*env)->FindClass(env, "java/lang/IllegalArgumentException"); + (*env)->ThrowNew(env, newExcCls, "Name not found"); + + return NULL; + } sig = (char *)string_get(info->method[mnum].sig_index); HPROF_ASSERT(sig!=NULL); clazz = class_get_class(env, index); diff --git a/jdk/src/share/demo/jvmti/hprof/hprof_event.c b/jdk/src/share/demo/jvmti/hprof/hprof_event.c index 15dd4ddaa76..7892457d3f8 100644 --- a/jdk/src/share/demo/jvmti/hprof/hprof_event.c +++ b/jdk/src/share/demo/jvmti/hprof/hprof_event.c @@ -195,7 +195,12 @@ event_call(JNIEnv *env, jthread thread, ClassIndex cnum, MethodIndex mnum) HPROF_ASSERT(env!=NULL); HPROF_ASSERT(thread!=NULL); - HPROF_ASSERT(cnum!=0 && cnum!=gdata->tracker_cnum); + if (cnum == 0 || cnum == gdata->tracker_cnum) { + jclass newExcCls = (*env)->FindClass(env, "java/lang/IllegalArgumentException"); + (*env)->ThrowNew(env, newExcCls, "Illegal cnum."); + + return; + } /* Prevent recursion into any BCI function for this thread (pstatus). */ if ( tls_get_tracker_status(env, thread, JNI_FALSE, @@ -204,8 +209,10 @@ event_call(JNIEnv *env, jthread thread, ClassIndex cnum, MethodIndex mnum) (*pstatus) = 1; method = class_get_methodID(env, cnum, mnum); - HPROF_ASSERT(method!=NULL); - tls_push_method(tls_index, method); + if (method != NULL) { + tls_push_method(tls_index, method); + } + (*pstatus) = 0; } } @@ -248,7 +255,13 @@ event_return(JNIEnv *env, jthread thread, ClassIndex cnum, MethodIndex mnum) HPROF_ASSERT(env!=NULL); HPROF_ASSERT(thread!=NULL); - HPROF_ASSERT(cnum!=0 && cnum!=gdata->tracker_cnum); + + if (cnum == 0 || cnum == gdata->tracker_cnum) { + jclass newExcCls = (*env)->FindClass(env, "java/lang/IllegalArgumentException"); + (*env)->ThrowNew(env, newExcCls, "Illegal cnum."); + + return; + } /* Prevent recursion into any BCI function for this thread (pstatus). */ if ( tls_get_tracker_status(env, thread, JNI_FALSE, @@ -257,8 +270,10 @@ event_return(JNIEnv *env, jthread thread, ClassIndex cnum, MethodIndex mnum) (*pstatus) = 1; method = class_get_methodID(env, cnum, mnum); - HPROF_ASSERT(method!=NULL); - tls_pop_method(tls_index, thread, method); + if (method != NULL) { + tls_pop_method(tls_index, thread, method); + } + (*pstatus) = 0; } } From bd41c425d2a88e9e78897a43a5e3ea811d453ba4 Mon Sep 17 00:00:00 2001 From: Mandy Chung Date: Mon, 22 Jul 2013 19:41:07 -0700 Subject: [PATCH 028/131] 8017196: Ensure Proxies are handled appropriately Reviewed-by: dfuchs, jrose, jdn, ahgross, chegar --- .../java/lang/invoke/MethodHandles.java | 15 ++++-- .../classes/java/lang/reflect/Proxy.java | 38 +++++++++++---- .../classes/sun/reflect/misc/ReflectUtil.java | 48 +++++++++++++++++++ 3 files changed, 88 insertions(+), 13 deletions(-) diff --git a/jdk/src/share/classes/java/lang/invoke/MethodHandles.java b/jdk/src/share/classes/java/lang/invoke/MethodHandles.java index 3bf24bc8503..1c9a068ed92 100644 --- a/jdk/src/share/classes/java/lang/invoke/MethodHandles.java +++ b/jdk/src/share/classes/java/lang/invoke/MethodHandles.java @@ -433,7 +433,7 @@ public class MethodHandles { Lookup(Class lookupClass) { this(lookupClass, ALL_MODES); // make sure we haven't accidentally picked up a privileged class: - checkUnprivilegedlookupClass(lookupClass); + checkUnprivilegedlookupClass(lookupClass, ALL_MODES); } private Lookup(Class lookupClass, int allowedModes) { @@ -487,7 +487,7 @@ public class MethodHandles { // No permissions. newModes = 0; } - checkUnprivilegedlookupClass(requestedLookupClass); + checkUnprivilegedlookupClass(requestedLookupClass, newModes); return new Lookup(requestedLookupClass, newModes); } @@ -503,10 +503,19 @@ public class MethodHandles { /** Package-private version of lookup which is trusted. */ static final Lookup IMPL_LOOKUP = new Lookup(Object.class, TRUSTED); - private static void checkUnprivilegedlookupClass(Class lookupClass) { + private static void checkUnprivilegedlookupClass(Class lookupClass, int allowedModes) { String name = lookupClass.getName(); if (name.startsWith("java.lang.invoke.")) throw newIllegalArgumentException("illegal lookupClass: "+lookupClass); + + // For caller-sensitive MethodHandles.lookup() + // disallow lookup more restricted packages + if (allowedModes == ALL_MODES && lookupClass.getClassLoader() == null) { + if (name.startsWith("java.") || + (name.startsWith("sun.") && !name.startsWith("sun.invoke."))) { + throw newIllegalArgumentException("illegal lookupClass: " + lookupClass); + } + } } /** diff --git a/jdk/src/share/classes/java/lang/reflect/Proxy.java b/jdk/src/share/classes/java/lang/reflect/Proxy.java index dd5c2ad4336..f2e4eda4e62 100644 --- a/jdk/src/share/classes/java/lang/reflect/Proxy.java +++ b/jdk/src/share/classes/java/lang/reflect/Proxy.java @@ -347,11 +347,11 @@ public class Proxy implements java.io.Serializable { * s.checkPermission} with * {@code RuntimePermission("getClassLoader")} permission * denies access. - *

  • the caller's class loader is not the same as or an - * ancestor of the class loader for the current class and + *
  • for each proxy interface, {@code intf}, + * the caller's class loader is not the same as or an + * ancestor of the class loader for {@code intf} and * invocation of {@link SecurityManager#checkPackageAccess - * s.checkPackageAccess()} denies access to any one of the - * given proxy interfaces.
  • + * s.checkPackageAccess()} denies access to {@code intf}. * * @throws NullPointerException if the {@code interfaces} array @@ -680,11 +680,11 @@ public class Proxy implements java.io.Serializable { * s.checkPermission} with * {@code RuntimePermission("getClassLoader")} permission * denies access; - *
  • the caller's class loader is not the same as or an - * ancestor of the class loader for the current class and + *
  • for each proxy interface, {@code intf}, + * the caller's class loader is not the same as or an + * ancestor of the class loader for {@code intf} and * invocation of {@link SecurityManager#checkPackageAccess - * s.checkPackageAccess()} denies access to any one of the - * given proxy interfaces.
  • + * s.checkPackageAccess()} denies access to {@code intf}; *
  • any of the given proxy interfaces is non-public and the * caller class is not in the same {@linkplain Package runtime package} * as the non-public interface and the invocation of @@ -795,7 +795,14 @@ public class Proxy implements java.io.Serializable { * @return the invocation handler for the proxy instance * @throws IllegalArgumentException if the argument is not a * proxy instance + * @throws SecurityException if a security manager, s, is present + * and the caller's class loader is not the same as or an + * ancestor of the class loader for the invocation handler + * and invocation of {@link SecurityManager#checkPackageAccess + * s.checkPackageAccess()} denies access to the invocation + * handler's class. */ + @CallerSensitive public static InvocationHandler getInvocationHandler(Object proxy) throws IllegalArgumentException { @@ -806,8 +813,19 @@ public class Proxy implements java.io.Serializable { throw new IllegalArgumentException("not a proxy instance"); } - Proxy p = (Proxy) proxy; - return p.h; + final Proxy p = (Proxy) proxy; + final InvocationHandler ih = p.h; + if (System.getSecurityManager() != null) { + Class ihClass = ih.getClass(); + Class caller = Reflection.getCallerClass(); + if (ReflectUtil.needsPackageAccessCheck(caller.getClassLoader(), + ihClass.getClassLoader())) + { + ReflectUtil.checkPackageAccess(ihClass); + } + } + + return ih; } private static native Class defineClass0(ClassLoader loader, String name, diff --git a/jdk/src/share/classes/sun/reflect/misc/ReflectUtil.java b/jdk/src/share/classes/sun/reflect/misc/ReflectUtil.java index efd85fca9cb..1f871e8de02 100644 --- a/jdk/src/share/classes/sun/reflect/misc/ReflectUtil.java +++ b/jdk/src/share/classes/sun/reflect/misc/ReflectUtil.java @@ -26,8 +26,10 @@ package sun.reflect.misc; +import java.lang.reflect.Method; import java.lang.reflect.Modifier; import java.lang.reflect.Proxy; +import java.util.Arrays; import sun.reflect.Reflection; public final class ReflectUtil { @@ -250,4 +252,50 @@ public final class ReflectUtil { String pkg = (i != -1) ? name.substring(0, i) : ""; return Proxy.isProxyClass(cls) && !pkg.equals(PROXY_PACKAGE); } + + /** + * Check if the given method is a method declared in the proxy interface + * implemented by the given proxy instance. + * + * @param proxy a proxy instance + * @param method an interface method dispatched to a InvocationHandler + * + * @throws IllegalArgumentException if the given proxy or method is invalid. + */ + public static void checkProxyMethod(Object proxy, Method method) { + // check if it is a valid proxy instance + if (proxy == null || !Proxy.isProxyClass(proxy.getClass())) { + throw new IllegalArgumentException("Not a Proxy instance"); +} + if (Modifier.isStatic(method.getModifiers())) { + throw new IllegalArgumentException("Can't handle static method"); + } + + Class c = method.getDeclaringClass(); + if (c == Object.class) { + String name = method.getName(); + if (name.equals("hashCode") || name.equals("equals") || name.equals("toString")) { + return; + } + } + + if (isSuperInterface(proxy.getClass(), c)) { + return; + } + + // disallow any method not declared in one of the proxy intefaces + throw new IllegalArgumentException("Can't handle: " + method); + } + + private static boolean isSuperInterface(Class c, Class intf) { + for (Class i : c.getInterfaces()) { + if (i == intf) { + return true; + } + if (isSuperInterface(i, intf)) { + return true; + } + } + return false; + } } From ff1d4ae90507ecf250df4852ffab15b037670f13 Mon Sep 17 00:00:00 2001 From: Sergey Gabdurakhmanov Date: Tue, 23 Jul 2013 09:30:58 +0400 Subject: [PATCH 029/131] 8016357: Update hotspot diagnostic class Add security check to HotSpotDiagnostic.dumpHeap Reviewed-by: fparain, sla, ahgross --- jdk/make/java/management/mapfile-vers | 2 +- jdk/makefiles/mapfiles/libmanagement/mapfile-vers | 2 +- .../com/sun/management/HotSpotDiagnosticMXBean.java | 5 +++++ .../classes/sun/management/HotSpotDiagnostic.java | 12 +++++++++++- .../share/native/sun/management/HotSpotDiagnostic.c | 2 +- 5 files changed, 19 insertions(+), 4 deletions(-) diff --git a/jdk/make/java/management/mapfile-vers b/jdk/make/java/management/mapfile-vers index 63c4fbf03cc..0ea2ab4eb06 100644 --- a/jdk/make/java/management/mapfile-vers +++ b/jdk/make/java/management/mapfile-vers @@ -57,7 +57,7 @@ SUNWprivate_1.1 { Java_sun_management_GcInfoBuilder_fillGcAttributeInfo; Java_sun_management_GcInfoBuilder_getLastGcInfo0; Java_sun_management_GcInfoBuilder_getNumGcExtAttributes; - Java_sun_management_HotSpotDiagnostic_dumpHeap; + Java_sun_management_HotSpotDiagnostic_dumpHeap0; Java_sun_management_HotspotThread_getInternalThreadCount; Java_sun_management_HotspotThread_getInternalThreadTimes0; Java_sun_management_MemoryImpl_getMemoryManagers0; diff --git a/jdk/makefiles/mapfiles/libmanagement/mapfile-vers b/jdk/makefiles/mapfiles/libmanagement/mapfile-vers index b934fe8b748..724f7bb7100 100644 --- a/jdk/makefiles/mapfiles/libmanagement/mapfile-vers +++ b/jdk/makefiles/mapfiles/libmanagement/mapfile-vers @@ -57,7 +57,7 @@ SUNWprivate_1.1 { Java_sun_management_GcInfoBuilder_fillGcAttributeInfo; Java_sun_management_GcInfoBuilder_getLastGcInfo0; Java_sun_management_GcInfoBuilder_getNumGcExtAttributes; - Java_sun_management_HotSpotDiagnostic_dumpHeap; + Java_sun_management_HotSpotDiagnostic_dumpHeap0; Java_sun_management_HotspotThread_getInternalThreadCount; Java_sun_management_HotspotThread_getInternalThreadTimes0; Java_sun_management_MemoryImpl_getMemoryManagers0; diff --git a/jdk/src/share/classes/com/sun/management/HotSpotDiagnosticMXBean.java b/jdk/src/share/classes/com/sun/management/HotSpotDiagnosticMXBean.java index 2fe8835259f..eaf5447b430 100644 --- a/jdk/src/share/classes/com/sun/management/HotSpotDiagnosticMXBean.java +++ b/jdk/src/share/classes/com/sun/management/HotSpotDiagnosticMXBean.java @@ -66,6 +66,11 @@ public interface HotSpotDiagnosticMXBean extends PlatformManagedObject { * cannot be created, opened, or written to. * @throws UnsupportedOperationException if this operation is not supported. * @throws NullPointerException if outputFile is null. + * @throws SecurityException + * If a security manager exists and its {@link + * java.lang.SecurityManager#checkWrite(java.lang.String)} + * method denies write access to the named file + * or the caller does not have ManagmentPermission("control"). */ public void dumpHeap(String outputFile, boolean live) throws java.io.IOException; diff --git a/jdk/src/share/classes/sun/management/HotSpotDiagnostic.java b/jdk/src/share/classes/sun/management/HotSpotDiagnostic.java index a6d3be1640f..7a4bd99f274 100644 --- a/jdk/src/share/classes/sun/management/HotSpotDiagnostic.java +++ b/jdk/src/share/classes/sun/management/HotSpotDiagnostic.java @@ -40,7 +40,17 @@ public class HotSpotDiagnostic implements HotSpotDiagnosticMXBean { public HotSpotDiagnostic() { } - public native void dumpHeap(String outputFile, boolean live) throws IOException; + public void dumpHeap(String outputFile, boolean live) throws IOException { + SecurityManager security = System.getSecurityManager(); + if (security != null) { + security.checkWrite(outputFile); + Util.checkControlAccess(); + } + + dumpHeap0(outputFile, live); + } + + private native void dumpHeap0(String outputFile, boolean live) throws IOException; public List getDiagnosticOptions() { List allFlags = Flag.getAllFlags(); diff --git a/jdk/src/share/native/sun/management/HotSpotDiagnostic.c b/jdk/src/share/native/sun/management/HotSpotDiagnostic.c index 8d48b201109..cfa9e9ab8fa 100644 --- a/jdk/src/share/native/sun/management/HotSpotDiagnostic.c +++ b/jdk/src/share/native/sun/management/HotSpotDiagnostic.c @@ -29,7 +29,7 @@ #include "sun_management_HotSpotDiagnostic.h" JNIEXPORT void JNICALL -Java_sun_management_HotSpotDiagnostic_dumpHeap +Java_sun_management_HotSpotDiagnostic_dumpHeap0 (JNIEnv *env, jobject dummy, jstring outputfile, jboolean live) { jmm_interface->DumpHeap0(env, outputfile, live); From 2fac55ced5c5e37112d3d2ab6ed0f7f88a725838 Mon Sep 17 00:00:00 2001 From: Weijun Wang Date: Wed, 17 Jul 2013 18:46:00 +0800 Subject: [PATCH 030/131] 8020696: Merge problem for KdcComm.java Reviewed-by: chegar --- jdk/src/share/classes/sun/security/krb5/KdcComm.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/jdk/src/share/classes/sun/security/krb5/KdcComm.java b/jdk/src/share/classes/sun/security/krb5/KdcComm.java index ae3b0f098b7..3d50f9569d3 100644 --- a/jdk/src/share/classes/sun/security/krb5/KdcComm.java +++ b/jdk/src/share/classes/sun/security/krb5/KdcComm.java @@ -227,15 +227,15 @@ public final class KdcComm { try { ibuf = sendIfPossible(obuf, tempKdc.next(), useTCP); } catch(Exception first) { + boolean ok = false; while(tempKdc.hasNext()) { try { ibuf = sendIfPossible(obuf, tempKdc.next(), useTCP); - if (ibuf != null) { - return ibuf; - } + ok = true; + break; } catch(Exception ignore) {} } - throw first; + if (!ok) throw first; } if (ibuf == null) { throw new IOException("Cannot get a KDC reply"); From eef8299094596d609d610228ba0775a04f6b6108 Mon Sep 17 00:00:00 2001 From: Jaroslav Bachorik Date: Fri, 19 Jul 2013 16:29:26 +0200 Subject: [PATCH 031/131] 8019584: javax/management/remote/mandatory/loading/MissingClassTest.java failed in nightly against jdk7u45: java.io.InvalidObjectException: Invalid notification: null Reviewed-by: mchung, sjiang, dfuchs, ahgross --- .../management/remote/NotificationResult.java | 17 +++++++++-------- .../management/remote/TargetedNotification.java | 8 ++------ .../mandatory/loading/MissingClassTest.java | 2 +- 3 files changed, 12 insertions(+), 15 deletions(-) diff --git a/jdk/src/share/classes/javax/management/remote/NotificationResult.java b/jdk/src/share/classes/javax/management/remote/NotificationResult.java index 9e7cfaac31d..ff3978d99eb 100644 --- a/jdk/src/share/classes/javax/management/remote/NotificationResult.java +++ b/jdk/src/share/classes/javax/management/remote/NotificationResult.java @@ -132,16 +132,17 @@ public class NotificationResult implements Serializable { } private void readObject(ObjectInputStream ois) throws IOException, ClassNotFoundException { - ObjectInputStream.GetField gf = ois.readFields(); - TargetedNotification[] tNotifs = (TargetedNotification[])gf.get("targetedNotifications", null); - long snStart = gf.get("earliestSequenceNumber", -1L); - long snNext = gf.get("nextSequenceNumber", -1L); + ois.defaultReadObject(); try { - validate(tNotifs, snStart, snNext); + validate( + this.targetedNotifications, + this.earliestSequenceNumber, + this.nextSequenceNumber + ); - this.targetedNotifications = tNotifs.length == 0 ? tNotifs : tNotifs.clone(); - this.earliestSequenceNumber = snStart; - this.nextSequenceNumber = snNext; + this.targetedNotifications = this.targetedNotifications.length == 0 ? + this.targetedNotifications : + this.targetedNotifications.clone(); } catch (IllegalArgumentException e) { throw new InvalidObjectException(e.getMessage()); } diff --git a/jdk/src/share/classes/javax/management/remote/TargetedNotification.java b/jdk/src/share/classes/javax/management/remote/TargetedNotification.java index 03aa0ca6235..cc3d0dcc664 100644 --- a/jdk/src/share/classes/javax/management/remote/TargetedNotification.java +++ b/jdk/src/share/classes/javax/management/remote/TargetedNotification.java @@ -132,13 +132,9 @@ public class TargetedNotification implements Serializable { // } private void readObject(ObjectInputStream ois) throws IOException, ClassNotFoundException { - ObjectInputStream.GetField gf = ois.readFields(); - Notification notification = (Notification)gf.get("notif", null); - Integer listenerId = (Integer)gf.get("id", null); + ois.defaultReadObject(); try { - validate(notification, listenerId); - this.notif = notification; - this.id = listenerId; + validate(this.notif, this.id); } catch (IllegalArgumentException e) { throw new InvalidObjectException(e.getMessage()); } diff --git a/jdk/test/javax/management/remote/mandatory/loading/MissingClassTest.java b/jdk/test/javax/management/remote/mandatory/loading/MissingClassTest.java index e70d0adfe6e..98eead895bf 100644 --- a/jdk/test/javax/management/remote/mandatory/loading/MissingClassTest.java +++ b/jdk/test/javax/management/remote/mandatory/loading/MissingClassTest.java @@ -23,7 +23,7 @@ /* * @test - * @bug 4915825 4921009 4934965 4977469 + * @bug 4915825 4921009 4934965 4977469 8019584 * @summary Tests behavior when client or server gets object of unknown class * @author Eamonn McManus * @run clean MissingClassTest SingleClassLoader From 99860de3cd08c11752b465c31a4257118d70ac28 Mon Sep 17 00:00:00 2001 From: Johnny Chen Date: Wed, 24 Jul 2013 12:03:57 -0700 Subject: [PATCH 032/131] 8020293: JVM crash Reviewed-by: prr, jgodinez --- jdk/src/share/classes/sun/font/GlyphLayout.java | 7 ++++--- jdk/src/share/native/sun/font/layout/SunLayoutEngine.cpp | 4 ++++ 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/jdk/src/share/classes/sun/font/GlyphLayout.java b/jdk/src/share/classes/sun/font/GlyphLayout.java index d29ecf34cb2..f2fc484caa0 100644 --- a/jdk/src/share/classes/sun/font/GlyphLayout.java +++ b/jdk/src/share/classes/sun/font/GlyphLayout.java @@ -468,9 +468,10 @@ public final class GlyphLayout { _gvdata.grow(); } } - if (_gvdata._count < 0) { - break; - } + } + // Break out of the outer for loop if layout fails. + if (_gvdata._count < 0) { + break; } } diff --git a/jdk/src/share/native/sun/font/layout/SunLayoutEngine.cpp b/jdk/src/share/native/sun/font/layout/SunLayoutEngine.cpp index b32f2601b4d..858e3636038 100644 --- a/jdk/src/share/native/sun/font/layout/SunLayoutEngine.cpp +++ b/jdk/src/share/native/sun/font/layout/SunLayoutEngine.cpp @@ -104,6 +104,10 @@ Java_sun_font_SunLayoutEngine_initGVIDs int putGV(JNIEnv* env, jint gmask, jint baseIndex, jobject gvdata, const LayoutEngine* engine, int glyphCount) { int count = env->GetIntField(gvdata, gvdCountFID); + if (count < 0) { + JNU_ThrowInternalError(env, "count negative"); + return 0; + } jarray glyphArray = (jarray)env->GetObjectField(gvdata, gvdGlyphsFID); if (IS_NULL(glyphArray)) { From 7abc885152c1d3036c9aaae323a2b7aff39f282b Mon Sep 17 00:00:00 2001 From: Jaroslav Bachorik Date: Mon, 29 Jul 2013 04:43:41 -0700 Subject: [PATCH 033/131] 8021577: JCK test api/javax_management/jmx_serial/modelmbean/ModelMBeanNotificationInfo/serial/index.html#Input has failed since jdk 7u45 b01 Reviewed-by: alanb, dfuchs, ahgross --- .../classes/javax/management/MBeanNotificationInfo.java | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/jdk/src/share/classes/javax/management/MBeanNotificationInfo.java b/jdk/src/share/classes/javax/management/MBeanNotificationInfo.java index dfa4ab1f8ff..e3b4aba1252 100644 --- a/jdk/src/share/classes/javax/management/MBeanNotificationInfo.java +++ b/jdk/src/share/classes/javax/management/MBeanNotificationInfo.java @@ -210,11 +210,6 @@ public class MBeanNotificationInfo extends MBeanFeatureInfo implements Cloneable ObjectInputStream.GetField gf = ois.readFields(); String[] t = (String[])gf.get("types", null); - if (t == null) { - throw new InvalidObjectException("Trying to deserialize an invalid " + - "instance of " + MBeanNotificationInfo.class + - "[types=null]"); - } - types = t.length == 0 ? t : t.clone(); + types = (t != null && t.length != 0) ? t.clone() : NO_TYPES; } } From adf52d0164028f9a7ceedeb0afc633f4f0bcd0fb Mon Sep 17 00:00:00 2001 From: Naoto Sato Date: Thu, 1 Aug 2013 14:09:39 -0700 Subject: [PATCH 034/131] 8021286: Improve MacOS resourcing Reviewed-by: okutsu --- jdk/make/sun/awt/FILES_c_macosx.gmk | 28 ----- jdk/make/sun/awt/FILES_export_macosx.gmk | 29 ----- jdk/make/sun/awt/Makefile | 2 - jdk/makefiles/CompileNativeLibraries.gmk | 4 - .../com/apple/laf/AquaLookAndFeel.java | 4 +- .../apple/resources/MacOSXResourceBundle.java | 110 ------------------ .../apple/resources/MacOSXResourceBundle.m | 110 ------------------ 7 files changed, 1 insertion(+), 286 deletions(-) delete mode 100644 jdk/make/sun/awt/FILES_c_macosx.gmk delete mode 100644 jdk/make/sun/awt/FILES_export_macosx.gmk delete mode 100644 jdk/src/macosx/classes/com/apple/resources/MacOSXResourceBundle.java delete mode 100644 jdk/src/macosx/native/com/apple/resources/MacOSXResourceBundle.m diff --git a/jdk/make/sun/awt/FILES_c_macosx.gmk b/jdk/make/sun/awt/FILES_c_macosx.gmk deleted file mode 100644 index d6bef30bb2a..00000000000 --- a/jdk/make/sun/awt/FILES_c_macosx.gmk +++ /dev/null @@ -1,28 +0,0 @@ -# -# Copyright (c) 1995, 2012, 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. -# - -FILES_AWT_objc = \ - $(TARGDIR)MacOSXResourceBundle.m - diff --git a/jdk/make/sun/awt/FILES_export_macosx.gmk b/jdk/make/sun/awt/FILES_export_macosx.gmk deleted file mode 100644 index c7f0e003cb9..00000000000 --- a/jdk/make/sun/awt/FILES_export_macosx.gmk +++ /dev/null @@ -1,29 +0,0 @@ -# -# Copyright (c) 1995, 2012, 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. -# - -# FILES_export definitions for Mac OS X - -FILES_export += \ - com/apple/resources/MacOSXResourceBundle.java diff --git a/jdk/make/sun/awt/Makefile b/jdk/make/sun/awt/Makefile index dc4c250cf74..c45ecb9fe45 100644 --- a/jdk/make/sun/awt/Makefile +++ b/jdk/make/sun/awt/Makefile @@ -145,8 +145,6 @@ ifeq ($(PLATFORM), macosx) # # Files # -include FILES_c_macosx.gmk -include FILES_export_macosx.gmk FILES_objc = $(FILES_AWT_objc) OTHER_LDLIBS = -lmlib_image $(JVMLIB) $(LIBM) \ diff --git a/jdk/makefiles/CompileNativeLibraries.gmk b/jdk/makefiles/CompileNativeLibraries.gmk index 02bf3be808c..fa416032473 100644 --- a/jdk/makefiles/CompileNativeLibraries.gmk +++ b/jdk/makefiles/CompileNativeLibraries.gmk @@ -558,11 +558,7 @@ endif ifeq ($(OPENJDK_TARGET_OS),macosx) LIBAWT_FILES += awt_LoadLibrary.c img_colors.c - LIBAWT_DIRS += $(JDK_TOPDIR)/src/macosx/native/com/apple/resources - LIBAWT_FILES += awt_LoadLibrary.c MacOSXResourceBundle.m LIBAWT_CFLAGS += -F/System/Library/Frameworks/JavaVM.framework/Frameworks - - LIBAWT_MacOSXResourceBundle.m_CFLAGS:=-O0 endif ifeq ($(OPENJDK_TARGET_OS)-$(OPENJDK_TARGET_CPU_ARCH), solaris-sparc) diff --git a/jdk/src/macosx/classes/com/apple/laf/AquaLookAndFeel.java b/jdk/src/macosx/classes/com/apple/laf/AquaLookAndFeel.java index 457b82d36a3..046d693e329 100644 --- a/jdk/src/macosx/classes/com/apple/laf/AquaLookAndFeel.java +++ b/jdk/src/macosx/classes/com/apple/laf/AquaLookAndFeel.java @@ -37,8 +37,6 @@ import javax.swing.plaf.basic.BasicLookAndFeel; import sun.swing.*; import apple.laf.*; -import com.apple.resources.MacOSXResourceBundle; - public class AquaLookAndFeel extends BasicLookAndFeel { static final String sOldPropertyPrefix = "com.apple.macos."; // old prefix for things like 'useScreenMenuBar' static final String sPropertyPrefix = "apple.laf."; // new prefix for things like 'useScreenMenuBar' @@ -252,7 +250,7 @@ public class AquaLookAndFeel extends BasicLookAndFeel { table.setDefaultLocale(Locale.getDefault()); table.addResourceBundle(PKG_PREFIX + "resources.aqua"); try { - final ResourceBundle aquaProperties = MacOSXResourceBundle.getMacResourceBundle(PKG_PREFIX + "resources.aqua"); + final ResourceBundle aquaProperties = ResourceBundle.getBundle(PKG_PREFIX + "resources.aqua"); final Enumeration propertyKeys = aquaProperties.getKeys(); while (propertyKeys.hasMoreElements()) { diff --git a/jdk/src/macosx/classes/com/apple/resources/MacOSXResourceBundle.java b/jdk/src/macosx/classes/com/apple/resources/MacOSXResourceBundle.java deleted file mode 100644 index 143584b0b87..00000000000 --- a/jdk/src/macosx/classes/com/apple/resources/MacOSXResourceBundle.java +++ /dev/null @@ -1,110 +0,0 @@ -/* - * Copyright (c) 2011, 2012, 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.apple.resources; - -import java.security.*; -import java.util.PropertyResourceBundle; -import java.util.ResourceBundle; -import java.io.*; - -public class MacOSXResourceBundle extends PropertyResourceBundle { - MacOSXResourceBundle(InputStream stream) throws IOException { - super(stream); - } - - void setItsParent(ResourceBundle rb) { - setParent(rb); - } - - public static ResourceBundle getMacResourceBundle(String baseJavaBundle) throws Exception { - return getMacResourceBundle(baseJavaBundle, null); - } - - public static ResourceBundle getMacResourceBundle(String baseJavaBundle, String filename) throws Exception { - LoadNativeBundleAction lnba = new LoadNativeBundleAction(baseJavaBundle, filename); - return (ResourceBundle)java.security.AccessController.doPrivileged(lnba); - } -} - -class LoadNativeBundleAction implements PrivilegedExceptionAction { - String mBaseJavaBundle; - String mFilenameOverride; - - LoadNativeBundleAction(String baseJavaBundle, String filenameOverride) { - mBaseJavaBundle = baseJavaBundle; - mFilenameOverride = filenameOverride; - } - - public Object run() { - java.util.ResourceBundle returnValue = null; - MacOSXResourceBundle macOSrb = null; - - // Load the Mac OS X resources. - // Use a base filename if we were given one. Otherwise, we will look for the last piece of the bundle path - // with '.properties' appended. Either way, the native method will take care of the extension. - String filename = mFilenameOverride; - - if (filename == null) { - filename = mBaseJavaBundle.substring(mBaseJavaBundle.lastIndexOf('.') + 1); - } - - File propsFile = null; - String propertyFileName = getPathToBundleFile(filename); - InputStream stream = null; - - try { - propsFile = new File(propertyFileName); - stream = new FileInputStream(propsFile); - stream = new java.io.BufferedInputStream(stream); - macOSrb = new MacOSXResourceBundle(stream); - } catch (Exception e) { - //e.printStackTrace(); - //System.out.println("Failed to create resources from application bundle. Using Java-based resources."); - } finally { - try { - if (stream != null) stream.close(); - stream = null; - } catch (Exception e) { - e.printStackTrace(); - } - } - - returnValue = ResourceBundle.getBundle(mBaseJavaBundle); - - // If we have a platform-specific bundle, make it the parent of the generic bundle, so failures propagate up to the parent. - if (returnValue != null) { - if (macOSrb != null) { - macOSrb.setItsParent(returnValue); - returnValue = macOSrb; - } - } - - return returnValue; - } - - private static native String getPathToBundleFile(String filename); -} - diff --git a/jdk/src/macosx/native/com/apple/resources/MacOSXResourceBundle.m b/jdk/src/macosx/native/com/apple/resources/MacOSXResourceBundle.m deleted file mode 100644 index 0b98d2b0588..00000000000 --- a/jdk/src/macosx/native/com/apple/resources/MacOSXResourceBundle.m +++ /dev/null @@ -1,110 +0,0 @@ -/* - * Copyright (c) 2011, 2012, 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. - */ - -#import -#import -#import - -#ifndef MAXPATHLEN -#define MAXPATHLEN PATH_MAX -#endif - -static jboolean -GetPathFromCurrentBinary(char *buf, jint bufsize) -{ - Dl_info dlinfo; - dladdr((void *)GetPathFromCurrentBinary, &dlinfo); - if (realpath(dlinfo.dli_fname, buf) == NULL) { -// fprintf(stderr, "Error: realpath(`%s') failed.\n", dlinfo.dli_fname); - return JNI_FALSE; - } - - const char *libawt = "lib/libawt.dylib"; - int strLen, libawtLen; - - strLen = strlen(buf); - libawtLen = strlen(libawt); - - if (strLen < libawtLen || - strcmp(buf + strLen - libawtLen, libawt) != 0) { - return JNI_FALSE; - } - - buf[strLen - libawtLen] = '\0'; - - return JNI_TRUE; -} - -#define JAVA_DLL "libjava.dylib" - -static jboolean -GetJREPath(char *buf, jint bufsize) -{ - /* try to get the path from the current binary, if not, bail to the framework */ - if (GetPathFromCurrentBinary(buf, bufsize) == JNI_TRUE) { - /* does the rest of the JRE exist? */ - char libjava[MAXPATHLEN]; - snprintf(libjava, MAXPATHLEN, "%s/lib/" JAVA_DLL, buf); - if (access(libjava, F_OK) == 0) { - return JNI_TRUE; - } - } - - return JNI_FALSE; -} - -static NSString *getRunningJavaBundle() -{ - char path[MAXPATHLEN]; - GetJREPath(path, MAXPATHLEN); - return [[NSString alloc] initWithFormat:@"%@/bundle", [NSString stringWithUTF8String:path]]; -} - -/* - * Class: com_apple_resources_LoadNativeBundleAction - * Method: getPathToBundleFile - * Signature: (Ljava/lang/String)Ljava/lang/String; - */ -JNIEXPORT jstring JNICALL -Java_com_apple_resources_LoadNativeBundleAction_getPathToBundleFile - (JNIEnv *env, jclass klass, jstring filename) -{ - jstring returnVal = NULL; - if (filename == NULL) { - return NULL; - } - -JNF_COCOA_ENTER(env); - NSBundle *javaBundle = [NSBundle bundleWithPath:getRunningJavaBundle()]; - NSString *baseFilename = JNFJavaToNSString(env, filename); - NSString *propertyFilePath = [javaBundle pathForResource:baseFilename ofType:@"properties"]; - - if (propertyFilePath != nil) { - returnVal = JNFNSToJavaString(env, propertyFilePath); - } -JNF_COCOA_EXIT(env); - - return returnVal; -} From 10738dc29803a286a22c0973f85ffaac94ef6b5a Mon Sep 17 00:00:00 2001 From: Sergey Bylokhov Date: Sun, 4 Aug 2013 02:50:02 +0400 Subject: [PATCH 035/131] 8021282: Better recycling of object instances Reviewed-by: art --- .../classes/com/apple/laf/AquaUtils.java | 193 ++++++++++-------- 1 file changed, 104 insertions(+), 89 deletions(-) diff --git a/jdk/src/macosx/classes/com/apple/laf/AquaUtils.java b/jdk/src/macosx/classes/com/apple/laf/AquaUtils.java index 0592da714a2..a5f5501cb35 100644 --- a/jdk/src/macosx/classes/com/apple/laf/AquaUtils.java +++ b/jdk/src/macosx/classes/com/apple/laf/AquaUtils.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -29,6 +29,7 @@ import java.awt.*; import java.awt.image.*; import java.lang.ref.SoftReference; import java.lang.reflect.Method; +import java.security.AccessController; import java.security.PrivilegedAction; import java.util.*; @@ -41,56 +42,68 @@ import sun.awt.AppContext; import sun.lwawt.macosx.CImage; import sun.lwawt.macosx.CImage.Creator; import sun.lwawt.macosx.CPlatformWindow; +import sun.misc.Launcher; +import sun.reflect.misc.ReflectUtil; +import sun.security.action.GetPropertyAction; import sun.swing.SwingUtilities2; import com.apple.laf.AquaImageFactory.SlicedImageControl; -public class AquaUtils { - final static String ANIMATIONS_SYSTEM_PROPERTY = "swing.enableAnimations"; +final class AquaUtils { - /* + private static final String ANIMATIONS_PROPERTY = "swing.enableAnimations"; + + /** + * Suppresses default constructor, ensuring non-instantiability. + */ + private AquaUtils() { + } + + /** * Convenience function for determining ComponentOrientation. Helps us * avoid having Munge directives throughout the code. */ - public static boolean isLeftToRight(final Component c) { + static boolean isLeftToRight(final Component c) { return c.getComponentOrientation().isLeftToRight(); } - public static void enforceComponentOrientation(Component c, ComponentOrientation orientation) { + static void enforceComponentOrientation(final Component c, final ComponentOrientation orientation) { c.setComponentOrientation(orientation); if (c instanceof Container) { - for (Component child : ((Container)c).getComponents()) { + for (final Component child : ((Container)c).getComponents()) { enforceComponentOrientation(child, orientation); } } } - private static CImage.Creator getCImageCreatorInternal() { - return java.security.AccessController.doPrivileged(new PrivilegedAction() { + private static Creator getCImageCreatorInternal() { + return AccessController.doPrivileged(new PrivilegedAction() { + @Override public Creator run() { try { final Method getCreatorMethod = CImage.class.getDeclaredMethod("getCreator", new Class[] {}); getCreatorMethod.setAccessible(true); - return (CImage.Creator)getCreatorMethod.invoke(null, new Object[] {}); - } catch (final Exception e) { + return (Creator)getCreatorMethod.invoke(null, new Object[] {}); + } catch (final Exception ignored) { return null; } } }); } - private static final RecyclableSingleton cImageCreator = new RecyclableSingleton() { + private static final RecyclableSingleton cImageCreator = new RecyclableSingleton() { @Override protected Creator getInstance() { return getCImageCreatorInternal(); } }; - static CImage.Creator getCImageCreator() { + static Creator getCImageCreator() { return cImageCreator.get(); } - protected static Image generateSelectedDarkImage(final Image image) { + static Image generateSelectedDarkImage(final Image image) { final ImageProducer prod = new FilteredImageSource(image.getSource(), new IconImageFilter() { + @Override int getGreyFor(final int gray) { return gray * 75 / 100; } @@ -98,8 +111,9 @@ public class AquaUtils { return Toolkit.getDefaultToolkit().createImage(prod); } - protected static Image generateDisabledImage(final Image image) { + static Image generateDisabledImage(final Image image) { final ImageProducer prod = new FilteredImageSource(image.getSource(), new IconImageFilter() { + @Override int getGreyFor(final int gray) { return 255 - ((255 - gray) * 65 / 100); } @@ -107,19 +121,20 @@ public class AquaUtils { return Toolkit.getDefaultToolkit().createImage(prod); } - protected static Image generateLightenedImage(final Image image, final int percent) { + static Image generateLightenedImage(final Image image, final int percent) { final GrayFilter filter = new GrayFilter(true, percent); final ImageProducer prod = new FilteredImageSource(image.getSource(), filter); return Toolkit.getDefaultToolkit().createImage(prod); } - static abstract class IconImageFilter extends RGBImageFilter { - public IconImageFilter() { + private abstract static class IconImageFilter extends RGBImageFilter { + IconImageFilter() { super(); canFilterIndexColorModel = true; } - public int filterRGB(final int x, final int y, final int rgb) { + @Override + public final int filterRGB(final int x, final int y, final int rgb) { final int red = (rgb >> 16) & 0xff; final int green = (rgb >> 8) & 0xff; final int blue = rgb & 0xff; @@ -135,14 +150,14 @@ public class AquaUtils { return result; } - abstract int getGreyFor(final int gray); + abstract int getGreyFor(int gray); } - public abstract static class RecyclableObject { - protected SoftReference objectRef = null; + abstract static class RecyclableObject { + private SoftReference objectRef; - public T get() { - T referent = null; + T get() { + T referent; if (objectRef != null && (referent = objectRef.get()) != null) return referent; referent = create(); objectRef = new SoftReference(referent); @@ -152,8 +167,8 @@ public class AquaUtils { protected abstract T create(); } - public abstract static class RecyclableSingleton { - public T get() { + abstract static class RecyclableSingleton { + final T get() { final AppContext appContext = AppContext.getAppContext(); SoftReference ref = (SoftReference) appContext.get(this); if (ref != null) { @@ -166,38 +181,36 @@ public class AquaUtils { return object; } - public void reset() { - AppContext appContext = AppContext.getAppContext(); - appContext.remove(this); + void reset() { + AppContext.getAppContext().remove(this); } - protected abstract T getInstance(); + abstract T getInstance(); } - public static class RecyclableSingletonFromDefaultConstructor extends RecyclableSingleton { - protected final Class clazz; + static class RecyclableSingletonFromDefaultConstructor extends RecyclableSingleton { + private final Class clazz; - public RecyclableSingletonFromDefaultConstructor(final Class clazz) { + RecyclableSingletonFromDefaultConstructor(final Class clazz) { this.clazz = clazz; } - protected T getInstance() { + @Override + T getInstance() { try { + ReflectUtil.checkPackageAccess(clazz); return clazz.newInstance(); - } catch (final InstantiationException e) { - e.printStackTrace(); - } catch (final IllegalAccessException e) { - e.printStackTrace(); + } catch (InstantiationException | IllegalAccessException ignored) { } return null; } } - public abstract static class LazyKeyedSingleton { - protected Map refs; + abstract static class LazyKeyedSingleton { + private Map refs; - public V get(final K key) { - if (refs == null) refs = new HashMap(); + V get(final K key) { + if (refs == null) refs = new HashMap<>(); final V cachedValue = refs.get(key); if (cachedValue != null) return cachedValue; @@ -207,44 +220,45 @@ public class AquaUtils { return value; } - protected abstract V getInstance(final K key); + protected abstract V getInstance(K key); } - static final RecyclableSingleton enableAnimations = new RecyclableSingleton() { + private static final RecyclableSingleton enableAnimations = new RecyclableSingleton() { @Override protected Boolean getInstance() { - final String sizeProperty = (String)java.security.AccessController.doPrivileged((PrivilegedAction)new sun.security.action.GetPropertyAction(ANIMATIONS_SYSTEM_PROPERTY)); - return new Boolean(!"false".equals(sizeProperty)); // should be true by default + final String sizeProperty = (String) AccessController.doPrivileged((PrivilegedAction)new GetPropertyAction( + ANIMATIONS_PROPERTY)); + return !"false".equals(sizeProperty); // should be true by default } }; - static boolean animationsEnabled() { + private static boolean animationsEnabled() { return enableAnimations.get(); } - static final int MENU_BLINK_DELAY = 50; // 50ms == 3/60 sec, according to the spec - protected static void blinkMenu(final Selectable selectable) { + private static final int MENU_BLINK_DELAY = 50; // 50ms == 3/60 sec, according to the spec + static void blinkMenu(final Selectable selectable) { if (!animationsEnabled()) return; try { selectable.paintSelected(false); Thread.sleep(MENU_BLINK_DELAY); selectable.paintSelected(true); Thread.sleep(MENU_BLINK_DELAY); - } catch (final InterruptedException e) { } + } catch (final InterruptedException ignored) { } } interface Selectable { - void paintSelected(final boolean selected); + void paintSelected(boolean selected); } interface JComponentPainter { - public void paint(JComponent c, Graphics g, int x, int y, int w, int h); + void paint(JComponent c, Graphics g, int x, int y, int w, int h); } interface Painter { - public void paint(final Graphics g, int x, int y, int w, int h); + void paint(Graphics g, int x, int y, int w, int h); } - public static void paintDropShadowText(final Graphics g, final JComponent c, final Font font, final FontMetrics metrics, final int x, final int y, final int offsetX, final int offsetY, final Color textColor, final Color shadowColor, final String text) { + static void paintDropShadowText(final Graphics g, final JComponent c, final Font font, final FontMetrics metrics, final int x, final int y, final int offsetX, final int offsetY, final Color textColor, final Color shadowColor, final String text) { g.setFont(font); g.setColor(shadowColor); SwingUtilities2.drawString(c, g, text, x + offsetX, y + offsetY + metrics.getAscent()); @@ -252,22 +266,22 @@ public class AquaUtils { SwingUtilities2.drawString(c, g, text, x, y + metrics.getAscent()); } - public static class ShadowBorder implements Border { - final Painter prePainter; - final Painter postPainter; + static class ShadowBorder implements Border { + private final Painter prePainter; + private final Painter postPainter; - final int offsetX; - final int offsetY; - final float distance; - final int blur; - final Insets insets; - final ConvolveOp blurOp; + private final int offsetX; + private final int offsetY; + private final float distance; + private final int blur; + private final Insets insets; + private final ConvolveOp blurOp; - public ShadowBorder(final Painter prePainter, final Painter postPainter, final int offsetX, final int offsetY, final float distance, final float intensity, final int blur) { + ShadowBorder(final Painter prePainter, final Painter postPainter, final int offsetX, final int offsetY, final float distance, final float intensity, final int blur) { this.prePainter = prePainter; this.postPainter = postPainter; this.offsetX = offsetX; this.offsetY = offsetY; this.distance = distance; this.blur = blur; final int halfBlur = blur / 2; - this.insets = new Insets(halfBlur - offsetY, halfBlur - offsetX, halfBlur + offsetY, halfBlur + offsetX); + insets = new Insets(halfBlur - offsetY, halfBlur - offsetX, halfBlur + offsetY, halfBlur + offsetX); final float blurry = intensity / (blur * blur); final float[] blurKernel = new float[blur * blur]; @@ -275,14 +289,17 @@ public class AquaUtils { blurOp = new ConvolveOp(new Kernel(blur, blur, blurKernel)); } - public boolean isBorderOpaque() { + @Override + public final boolean isBorderOpaque() { return false; } - public Insets getBorderInsets(final Component c) { + @Override + public final Insets getBorderInsets(final Component c) { return insets; } + @Override public void paintBorder(final Component c, final Graphics g, final int x, final int y, final int width, final int height) { final BufferedImage img = new BufferedImage(width + blur * 2, height + blur * 2, BufferedImage.TYPE_INT_ARGB_PRE); paintToImage(img, x, y, width, height); @@ -290,7 +307,7 @@ public class AquaUtils { g.drawImage(img, -blur, -blur, null); } - protected void paintToImage(final BufferedImage img, final int x, final int y, final int width, final int height) { + private void paintToImage(final BufferedImage img, final int x, final int y, final int width, final int height) { // clear the prior image Graphics2D imgG = (Graphics2D)img.getGraphics(); imgG.setComposite(AlphaComposite.Clear); @@ -319,10 +336,10 @@ public class AquaUtils { } } - public static class SlicedShadowBorder extends ShadowBorder { - final SlicedImageControl slices; + static class SlicedShadowBorder extends ShadowBorder { + private final SlicedImageControl slices; - public SlicedShadowBorder(final Painter prePainter, final Painter postPainter, final int offsetX, final int offsetY, final float distance, final float intensity, final int blur, final int templateWidth, final int templateHeight, final int leftCut, final int topCut, final int rightCut, final int bottomCut) { + SlicedShadowBorder(final Painter prePainter, final Painter postPainter, final int offsetX, final int offsetY, final float distance, final float intensity, final int blur, final int templateWidth, final int templateHeight, final int leftCut, final int topCut, final int rightCut, final int bottomCut) { super(prePainter, postPainter, offsetX, offsetY, distance, intensity, blur); final BufferedImage i = new BufferedImage(templateWidth, templateHeight, BufferedImage.TYPE_INT_ARGB_PRE); @@ -331,15 +348,12 @@ public class AquaUtils { slices = new SlicedImageControl(i, leftCut, topCut, rightCut, bottomCut, false); } + @Override public void paintBorder(final Component c, final Graphics g, final int x, final int y, final int width, final int height) { slices.paint(g, x, y, width, height); } } - public interface NineSliceMetricsProvider { - - } - // static void debugFrame(String name, Image image) { // JFrame f = new JFrame(name); // f.setContentPane(new JLabel(new ImageIcon(image))); @@ -350,28 +364,30 @@ public class AquaUtils { // special casing naughty applications, like InstallAnywhere // REGR: JButton: Myst IV: the buttons of 1.0.3 updater have redraw issue static boolean shouldUseOpaqueButtons() { - final ClassLoader launcherClassLoader = sun.misc.Launcher.getLauncher().getClassLoader(); + final ClassLoader launcherClassLoader = Launcher.getLauncher().getClassLoader(); if (classExists(launcherClassLoader, "com.installshield.wizard.platform.macosx.MacOSXUtils")) return true; return false; } - static boolean classExists(final ClassLoader classLoader, final String clazzName) { + private static boolean classExists(final ClassLoader classLoader, final String clazzName) { try { return Class.forName(clazzName, false, classLoader) != null; - } catch (final Throwable e) { } + } catch (final Throwable ignored) { } return false; } - private static RecyclableSingleton getJComponentGetFlagMethod = new RecyclableSingleton() { + private static final RecyclableSingleton getJComponentGetFlagMethod = new RecyclableSingleton() { + @Override protected Method getInstance() { - return java.security.AccessController.doPrivileged( + return AccessController.doPrivileged( new PrivilegedAction() { + @Override public Method run() { try { final Method method = JComponent.class.getDeclaredMethod("getFlag", new Class[] { int.class }); method.setAccessible(true); return method; - } catch (final Throwable e) { + } catch (final Throwable ignored) { return null; } } @@ -380,18 +396,18 @@ public class AquaUtils { } }; - private static final Integer OPAQUE_SET_FLAG = new Integer(24); // private int JComponent.OPAQUE_SET - protected static boolean hasOpaqueBeenExplicitlySet(final JComponent c) { + private static final Integer OPAQUE_SET_FLAG = 24; // private int JComponent.OPAQUE_SET + static boolean hasOpaqueBeenExplicitlySet(final JComponent c) { final Method method = getJComponentGetFlagMethod.get(); if (method == null) return false; try { return Boolean.TRUE.equals(method.invoke(c, OPAQUE_SET_FLAG)); - } catch (final Throwable e) { + } catch (final Throwable ignored) { return false; } } - protected static boolean isWindowTextured(final Component c) { + private static boolean isWindowTextured(final Component c) { if (!(c instanceof JComponent)) { return false; } @@ -412,13 +428,12 @@ public class AquaUtils { return new Color(color.getRed(), color.getGreen(), color.getBlue(), 0); } - protected static void fillRect(final Graphics g, final Component c) { + static void fillRect(final Graphics g, final Component c) { fillRect(g, c, c.getBackground(), 0, 0, c.getWidth(), c.getHeight()); } - protected static void fillRect(final Graphics g, final Component c, - final Color color, final int x, final int y, - final int w, final int h) { + static void fillRect(final Graphics g, final Component c, final Color color, + final int x, final int y, final int w, final int h) { if (!(g instanceof Graphics2D)) { return; } From a3b45465c6003b542aafe8969f5a5f13d3b2ca48 Mon Sep 17 00:00:00 2001 From: Shanliang Jiang Date: Tue, 6 Aug 2013 10:33:42 +0200 Subject: [PATCH 036/131] 8019292: Better Attribute Value Exceptions Reviewed-by: dfuchs, dholmes, ahgross --- .../BadAttributeValueExpException.java | 32 +++++++++++++++++-- 1 file changed, 29 insertions(+), 3 deletions(-) diff --git a/jdk/src/share/classes/javax/management/BadAttributeValueExpException.java b/jdk/src/share/classes/javax/management/BadAttributeValueExpException.java index 9ed27e91fa3..2eda233d24a 100644 --- a/jdk/src/share/classes/javax/management/BadAttributeValueExpException.java +++ b/jdk/src/share/classes/javax/management/BadAttributeValueExpException.java @@ -25,6 +25,9 @@ package javax.management; +import java.io.IOException; +import java.io.ObjectInputStream; + /** * Thrown when an invalid MBean attribute is passed to a query @@ -41,17 +44,19 @@ public class BadAttributeValueExpException extends Exception { private static final long serialVersionUID = -3105272988410493376L; /** - * @serial The attribute value that originated this exception + * @serial A string representation of the attribute that originated this exception. + * for example, the string value can be the return of {@code attribute.toString()} */ private Object val; /** - * Constructs an BadAttributeValueExpException with the specified Object. + * Constructs a BadAttributeValueExpException using the specified Object to + * create the toString() value. * * @param val the inappropriate value. */ public BadAttributeValueExpException (Object val) { - this.val = val; + this.val = val == null ? null : val.toString(); } @@ -62,4 +67,25 @@ public class BadAttributeValueExpException extends Exception { return "BadAttributeValueException: " + val; } + private void readObject(ObjectInputStream ois) throws IOException, ClassNotFoundException { + ObjectInputStream.GetField gf = ois.readFields(); + Object valObj = gf.get("val", null); + + if (valObj == null) { + val = null; + } else if (valObj instanceof String) { + val= valObj; + } else if (System.getSecurityManager() == null + || valObj instanceof Long + || valObj instanceof Integer + || valObj instanceof Float + || valObj instanceof Double + || valObj instanceof Byte + || valObj instanceof Short + || valObj instanceof Boolean) { + val = valObj.toString(); + } else { // the serialized object is from a version without JDK-8019292 fix + val = System.identityHashCode(valObj) + "@" + valObj.getClass().getName(); + } + } } From 68d1aae1be91153f3df0736e8a96ed99d36945a6 Mon Sep 17 00:00:00 2001 From: Sergey Malenkov Date: Wed, 7 Aug 2013 14:37:22 +0400 Subject: [PATCH 037/131] 8021969: The index_AccessAllowed jnlp can not load successfully with exception thrown in the log Reviewed-by: art, skoivu --- jdk/src/share/classes/java/awt/datatransfer/DataFlavor.java | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/jdk/src/share/classes/java/awt/datatransfer/DataFlavor.java b/jdk/src/share/classes/java/awt/datatransfer/DataFlavor.java index 3c1691545f4..400553dd854 100644 --- a/jdk/src/share/classes/java/awt/datatransfer/DataFlavor.java +++ b/jdk/src/share/classes/java/awt/datatransfer/DataFlavor.java @@ -145,11 +145,7 @@ public class DataFlavor implements Externalizable, Cloneable { } catch (SecurityException exception) { // ignore secured class loaders } - if (fallback != null) { - return Class.forName(className, true, fallback); - } else { - throw new ClassNotFoundException(className); - } + return Class.forName(className, true, fallback); } /* From 046a6fa8e2263dc23bc39d97294922c71cf893b7 Mon Sep 17 00:00:00 2001 From: Jaroslav Bachorik Date: Thu, 8 Aug 2013 19:16:27 +0200 Subject: [PATCH 038/131] 8021360: object not exported" on start of JMXConnectorServer for RMI-IIOP protocol with security manager Reviewed-by: alanb, ahgross, smarks, coffeys --- .../remote/protocol/iiop/IIOPProxyImpl.java | 46 +++++++++++++++++-- 1 file changed, 42 insertions(+), 4 deletions(-) diff --git a/jdk/src/share/classes/com/sun/jmx/remote/protocol/iiop/IIOPProxyImpl.java b/jdk/src/share/classes/com/sun/jmx/remote/protocol/iiop/IIOPProxyImpl.java index d4171b24282..b0fe91bf728 100644 --- a/jdk/src/share/classes/com/sun/jmx/remote/protocol/iiop/IIOPProxyImpl.java +++ b/jdk/src/share/classes/com/sun/jmx/remote/protocol/iiop/IIOPProxyImpl.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2009,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 @@ -36,13 +36,34 @@ import java.rmi.RemoteException; import java.rmi.NoSuchObjectException; import com.sun.jmx.remote.internal.IIOPProxy; +import java.io.SerializablePermission; +import java.security.AccessControlContext; +import java.security.AccessController; +import java.security.Permissions; +import java.security.PrivilegedActionException; +import java.security.PrivilegedExceptionAction; +import java.security.ProtectionDomain; /** - * An implementatin of IIOPProxy that simply delegates to the appropriate + * An implementation of IIOPProxy that simply delegates to the appropriate * RMI-IIOP and CORBA APIs. */ public class IIOPProxyImpl implements IIOPProxy { + // special ACC used to initialize the IIOP stub + // the only allowed privilege is SerializablePermission("enableSubclassImplementation") + private static final AccessControlContext STUB_ACC; + + static { + Permissions p = new Permissions(); + p.add(new SerializablePermission("enableSubclassImplementation")); + STUB_ACC = new AccessControlContext( + new ProtectionDomain[]{ + new ProtectionDomain(null, p) + } + ); + } + public IIOPProxyImpl() { } @Override @@ -113,7 +134,24 @@ public class IIOPProxyImpl implements IIOPProxy { } @Override - public Remote toStub(Remote obj) throws NoSuchObjectException { - return PortableRemoteObject.toStub(obj); + public Remote toStub(final Remote obj) throws NoSuchObjectException { + if (System.getSecurityManager() == null) { + return PortableRemoteObject.toStub(obj); + } else { + try { + return AccessController.doPrivileged(new PrivilegedExceptionAction() { + + @Override + public Remote run() throws Exception { + return PortableRemoteObject.toStub(obj); + } + }, STUB_ACC); + } catch (PrivilegedActionException e) { + if (e.getException() instanceof NoSuchObjectException) { + throw (NoSuchObjectException)e.getException(); + } + throw new RuntimeException("Unexpected exception type", e.getException()); + } + } } } From ac42104fef46f3d20133383985fea56247768156 Mon Sep 17 00:00:00 2001 From: Sergey Bylokhov Date: Mon, 12 Aug 2013 19:57:21 +0400 Subject: [PATCH 039/131] 8021275: Better screening for ScreenMenu Reviewed-by: art --- .../classes/com/apple/laf/ScreenMenu.java | 144 +++++++++--------- 1 file changed, 75 insertions(+), 69 deletions(-) diff --git a/jdk/src/macosx/classes/com/apple/laf/ScreenMenu.java b/jdk/src/macosx/classes/com/apple/laf/ScreenMenu.java index 5f78ff6e061..87393408487 100644 --- a/jdk/src/macosx/classes/com/apple/laf/ScreenMenu.java +++ b/jdk/src/macosx/classes/com/apple/laf/ScreenMenu.java @@ -36,7 +36,10 @@ import sun.awt.SunToolkit; import sun.lwawt.LWToolkit; import sun.lwawt.macosx.*; -class ScreenMenu extends Menu implements ContainerListener, ComponentListener, ScreenMenuPropertyHandler { +final class ScreenMenu extends Menu + implements ContainerListener, ComponentListener, + ScreenMenuPropertyHandler { + static { java.security.AccessController.doPrivileged( new java.security.PrivilegedAction() { @@ -48,20 +51,22 @@ class ScreenMenu extends Menu implements ContainerListener, ComponentListener, S } // screen menu stuff - public static native long addMenuListeners(ScreenMenu listener, long nativeMenu); - public static native void removeMenuListeners(long modelPtr); + private static native long addMenuListeners(ScreenMenu listener, long nativeMenu); + private static native void removeMenuListeners(long modelPtr); - long fModelPtr = 0; + private transient long fModelPtr; - Hashtable fItems; - JMenu fInvoker; + private final Hashtable fItems; + private final JMenu fInvoker; - Component fLastMouseEventTarget; - Rectangle fLastTargetRect; + private Component fLastMouseEventTarget; + private Rectangle fLastTargetRect; private volatile Rectangle[] fItemBounds; + private ScreenMenuPropertyListener fPropertyListener; + // Array of child hashes used to see if we need to recreate the Menu. - int childHashArray[]; + private int childHashArray[]; ScreenMenu(final JMenu invoker) { super(invoker.getText()); @@ -74,25 +79,12 @@ class ScreenMenu extends Menu implements ContainerListener, ComponentListener, S updateItems(); } - // I'm always 'visible', but never on screen - static class ScreenMenuComponent extends Container { - public boolean isVisible() { return true; } - public boolean isShowing() { return true; } - public void setVisible(final boolean b) {} - public void show() {} - } - - ScreenMenuComponent makeScreenMenuComponent() { - return new ScreenMenuComponent(); - } - - /** * Determine if we need to tear down the Menu and re-create it, since the contents may have changed in the Menu opened listener and * we do not get notified of it, because EDT is busy in our code. We only need to update if the menu contents have changed in some * way, such as the number of menu items, the text of the menuitems, icon, shortcut etc. */ - static boolean needsUpdate(final Component items[], final int childHashArray[]) { + private static boolean needsUpdate(final Component items[], final int childHashArray[]) { if (items == null || childHashArray == null) { return true; } @@ -112,7 +104,7 @@ class ScreenMenu extends Menu implements ContainerListener, ComponentListener, S * Used to recreate the AWT based Menu structure that implements the Screen Menu. * Also computes hashcode and stores them so that we can compare them later in needsUpdate. */ - void updateItems() { + private void updateItems() { final int count = fInvoker.getMenuComponentCount(); final Component[] items = fInvoker.getMenuComponents(); if (needsUpdate(items, childHashArray)) { @@ -163,16 +155,14 @@ class ScreenMenu extends Menu implements ContainerListener, ComponentListener, S LWCToolkit.invokeAndWait(new Runnable() { public void run() { invoker.setSelected(false); - - // Null out the tracking rectangles and the array. + // Null out the tracking rectangles and the array. if (fItemBounds != null) { - for (int i = 0; i < fItemBounds.length; i++) { - fItemBounds[i] = null; - } + for (int i = 0; i < fItemBounds.length; i++) { + fItemBounds[i] = null; + } } - - fItemBounds = null; - } + fItemBounds = null; + } }, invoker); } catch (final Exception e) { e.printStackTrace(); @@ -237,49 +227,56 @@ class ScreenMenu extends Menu implements ContainerListener, ComponentListener, S }); } - ScreenMenuPropertyListener fPropertyListener; + @Override public void addNotify() { - super.addNotify(); - if (fModelPtr == 0) { - fInvoker.addContainerListener(this); - fInvoker.addComponentListener(this); - fPropertyListener = new ScreenMenuPropertyListener(this); - fInvoker.addPropertyChangeListener(fPropertyListener); + synchronized (getTreeLock()) { + super.addNotify(); + if (fModelPtr == 0) { + fInvoker.addContainerListener(this); + fInvoker.addComponentListener(this); + fPropertyListener = new ScreenMenuPropertyListener(this); + fInvoker.addPropertyChangeListener(fPropertyListener); - final Icon icon = fInvoker.getIcon(); - if (icon != null) { - this.setIcon(icon); - } + final Icon icon = fInvoker.getIcon(); + if (icon != null) { + setIcon(icon); + } - final String tooltipText = fInvoker.getToolTipText(); - if (tooltipText != null) { - this.setToolTipText(tooltipText); - } - final MenuComponentPeer peer = getPeer(); - if (peer instanceof CMenu) { - final CMenu menu = (CMenu)peer; - final long nativeMenu = menu.getNativeMenu(); - fModelPtr = addMenuListeners(this, nativeMenu); + final String tooltipText = fInvoker.getToolTipText(); + if (tooltipText != null) { + setToolTipText(tooltipText); + } + final MenuComponentPeer peer = getPeer(); + if (peer instanceof CMenu) { + final CMenu menu = (CMenu) peer; + final long nativeMenu = menu.getNativeMenu(); + fModelPtr = addMenuListeners(this, nativeMenu); + } } } } + @Override public void removeNotify() { - // Call super so that the NSMenu has been removed, before we release the delegate in removeMenuListeners - super.removeNotify(); - fItems.clear(); - if (fModelPtr != 0) { - removeMenuListeners(fModelPtr); - fModelPtr = 0; - fInvoker.removeContainerListener(this); - fInvoker.removeComponentListener(this); - fInvoker.removePropertyChangeListener(fPropertyListener); + synchronized (getTreeLock()) { + // Call super so that the NSMenu has been removed, before we release + // the delegate in removeMenuListeners + super.removeNotify(); + fItems.clear(); + if (fModelPtr != 0) { + removeMenuListeners(fModelPtr); + fModelPtr = 0; + fInvoker.removeContainerListener(this); + fInvoker.removeComponentListener(this); + fInvoker.removePropertyChangeListener(fPropertyListener); + } } } /** * Invoked when a component has been added to the container. */ + @Override public void componentAdded(final ContainerEvent e) { addItem(e.getChild()); } @@ -287,23 +284,26 @@ class ScreenMenu extends Menu implements ContainerListener, ComponentListener, S /** * Invoked when a component has been removed from the container. */ + @Override public void componentRemoved(final ContainerEvent e) { final Component child = e.getChild(); final MenuItem sm = fItems.get(child); if (sm == null) return; - remove(sm); - fItems.remove(sm); - } + remove(sm); + fItems.remove(sm); + } /** * Invoked when the component's size changes. */ + @Override public void componentResized(final ComponentEvent e) {} /** * Invoked when the component's position changes. */ + @Override public void componentMoved(final ComponentEvent e) {} /** @@ -311,6 +311,7 @@ class ScreenMenu extends Menu implements ContainerListener, ComponentListener, S * See componentHidden - we should still have a MenuItem * it just isn't inserted */ + @Override public void componentShown(final ComponentEvent e) { setVisible(true); } @@ -321,11 +322,12 @@ class ScreenMenu extends Menu implements ContainerListener, ComponentListener, S * so we remove the ScreenMenuItem from the ScreenMenu * but leave it in fItems */ + @Override public void componentHidden(final ComponentEvent e) { setVisible(false); } - public void setVisible(final boolean b) { + private void setVisible(final boolean b) { // Tell our parent to add/remove us final MenuContainer parent = getParent(); @@ -333,20 +335,24 @@ class ScreenMenu extends Menu implements ContainerListener, ComponentListener, S if (parent instanceof ScreenMenu) { final ScreenMenu sm = (ScreenMenu)parent; sm.setChildVisible(fInvoker, b); - } + } } } + @Override public void setChildVisible(final JMenuItem child, final boolean b) { fItems.remove(child); updateItems(); } + @Override public void setAccelerator(final KeyStroke ks) {} // only check and radio items can be indeterminate + @Override public void setIndeterminate(boolean indeterminate) { } + @Override public void setToolTipText(final String text) { final MenuComponentPeer peer = getPeer(); if (!(peer instanceof CMenuItem)) return; @@ -355,6 +361,7 @@ class ScreenMenu extends Menu implements ContainerListener, ComponentListener, S cmi.setToolTipText(text); } + @Override public void setIcon(final Icon i) { final MenuComponentPeer peer = getPeer(); if (!(peer instanceof CMenuItem)) return; @@ -374,9 +381,8 @@ class ScreenMenu extends Menu implements ContainerListener, ComponentListener, S /** * Gets a hashCode for a JMenu or JMenuItem or subclass so that we can compare for * changes in the Menu. - * */ - static int getHashCode(final Component m) { + private static int getHashCode(final Component m) { int hashCode = m.hashCode(); if (m instanceof JMenuItem) { @@ -408,7 +414,7 @@ class ScreenMenu extends Menu implements ContainerListener, ComponentListener, S return hashCode; } - void addItem(final Component m) { + private void addItem(final Component m) { if (!m.isVisible()) return; MenuItem sm = fItems.get(m); From 53b5f75095fbfdc11d0816de508bdde491844095 Mon Sep 17 00:00:00 2001 From: Christian Thalinger Date: Mon, 12 Aug 2013 13:47:21 -0700 Subject: [PATCH 040/131] 8022066: Evaluation of method reference to signature polymorphic method crashes VM Reviewed-by: jrose --- .../java/lang/invoke/MethodHandles.java | 4 + .../lang/invoke/MethodHandleConstants.java | 188 ++++++++++++++++++ 2 files changed, 192 insertions(+) create mode 100644 jdk/test/java/lang/invoke/MethodHandleConstants.java diff --git a/jdk/src/share/classes/java/lang/invoke/MethodHandles.java b/jdk/src/share/classes/java/lang/invoke/MethodHandles.java index 8a435d06fca..2ee21d667c0 100644 --- a/jdk/src/share/classes/java/lang/invoke/MethodHandles.java +++ b/jdk/src/share/classes/java/lang/invoke/MethodHandles.java @@ -1289,6 +1289,10 @@ return mh1; : resolveOrFail(refKind, defc, name, (Class) type); return getDirectField(refKind, defc, field); } else if (MethodHandleNatives.refKindIsMethod(refKind)) { + if (defc == MethodHandle.class && refKind == REF_invokeVirtual) { + MethodHandle mh = findVirtualForMH(name, (MethodType) type); + if (mh != null) return mh; + } MemberName method = (resolved != null) ? resolved : resolveOrFail(refKind, defc, name, (MethodType) type); return getDirectMethod(refKind, defc, method, lookupClass); diff --git a/jdk/test/java/lang/invoke/MethodHandleConstants.java b/jdk/test/java/lang/invoke/MethodHandleConstants.java new file mode 100644 index 00000000000..57e041ba7bb --- /dev/null +++ b/jdk/test/java/lang/invoke/MethodHandleConstants.java @@ -0,0 +1,188 @@ +/* + * Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* @test + * @bug 8022066 + * @summary smoke test for method handle constants + * @build indify.Indify + * @compile MethodHandleConstants.java + * @run main/othervm + * indify.Indify + * --verify-specifier-count=0 + * --expand-properties --classpath ${test.classes} + * --java test.java.lang.invoke.MethodHandleConstants --check-output + * @run main/othervm + * indify.Indify + * --expand-properties --classpath ${test.classes} + * --java test.java.lang.invoke.MethodHandleConstants --security-manager + */ + +package test.java.lang.invoke; + +import java.util.*; +import java.io.*; +import java.lang.invoke.*; +import java.security.*; + +import static java.lang.invoke.MethodHandles.*; +import static java.lang.invoke.MethodType.*; + +public class MethodHandleConstants { + public static void main(String... av) throws Throwable { + if (av.length > 0 && av[0].equals("--check-output")) openBuf(); + if (av.length > 0 && av[0].equals("--security-manager")) setSM(); + System.out.println("Obtaining method handle constants:"); + testCase(MH_String_replace_C2(), String.class, "replace", String.class, String.class, char.class, char.class); + testCase(MH_MethodHandle_invokeExact_SC2(), MethodHandle.class, "invokeExact", String.class, MethodHandle.class, String.class, char.class, char.class); + testCase(MH_MethodHandle_invoke_SC2(), MethodHandle.class, "invoke", String.class, MethodHandle.class, String.class, char.class, char.class); + testCase(MH_Class_forName_S(), Class.class, "forName", Class.class, String.class); + testCase(MH_Class_forName_SbCL(), Class.class, "forName", Class.class, String.class, boolean.class, ClassLoader.class); + System.out.println("Done."); + closeBuf(); + } + + private static void testCase(MethodHandle mh, Class defc, String name, Class rtype, Class... ptypes) throws Throwable { + System.out.println(mh); + // we include defc, because we assume it is a non-static MH: + MethodType mt = methodType(rtype, ptypes); + assertEquals(mh.type(), mt); + // FIXME: Use revealDirect to find out more + } + private static void assertEquals(Object exp, Object act) { + if (exp == act || (exp != null && exp.equals(act))) return; + throw new AssertionError("not equal: "+exp+", "+act); + } + + private static void setSM() { + Policy.setPolicy(new TestPolicy()); + System.setSecurityManager(new SecurityManager()); + } + + private static PrintStream oldOut; + private static ByteArrayOutputStream buf; + private static void openBuf() { + oldOut = System.out; + buf = new ByteArrayOutputStream(); + System.setOut(new PrintStream(buf)); + } + private static void closeBuf() { + if (buf == null) return; + System.out.flush(); + System.setOut(oldOut); + String[] haveLines = new String(buf.toByteArray()).split("[\n\r]+"); + for (String line : haveLines) System.out.println(line); + Iterator iter = Arrays.asList(haveLines).iterator(); + for (String want : EXPECT_OUTPUT) { + String have = iter.hasNext() ? iter.next() : "[EOF]"; + if (want.equals(have)) continue; + System.err.println("want line: "+want); + System.err.println("have line: "+have); + throw new AssertionError("unexpected output: "+have); + } + if (iter.hasNext()) + throw new AssertionError("unexpected output: "+iter.next()); + } + private static final String[] EXPECT_OUTPUT = { + "Obtaining method handle constants:", + "MethodHandle(String,char,char)String", + "MethodHandle(MethodHandle,String,char,char)String", + "MethodHandle(MethodHandle,String,char,char)String", + "MethodHandle(String)Class", + "MethodHandle(String,boolean,ClassLoader)Class", + "Done." + }; + + // String.replace(String, char, char) + private static MethodType MT_String_replace_C2() { + shouldNotCallThis(); + return methodType(String.class, char.class, char.class); + } + private static MethodHandle MH_String_replace_C2() throws ReflectiveOperationException { + shouldNotCallThis(); + return lookup().findVirtual(String.class, "replace", MT_String_replace_C2()); + } + + // MethodHandle.invokeExact(...) + private static MethodType MT_MethodHandle_invokeExact_SC2() { + shouldNotCallThis(); + return methodType(String.class, String.class, char.class, char.class); + } + private static MethodHandle MH_MethodHandle_invokeExact_SC2() throws ReflectiveOperationException { + shouldNotCallThis(); + return lookup().findVirtual(MethodHandle.class, "invokeExact", MT_MethodHandle_invokeExact_SC2()); + } + + // MethodHandle.invoke(...) + private static MethodType MT_MethodHandle_invoke_SC2() { + shouldNotCallThis(); + return methodType(String.class, String.class, char.class, char.class); + } + private static MethodHandle MH_MethodHandle_invoke_SC2() throws ReflectiveOperationException { + shouldNotCallThis(); + return lookup().findVirtual(MethodHandle.class, "invoke", MT_MethodHandle_invoke_SC2()); + } + + // Class.forName(String) + private static MethodType MT_Class_forName_S() { + shouldNotCallThis(); + return methodType(Class.class, String.class); + } + private static MethodHandle MH_Class_forName_S() throws ReflectiveOperationException { + shouldNotCallThis(); + return lookup().findStatic(Class.class, "forName", MT_Class_forName_S()); + } + + // Class.forName(String, boolean, ClassLoader) + private static MethodType MT_Class_forName_SbCL() { + shouldNotCallThis(); + return methodType(Class.class, String.class, boolean.class, ClassLoader.class); + } + private static MethodHandle MH_Class_forName_SbCL() throws ReflectiveOperationException { + shouldNotCallThis(); + return lookup().findStatic(Class.class, "forName", MT_Class_forName_SbCL()); + } + + private static void shouldNotCallThis() { + // if this gets called, the transformation has not taken place + if (System.getProperty("MethodHandleConstants.allow-untransformed") != null) return; + throw new AssertionError("this code should be statically transformed away by Indify"); + } + + static class TestPolicy extends Policy { + final PermissionCollection permissions = new Permissions(); + TestPolicy() { + permissions.add(new java.io.FilePermission("<>", "read")); + } + public PermissionCollection getPermissions(ProtectionDomain domain) { + return permissions; + } + + public PermissionCollection getPermissions(CodeSource codesource) { + return permissions; + } + + public boolean implies(ProtectionDomain domain, Permission perm) { + return permissions.implies(perm); + } + } +} From 73aa07b6c5c56bc747c0ff14ac13ff3fdea70b39 Mon Sep 17 00:00:00 2001 From: Kumar Srinivasan Date: Wed, 14 Aug 2013 10:17:57 -0700 Subject: [PATCH 041/131] 8021355: REGRESSION: Five closed/java/awt/SplashScreen tests fail since 7u45 b01 on Linux, Solaris Reviewed-by: dholmes, anthony, ahgross, erikj --- jdk/src/solaris/bin/java_md_solinux.c | 26 ++++++++++++++++++++++---- 1 file changed, 22 insertions(+), 4 deletions(-) diff --git a/jdk/src/solaris/bin/java_md_solinux.c b/jdk/src/solaris/bin/java_md_solinux.c index b0028bde78d..05a5b3e34d8 100644 --- a/jdk/src/solaris/bin/java_md_solinux.c +++ b/jdk/src/solaris/bin/java_md_solinux.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 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 @@ -958,9 +958,27 @@ static void* hSplashLib = NULL; void* SplashProcAddress(const char* name) { if (!hSplashLib) { - const char * splashLibPath; - splashLibPath = SPLASHSCREEN_SO; - hSplashLib = dlopen(splashLibPath, RTLD_LAZY | RTLD_GLOBAL); + int ret; + char jrePath[MAXPATHLEN]; + char splashPath[MAXPATHLEN]; + + if (!GetJREPath(jrePath, sizeof(jrePath), GetArch(), JNI_FALSE)) { + JLI_ReportErrorMessage(JRE_ERROR1); + return NULL; + } + ret = JLI_Snprintf(splashPath, sizeof(splashPath), "%s/lib/%s/%s", + jrePath, GetArch(), SPLASHSCREEN_SO); + + if (ret >= (int) sizeof(splashPath)) { + JLI_ReportErrorMessage(JRE_ERROR11); + return NULL; + } + if (ret < 0) { + JLI_ReportErrorMessage(JRE_ERROR13); + return NULL; + } + hSplashLib = dlopen(splashPath, RTLD_LAZY | RTLD_GLOBAL); + JLI_TraceLauncher("Info: loaded %s\n", splashPath); } if (hSplashLib) { void* sym = dlsym(hSplashLib, name); From 9b8991f944b3a1e10a073ab4b26ef3dd32511191 Mon Sep 17 00:00:00 2001 From: Weijun Wang Date: Wed, 14 Aug 2013 15:25:16 +0800 Subject: [PATCH 042/131] 8022931: Enhance Kerberos exceptions Reviewed-by: xuelei, ahgross --- .../javax/security/auth/kerberos/KeyTab.java | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/jdk/src/share/classes/javax/security/auth/kerberos/KeyTab.java b/jdk/src/share/classes/javax/security/auth/kerberos/KeyTab.java index 631b7d02275..db815395e3a 100644 --- a/jdk/src/share/classes/javax/security/auth/kerberos/KeyTab.java +++ b/jdk/src/share/classes/javax/security/auth/kerberos/KeyTab.java @@ -26,6 +26,7 @@ package javax.security.auth.kerberos; import java.io.File; +import java.security.AccessControlException; import java.util.Objects; import sun.security.krb5.EncryptionKey; import sun.security.krb5.KerberosSecrets; @@ -214,9 +215,22 @@ public final class KeyTab { return new KeyTab(princ, null, true); } - //Takes a snapshot of the keytab content + // Takes a snapshot of the keytab content. This method is called by + // JavaxSecurityAuthKerberosAccessImpl so no more private sun.security.krb5.internal.ktab.KeyTab takeSnapshot() { - return sun.security.krb5.internal.ktab.KeyTab.getInstance(file); + try { + return sun.security.krb5.internal.ktab.KeyTab.getInstance(file); + } catch (AccessControlException ace) { + if (file != null) { + // It's OK to show the name if caller specified it + throw ace; + } else { + AccessControlException ace2 = new AccessControlException( + "Access to default keytab denied (modified exception)"); + ace2.setStackTrace(ace.getStackTrace()); + throw ace2; + } + } } /** From 73ddb82395f11287b3e46abef29c720d1c98b958 Mon Sep 17 00:00:00 2001 From: Erik Joelsson Date: Mon, 19 Aug 2013 12:30:48 +0200 Subject: [PATCH 043/131] 8022719: tools/launcher/RunpathTest.java fails after 8012146 Reviewed-by: chegar --- jdk/test/tools/launcher/RunpathTest.java | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/jdk/test/tools/launcher/RunpathTest.java b/jdk/test/tools/launcher/RunpathTest.java index 631be16d975..675d7630dbe 100644 --- a/jdk/test/tools/launcher/RunpathTest.java +++ b/jdk/test/tools/launcher/RunpathTest.java @@ -23,7 +23,7 @@ /* * @test - * @bug 7190813 + * @bug 7190813, 8022719 * @summary Check for extended RPATHs on *nixes * @compile -XDignore.symbol.file RunpathTest.java * @run main RunpathTest @@ -65,12 +65,10 @@ public class RunpathTest extends TestHelper { void testRpath() { if (isDualMode && is64Bit) { - String expectedRpath = ".*RPATH.*\\$ORIGIN/../../lib/" + getJreArch() - + ":\\$ORIGIN/../../jre/lib/" + getJreArch() + ".*"; + String expectedRpath = ".*RPATH.*\\$ORIGIN/../../lib/" + getJreArch() + ".*"; elfCheck(java64Cmd, expectedRpath); } else { - String expectedRpath = ".*RPATH.*\\$ORIGIN/../lib/" + getJreArch() - + ":\\$ORIGIN/../jre/lib/" + getJreArch() + ".*"; + String expectedRpath = ".*RPATH.*\\$ORIGIN/../lib/" + getJreArch() + ".*"; elfCheck(javaCmd, expectedRpath); } } From c130ed36602208230609811e52c78c5fe58a784c Mon Sep 17 00:00:00 2001 From: Erik Joelsson Date: Mon, 19 Aug 2013 14:48:08 +0200 Subject: [PATCH 044/131] 8023231: Remove comma from jtreg bug line Reviewed-by: alanb, chegar --- jdk/test/tools/launcher/RunpathTest.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/jdk/test/tools/launcher/RunpathTest.java b/jdk/test/tools/launcher/RunpathTest.java index 675d7630dbe..79b8b0ecca7 100644 --- a/jdk/test/tools/launcher/RunpathTest.java +++ b/jdk/test/tools/launcher/RunpathTest.java @@ -23,7 +23,7 @@ /* * @test - * @bug 7190813, 8022719 + * @bug 7190813 8022719 * @summary Check for extended RPATHs on *nixes * @compile -XDignore.symbol.file RunpathTest.java * @run main RunpathTest From 7569765f7e21c1b4ce2d4223bdde1dd1ae70b53e Mon Sep 17 00:00:00 2001 From: Taras Ledkov Date: Fri, 27 Sep 2013 12:35:43 +0400 Subject: [PATCH 045/131] 8025249: [javadoc] fix some javadoc errors in javax/swing/ Reviewed-by: alexsch, yan --- .../javax/swing/border/CompoundBorder.java | 4 +- .../AbstractColorChooserPanel.java | 6 +- .../classes/javax/swing/event/CaretEvent.java | 4 +- .../javax/swing/event/DocumentEvent.java | 6 +- .../javax/swing/event/EventListenerList.java | 2 +- .../javax/swing/event/ListDataEvent.java | 4 +- .../javax/swing/event/TreeModelEvent.java | 8 +- .../javax/swing/filechooser/FileView.java | 6 +- .../swing/table/DefaultTableCellRenderer.java | 2 +- .../javax/swing/table/DefaultTableModel.java | 5 +- .../javax/swing/table/JTableHeader.java | 10 +- .../javax/swing/table/TableCellRenderer.java | 8 +- .../javax/swing/text/AbstractDocument.java | 106 +++++++++--------- .../javax/swing/text/AbstractWriter.java | 4 +- .../javax/swing/text/AsyncBoxView.java | 50 ++++----- .../javax/swing/text/AttributeSet.java | 2 +- .../classes/javax/swing/text/Document.java | 22 ++-- .../classes/javax/swing/text/Element.java | 14 +-- .../share/classes/javax/swing/text/View.java | 62 +++++----- 19 files changed, 162 insertions(+), 163 deletions(-) diff --git a/jdk/src/share/classes/javax/swing/border/CompoundBorder.java b/jdk/src/share/classes/javax/swing/border/CompoundBorder.java index 56371a47a6d..a0143670ec2 100644 --- a/jdk/src/share/classes/javax/swing/border/CompoundBorder.java +++ b/jdk/src/share/classes/javax/swing/border/CompoundBorder.java @@ -37,11 +37,11 @@ import java.beans.ConstructorProperties; * For example, this class may be used to add blank margin space * to a component with an existing decorative border: *

    - *

    + * 
      *    Border border = comp.getBorder();
      *    Border margin = new EmptyBorder(10,10,10,10);
      *    comp.setBorder(new CompoundBorder(border, margin));
    - * 
    + *
    *

    * Warning: * Serialized objects of this class will not be compatible with diff --git a/jdk/src/share/classes/javax/swing/colorchooser/AbstractColorChooserPanel.java b/jdk/src/share/classes/javax/swing/colorchooser/AbstractColorChooserPanel.java index 99a20e38ffd..2a3b0c0c4c1 100644 --- a/jdk/src/share/classes/javax/swing/colorchooser/AbstractColorChooserPanel.java +++ b/jdk/src/share/classes/javax/swing/colorchooser/AbstractColorChooserPanel.java @@ -85,7 +85,7 @@ public abstract class AbstractColorChooserPanel extends JPanel { /** * Provides a hint to the look and feel as to the * KeyEvent.VK constant that can be used as a mnemonic to - * access the panel. A return value <= 0 indicates there is no mnemonic. + * access the panel. A return value <= 0 indicates there is no mnemonic. *

    * The return value here is a hint, it is ultimately up to the look * and feel to honor the return value in some meaningful way. @@ -94,7 +94,7 @@ public abstract class AbstractColorChooserPanel extends JPanel { * AbstractColorChooserPanel does not support a mnemonic, * subclasses wishing a mnemonic will need to override this. * - * @return KeyEvent.VK constant identifying the mnemonic; <= 0 for no + * @return KeyEvent.VK constant identifying the mnemonic; <= 0 for no * mnemonic * @see #getDisplayedMnemonicIndex * @since 1.4 @@ -107,7 +107,7 @@ public abstract class AbstractColorChooserPanel extends JPanel { * Provides a hint to the look and feel as to the index of the character in * getDisplayName that should be visually identified as the * mnemonic. The look and feel should only use this if - * getMnemonic returns a value > 0. + * getMnemonic returns a value > 0. *

    * The return value here is a hint, it is ultimately up to the look * and feel to honor the return value in some meaningful way. For example, diff --git a/jdk/src/share/classes/javax/swing/event/CaretEvent.java b/jdk/src/share/classes/javax/swing/event/CaretEvent.java index 7b47eb3f714..6cb3164b6b0 100644 --- a/jdk/src/share/classes/javax/swing/event/CaretEvent.java +++ b/jdk/src/share/classes/javax/swing/event/CaretEvent.java @@ -56,7 +56,7 @@ public abstract class CaretEvent extends EventObject { /** * Fetches the location of the caret. * - * @return the dot >= 0 + * @return the dot >= 0 */ public abstract int getDot(); @@ -65,7 +65,7 @@ public abstract class CaretEvent extends EventObject { * selection. If there is no selection, this * will be the same as dot. * - * @return the mark >= 0 + * @return the mark >= 0 */ public abstract int getMark(); } diff --git a/jdk/src/share/classes/javax/swing/event/DocumentEvent.java b/jdk/src/share/classes/javax/swing/event/DocumentEvent.java index 707e698b63c..9c9c796f8ec 100644 --- a/jdk/src/share/classes/javax/swing/event/DocumentEvent.java +++ b/jdk/src/share/classes/javax/swing/event/DocumentEvent.java @@ -45,14 +45,14 @@ public interface DocumentEvent { * Returns the offset within the document of the start * of the change. * - * @return the offset >= 0 + * @return the offset >= 0 */ public int getOffset(); /** * Returns the length of the change. * - * @return the length >= 0 + * @return the length >= 0 */ public int getLength(); @@ -155,7 +155,7 @@ public interface DocumentEvent { * This is the location that children were added * and/or removed. * - * @return the index >= 0 + * @return the index >= 0 */ public int getIndex(); diff --git a/jdk/src/share/classes/javax/swing/event/EventListenerList.java b/jdk/src/share/classes/javax/swing/event/EventListenerList.java index 237bf2067b2..004659ad24e 100644 --- a/jdk/src/share/classes/javax/swing/event/EventListenerList.java +++ b/jdk/src/share/classes/javax/swing/event/EventListenerList.java @@ -69,7 +69,7 @@ import java.lang.reflect.Array; * Object[] listeners = listenerList.getListenerList(); * // Process the listeners last to first, notifying * // those that are interested in this event - * for (int i = listeners.length-2; i>=0; i-=2) { + * for (int i = listeners.length-2; i>=0; i-=2) { * if (listeners[i]==FooListener.class) { * // Lazily create the event: * if (fooEvent == null) diff --git a/jdk/src/share/classes/javax/swing/event/ListDataEvent.java b/jdk/src/share/classes/javax/swing/event/ListDataEvent.java index 3ccf01e1a45..8862e724eac 100644 --- a/jdk/src/share/classes/javax/swing/event/ListDataEvent.java +++ b/jdk/src/share/classes/javax/swing/event/ListDataEvent.java @@ -85,9 +85,9 @@ public class ListDataEvent extends EventObject public int getIndex1() { return index1; } /** - * Constructs a ListDataEvent object. If index0 is > + * Constructs a ListDataEvent object. If index0 is > * index1, index0 and index1 will be swapped such that - * index0 will always be <= index1. + * index0 will always be <= index1. * * @param source the source Object (typically this) * @param type an int specifying {@link #CONTENTS_CHANGED}, diff --git a/jdk/src/share/classes/javax/swing/event/TreeModelEvent.java b/jdk/src/share/classes/javax/swing/event/TreeModelEvent.java index 3c92dc16377..6c6d7cef4cd 100644 --- a/jdk/src/share/classes/javax/swing/event/TreeModelEvent.java +++ b/jdk/src/share/classes/javax/swing/event/TreeModelEvent.java @@ -101,14 +101,14 @@ public class TreeModelEvent extends EventObject { * of initial-positions, you then need to convert the Vector of Integer * objects to an array of int to create the event. *

    - * Notes:

      + * Notes:
        *
      • Like the insertNodeInto method in the * DefaultTreeModel class, insertElementAt * appends to the Vector when the index matches the size * of the vector. So you can use insertElementAt(Integer, 0) - * even when the vector is empty. - *
          To create a node changed event for the root node, specify the parent - * and the child indices as null. + * even when the vector is empty. + *
        • To create a node changed event for the root node, specify the parent + * and the child indices as null.
        • *
        * * @param source the Object responsible for generating the event (typically diff --git a/jdk/src/share/classes/javax/swing/filechooser/FileView.java b/jdk/src/share/classes/javax/swing/filechooser/FileView.java index 771070534a7..7e208b09c9c 100644 --- a/jdk/src/share/classes/javax/swing/filechooser/FileView.java +++ b/jdk/src/share/classes/javax/swing/filechooser/FileView.java @@ -31,9 +31,9 @@ import javax.swing.*; /** * FileView defines an abstract class that can be implemented * to provide the filechooser with UI information for a File. - * Each L&F JFileChooserUI object implements this + * Each L&F JFileChooserUI object implements this * class to pass back the correct icons and type descriptions specific to - * that L&F. For example, the Microsoft Windows L&F returns the + * that L&F. For example, the Microsoft Windows L&F returns the * generic Windows icons for directories and generic files. * Additionally, you may want to provide your own FileView to * JFileChooser to return different icons or additional @@ -44,7 +44,7 @@ import javax.swing.*; * JFileChooser first looks to see if there is a user defined * FileView, if there is, it gets type information from * there first. If FileView returns null for - * any method, JFileChooser then uses the L&F specific + * any method, JFileChooser then uses the L&F specific * view to get the information. * So, for example, if you provide a FileView class that * returns an Icon for JPG files, and returns null diff --git a/jdk/src/share/classes/javax/swing/table/DefaultTableCellRenderer.java b/jdk/src/share/classes/javax/swing/table/DefaultTableCellRenderer.java index 518b43cafa9..e061bff35a2 100644 --- a/jdk/src/share/classes/javax/swing/table/DefaultTableCellRenderer.java +++ b/jdk/src/share/classes/javax/swing/table/DefaultTableCellRenderer.java @@ -150,7 +150,7 @@ public class DefaultTableCellRenderer extends JLabel /** * Notification from the UIManager that the look and feel - * [L&F] has changed. + * [L&F] has changed. * Replaces the current UI object with the latest version from the * UIManager. * diff --git a/jdk/src/share/classes/javax/swing/table/DefaultTableModel.java b/jdk/src/share/classes/javax/swing/table/DefaultTableModel.java index 623a7195559..a018324a6bb 100644 --- a/jdk/src/share/classes/javax/swing/table/DefaultTableModel.java +++ b/jdk/src/share/classes/javax/swing/table/DefaultTableModel.java @@ -418,15 +418,14 @@ public class DefaultTableModel extends AbstractTableModel implements Serializabl * *
              *  Examples of moves:
        -     *  

        + * * 1. moveRow(1,3,5); * a|B|C|D|e|f|g|h|i|j|k - before * a|e|f|g|h|B|C|D|i|j|k - after - *

        + * * 2. moveRow(6,7,1); * a|b|c|d|e|f|G|H|i|j|k - before * a|G|H|b|c|d|e|f|i|j|k - after - *

        *

        * * @param start the starting row index to be moved diff --git a/jdk/src/share/classes/javax/swing/table/JTableHeader.java b/jdk/src/share/classes/javax/swing/table/JTableHeader.java index 04420e2386d..f4a2901d5ae 100644 --- a/jdk/src/share/classes/javax/swing/table/JTableHeader.java +++ b/jdk/src/share/classes/javax/swing/table/JTableHeader.java @@ -437,7 +437,7 @@ public class JTableHeader extends JComponent implements TableColumnModelListener // /** - * Returns the look and feel (L&F) object that renders this component. + * Returns the look and feel (L&F) object that renders this component. * * @return the TableHeaderUI object that renders this component */ @@ -446,9 +446,9 @@ public class JTableHeader extends JComponent implements TableColumnModelListener } /** - * Sets the look and feel (L&F) object that renders this component. + * Sets the look and feel (L&F) object that renders this component. * - * @param ui the TableHeaderUI L&F object + * @param ui the TableHeaderUI L&F object * @see UIDefaults#getUI */ public void setUI(TableHeaderUI ui){ @@ -460,7 +460,7 @@ public class JTableHeader extends JComponent implements TableColumnModelListener /** * Notification from the UIManager that the look and feel - * (L&F) has changed. + * (L&F) has changed. * Replaces the current UI object with the latest version from the * UIManager. * @@ -478,7 +478,7 @@ public class JTableHeader extends JComponent implements TableColumnModelListener /** * Returns the suffix used to construct the name of the look and feel - * (L&F) class used to render this component. + * (L&F) class used to render this component. * @return the string "TableHeaderUI" * * @return "TableHeaderUI" diff --git a/jdk/src/share/classes/javax/swing/table/TableCellRenderer.java b/jdk/src/share/classes/javax/swing/table/TableCellRenderer.java index f48c628281a..52574164888 100644 --- a/jdk/src/share/classes/javax/swing/table/TableCellRenderer.java +++ b/jdk/src/share/classes/javax/swing/table/TableCellRenderer.java @@ -49,10 +49,10 @@ public interface TableCellRenderer { *
              *     JTable.DropLocation dropLocation = table.getDropLocation();
              *     if (dropLocation != null
        -     *             && !dropLocation.isInsertRow()
        -     *             && !dropLocation.isInsertColumn()
        -     *             && dropLocation.getRow() == row
        -     *             && dropLocation.getColumn() == column) {
        +     *             && !dropLocation.isInsertRow()
        +     *             && !dropLocation.isInsertColumn()
        +     *             && dropLocation.getRow() == row
        +     *             && dropLocation.getColumn() == column) {
              *
              *         // this cell represents the current drop location
              *         // so render it specially, perhaps with a different color
        diff --git a/jdk/src/share/classes/javax/swing/text/AbstractDocument.java b/jdk/src/share/classes/javax/swing/text/AbstractDocument.java
        index d9eefe375c5..a4dad8eed3a 100644
        --- a/jdk/src/share/classes/javax/swing/text/AbstractDocument.java
        +++ b/jdk/src/share/classes/javax/swing/text/AbstractDocument.java
        @@ -426,7 +426,7 @@ public abstract class AbstractDocument implements Document, Serializable {
              * Returns the length of the data.  This is the number of
              * characters of content that represents the users data.
              *
        -     * @return the length >= 0
        +     * @return the length >= 0
              * @see Document#getLength
              */
             public int getLength() {
        @@ -572,8 +572,8 @@ public abstract class AbstractDocument implements Document, Serializable {
              * Concurrency
              * in Swing for more information.
              *
        -     * @param offs the starting offset >= 0
        -     * @param len the number of characters to remove >= 0
        +     * @param offs the starting offset >= 0
        +     * @param len the number of characters to remove >= 0
              * @exception BadLocationException  the given remove position is not a valid
              *   position within the document
              * @see Document#remove
        @@ -685,7 +685,7 @@ public abstract class AbstractDocument implements Document, Serializable {
              * Concurrency
              * in Swing for more information.
              *
        -     * @param offs the starting offset >= 0
        +     * @param offs the starting offset >= 0
              * @param str the string to insert; does nothing with null/empty strings
              * @param a the attributes for the inserted content
              * @exception BadLocationException  the given insert position is not a valid
        @@ -777,8 +777,8 @@ public abstract class AbstractDocument implements Document, Serializable {
             /**
              * Gets a sequence of text from the document.
              *
        -     * @param offset the starting offset >= 0
        -     * @param length the number of characters to retrieve >= 0
        +     * @param offset the starting offset >= 0
        +     * @param length the number of characters to retrieve >= 0
              * @return the text
              * @exception BadLocationException  the range given includes a position
              *   that is not a valid position within the document
        @@ -810,7 +810,7 @@ public abstract class AbstractDocument implements Document, Serializable {
              *   Segment text = new Segment();
              *   int offs = 0;
              *   text.setPartialReturn(true);
        -     *   while (nleft > 0) {
        +     *   while (nleft > 0) {
              *       doc.getText(offs, nleft, text);
              *       // do something with text
              *       nleft -= text.count;
        @@ -818,8 +818,8 @@ public abstract class AbstractDocument implements Document, Serializable {
              *   }
              * 
        * - * @param offset the starting offset >= 0 - * @param length the number of characters to retrieve >= 0 + * @param offset the starting offset >= 0 + * @param length the number of characters to retrieve >= 0 * @param txt the Segment object to retrieve the text into * @exception BadLocationException the range given includes a position * that is not a valid position within the document @@ -840,7 +840,7 @@ public abstract class AbstractDocument implements Document, Serializable { * Concurrency * in Swing for more information. * - * @param offs the position in the model >= 0 + * @param offs the position in the model >= 0 * @return the position * @exception BadLocationException if the given position does not * represent a valid location in the associated document @@ -956,7 +956,7 @@ public abstract class AbstractDocument implements Document, Serializable { * should keep in mind however that a paragraph should at least be the * unit of text over which to run the Unicode bidirectional algorithm. * - * @param pos the starting offset >= 0 + * @param pos the starting offset >= 0 * @return the element */ public abstract Element getParagraphElement(int pos); @@ -1288,8 +1288,8 @@ public abstract class AbstractDocument implements Document, Serializable { * * @param parent the parent element * @param a the attributes for the element - * @param p0 the beginning of the range >= 0 - * @param p1 the end of the range >= p0 + * @param p0 the beginning of the range >= 0 + * @param p1 the end of the range >= p0 * @return the new element */ protected Element createLeafElement(Element parent, AttributeSet a, int p0, int p1) { @@ -1610,7 +1610,7 @@ public abstract class AbstractDocument implements Document, Serializable { * Creates a position within the content that will * track change as the content is mutated. * - * @param offset the offset in the content >= 0 + * @param offset the offset in the content >= 0 * @return a Position * @exception BadLocationException for an invalid offset */ @@ -1619,14 +1619,14 @@ public abstract class AbstractDocument implements Document, Serializable { /** * Current length of the sequence of character content. * - * @return the length >= 0 + * @return the length >= 0 */ public int length(); /** * Inserts a string of characters into the sequence. * - * @param where offset into the sequence to make the insertion >= 0 + * @param where offset into the sequence to make the insertion >= 0 * @param str string to insert * @return if the implementation supports a history mechanism, * a reference to an Edit implementation will be returned, @@ -1640,8 +1640,8 @@ public abstract class AbstractDocument implements Document, Serializable { * Removes some portion of the sequence. * * @param where The offset into the sequence to make the - * insertion >= 0. - * @param nitems The number of items in the sequence to remove >= 0. + * insertion >= 0. + * @param nitems The number of items in the sequence to remove >= 0. * @return If the implementation supports a history mechansim, * a reference to an Edit implementation will be returned, * otherwise null. @@ -1653,8 +1653,8 @@ public abstract class AbstractDocument implements Document, Serializable { /** * Fetches a string of characters contained in the sequence. * - * @param where Offset into the sequence to fetch >= 0. - * @param len number of characters to copy >= 0. + * @param where Offset into the sequence to fetch >= 0. + * @param len number of characters to copy >= 0. * @return the string * @exception BadLocationException Thrown if the area covered by * the arguments is not contained in the character sequence. @@ -1664,8 +1664,8 @@ public abstract class AbstractDocument implements Document, Serializable { /** * Gets a sequence of characters and copies them into a Segment. * - * @param where the starting offset >= 0 - * @param len the number of characters >= 0 + * @param where the starting offset >= 0 + * @param len the number of characters >= 0 * @param txt the target location to copy into * @exception BadLocationException Thrown if the area covered by * the arguments is not contained in the character sequence. @@ -1809,7 +1809,7 @@ public abstract class AbstractDocument implements Document, Serializable { * Dumps a debugging representation of the element hierarchy. * * @param psOut the output stream - * @param indentAmount the indentation level >= 0 + * @param indentAmount the indentation level >= 0 */ public void dump(PrintStream psOut, int indentAmount) { PrintWriter out; @@ -1867,7 +1867,7 @@ public abstract class AbstractDocument implements Document, Serializable { /** * Gets the number of attributes that are defined. * - * @return the number of attributes >= 0 + * @return the number of attributes >= 0 * @see AttributeSet#getAttributeCount */ public int getAttributeCount() { @@ -2116,21 +2116,21 @@ public abstract class AbstractDocument implements Document, Serializable { /** * Gets the starting offset in the model for the element. * - * @return the offset >= 0 + * @return the offset >= 0 */ public abstract int getStartOffset(); /** * Gets the ending offset in the model for the element. * - * @return the offset >= 0 + * @return the offset >= 0 */ public abstract int getEndOffset(); /** * Gets a child element. * - * @param index the child index, >= 0 && < getElementCount() + * @param index the child index, >= 0 && < getElementCount() * @return the child element */ public abstract Element getElement(int index); @@ -2138,15 +2138,15 @@ public abstract class AbstractDocument implements Document, Serializable { /** * Gets the number of children for the element. * - * @return the number of children >= 0 + * @return the number of children >= 0 */ public abstract int getElementCount(); /** * Gets the child element index closest to the given model offset. * - * @param offset the offset >= 0 - * @return the element index >= 0 + * @param offset the offset >= 0 + * @return the element index >= 0 */ public abstract int getElementIndex(int offset); @@ -2272,7 +2272,7 @@ public abstract class AbstractDocument implements Document, Serializable { * Gets the child element that contains * the given model position. * - * @param pos the position >= 0 + * @param pos the position >= 0 * @return the element, null if none */ public Element positionToElement(int pos) { @@ -2289,8 +2289,8 @@ public abstract class AbstractDocument implements Document, Serializable { /** * Replaces content with a new set of elements. * - * @param offset the starting offset >= 0 - * @param length the length to replace >= 0 + * @param offset the starting offset >= 0 + * @param length the length to replace >= 0 * @param elems the new elements */ public void replace(int offset, int length, Element[] elems) { @@ -2342,7 +2342,7 @@ public abstract class AbstractDocument implements Document, Serializable { /** * Gets the starting offset in the model for the element. * - * @return the offset >= 0 + * @return the offset >= 0 */ public int getStartOffset() { return children[0].getStartOffset(); @@ -2352,7 +2352,7 @@ public abstract class AbstractDocument implements Document, Serializable { * Gets the ending offset in the model for the element. * @throws NullPointerException if this element has no children * - * @return the offset >= 0 + * @return the offset >= 0 */ public int getEndOffset() { Element child = @@ -2363,7 +2363,7 @@ public abstract class AbstractDocument implements Document, Serializable { /** * Gets a child element. * - * @param index the child index, >= 0 && < getElementCount() + * @param index the child index, >= 0 && < getElementCount() * @return the child element, null if none */ public Element getElement(int index) { @@ -2376,7 +2376,7 @@ public abstract class AbstractDocument implements Document, Serializable { /** * Gets the number of children for the element. * - * @return the number of children >= 0 + * @return the number of children >= 0 */ public int getElementCount() { return nchildren; @@ -2385,8 +2385,8 @@ public abstract class AbstractDocument implements Document, Serializable { /** * Gets the child element index closest to the given model offset. * - * @param offset the offset >= 0 - * @return the element index >= 0 + * @param offset the offset >= 0 + * @return the element index >= 0 */ public int getElementIndex(int offset) { int index; @@ -2515,8 +2515,8 @@ public abstract class AbstractDocument implements Document, Serializable { * * @param parent The parent element * @param a The element attributes - * @param offs0 The start offset >= 0 - * @param offs1 The end offset >= offs0 + * @param offs0 The start offset >= 0 + * @param offs1 The end offset >= offs0 * @since 1.4 */ public LeafElement(Element parent, AttributeSet a, int offs0, int offs1) { @@ -2545,7 +2545,7 @@ public abstract class AbstractDocument implements Document, Serializable { /** * Gets the starting offset in the model for the element. * - * @return the offset >= 0 + * @return the offset >= 0 */ public int getStartOffset() { return p0.getOffset(); @@ -2554,7 +2554,7 @@ public abstract class AbstractDocument implements Document, Serializable { /** * Gets the ending offset in the model for the element. * - * @return the offset >= 0 + * @return the offset >= 0 */ public int getEndOffset() { return p1.getOffset(); @@ -2576,8 +2576,8 @@ public abstract class AbstractDocument implements Document, Serializable { /** * Gets the child element index closest to the given model offset. * - * @param pos the offset >= 0 - * @return the element index >= 0 + * @param pos the offset >= 0 + * @return the element index >= 0 */ public int getElementIndex(int pos) { return -1; @@ -2586,7 +2586,7 @@ public abstract class AbstractDocument implements Document, Serializable { /** * Gets a child element. * - * @param index the child index, >= 0 && < getElementCount() + * @param index the child index, >= 0 && < getElementCount() * @return the child element */ public Element getElement(int index) { @@ -2596,7 +2596,7 @@ public abstract class AbstractDocument implements Document, Serializable { /** * Returns the number of child elements. * - * @return the number of children >= 0 + * @return the number of children >= 0 */ public int getElementCount() { return 0; @@ -2731,8 +2731,8 @@ public abstract class AbstractDocument implements Document, Serializable { /** * Constructs a change record. * - * @param offs the offset into the document of the change >= 0 - * @param len the length of the change >= 0 + * @param offs the offset into the document of the change >= 0 + * @param len the length of the change >= 0 * @param type the type of event (DocumentEvent.EventType) * @since 1.4 */ @@ -2901,7 +2901,7 @@ public abstract class AbstractDocument implements Document, Serializable { /** * Returns the offset within the document of the start of the change. * - * @return the offset >= 0 + * @return the offset >= 0 * @see DocumentEvent#getOffset */ public int getOffset() { @@ -2911,7 +2911,7 @@ public abstract class AbstractDocument implements Document, Serializable { /** * Returns the length of the change. * - * @return the length >= 0 + * @return the length >= 0 * @see DocumentEvent#getLength */ public int getLength() { @@ -3024,7 +3024,7 @@ public abstract class AbstractDocument implements Document, Serializable { * current model state for views that just attached to a model. * * @param e the element - * @param index the index into the model >= 0 + * @param index the index into the model >= 0 * @param removed a set of elements that were removed * @param added a set of elements that were added */ @@ -3048,7 +3048,7 @@ public abstract class AbstractDocument implements Document, Serializable { /** * Returns the index into the list of elements. * - * @return the index >= 0 + * @return the index >= 0 */ public int getIndex() { return index; diff --git a/jdk/src/share/classes/javax/swing/text/AbstractWriter.java b/jdk/src/share/classes/javax/swing/text/AbstractWriter.java index f3397e86679..1a664ce90c1 100644 --- a/jdk/src/share/classes/javax/swing/text/AbstractWriter.java +++ b/jdk/src/share/classes/javax/swing/text/AbstractWriter.java @@ -417,7 +417,7 @@ public abstract class AbstractWriter { /** * Increments the indent level. If indenting would cause - * getIndentSpace() *getIndentLevel() to be > + * getIndentSpace() *getIndentLevel() to be > * than getLineLength() this will not cause an indent. */ protected void incrIndent() { @@ -663,7 +663,7 @@ public abstract class AbstractWriter { } /** - * Writes out the set of attributes as " =" + * Writes out the set of attributes as " <name>=<value>" * pairs. It throws an IOException when encountered. * * @param attr an AttributeSet. diff --git a/jdk/src/share/classes/javax/swing/text/AsyncBoxView.java b/jdk/src/share/classes/javax/swing/text/AsyncBoxView.java index 7876a2c1e04..7440eee2a26 100644 --- a/jdk/src/share/classes/javax/swing/text/AsyncBoxView.java +++ b/jdk/src/share/classes/javax/swing/text/AsyncBoxView.java @@ -193,7 +193,7 @@ public class AsyncBoxView extends View { * of the child at the given index. * * @param index the child index. This should be a - * value >= 0 and < getViewCount(). + * value >= 0 and < getViewCount(). */ protected ChildState getChildState(int index) { synchronized(stats) { @@ -350,8 +350,8 @@ public class AsyncBoxView extends View { * thread will not happen (i.e. the layout thread * acquires a read lock before doing anything). * - * @param offset the starting offset into the child views >= 0 - * @param length the number of existing views to replace >= 0 + * @param offset the starting offset into the child views >= 0 + * @param length the number of existing views to replace >= 0 * @param views the child views to insert */ public void replace(int offset, int length, View[] views) { @@ -417,7 +417,7 @@ public class AsyncBoxView extends View { * the model. This is implemented to fetch the view in the case * where there is a child view for each child element. * - * @param pos the position >= 0 + * @param pos the position >= 0 * @return index of the view representing the given position, or * -1 if no view represents that position */ @@ -525,8 +525,8 @@ public class AsyncBoxView extends View { * axis. Since the minor axis is flexible, work is queued to resize * the children if the minor span changes. * - * @param width the width >= 0 - * @param height the height >= 0 + * @param width the width >= 0 + * @param height the height >= 0 */ public void setSize(float width, float height) { setSpanOnAxis(X_AXIS, width); @@ -618,7 +618,7 @@ public class AsyncBoxView extends View { * axis. * * @param axis may be either View.X_AXIS or View.Y_AXIS - * @return the span the view would like to be rendered into >= 0. + * @return the span the view would like to be rendered into >= 0. * Typically the view is told to render into the span * that is returned, although there is no guarantee. * The parent may choose to resize or break the view. @@ -643,7 +643,7 @@ public class AsyncBoxView extends View { * axis. * * @param axis may be either View.X_AXIS or View.Y_AXIS - * @return the span the view would like to be rendered into >= 0. + * @return the span the view would like to be rendered into >= 0. * Typically the view is told to render into the span * that is returned, although there is no guarantee. * The parent may choose to resize or break the view. @@ -671,7 +671,7 @@ public class AsyncBoxView extends View { * axis. * * @param axis may be either View.X_AXIS or View.Y_AXIS - * @return the span the view would like to be rendered into >= 0. + * @return the span the view would like to be rendered into >= 0. * Typically the view is told to render into the span * that is returned, although there is no guarantee. * The parent may choose to resize or break the view. @@ -690,7 +690,7 @@ public class AsyncBoxView extends View { * the default is to not be a composite view this * returns 0. * - * @return the number of views >= 0 + * @return the number of views >= 0 * @see View#getViewCount */ public int getViewCount() { @@ -703,7 +703,7 @@ public class AsyncBoxView extends View { * Gets the nth child view. Since there are no * children by default, this returns null. * - * @param n the number of the view to get, >= 0 && < getViewCount() + * @param n the number of the view to get, >= 0 && < getViewCount() * @return the view */ public View getView(int n) { @@ -721,7 +721,7 @@ public class AsyncBoxView extends View { * their location. This returns null since the * default is to not have any child views. * - * @param index the index of the child, >= 0 && < getViewCount() + * @param index the index of the child, >= 0 && < getViewCount() * @param a the allocation to this view. * @return the allocation to the child */ @@ -736,7 +736,7 @@ public class AsyncBoxView extends View { * to return -1 to indicate there is no valid child index for any * position. * - * @param pos the position >= 0 + * @param pos the position >= 0 * @return index of the view representing the given position, or * -1 if no view represents that position * @since 1.3 @@ -749,7 +749,7 @@ public class AsyncBoxView extends View { * Provides a mapping from the document model coordinate space * to the coordinate space of the view mapped to it. * - * @param pos the position to convert >= 0 + * @param pos the position to convert >= 0 * @param a the allocated region to render into * @param b the bias toward the previous character or the * next character represented by the offset, in case the @@ -788,11 +788,11 @@ public class AsyncBoxView extends View { * on the child view with a lock on the ChildState object * to avoid interaction with the layout thread. * - * @param x the X coordinate >= 0 - * @param y the Y coordinate >= 0 + * @param x the X coordinate >= 0 + * @param y the Y coordinate >= 0 * @param a the allocated region to render into * @return the location within the model that best represents the - * given point in the view >= 0. The biasReturn argument will be + * given point in the view >= 0. The biasReturn argument will be * filled in to indicate that the point given is closer to the next * character in the model or the previous character in the model. */ @@ -828,16 +828,16 @@ public class AsyncBoxView extends View { * they might not be in the same order found in the model, or they just * might not allow access to some of the locations in the model. * - * @param pos the position to convert >= 0 + * @param pos the position to convert >= 0 * @param a the allocated region to render into * @param direction the direction from the current position that can * be thought of as the arrow keys typically found on a keyboard; * this may be one of the following: - *
          - * SwingConstants.WEST - * SwingConstants.EAST - * SwingConstants.NORTH - * SwingConstants.SOUTH + *
            + *
          • SwingConstants.WEST
          • + *
          • SwingConstants.EAST
          • + *
          • SwingConstants.NORTH
          • + *
          • SwingConstants.SOUTH
          • *
          * @param biasRet an array contain the bias that was checked * @return the location within the model that best represents the next @@ -1007,8 +1007,8 @@ public class AsyncBoxView extends View { * with one or more calls to getChildAllocation that * should also be in the synchronized block. * - * @param x the X coordinate >= 0 - * @param y the Y coordinate >= 0 + * @param x the X coordinate >= 0 + * @param y the Y coordinate >= 0 * @param a the allocation to the View * @return the nearest child index */ diff --git a/jdk/src/share/classes/javax/swing/text/AttributeSet.java b/jdk/src/share/classes/javax/swing/text/AttributeSet.java index 659136d9648..dc146e52069 100644 --- a/jdk/src/share/classes/javax/swing/text/AttributeSet.java +++ b/jdk/src/share/classes/javax/swing/text/AttributeSet.java @@ -89,7 +89,7 @@ public interface AttributeSet { * Returns the number of attributes that are defined locally in this set. * Attributes that are defined in the parent set are not included. * - * @return the number of attributes >= 0 + * @return the number of attributes >= 0 */ public int getAttributeCount(); diff --git a/jdk/src/share/classes/javax/swing/text/Document.java b/jdk/src/share/classes/javax/swing/text/Document.java index 51505707db3..0e89c3d026f 100644 --- a/jdk/src/share/classes/javax/swing/text/Document.java +++ b/jdk/src/share/classes/javax/swing/text/Document.java @@ -187,7 +187,7 @@ public interface Document { * Returns number of characters of content currently * in the document. * - * @return number of characters >= 0 + * @return number of characters >= 0 */ public int getLength(); @@ -280,8 +280,8 @@ public interface Document { * If the Document supports undo/redo, an UndoableEditEvent will * also be generated. * - * @param offs the offset from the beginning >= 0 - * @param len the number of characters to remove >= 0 + * @param offs the offset from the beginning >= 0 + * @param len the number of characters to remove >= 0 * @exception BadLocationException some portion of the removal range * was not a valid part of the document. The location in the exception * is the first bad position encountered. @@ -313,7 +313,7 @@ public interface Document { * If the Document supports undo/redo, an UndoableEditEvent will * also be generated. * - * @param offset the offset into the document to insert the content >= 0. + * @param offset the offset into the document to insert the content >= 0. * All positions that track change at or after the given location * will move. * @param str the string to insert @@ -333,9 +333,9 @@ public interface Document { * of the document. * * @param offset the offset into the document representing the desired - * start of the text >= 0 - * @param length the length of the desired string >= 0 - * @return the text, in a String of length >= 0 + * start of the text >= 0 + * @param length the length of the desired string >= 0 + * @return the text, in a String of length >= 0 * @exception BadLocationException some portion of the given range * was not a valid part of the document. The location in the exception * is the first bad position encountered. @@ -361,7 +361,7 @@ public interface Document { *   Segment text = new Segment(); *   int offs = 0; *   text.setPartialReturn(true); - *   while (nleft > 0) { + *   while (nleft > 0) { *   doc.getText(offs, nleft, text); *   // do someting with text *   nleft -= text.count; @@ -371,8 +371,8 @@ public interface Document { * * * @param offset the offset into the document representing the desired - * start of the text >= 0 - * @param length the length of the desired string >= 0 + * start of the text >= 0 + * @param length the length of the desired string >= 0 * @param txt the Segment object to return the text in * * @exception BadLocationException Some portion of the given range @@ -409,7 +409,7 @@ public interface Document { * insertion is forced to a position that follows the * original position. * - * @param offs the offset from the start of the document >= 0 + * @param offs the offset from the start of the document >= 0 * @return the position * @exception BadLocationException if the given position does not * represent a valid location in the associated document diff --git a/jdk/src/share/classes/javax/swing/text/Element.java b/jdk/src/share/classes/javax/swing/text/Element.java index b0510a240d1..cde494b3673 100644 --- a/jdk/src/share/classes/javax/swing/text/Element.java +++ b/jdk/src/share/classes/javax/swing/text/Element.java @@ -69,7 +69,7 @@ public interface Element { * children, this will be the offset of the first child. * As a document position, there is an implied forward bias. * - * @return the starting offset >= 0 and < getEndOffset(); + * @return the starting offset >= 0 and < getEndOffset(); * @see Document * @see AbstractDocument */ @@ -87,8 +87,8 @@ public interface Element { * the document. As a result of this, it is possible for this to * return a value greater than the length of the document. * - * @return the ending offset > getStartOffset() and - * <= getDocument().getLength() + 1 + * @return the ending offset > getStartOffset() and + * <= getDocument().getLength() + 1 * @see Document * @see AbstractDocument */ @@ -105,8 +105,8 @@ public interface Element { * getElementCount() - 1 if the location is * greater than or equal to the end offset. * - * @param offset the specified offset >= 0 - * @return the element index >= 0 + * @param offset the specified offset >= 0 + * @return the element index >= 0 */ public int getElementIndex(int offset); @@ -114,14 +114,14 @@ public interface Element { * Gets the number of child elements contained by this element. * If this element is a leaf, a count of zero is returned. * - * @return the number of child elements >= 0 + * @return the number of child elements >= 0 */ public int getElementCount(); /** * Fetches the child element at the given index. * - * @param index the specified index >= 0 + * @param index the specified index >= 0 * @return the child element */ public Element getElement(int index); diff --git a/jdk/src/share/classes/javax/swing/text/View.java b/jdk/src/share/classes/javax/swing/text/View.java index 7eed01ef111..8223cc8ed3a 100644 --- a/jdk/src/share/classes/javax/swing/text/View.java +++ b/jdk/src/share/classes/javax/swing/text/View.java @@ -293,7 +293,7 @@ public abstract class View implements SwingConstants { /** * Determines the desired alignment for this view along an * axis. The desired alignment is returned. This should be - * a value >= 0.0 and <= 1.0, where 0 indicates alignment at + * a value >= 0.0 and <= 1.0, where 0 indicates alignment at * the origin and 1.0 indicates alignment to the full span * away from the origin. An alignment of 0.5 would be the * center of the view. @@ -351,7 +351,7 @@ public abstract class View implements SwingConstants { * the default is to not be a composite view this * returns 0. * - * @return the number of views >= 0 + * @return the number of views >= 0 * @see View#getViewCount */ public int getViewCount() { @@ -362,7 +362,7 @@ public abstract class View implements SwingConstants { * Gets the nth child view. Since there are no * children by default, this returns null. * - * @param n the number of the view to get, >= 0 && < getViewCount() + * @param n the number of the view to get, >= 0 && < getViewCount() * @return the view */ public View getView(int n) { @@ -393,7 +393,7 @@ public abstract class View implements SwingConstants { * Inserts a single child view. This is a convenience * call to replace. * - * @param offs the offset of the view to insert before >= 0 + * @param offs the offset of the view to insert before >= 0 * @param v the view * @see #replace * @since 1.3 @@ -428,9 +428,9 @@ public abstract class View implements SwingConstants { * a view has no children. * * @param offset the starting index into the child views to insert - * the new views. This should be a value >= 0 and <= getViewCount + * the new views. This should be a value >= 0 and <= getViewCount * @param length the number of existing child views to remove - * This should be a value >= 0 and <= (getViewCount() - offset). + * This should be a value >= 0 and <= (getViewCount() - offset). * @param views the child views to add. This value can be * null to indicate no children are being added * (useful to remove). @@ -445,7 +445,7 @@ public abstract class View implements SwingConstants { * to return -1 to indicate there is no valid child index for any * position. * - * @param pos the position >= 0 + * @param pos the position >= 0 * @return index of the view representing the given position, or * -1 if no view represents that position * @since 1.3 @@ -461,7 +461,7 @@ public abstract class View implements SwingConstants { * their location. This returns null since the * default is to not have any child views. * - * @param index the index of the child, >= 0 && < + * @param index the index of the child, >= 0 && < * getViewCount() * @param a the allocation to this view * @return the allocation to the child @@ -477,7 +477,7 @@ public abstract class View implements SwingConstants { * they might not be in the same order found in the model, or they just * might not allow access to some of the locations in the model. * - * @param pos the position to convert >= 0 + * @param pos the position to convert >= 0 * @param a the allocated region in which to render * @param direction the direction from the current position that can * be thought of as the arrow keys typically found on a keyboard. @@ -566,7 +566,7 @@ public abstract class View implements SwingConstants { * from the document model coordinate space * to the view coordinate space. * - * @param pos the position of the desired character (>=0) + * @param pos the position of the desired character (>=0) * @param a the area of the view, which encompasses the requested character * @param b the bias toward the previous character or the * next character represented by the offset, in case the @@ -592,17 +592,17 @@ public abstract class View implements SwingConstants { * to the view coordinate space. The specified region is * created as a union of the first and last character positions. * - * @param p0 the position of the first character (>=0) + * @param p0 the position of the first character (>=0) * @param b0 the bias of the first character position, * toward the previous character or the * next character represented by the offset, in case the * position is a boundary of two views; b0 will have one * of these values: - *
            + *
              *
            • Position.Bias.Forward *
            • Position.Bias.Backward *
            - * @param p1 the position of the last character (>=0) + * @param p1 the position of the last character (>=0) * @param b1 the bias for the second character position, defined * one of the legal values shown above * @param a the area of the view, which encompasses the requested region @@ -656,11 +656,11 @@ public abstract class View implements SwingConstants { * closer to the next character in the model or the previous * character in the model. * - * @param x the X coordinate >= 0 - * @param y the Y coordinate >= 0 + * @param x the X coordinate >= 0 + * @param y the Y coordinate >= 0 * @param a the allocated region in which to render * @return the location within the model that best represents the - * given point in the view >= 0. The biasReturn + * given point in the view >= 0. The biasReturn * argument will be * filled in to indicate that the point given is closer to the next * character in the model or the previous character in the model. @@ -804,7 +804,7 @@ public abstract class View implements SwingConstants { * Fetches the portion of the model for which this view is * responsible. * - * @return the starting offset into the model >= 0 + * @return the starting offset into the model >= 0 * @see View#getStartOffset */ public int getStartOffset() { @@ -815,7 +815,7 @@ public abstract class View implements SwingConstants { * Fetches the portion of the model for which this view is * responsible. * - * @return the ending offset into the model >= 0 + * @return the ending offset into the model >= 0 * @see View#getEndOffset */ public int getEndOffset() { @@ -884,14 +884,14 @@ public abstract class View implements SwingConstants { * @param axis may be either View.X_AXIS or * View.Y_AXIS * @param offset the location in the document model - * that a broken fragment would occupy >= 0. This + * that a broken fragment would occupy >= 0. This * would be the starting offset of the fragment * returned * @param pos the position along the axis that the - * broken view would occupy >= 0. This may be useful for + * broken view would occupy >= 0. This may be useful for * things like tab calculations * @param len specifies the distance along the axis - * where a potential break is desired >= 0 + * where a potential break is desired >= 0 * @return the fragment of the view that represents the * given span, if the view can be broken. If the view * doesn't support breaking behavior, the view itself is @@ -909,10 +909,10 @@ public abstract class View implements SwingConstants { * the view doesn't support fragmenting (the default), it * should return itself. * - * @param p0 the starting offset >= 0. This should be a value + * @param p0 the starting offset >= 0. This should be a value * greater or equal to the element starting offset and * less than the element ending offset. - * @param p1 the ending offset > p0. This should be a value + * @param p1 the ending offset > p0. This should be a value * less than or equal to the elements end offset and * greater than the elements starting offset. * @return the view fragment, or itself if the view doesn't @@ -949,10 +949,10 @@ public abstract class View implements SwingConstants { * @param axis may be either View.X_AXIS or * View.Y_AXIS * @param pos the potential location of the start of the - * broken view >= 0. This may be useful for calculating tab + * broken view >= 0. This may be useful for calculating tab * positions * @param len specifies the relative length from pos - * where a potential break is desired >= 0 + * where a potential break is desired >= 0 * @return the weight, which should be a value between * ForcedBreakWeight and BadBreakWeight * @see LabelView @@ -986,8 +986,8 @@ public abstract class View implements SwingConstants { * layout of the view along the given axis, if it * has any layout duties. * - * @param width the width >= 0 - * @param height the height >= 0 + * @param width the width >= 0 + * @param height the height >= 0 */ public void setSize(float width, float height) { } @@ -1314,7 +1314,7 @@ public abstract class View implements SwingConstants { * implemented to default the bias to Position.Bias.Forward * which was previously implied. * - * @param pos the position to convert >= 0 + * @param pos the position to convert >= 0 * @param a the allocated region in which to render * @return the bounding box of the given position is returned * @exception BadLocationException if the given position does @@ -1332,11 +1332,11 @@ public abstract class View implements SwingConstants { * Provides a mapping from the view coordinate space to the logical * coordinate space of the model. * - * @param x the X coordinate >= 0 - * @param y the Y coordinate >= 0 + * @param x the X coordinate >= 0 + * @param y the Y coordinate >= 0 * @param a the allocated region in which to render * @return the location within the model that best represents the - * given point in the view >= 0 + * given point in the view >= 0 * @see View#viewToModel * @deprecated */ From c49c083729bed50fd69f39b697dafeab4f1f73b3 Mon Sep 17 00:00:00 2001 From: Alexander Stepanov Date: Fri, 27 Sep 2013 14:29:27 +0400 Subject: [PATCH 046/131] 8024122: [TEST] need test to cover JDK-7146572 Reviewed-by: anthony, yan --- .../InputMethodsTest/InputMethodsTest.html | 17 ++++ .../InputMethodsTest/InputMethodsTest.java | 90 +++++++++++++++++++ 2 files changed, 107 insertions(+) create mode 100644 jdk/test/java/awt/InputMethods/InputMethodsTest/InputMethodsTest.html create mode 100644 jdk/test/java/awt/InputMethods/InputMethodsTest/InputMethodsTest.java diff --git a/jdk/test/java/awt/InputMethods/InputMethodsTest/InputMethodsTest.html b/jdk/test/java/awt/InputMethods/InputMethodsTest/InputMethodsTest.html new file mode 100644 index 00000000000..b92e6c738c0 --- /dev/null +++ b/jdk/test/java/awt/InputMethods/InputMethodsTest/InputMethodsTest.html @@ -0,0 +1,17 @@ + + + InputMethodsTest + + + + +This test is for Linux only. For other platforms please simply push "Pass". + +Test run requires some Japanese input method to be installed. + +To test JDK-7146572 fix please perform the following steps: +1. Switch on input method and type Japanese in the above text fields. +2. Push "Disable Input Methods" button. +3. Try to type Japanese again. If it can be done then the test is failed; otherwise passed. + + diff --git a/jdk/test/java/awt/InputMethods/InputMethodsTest/InputMethodsTest.java b/jdk/test/java/awt/InputMethods/InputMethodsTest/InputMethodsTest.java new file mode 100644 index 00000000000..a5665c906b9 --- /dev/null +++ b/jdk/test/java/awt/InputMethods/InputMethodsTest/InputMethodsTest.java @@ -0,0 +1,90 @@ +/* + * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + + +/* + @test + @bug 7146572 8024122 + @summary Check if 'enableInputMethods' works properly for TextArea and TextField on Linux platform + @author a.stepanov + @run applet/manual=yesno InputMethodsTest.html +*/ + + +import java.applet.Applet; +import java.awt.*; +import javax.swing.*; +import java.awt.event.*; + + +public class InputMethodsTest extends Applet { + + TextArea txtArea = null; + TextField txtField = null; + JButton btnIM = null; + boolean inputMethodsEnabled = true; + + public void init() { + this.setLayout(new BorderLayout()); + } + + public void start() { + + setSize(350, 200); + + JPanel panel = new JPanel(); + panel.setLayout(new GridLayout(2, 1)); + + txtArea = new TextArea(); + panel.add(txtArea); + + txtField = new TextField(); + panel.add(txtField); + + add(panel, BorderLayout.CENTER); + + btnIM = new JButton(); + setBtnText(); + + btnIM.addActionListener(new ActionListener() { + @Override + public void actionPerformed(ActionEvent e) { + inputMethodsEnabled = !inputMethodsEnabled; + setBtnText(); + txtArea.enableInputMethods(inputMethodsEnabled); + txtField.enableInputMethods(inputMethodsEnabled); + } + }); + + add(btnIM, BorderLayout.SOUTH); + + validate(); + setVisible(true); + } + + private void setBtnText() { + String s = inputMethodsEnabled ? "Disable" : "Enable"; + btnIM.setText(s + " Input Methods"); + } +} + From 9d67cb2e944bb2652f224a2814b031465bf43224 Mon Sep 17 00:00:00 2001 From: Petr Pchelko Date: Fri, 27 Sep 2013 17:04:16 +0400 Subject: [PATCH 047/131] 8025503: [macosx] FileDialog allows file selection with apple.awt.fileDialogForDirectories = true Reviewed-by: serb, anthony --- jdk/src/macosx/native/sun/awt/CFileDialog.m | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/jdk/src/macosx/native/sun/awt/CFileDialog.m b/jdk/src/macosx/native/sun/awt/CFileDialog.m index be7cadc64fb..af92c77bed3 100644 --- a/jdk/src/macosx/native/sun/awt/CFileDialog.m +++ b/jdk/src/macosx/native/sun/awt/CFileDialog.m @@ -110,7 +110,7 @@ canChooseDirectories:(BOOL)inChooseDirectories if (fMode == java_awt_FileDialog_LOAD) { NSOpenPanel *openPanel = (NSOpenPanel *)thePanel; [openPanel setAllowsMultipleSelection:fMultipleMode]; - [openPanel setCanChooseFiles:YES]; + [openPanel setCanChooseFiles:!fChooseDirectories]; [openPanel setCanChooseDirectories:fChooseDirectories]; [openPanel setCanCreateDirectories:YES]; } From 247ec6ca80832dfd6790ce4fb7a4a6c3ceb15102 Mon Sep 17 00:00:00 2001 From: Petr Pchelko Date: Fri, 27 Sep 2013 18:35:00 +0400 Subject: [PATCH 048/131] 8016563: Test closed/java/awt/dnd/ImageTransferTest/ImageTransferTest.html fails Reviewed-by: anthony, serb --- .../classes/sun/awt/datatransfer/DataTransferer.java | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/jdk/src/share/classes/sun/awt/datatransfer/DataTransferer.java b/jdk/src/share/classes/sun/awt/datatransfer/DataTransferer.java index 493d80a4c82..821ccdc9c8c 100644 --- a/jdk/src/share/classes/sun/awt/datatransfer/DataTransferer.java +++ b/jdk/src/share/classes/sun/awt/datatransfer/DataTransferer.java @@ -1793,8 +1793,17 @@ search: } catch (Exception e) { throw new IOException(e.getMessage()); } + // Target data is Image + } else if (DataFlavor.imageFlavor.equals(flavor)) { + if (!isImageFormat(format)) { + throw new IOException("data translation failed"); + } + theObject = platformImageBytesToImage(inputStreamToByteArray(str), format); } + if (theObject == null) { + throw new IOException("data translation failed"); + } return theObject; From dd224c8deb4e364ba17379f36a89f990f04d32d5 Mon Sep 17 00:00:00 2001 From: Sergey Malenkov Date: Fri, 27 Sep 2013 22:17:24 +0400 Subject: [PATCH 049/131] 8012716: java.beans.EventHandler.create method should check if the given listenerInterface is a public interface Reviewed-by: art, mchung --- .../classes/java/beans/EventHandler.java | 27 +++++++++++++++---- 1 file changed, 22 insertions(+), 5 deletions(-) diff --git a/jdk/src/share/classes/java/beans/EventHandler.java b/jdk/src/share/classes/java/beans/EventHandler.java index b428f2892a1..935f7359e26 100644 --- a/jdk/src/share/classes/java/beans/EventHandler.java +++ b/jdk/src/share/classes/java/beans/EventHandler.java @@ -33,6 +33,7 @@ import java.security.AccessController; import java.security.PrivilegedAction; import sun.reflect.misc.MethodUtil; +import sun.reflect.misc.ReflectUtil; /** * The EventHandler class provides @@ -677,22 +678,38 @@ public class EventHandler implements InvocationHandler { * * @see EventHandler */ - @SuppressWarnings("unchecked") public static T create(Class listenerInterface, Object target, String action, String eventPropertyName, String listenerMethodName) { // Create this first to verify target/action are non-null - EventHandler eventHandler = new EventHandler(target, action, + final EventHandler handler = new EventHandler(target, action, eventPropertyName, listenerMethodName); if (listenerInterface == null) { throw new NullPointerException( "listenerInterface must be non-null"); } - return (T)Proxy.newProxyInstance(target.getClass().getClassLoader(), - new Class[] {listenerInterface}, - eventHandler); + final ClassLoader loader = getClassLoader(listenerInterface); + final Class[] interfaces = {listenerInterface}; + return AccessController.doPrivileged(new PrivilegedAction() { + @SuppressWarnings("unchecked") + public T run() { + return (T) Proxy.newProxyInstance(loader, interfaces, handler); + } + }); + } + + private static ClassLoader getClassLoader(Class type) { + ReflectUtil.checkPackageAccess(type); + ClassLoader loader = type.getClassLoader(); + if (loader == null) { + loader = Thread.currentThread().getContextClassLoader(); // avoid use of BCP + if (loader == null) { + loader = ClassLoader.getSystemClassLoader(); + } + } + return loader; } } From e37d16f11b715c32c26165d17c70bfa666a03ced Mon Sep 17 00:00:00 2001 From: Sergey Malenkov Date: Fri, 27 Sep 2013 22:25:58 +0400 Subject: [PATCH 050/131] 7117595: ArrayIndexOutOfBoundsException in Win32GraphicsEnvironment if display is removed Reviewed-by: anthony, serb --- jdk/src/macosx/classes/sun/awt/CGraphicsEnvironment.java | 3 +++ .../share/classes/sun/java2d/SunGraphicsEnvironment.java | 6 +++++- .../solaris/classes/sun/awt/X11GraphicsEnvironment.java | 7 ++++++- .../windows/classes/sun/awt/Win32GraphicsEnvironment.java | 7 ++++++- 4 files changed, 20 insertions(+), 3 deletions(-) diff --git a/jdk/src/macosx/classes/sun/awt/CGraphicsEnvironment.java b/jdk/src/macosx/classes/sun/awt/CGraphicsEnvironment.java index a2319e675f0..a117d99f42c 100644 --- a/jdk/src/macosx/classes/sun/awt/CGraphicsEnvironment.java +++ b/jdk/src/macosx/classes/sun/awt/CGraphicsEnvironment.java @@ -181,6 +181,9 @@ public final class CGraphicsEnvironment extends SunGraphicsEnvironment { initDevices(); d = devices.get(mainDisplayID); + if (d == null) { + throw new AWTError("no screen devices"); + } } return d; } diff --git a/jdk/src/share/classes/sun/java2d/SunGraphicsEnvironment.java b/jdk/src/share/classes/sun/java2d/SunGraphicsEnvironment.java index 724fa2f1d10..5bd2d2f99ee 100644 --- a/jdk/src/share/classes/sun/java2d/SunGraphicsEnvironment.java +++ b/jdk/src/share/classes/sun/java2d/SunGraphicsEnvironment.java @@ -165,7 +165,11 @@ public abstract class SunGraphicsEnvironment extends GraphicsEnvironment * Returns the default screen graphics device. */ public GraphicsDevice getDefaultScreenDevice() { - return getScreenDevices()[0]; + GraphicsDevice[] screens = getScreenDevices(); + if (screens.length == 0) { + throw new AWTError("no screen devices"); + } + return screens[0]; } /** diff --git a/jdk/src/solaris/classes/sun/awt/X11GraphicsEnvironment.java b/jdk/src/solaris/classes/sun/awt/X11GraphicsEnvironment.java index 4e1c816fd18..3dece38d457 100644 --- a/jdk/src/solaris/classes/sun/awt/X11GraphicsEnvironment.java +++ b/jdk/src/solaris/classes/sun/awt/X11GraphicsEnvironment.java @@ -200,7 +200,12 @@ public class X11GraphicsEnvironment * Returns the default screen graphics device. */ public GraphicsDevice getDefaultScreenDevice() { - return getScreenDevices()[getDefaultScreenNum()]; + GraphicsDevice[] screens = getScreenDevices(); + if (screens.length == 0) { + throw new AWTError("no screen devices"); + } + int index = getDefaultScreenNum(); + return screens[0 < index && index < screens.length ? index : 0]; } public boolean isDisplayLocal() { diff --git a/jdk/src/windows/classes/sun/awt/Win32GraphicsEnvironment.java b/jdk/src/windows/classes/sun/awt/Win32GraphicsEnvironment.java index a3a48e2d7b4..c3e684b4142 100644 --- a/jdk/src/windows/classes/sun/awt/Win32GraphicsEnvironment.java +++ b/jdk/src/windows/classes/sun/awt/Win32GraphicsEnvironment.java @@ -93,7 +93,12 @@ public class Win32GraphicsEnvironment protected native int getDefaultScreen(); public GraphicsDevice getDefaultScreenDevice() { - return getScreenDevices()[getDefaultScreen()]; + GraphicsDevice[] screens = getScreenDevices(); + if (screens.length == 0) { + throw new AWTError("no screen devices"); + } + int index = getDefaultScreen(); + return screens[0 < index && index < screens.length ? index : 0]; } /** From 2c516bc7b4990e1b29ca1d28fa563baa3caa0e58 Mon Sep 17 00:00:00 2001 From: Patrick Reinhart Date: Fri, 27 Sep 2013 13:04:54 -0700 Subject: [PATCH 051/131] 6870661: Setting a custom PrintService on a PrinterJob leads to a PrinterException Reviewed-by: prr, jgodinez --- .../classes/sun/awt/windows/WPrinterJob.java | 9 +- .../CustomPrintService/PrintDialog.java | 59 +++++++ .../CustomPrintService/PrintServiceStub.java | 160 ++++++++++++++++++ .../SetPrintServiceTest.java | 48 ++++++ 4 files changed, 271 insertions(+), 5 deletions(-) create mode 100644 jdk/test/java/awt/print/PrinterJob/CustomPrintService/PrintDialog.java create mode 100644 jdk/test/java/awt/print/PrinterJob/CustomPrintService/PrintServiceStub.java create mode 100644 jdk/test/java/awt/print/PrinterJob/CustomPrintService/SetPrintServiceTest.java diff --git a/jdk/src/windows/classes/sun/awt/windows/WPrinterJob.java b/jdk/src/windows/classes/sun/awt/windows/WPrinterJob.java index 519a0be422e..6f22231a53c 100644 --- a/jdk/src/windows/classes/sun/awt/windows/WPrinterJob.java +++ b/jdk/src/windows/classes/sun/awt/windows/WPrinterJob.java @@ -96,7 +96,6 @@ import javax.print.attribute.standard.PrinterName; import javax.print.attribute.standard.JobMediaSheetsSupported; import javax.print.attribute.standard.PageRanges; import javax.print.attribute.Size2DSyntax; -import javax.print.StreamPrintService; import sun.awt.Win32FontManager; @@ -440,7 +439,7 @@ public class WPrinterJob extends RasterPrinterJob implements DisposerTarget { throw new HeadlessException(); } - if (getPrintService() instanceof StreamPrintService) { + if (!(getPrintService() instanceof Win32PrintService)) { return super.pageDialog(page); } @@ -586,7 +585,7 @@ public class WPrinterJob extends RasterPrinterJob implements DisposerTarget { attributes = new HashPrintRequestAttributeSet(); } - if (getPrintService() instanceof StreamPrintService) { + if (!(getPrintService() instanceof Win32PrintService)) { return super.printDialog(attributes); } @@ -611,7 +610,7 @@ public class WPrinterJob extends RasterPrinterJob implements DisposerTarget { public void setPrintService(PrintService service) throws PrinterException { super.setPrintService(service); - if (service instanceof StreamPrintService) { + if (!(service instanceof Win32PrintService)) { return; } driverDoesMultipleCopies = false; @@ -648,7 +647,7 @@ public class WPrinterJob extends RasterPrinterJob implements DisposerTarget { } myService = PrintServiceLookup.lookupDefaultPrintService(); - if (myService != null) { + if (myService instanceof Win32PrintService) { try { setNativePrintServiceIfNeeded(myService.getName()); } catch (Exception e) { diff --git a/jdk/test/java/awt/print/PrinterJob/CustomPrintService/PrintDialog.java b/jdk/test/java/awt/print/PrinterJob/CustomPrintService/PrintDialog.java new file mode 100644 index 00000000000..d18ee86878d --- /dev/null +++ b/jdk/test/java/awt/print/PrinterJob/CustomPrintService/PrintDialog.java @@ -0,0 +1,59 @@ +/* + * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +import java.awt.*; +import java.awt.print.PrinterJob; +import javax.print.PrintServiceLookup; + +/** + * @test + * @bug 6870661 + * @summary Verify that no native dialog is opened for a custom PrintService + * @run main/manual PrintDialog + * @author reinhapa + */ +public class PrintDialog { + + private static final String instructions = + "This test shows a non native print dialog having a 'test' print service\n" + + "selected. No other options are selectable on the General tab. The other\n" + + "tabs are as follows:\n" + + "Page Setup: Media & Margins enabled, Orientation disabled\n" + + "Appearance: All parts disabled\n\n" + + "Test passes if the dialog is shown as described above."; + + public static void main(String[] args) throws Exception { + // instruction dialog + Frame instruction = new Frame("Verify that no native print dialog is showed"); + instruction.add(new TextArea(instructions)); + instruction.pack(); + instruction.show(); + // test begin + PrintServiceStub service = new PrintServiceStub("test"); + PrintServiceLookup.registerService(service); + PrinterJob job = PrinterJob.getPrinterJob(); + job.setPrintService(service); + job.printDialog(); + System.out.println("test passed"); + } +} diff --git a/jdk/test/java/awt/print/PrinterJob/CustomPrintService/PrintServiceStub.java b/jdk/test/java/awt/print/PrinterJob/CustomPrintService/PrintServiceStub.java new file mode 100644 index 00000000000..c430959c42b --- /dev/null +++ b/jdk/test/java/awt/print/PrinterJob/CustomPrintService/PrintServiceStub.java @@ -0,0 +1,160 @@ +/* + * 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. + */ + +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Set; + +import javax.print.DocFlavor; +import javax.print.DocPrintJob; +import javax.print.PrintService; +import javax.print.ServiceUIFactory; +import javax.print.attribute.Attribute; +import javax.print.attribute.AttributeSet; +import javax.print.attribute.HashPrintServiceAttributeSet; +import javax.print.attribute.PrintServiceAttribute; +import javax.print.attribute.PrintServiceAttributeSet; +import javax.print.attribute.standard.Media; +import javax.print.attribute.standard.MediaSizeName; +import javax.print.attribute.standard.PrinterInfo; +import javax.print.attribute.standard.PrinterIsAcceptingJobs; +import javax.print.attribute.standard.PrinterMakeAndModel; +import javax.print.attribute.standard.PrinterName; +import javax.print.attribute.standard.PrinterState; +import javax.print.event.PrintServiceAttributeListener; + +/** + * Stub implementation of a custom {@link PrintService}. + * + * @author reinhapa + */ +public class PrintServiceStub implements PrintService { + private final String _name; + private final Set _flavors; + private final Map, Object> _attributes; + + public PrintServiceStub(String name) { + _name = name; + _flavors = new HashSet(); + _flavors.add(DocFlavor.SERVICE_FORMATTED.PAGEABLE); + _flavors.add(DocFlavor.SERVICE_FORMATTED.PRINTABLE); + _attributes = new HashMap<>(); + _attributes.put(PrinterName.class, new PrinterName(name, null)); + _attributes.put(PrinterState.class, PrinterState.IDLE); + _attributes.put(PrinterInfo.class, new PrinterInfo("Custom location", + null)); + _attributes.put(PrinterIsAcceptingJobs.class, + PrinterIsAcceptingJobs.ACCEPTING_JOBS); + _attributes.put(PrinterMakeAndModel.class, new PrinterMakeAndModel( + "Custom printer", null)); + _attributes.put(Media.class, new Media[] { MediaSizeName.ISO_A4 }); + } + + @Override + public String getName() { + return _name; + } + + @Override + public boolean isDocFlavorSupported(DocFlavor flavor) { + return _flavors.contains(flavor); + } + + @Override + public Object getSupportedAttributeValues( + Class category, DocFlavor flavor, + AttributeSet attributes) { + return _attributes.get(category); + } + + @Override + public boolean isAttributeCategorySupported( + Class category) { + return _attributes.containsKey(category); + } + + @Override + public T getAttribute(Class category) { + return category.cast(_attributes.get(category)); + } + + @Override + public PrintServiceAttributeSet getAttributes() { + return new HashPrintServiceAttributeSet(_attributes.values().toArray( + new PrintServiceAttribute[_attributes.size()])); + } + + @Override + public DocFlavor[] getSupportedDocFlavors() { + return _flavors.toArray(new DocFlavor[_flavors.size()]); + } + + // not implemented methods + + @Override + public DocPrintJob createPrintJob() { + return null; + } + + @Override + public void addPrintServiceAttributeListener( + PrintServiceAttributeListener listener) { + + } + + @Override + public void removePrintServiceAttributeListener( + PrintServiceAttributeListener listener) { + + } + + @Override + public Class[] getSupportedAttributeCategories() { + return null; + } + + @Override + public Object getDefaultAttributeValue(Class category) { + return null; + } + + @Override + public boolean isAttributeValueSupported(Attribute attrval, + DocFlavor flavor, AttributeSet attributes) { + return false; + } + + @Override + public AttributeSet getUnsupportedAttributes(DocFlavor flavor, + AttributeSet attributes) { + return null; + } + + @Override + public ServiceUIFactory getServiceUIFactory() { + return null; + } +} diff --git a/jdk/test/java/awt/print/PrinterJob/CustomPrintService/SetPrintServiceTest.java b/jdk/test/java/awt/print/PrinterJob/CustomPrintService/SetPrintServiceTest.java new file mode 100644 index 00000000000..a6bc7ff9877 --- /dev/null +++ b/jdk/test/java/awt/print/PrinterJob/CustomPrintService/SetPrintServiceTest.java @@ -0,0 +1,48 @@ +/* + * 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. + */ + +import java.awt.print.PrinterException; +import java.awt.print.PrinterJob; + +/** + * @test + * @bug 6870661 + * @summary tests setPrintService() with a custom implementation + * @author reinhapa + */ +public class SetPrintServiceTest { + + public static void main(String[] args) { + PrintServiceStub service = new PrintServiceStub("CustomPrintService"); + PrinterJob printerJob = PrinterJob.getPrinterJob(); + try { + printerJob.setPrintService(service); + System.out.println("Test Passed"); + } catch (PrinterException e) { + throw new RuntimeException("Test FAILED", e); + } + } + +} From 7001d7b786ab50f0037608266ba6d03e334c40de Mon Sep 17 00:00:00 2001 From: Phil Race Date: Fri, 27 Sep 2013 13:06:47 -0700 Subject: [PATCH 052/131] 8020190: Fatal: Bug in native code: jfieldID must match object Reviewed-by: jgodinez, vadim --- jdk/src/share/classes/sun/font/FreetypeFontScaler.java | 8 ++++---- jdk/src/share/native/sun/font/freetypeScaler.c | 9 +++++---- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/jdk/src/share/classes/sun/font/FreetypeFontScaler.java b/jdk/src/share/classes/sun/font/FreetypeFontScaler.java index 3edfe5f0e6a..b4d961a881d 100644 --- a/jdk/src/share/classes/sun/font/FreetypeFontScaler.java +++ b/jdk/src/share/classes/sun/font/FreetypeFontScaler.java @@ -169,7 +169,7 @@ class FreetypeFontScaler extends FontScaler { public synchronized void dispose() { if (nativeScaler != 0L) { - disposeNativeScaler(nativeScaler); + disposeNativeScaler(font.get(), nativeScaler); nativeScaler = 0L; } } @@ -190,7 +190,7 @@ class FreetypeFontScaler extends FontScaler { synchronized int getGlyphCode(char charCode) throws FontScalerException { if (nativeScaler != 0L) { - return getGlyphCodeNative(nativeScaler, charCode); + return getGlyphCodeNative(font.get(), nativeScaler, charCode); } return FontScaler.getNullScaler().getGlyphCode(charCode); } @@ -245,9 +245,9 @@ class FreetypeFontScaler extends FontScaler { private native long getLayoutTableCacheNative(long pScaler); - private native void disposeNativeScaler(long pScaler); + private native void disposeNativeScaler(Font2D font2D, long pScaler); - private native int getGlyphCodeNative(long pScaler, char charCode); + private native int getGlyphCodeNative(Font2D font, long pScaler, char charCode); private native int getNumGlyphsNative(long pScaler); private native int getMissingGlyphCodeNative(long pScaler); diff --git a/jdk/src/share/native/sun/font/freetypeScaler.c b/jdk/src/share/native/sun/font/freetypeScaler.c index e84e77c4207..7e82c4da555 100644 --- a/jdk/src/share/native/sun/font/freetypeScaler.c +++ b/jdk/src/share/native/sun/font/freetypeScaler.c @@ -902,13 +902,13 @@ Java_sun_font_FreetypeFontScaler_getLayoutTableCacheNative( */ JNIEXPORT void JNICALL Java_sun_font_FreetypeFontScaler_disposeNativeScaler( - JNIEnv *env, jobject scaler, jlong pScaler) { + JNIEnv *env, jobject scaler, jobject font2D, jlong pScaler) { FTScalerInfo* scalerInfo = (FTScalerInfo *) jlong_to_ptr(pScaler); /* Freetype functions *may* cause callback to java that can use cached values. Make sure our cache is up to date. NB: scaler context is not important at this point, can use NULL. */ - int errCode = setupFTContext(env, scaler, scalerInfo, NULL); + int errCode = setupFTContext(env, font2D, scalerInfo, NULL); if (errCode) { return; } @@ -957,7 +957,8 @@ Java_sun_font_FreetypeFontScaler_getMissingGlyphCodeNative( */ JNIEXPORT jint JNICALL Java_sun_font_FreetypeFontScaler_getGlyphCodeNative( - JNIEnv *env, jobject scaler, jlong pScaler, jchar charCode) { + JNIEnv *env, jobject scaler, + jobject font2D, jlong pScaler, jchar charCode) { FTScalerInfo* scalerInfo = (FTScalerInfo *) jlong_to_ptr(pScaler); int errCode; @@ -970,7 +971,7 @@ Java_sun_font_FreetypeFontScaler_getGlyphCodeNative( /* Freetype functions *may* cause callback to java that can use cached values. Make sure our cache is up to date. Scaler context is not important here, can use NULL. */ - errCode = setupFTContext(env, scaler, scalerInfo, NULL); + errCode = setupFTContext(env, font2D, scalerInfo, NULL); if (errCode) { return 0; } From b75899e391a18d1bb0278e3b74897bebce5a343b Mon Sep 17 00:00:00 2001 From: Vadim Pakhnushev Date: Mon, 30 Sep 2013 12:50:52 +0400 Subject: [PATCH 053/131] 8001119: [fingbugs] Evaluate necessity to make some arrays package protected Reviewed-by: prr, bae --- .../plugins/bmp/BMPCompressionTypes.java | 47 +++++++++++++++ .../sun/imageio/plugins/bmp/BMPConstants.java | 3 - .../imageio/plugins/bmp/BMPImageWriter.java | 59 +++++++------------ .../sun/imageio/plugins/bmp/BMPMetadata.java | 2 +- .../plugins/gif/GIFStreamMetadata.java | 7 +-- .../com/sun/imageio/plugins/jpeg/JPEG.java | 13 ++-- .../sun/imageio/plugins/png/PNGMetadata.java | 24 ++++---- .../plugins/bmp/BMPImageWriteParam.java | 3 +- 8 files changed, 90 insertions(+), 68 deletions(-) create mode 100644 jdk/src/share/classes/com/sun/imageio/plugins/bmp/BMPCompressionTypes.java diff --git a/jdk/src/share/classes/com/sun/imageio/plugins/bmp/BMPCompressionTypes.java b/jdk/src/share/classes/com/sun/imageio/plugins/bmp/BMPCompressionTypes.java new file mode 100644 index 00000000000..c61beeeb789 --- /dev/null +++ b/jdk/src/share/classes/com/sun/imageio/plugins/bmp/BMPCompressionTypes.java @@ -0,0 +1,47 @@ +/* + * 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.imageio.plugins.bmp; + +public class BMPCompressionTypes { + + private static final String[] compressionTypeNames = + {"BI_RGB", "BI_RLE8", "BI_RLE4", "BI_BITFIELDS", "BI_JPEG", "BI_PNG"}; + + static int getType(String typeString) { + for (int i = 0; i < compressionTypeNames.length; i++) + if (compressionTypeNames[i].equals(typeString)) + return i; + return 0; + } + + static String getName(int type) { + return compressionTypeNames[type]; + } + + public static String[] getCompressionTypes() { + return compressionTypeNames.clone(); + } +} diff --git a/jdk/src/share/classes/com/sun/imageio/plugins/bmp/BMPConstants.java b/jdk/src/share/classes/com/sun/imageio/plugins/bmp/BMPConstants.java index 7934eaf17c0..b99d28484a7 100644 --- a/jdk/src/share/classes/com/sun/imageio/plugins/bmp/BMPConstants.java +++ b/jdk/src/share/classes/com/sun/imageio/plugins/bmp/BMPConstants.java @@ -47,7 +47,4 @@ public interface BMPConstants { static final int BI_BITFIELDS = 3; static final int BI_JPEG = 4; static final int BI_PNG = 5; - - static final String[] compressionTypeNames = - {"BI_RGB", "BI_RLE8", "BI_RLE4", "BI_BITFIELDS", "BI_JPEG", "BI_PNG"}; } diff --git a/jdk/src/share/classes/com/sun/imageio/plugins/bmp/BMPImageWriter.java b/jdk/src/share/classes/com/sun/imageio/plugins/bmp/BMPImageWriter.java index bfed710d1fc..5d1241ec53f 100644 --- a/jdk/src/share/classes/com/sun/imageio/plugins/bmp/BMPImageWriter.java +++ b/jdk/src/share/classes/com/sun/imageio/plugins/bmp/BMPImageWriter.java @@ -25,7 +25,6 @@ package com.sun.imageio.plugins.bmp; -import java.awt.Point; import java.awt.Rectangle; import java.awt.image.ColorModel; import java.awt.image.ComponentSampleModel; @@ -42,7 +41,6 @@ import java.awt.image.Raster; import java.awt.image.RenderedImage; import java.awt.image.SampleModel; import java.awt.image.SinglePixelPackedSampleModel; -import java.awt.image.WritableRaster; import java.awt.image.BufferedImage; import java.io.IOException; @@ -51,22 +49,16 @@ import java.nio.ByteOrder; import java.util.Iterator; import javax.imageio.IIOImage; -import javax.imageio.IIOException; import javax.imageio.ImageIO; import javax.imageio.ImageTypeSpecifier; import javax.imageio.ImageWriteParam; import javax.imageio.ImageWriter; import javax.imageio.metadata.IIOMetadata; -import javax.imageio.metadata.IIOMetadataNode; -import javax.imageio.metadata.IIOMetadataFormatImpl; -import javax.imageio.metadata.IIOInvalidTreeException; import javax.imageio.spi.ImageWriterSpi; import javax.imageio.stream.ImageOutputStream; import javax.imageio.event.IIOWriteProgressListener; import javax.imageio.event.IIOWriteWarningListener; -import org.w3c.dom.Node; -import org.w3c.dom.NodeList; import javax.imageio.plugins.bmp.BMPImageWriteParam; import com.sun.imageio.plugins.common.ImageUtil; @@ -129,7 +121,7 @@ public class BMPImageWriter extends ImageWriter implements BMPConstants { meta.compression = getPreferredCompressionType(imageType); if (param != null && param.getCompressionMode() == ImageWriteParam.MODE_EXPLICIT) { - meta.compression = getCompressionType(param.getCompressionType()); + meta.compression = BMPCompressionTypes.getType(param.getCompressionType()); } meta.bitsPerPixel = (short)imageType.getColorModel().getPixelSize(); return meta; @@ -308,7 +300,7 @@ public class BMPImageWriter extends ImageWriter implements BMPConstants { switch(bmpParam.getCompressionMode()) { case ImageWriteParam.MODE_EXPLICIT: - compressionType = getCompressionType(bmpParam.getCompressionType()); + compressionType = BMPCompressionTypes.getType(bmpParam.getCompressionType()); break; case ImageWriteParam.MODE_COPY_FROM_METADATA: compressionType = bmpImageMetadata.compression; @@ -323,12 +315,12 @@ public class BMPImageWriter extends ImageWriter implements BMPConstants { if (!canEncodeImage(compressionType, colorModel, sampleModel)) { throw new IOException("Image can not be encoded with compression type " - + compressionTypeNames[compressionType]); + + BMPCompressionTypes.getName(compressionType)); } byte r[] = null, g[] = null, b[] = null, a[] = null; - if (compressionType == BMPConstants.BI_BITFIELDS) { + if (compressionType == BI_BITFIELDS) { bitsPerPixel = DataBuffer.getDataTypeSize(sampleModel.getDataType()); @@ -372,7 +364,7 @@ public class BMPImageWriter extends ImageWriter implements BMPConstants { // an exception related to unsupported image format throw new IOException("Image can not be encoded with " + "compression type " + - compressionTypeNames[compressionType]); + BMPCompressionTypes.getName(compressionType)); } } writeMaskToPalette(rmask, 0, r, g, b, a); @@ -511,8 +503,8 @@ public class BMPImageWriter extends ImageWriter implements BMPConstants { * Images with any other compression type must be wrote in the * bottom-up layout. */ - if (compressionType == BMPConstants.BI_RGB || - compressionType == BMPConstants.BI_BITFIELDS) + if (compressionType == BI_RGB || + compressionType == BI_BITFIELDS) { isTopDown = bmpParam.isTopDown(); } else { @@ -543,7 +535,7 @@ public class BMPImageWriter extends ImageWriter implements BMPConstants { if (isPalette == true) { // write palette - if (compressionType == BMPConstants.BI_BITFIELDS) { + if (compressionType == BI_BITFIELDS) { // write masks for red, green and blue components. for (int i=0; i<3; i++) { int mask = (a[i]&0xFF) + ((r[i]&0xFF)*0x100) + ((g[i]&0xFF)*0x10000) + ((b[i]&0xFF)*0x1000000); @@ -571,8 +563,8 @@ public class BMPImageWriter extends ImageWriter implements BMPConstants { int l; - if (compressionType == BMPConstants.BI_JPEG || - compressionType == BMPConstants.BI_PNG) { + if (compressionType == BI_JPEG || + compressionType == BI_PNG) { // prepare embedded buffer embedded_stream = new ByteArrayOutputStream(); @@ -657,7 +649,7 @@ public class BMPImageWriter extends ImageWriter implements BMPConstants { pos = sppsm.getOffset(startX, startY); } - if (compressionType == BMPConstants.BI_RGB || compressionType == BMPConstants.BI_BITFIELDS){ + if (compressionType == BI_RGB || compressionType == BI_BITFIELDS){ switch(dataType) { case DataBuffer.TYPE_BYTE: byte[] bdata = @@ -687,7 +679,7 @@ public class BMPImageWriter extends ImageWriter implements BMPConstants { for(int k=0; kColorSpaceType node - public static final String[] colorSpaceTypeNames = { + static final String[] colorSpaceTypeNames = { "GRAY", null, "RGB", "RGB", "GRAY", null, "RGB" }; diff --git a/jdk/src/share/classes/javax/imageio/plugins/bmp/BMPImageWriteParam.java b/jdk/src/share/classes/javax/imageio/plugins/bmp/BMPImageWriteParam.java index de35f5fe11e..230f7203fc4 100644 --- a/jdk/src/share/classes/javax/imageio/plugins/bmp/BMPImageWriteParam.java +++ b/jdk/src/share/classes/javax/imageio/plugins/bmp/BMPImageWriteParam.java @@ -29,6 +29,7 @@ import java.util.Locale; import javax.imageio.ImageWriteParam; import com.sun.imageio.plugins.bmp.BMPConstants; +import com.sun.imageio.plugins.bmp.BMPCompressionTypes; /** * A subclass of ImageWriteParam for encoding images in @@ -78,7 +79,7 @@ public class BMPImageWriteParam extends ImageWriteParam { super(locale); // Set compression types ("BI_RGB" denotes uncompressed). - compressionTypes = BMPConstants.compressionTypeNames.clone(); + compressionTypes = BMPCompressionTypes.getCompressionTypes(); // Set compression flag. canWriteCompressed = true; From 557d4e977ba7885e856afe489877267c6412b018 Mon Sep 17 00:00:00 2001 From: Sergey Malenkov Date: Mon, 30 Sep 2013 22:08:45 +0400 Subject: [PATCH 054/131] 8025652: [macos] build failed Reviewed-by: serb --- jdk/src/share/classes/sun/java2d/SunGraphicsEnvironment.java | 1 + jdk/src/solaris/classes/sun/awt/X11GraphicsEnvironment.java | 2 +- jdk/src/windows/classes/sun/awt/Win32GraphicsEnvironment.java | 1 + 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/jdk/src/share/classes/sun/java2d/SunGraphicsEnvironment.java b/jdk/src/share/classes/sun/java2d/SunGraphicsEnvironment.java index 5bd2d2f99ee..92a0d2d2912 100644 --- a/jdk/src/share/classes/sun/java2d/SunGraphicsEnvironment.java +++ b/jdk/src/share/classes/sun/java2d/SunGraphicsEnvironment.java @@ -25,6 +25,7 @@ package sun.java2d; +import java.awt.AWTError; import java.awt.Color; import java.awt.Font; import java.awt.Graphics2D; diff --git a/jdk/src/solaris/classes/sun/awt/X11GraphicsEnvironment.java b/jdk/src/solaris/classes/sun/awt/X11GraphicsEnvironment.java index 3dece38d457..159bc48652a 100644 --- a/jdk/src/solaris/classes/sun/awt/X11GraphicsEnvironment.java +++ b/jdk/src/solaris/classes/sun/awt/X11GraphicsEnvironment.java @@ -25,8 +25,8 @@ package sun.awt; +import java.awt.AWTError; import java.awt.GraphicsDevice; - import java.awt.Point; import java.awt.Rectangle; import java.io.BufferedReader; diff --git a/jdk/src/windows/classes/sun/awt/Win32GraphicsEnvironment.java b/jdk/src/windows/classes/sun/awt/Win32GraphicsEnvironment.java index c3e684b4142..d3bd07f123c 100644 --- a/jdk/src/windows/classes/sun/awt/Win32GraphicsEnvironment.java +++ b/jdk/src/windows/classes/sun/awt/Win32GraphicsEnvironment.java @@ -25,6 +25,7 @@ package sun.awt; +import java.awt.AWTError; import java.awt.GraphicsConfiguration; import java.awt.GraphicsDevice; import java.awt.GraphicsEnvironment; From 0c7604f2bcc8066a301643f519761f9236a08607 Mon Sep 17 00:00:00 2001 From: Sergey Bylokhov Date: Tue, 1 Oct 2013 04:29:50 +0400 Subject: [PATCH 055/131] 7150100: [macosx] "0123456789" is selected in the TextField Reviewed-by: anthony, art --- .../sun/lwawt/LWTextComponentPeer.java | 3 +- .../classes/sun/awt/X11/XTextAreaPeer.java | 44 ++++++------- .../classes/sun/awt/X11/XTextFieldPeer.java | 41 ++++++------ .../SelectionVisible/SelectionVisible.html | 42 +++++++++++++ .../SelectionVisible/SelectionVisible.java | 62 ++++++++++++++++++ .../SelectionVisible/SelectionVisible.html | 42 +++++++++++++ .../SelectionVisible/SelectionVisible.java | 63 +++++++++++++++++++ 7 files changed, 247 insertions(+), 50 deletions(-) create mode 100644 jdk/test/java/awt/TextArea/SelectionVisible/SelectionVisible.html create mode 100644 jdk/test/java/awt/TextArea/SelectionVisible/SelectionVisible.java create mode 100644 jdk/test/java/awt/TextField/SelectionVisible/SelectionVisible.html create mode 100644 jdk/test/java/awt/TextField/SelectionVisible/SelectionVisible.java diff --git a/jdk/src/macosx/classes/sun/lwawt/LWTextComponentPeer.java b/jdk/src/macosx/classes/sun/lwawt/LWTextComponentPeer.java index 860aa546610..8616992e892 100644 --- a/jdk/src/macosx/classes/sun/lwawt/LWTextComponentPeer.java +++ b/jdk/src/macosx/classes/sun/lwawt/LWTextComponentPeer.java @@ -71,13 +71,14 @@ abstract class LWTextComponentPeer start) { + // Should be called after setText() and setCaretPosition() select(start, end); } - setCaretPosition(getTarget().getCaretPosition()); firstChangeSkipped = true; } diff --git a/jdk/src/solaris/classes/sun/awt/X11/XTextAreaPeer.java b/jdk/src/solaris/classes/sun/awt/X11/XTextAreaPeer.java index 27465df84a5..7ada27c8cfc 100644 --- a/jdk/src/solaris/classes/sun/awt/X11/XTextAreaPeer.java +++ b/jdk/src/solaris/classes/sun/awt/X11/XTextAreaPeer.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 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 @@ -64,16 +64,14 @@ import sun.awt.AWTAccessor; import sun.awt.SunToolkit; -class XTextAreaPeer extends XComponentPeer implements TextAreaPeer { - boolean editable; +final class XTextAreaPeer extends XComponentPeer implements TextAreaPeer { - AWTTextPane textPane; - AWTTextArea jtext; + private final AWTTextPane textPane; + private final AWTTextArea jtext; + private final boolean firstChangeSkipped; - boolean firstChangeSkipped; - - private final JavaMouseEventHandler javaMouseEventHandler - = new JavaMouseEventHandler( this ); + private final JavaMouseEventHandler javaMouseEventHandler = + new JavaMouseEventHandler(this); /* FIXME */ @@ -98,7 +96,7 @@ class XTextAreaPeer extends XComponentPeer implements TextAreaPeer { * Create a Text area. */ XTextAreaPeer(TextArea target) { - super( target ); + super(target); // some initializations require that target be set even // though init(target) has not been called @@ -106,8 +104,7 @@ class XTextAreaPeer extends XComponentPeer implements TextAreaPeer { //ComponentAccessor.enableEvents(target,AWTEvent.MOUSE_WHEEL_EVENT_MASK); - firstChangeSkipped = false; - String text = ((TextArea)target).getText(); + String text = target.getText(); jtext = new AWTTextArea(text, this); jtext.setWrapStyleWord(true); jtext.getDocument().addDocumentListener(jtext); @@ -143,25 +140,22 @@ class XTextAreaPeer extends XComponentPeer implements TextAreaPeer { setFont(font); + // set the text of this object to the text of its target + setTextImpl(target.getText()); //?? should this be setText + int start = target.getSelectionStart(); int end = target.getSelectionEnd(); - - if (end > start) { - select(start, end); - } // Fix for 5100200 // Restoring Motif behaviour // Since the end position of the selected text can be greater then the length of the text, // so we should set caret to max position of the text - int caretPosition = Math.min(end, text.length()); - setCaretPosition(caretPosition); - + setCaretPosition(Math.min(end, text.length())); + if (end > start) { + // Should be called after setText() and setCaretPosition() + select(start, end); + } setEditable(target.isEditable()); - setScrollBarVisibility(); - // set the text of this object to the text of its target - setTextImpl(target.getText()); //?? should this be setText - // After this line we should not change the component's text firstChangeSkipped = true; } @@ -408,7 +402,6 @@ class XTextAreaPeer extends XComponentPeer implements TextAreaPeer { * @see java.awt.peer.TextComponentPeer */ public void setEditable(boolean editable) { - this.editable = editable; if (jtext != null) jtext.setEditable(editable); repaintText(); } @@ -461,7 +454,7 @@ class XTextAreaPeer extends XComponentPeer implements TextAreaPeer { repaintText(); } - protected boolean setTextImpl(String txt) { + private void setTextImpl(String txt) { if (jtext != null) { // JTextArea.setText() posts two different events (remove & insert). // Since we make no differences between text events, @@ -474,7 +467,6 @@ class XTextAreaPeer extends XComponentPeer implements TextAreaPeer { } jtext.getDocument().addDocumentListener(jtext); } - return true; } /** diff --git a/jdk/src/solaris/classes/sun/awt/X11/XTextFieldPeer.java b/jdk/src/solaris/classes/sun/awt/X11/XTextFieldPeer.java index be948e2a708..8bb74559946 100644 --- a/jdk/src/solaris/classes/sun/awt/X11/XTextFieldPeer.java +++ b/jdk/src/solaris/classes/sun/awt/X11/XTextFieldPeer.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 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 @@ -57,46 +57,41 @@ import sun.util.logging.PlatformLogger; import sun.awt.CausedFocusEvent; import sun.awt.AWTAccessor; -public class XTextFieldPeer extends XComponentPeer implements TextFieldPeer { +final class XTextFieldPeer extends XComponentPeer implements TextFieldPeer { private static final PlatformLogger log = PlatformLogger.getLogger("sun.awt.X11.XTextField"); - String text; - XAWTTextField xtext; + private String text; + private final XAWTTextField xtext; + private final boolean firstChangeSkipped; - boolean firstChangeSkipped; - - public XTextFieldPeer(TextField target) { + XTextFieldPeer(TextField target) { super(target); - int start, end; - firstChangeSkipped = false; text = target.getText(); xtext = new XAWTTextField(text,this, target.getParent()); xtext.getDocument().addDocumentListener(xtext); xtext.setCursor(target.getCursor()); XToolkit.specialPeerMap.put(xtext,this); - TextField txt = (TextField) target; initTextField(); - setText(txt.getText()); - if (txt.echoCharIsSet()) { - setEchoChar(txt.getEchoChar()); + setText(target.getText()); + if (target.echoCharIsSet()) { + setEchoChar(target.getEchoChar()); } else setEchoChar((char)0); - start = txt.getSelectionStart(); - end = txt.getSelectionEnd(); - - if (end > start) { - select(start, end); - } + int start = target.getSelectionStart(); + int end = target.getSelectionEnd(); // Fix for 5100200 // Restoring Motif behaviour // Since the end position of the selected text can be greater then the length of the text, // so we should set caret to max position of the text - int caretPosition = Math.min(end, text.length()); - setCaretPosition(caretPosition); + setCaretPosition(Math.min(end, text.length())); + if (end > start) { + // Should be called after setText() and setCaretPosition() + select(start, end); + } - setEditable(txt.isEditable()); + setEditable(target.isEditable()); // After this line we should not change the component's text firstChangeSkipped = true; @@ -219,7 +214,7 @@ public class XTextFieldPeer extends XComponentPeer implements TextFieldPeer { repaint(); } - protected boolean setXAWTTextField(String txt) { + private boolean setXAWTTextField(String txt) { text = txt; if (xtext != null) { // JTextField.setText() posts two different events (remove & insert). diff --git a/jdk/test/java/awt/TextArea/SelectionVisible/SelectionVisible.html b/jdk/test/java/awt/TextArea/SelectionVisible/SelectionVisible.html new file mode 100644 index 00000000000..efa092ba9cc --- /dev/null +++ b/jdk/test/java/awt/TextArea/SelectionVisible/SelectionVisible.html @@ -0,0 +1,42 @@ + + + + + + SelectionVisible + + + +

            SelectionVisible
            Bugid: 4082144

            + + + + diff --git a/jdk/test/java/awt/TextArea/SelectionVisible/SelectionVisible.java b/jdk/test/java/awt/TextArea/SelectionVisible/SelectionVisible.java new file mode 100644 index 00000000000..c34f75f60d7 --- /dev/null +++ b/jdk/test/java/awt/TextArea/SelectionVisible/SelectionVisible.java @@ -0,0 +1,62 @@ +/* + * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + + +import java.applet.Applet; +import java.awt.BorderLayout; +import java.awt.Dimension; +import java.awt.FlowLayout; +import java.awt.Panel; +import java.awt.TextArea; + +public final class SelectionVisible extends Applet { + + TextArea tf; + + @Override + public void init() { + tf = new TextArea(3, 20); + tf.setText("0123456789"); + tf.select(0, 6); + + final TextArea ta = new TextArea("INSTRUCTIONS:\n" + + "The text 012345 should be selected in the TextArea.\n" + + "If this is what you observe, then the test passes.\n" + + "Otherwise, the test fails.", 40, 5, + TextArea.SCROLLBARS_NONE); + ta.setEditable(false); + ta.setPreferredSize(new Dimension(300, 70)); + final Panel panel = new Panel(); + panel.setLayout(new FlowLayout()); + panel.add(tf); + setLayout(new BorderLayout()); + add(ta, BorderLayout.CENTER); + add(panel, BorderLayout.PAGE_END); + } + + @Override + public void start() { + setVisible(true); + tf.requestFocus(); + } +} diff --git a/jdk/test/java/awt/TextField/SelectionVisible/SelectionVisible.html b/jdk/test/java/awt/TextField/SelectionVisible/SelectionVisible.html new file mode 100644 index 00000000000..31490d16f0b --- /dev/null +++ b/jdk/test/java/awt/TextField/SelectionVisible/SelectionVisible.html @@ -0,0 +1,42 @@ + + + + + + SelectionVisible + + + +

            SelectionVisible
            Bugid: 4082144

            + + + + diff --git a/jdk/test/java/awt/TextField/SelectionVisible/SelectionVisible.java b/jdk/test/java/awt/TextField/SelectionVisible/SelectionVisible.java new file mode 100644 index 00000000000..cccec8eb347 --- /dev/null +++ b/jdk/test/java/awt/TextField/SelectionVisible/SelectionVisible.java @@ -0,0 +1,63 @@ +/* + * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + + +import java.applet.Applet; +import java.awt.BorderLayout; +import java.awt.Dimension; +import java.awt.FlowLayout; +import java.awt.Panel; +import java.awt.TextArea; +import java.awt.TextField; + +public final class SelectionVisible extends Applet { + + TextField tf; + + @Override + public void init() { + tf = new TextField(20); + tf.setText("0123456789"); + tf.select(0, 6); + + final TextArea ta = new TextArea("INSTRUCTIONS:\n" + + "The text 012345 should be selected in the TextField.\n" + + "If this is what you observe, then the test passes.\n" + + "Otherwise, the test fails.", 40, 5, + TextArea.SCROLLBARS_NONE); + ta.setEditable(false); + ta.setPreferredSize(new Dimension(300, 70)); + final Panel panel = new Panel(); + panel.setLayout(new FlowLayout()); + panel.add(tf); + setLayout(new BorderLayout()); + add(ta, BorderLayout.CENTER); + add(panel, BorderLayout.PAGE_END); + } + + @Override + public void start() { + setVisible(true); + tf.requestFocus(); + } +} From 6d63827a99f0c04f66334195ad2254043e437c7c Mon Sep 17 00:00:00 2001 From: Vera Akulova Date: Tue, 1 Oct 2013 13:19:07 +0400 Subject: [PATCH 056/131] 7125471: [macosx] NofocusListDblClickTest should wait between doublr clicks Reviewed-by: anthony, serb --- .../NofocusListDblClickTest.java | 129 ++++++++++++++++++ 1 file changed, 129 insertions(+) create mode 100644 jdk/test/java/awt/List/NofocusListDblClickTest/NofocusListDblClickTest.java diff --git a/jdk/test/java/awt/List/NofocusListDblClickTest/NofocusListDblClickTest.java b/jdk/test/java/awt/List/NofocusListDblClickTest/NofocusListDblClickTest.java new file mode 100644 index 00000000000..6215ccb4007 --- /dev/null +++ b/jdk/test/java/awt/List/NofocusListDblClickTest/NofocusListDblClickTest.java @@ -0,0 +1,129 @@ +/* + * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ +/* + @test + @bug 6240202 + @summary Tests that non-focusable List in a Window generates ActionEvent. + @author anton.tarasov@sun.com: area=awt-list + @run main NofocusListDblClickTest +*/ + +import java.awt.*; +import java.awt.event.*; +import java.util.concurrent.atomic.AtomicInteger; +import javax.swing.SwingUtilities; +import sun.awt.SunToolkit; + +public class NofocusListDblClickTest { + static final int EXPECTED_ACTION_COUNT = 2; + static Robot robot; + static final AtomicInteger actionPerformed = new AtomicInteger(0); + static List lst; + private static final SunToolkit toolkit = (SunToolkit) Toolkit.getDefaultToolkit(); + + public static void main(String[] args) throws Exception { + SwingUtilities.invokeAndWait(new Runnable() { + public void run() { + createAndShowGUI(); + } + }); + toolkit.realSync(); + Thread.sleep(1000); + + robot = new Robot(); + robot.setAutoDelay(50); + // ACTION_PERFORMED event happens only on even clicks + clickTwiceOn(lst); + Thread.sleep(500); + clickTwiceOn(lst); + toolkit.realSync(); + Thread.sleep(1000); + + synchronized (actionPerformed) { + if (actionPerformed.get() != EXPECTED_ACTION_COUNT) { + try { + actionPerformed.wait(3000); + } catch (InterruptedException e) { + System.out.println("Interrupted unexpectedly!"); + throw new RuntimeException(e); + } + } + } + + if (actionPerformed.get() != EXPECTED_ACTION_COUNT) { + System.out.println("No ActionEvent was generated. " + actionPerformed.get()); + throw new RuntimeException("Test failed!"); + } + + System.out.println("Test passed."); + } + + public static void createAndShowGUI() { + Frame f = new Frame("Owner"); + Window w = new Window(f); + lst = new List(3, true); + //this.setLayout (new BorderLayout ()); + f.setBounds(800, 0, 100, 100); + w.setLocation(800, 150); + + lst.add("item 0"); + lst.add("item 1"); + lst.add("item 2"); + + lst.setFocusable(false); + + lst.addActionListener(new ActionListener() { + public void actionPerformed(ActionEvent e) { + System.out.println(e.toString()); + synchronized (actionPerformed) { + if (EXPECTED_ACTION_COUNT == actionPerformed.incrementAndGet()) { + actionPerformed.notifyAll(); + } + } + } + }); + + w.add(lst); + w.pack(); + + f.setVisible(true); + w.setVisible(true); + } + + static void clickTwiceOn(Component c) throws Exception { + Point p = c.getLocationOnScreen(); + Dimension d = c.getSize(); + + if (c instanceof Frame) { + robot.mouseMove(p.x + (int)(d.getWidth()/2), p.y + ((Frame)c).getInsets().top/2); + } else { + robot.mouseMove(p.x + (int)(d.getWidth()/2), p.y + (int)(d.getHeight()/2)); + } + + robot.mousePress(InputEvent.BUTTON1_MASK); + robot.mouseRelease(InputEvent.BUTTON1_MASK); + Thread.sleep(20); + robot.mousePress(InputEvent.BUTTON1_MASK); + robot.mouseRelease(InputEvent.BUTTON1_MASK); + } +} From c4d57a676d32cd7ee628abd456fc56b19d303c89 Mon Sep 17 00:00:00 2001 From: Vera Akulova Date: Tue, 1 Oct 2013 13:30:37 +0400 Subject: [PATCH 057/131] 8012468: [TEST_BUG] javax/swing/PopupFactory/6276087/NonOpaquePopupMenuTest.java doesn't release mouse button Reviewed-by: serb, alexsch --- .../swing/PopupFactory/6276087/NonOpaquePopupMenuTest.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/jdk/test/javax/swing/PopupFactory/6276087/NonOpaquePopupMenuTest.java b/jdk/test/javax/swing/PopupFactory/6276087/NonOpaquePopupMenuTest.java index c816734f2f4..467aee5fc54 100644 --- a/jdk/test/javax/swing/PopupFactory/6276087/NonOpaquePopupMenuTest.java +++ b/jdk/test/javax/swing/PopupFactory/6276087/NonOpaquePopupMenuTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -70,6 +70,7 @@ public class NonOpaquePopupMenuTest extends JFrame { Point p = getMenuClickPoint(); robot.mouseMove(p.x, p.y); robot.mousePress(InputEvent.BUTTON1_MASK); + robot.mouseRelease(InputEvent.BUTTON1_MASK); toolkit.realSync(); From 28fa075d75d66a5d7e462d5b35ba2e3d2beb1f0c Mon Sep 17 00:00:00 2001 From: Vera Akulova Date: Tue, 1 Oct 2013 13:38:07 +0400 Subject: [PATCH 058/131] 8012466: [TEST_BUG] javax/swing/JInternalFrame/Test6505027.java doesn't release mouse button Reviewed-by: serb, alexsch --- jdk/test/javax/swing/JInternalFrame/Test6505027.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/jdk/test/javax/swing/JInternalFrame/Test6505027.java b/jdk/test/javax/swing/JInternalFrame/Test6505027.java index 241ea78ea9e..36c3db3b2d7 100644 --- a/jdk/test/javax/swing/JInternalFrame/Test6505027.java +++ b/jdk/test/javax/swing/JInternalFrame/Test6505027.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2009, 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 @@ -96,8 +96,10 @@ public class Test6505027 { SwingUtilities.convertPointToScreen(point, this.table); Robot robot = new Robot(); + robot.setAutoDelay(50); robot.mouseMove(point.x + 1, point.y + 1); robot.mousePress(InputEvent.BUTTON1_MASK); + robot.mouseRelease(InputEvent.BUTTON1_MASK); } public static void validate() { From 0307ac32a2df68dc4519c6582d0bf7283b35c76c Mon Sep 17 00:00:00 2001 From: Vera Akulova Date: Tue, 1 Oct 2013 13:40:26 +0400 Subject: [PATCH 059/131] 8004294: [TEST_BUG] javax/swing/JSpinner/4973721/bug4973721.java failed on win2003 Reviewed-by: serb, alexsch --- .../swing/JSpinner/4973721/bug4973721.java | 120 ++++++++++++++++++ 1 file changed, 120 insertions(+) create mode 100644 jdk/test/javax/swing/JSpinner/4973721/bug4973721.java diff --git a/jdk/test/javax/swing/JSpinner/4973721/bug4973721.java b/jdk/test/javax/swing/JSpinner/4973721/bug4973721.java new file mode 100644 index 00000000000..f94ce860eed --- /dev/null +++ b/jdk/test/javax/swing/JSpinner/4973721/bug4973721.java @@ -0,0 +1,120 @@ +/* + * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ +/* @test + @bug 4973721 + @summary Up and Down Arrow key buttons are not working for the JSpinner in Synth LAF + @library ../../regtesthelpers + @build Util + @author Oleg Mokhovikov + @run main bug4973721 +*/ + +import java.awt.Robot; +import java.awt.Toolkit; +import javax.swing.event.ChangeListener; +import javax.swing.event.ChangeEvent; +import java.awt.event.KeyEvent; +import java.awt.event.FocusListener; +import java.awt.event.FocusEvent; +import javax.swing.*; +import sun.awt.SunToolkit; + +public class bug4973721 implements ChangeListener, FocusListener { + static volatile boolean bStateChanged = false; + static volatile boolean bFocusGained = false; + static JSpinner spinner; + static final Object listener = new bug4973721(); + private static final SunToolkit toolkit = (SunToolkit) Toolkit.getDefaultToolkit(); + + public void focusLost(FocusEvent e) {} + + public synchronized void focusGained(FocusEvent e) { + System.out.println("focusGained"); + bFocusGained = true; + notifyAll(); + } + + public synchronized void stateChanged(ChangeEvent e) { + System.out.println("stateChanged"); + bStateChanged = true; + notifyAll(); + } + + public static void main(String[] args) throws Exception { + UIManager.setLookAndFeel("javax.swing.plaf.synth.SynthLookAndFeel"); + + SwingUtilities.invokeAndWait(new Runnable() { + public void run() { + final JFrame frame = new JFrame(); + spinner = new JSpinner(); + frame.getContentPane().add(spinner); + frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); + + frame.pack(); + frame.setVisible(true); + spinner.addChangeListener((ChangeListener)listener); + spinner.addFocusListener((FocusListener)listener); + spinner.requestFocus(); + + } + }); + + synchronized(listener) { + if (!bFocusGained) { + System.out.println("waiting focusGained..."); + try { listener.wait(5000); } catch (InterruptedException e) {} + } + } + + boolean hasFocus = Util.invokeOnEDT(new java.util.concurrent.Callable() { + @Override + public Boolean call() throws Exception { + return spinner.hasFocus(); + } + }); + + if (!bFocusGained && !hasFocus) { + throw new RuntimeException("Couldn't request focus for spinner"); + } + Robot robot = new Robot(); + robot.setAutoDelay(50); + + Util.hitKeys(robot, KeyEvent.VK_UP); + toolkit.realSync(); + Thread.sleep(1000); + + if (!bStateChanged) { + throw new RuntimeException("Up arrow key button doesn't work for a spinner in Synth L&F"); + } + + bStateChanged = false; + + Util.hitKeys(robot, KeyEvent.VK_DOWN); + toolkit.realSync(); + Thread.sleep(1000); + + if (!bStateChanged) { + throw new RuntimeException("Down arrow key button doesn't work for a spinner in Synth L&F"); + } + } +} From 920c1d844fd04601d90bc643f185f0953a245aed Mon Sep 17 00:00:00 2001 From: Vera Akulova Date: Tue, 1 Oct 2013 13:45:51 +0400 Subject: [PATCH 060/131] 8012461: [TEST_BUG] closed/javax/swing/plaf/synth/SynthButtonUI/6276188/bug6276188.java doesn't release mouse button Reviewed-by: serb, alexsch --- .../SynthButtonUI/6276188/bug6276188.java | 81 +++++++++++++++++++ .../SynthButtonUI/6276188/bug6276188.xml | 19 +++++ 2 files changed, 100 insertions(+) create mode 100644 jdk/test/javax/swing/plaf/synth/SynthButtonUI/6276188/bug6276188.java create mode 100644 jdk/test/javax/swing/plaf/synth/SynthButtonUI/6276188/bug6276188.xml diff --git a/jdk/test/javax/swing/plaf/synth/SynthButtonUI/6276188/bug6276188.java b/jdk/test/javax/swing/plaf/synth/SynthButtonUI/6276188/bug6276188.java new file mode 100644 index 00000000000..7d6d8ea616f --- /dev/null +++ b/jdk/test/javax/swing/plaf/synth/SynthButtonUI/6276188/bug6276188.java @@ -0,0 +1,81 @@ +/* + * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ +/** + * @test 1.4 08/08/05 + * @bug 6276188 + * @library ../../../../regtesthelpers + * @build Util + * @author Romain Guy + * @summary Tests PRESSED and MOUSE_OVER and FOCUSED state for buttons with Synth. + * @run main bug6276188 + */ +import java.awt.*; +import java.awt.image.*; +import java.awt.event.*; + +import javax.swing.*; +import javax.swing.plaf.synth.*; +import sun.awt.SunToolkit; + +public class bug6276188 extends JFrame { + + private static JButton button; + private static Point p; + private static final SunToolkit toolkit = (SunToolkit) Toolkit.getDefaultToolkit(); + + public static void main(String[] args) throws Throwable { + SynthLookAndFeel lookAndFeel = new SynthLookAndFeel(); + lookAndFeel.load(bug6276188.class.getResourceAsStream("bug6276188.xml"), bug6276188.class); + + UIManager.setLookAndFeel(lookAndFeel); + SwingUtilities.invokeAndWait(new Runnable() { + public void run() { + JFrame testFrame = new JFrame(); + testFrame.setLayout(new BorderLayout()); + testFrame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); + testFrame.add(BorderLayout.CENTER, button = new JButton()); + + testFrame.setSize(new Dimension(320, 200)); + testFrame.setVisible(true); + } + }); + + p = Util.getCenterPoint(button); + + Robot robot = new Robot(); + robot.setAutoDelay(50); + + robot.mouseMove(p.x , p.y); + robot.mousePress(InputEvent.BUTTON1_MASK); + toolkit.realSync(); + robot.delay(1000); + + Color color = robot.getPixelColor(p.x, p.y); + robot.mouseRelease(InputEvent.BUTTON1_MASK); + boolean red = color.getRed() > 0 && color.getGreen() == 0 && color.getBlue() == 0; + if (!red) { + System.err.println("Red: " + color.getRed() + "; Green: " + color.getGreen() + "; Blue: " + color.getBlue()); + throw new RuntimeException("Synth ButtonUI does not handle PRESSED & MOUSE_OVER state"); + } + } +} diff --git a/jdk/test/javax/swing/plaf/synth/SynthButtonUI/6276188/bug6276188.xml b/jdk/test/javax/swing/plaf/synth/SynthButtonUI/6276188/bug6276188.xml new file mode 100644 index 00000000000..c6bc6ceae79 --- /dev/null +++ b/jdk/test/javax/swing/plaf/synth/SynthButtonUI/6276188/bug6276188.xml @@ -0,0 +1,19 @@ + + + + + + + + From 401b226ad5bd39c5cca95cc1f29c76c23d1b3fb7 Mon Sep 17 00:00:00 2001 From: Vera Akulova Date: Tue, 1 Oct 2013 13:46:53 +0400 Subject: [PATCH 061/131] 7133545: [macosx] closed/javax/swing/JSplitPane/4514858/bug4514858.java fails on MacOS Reviewed-by: serb, alexsch --- .../swing/JSplitPane/4514858/bug4514858.java | 210 ++++++++++++++++++ 1 file changed, 210 insertions(+) create mode 100644 jdk/test/javax/swing/JSplitPane/4514858/bug4514858.java diff --git a/jdk/test/javax/swing/JSplitPane/4514858/bug4514858.java b/jdk/test/javax/swing/JSplitPane/4514858/bug4514858.java new file mode 100644 index 00000000000..38deb964e00 --- /dev/null +++ b/jdk/test/javax/swing/JSplitPane/4514858/bug4514858.java @@ -0,0 +1,210 @@ +/* + * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ +/* @test + @bug 4514858 4164779 + @summary F6, F8 Ctrl-TAB and Ctrl-Shift-TAB in JSplitPane + @author Andrey Pikalev + @run main/manual bug4514858 +*/ + +import javax.swing.*; +import javax.swing.border.TitledBorder; +import java.awt.*; +import java.awt.event.*; + + +public class bug4514858 implements ActionListener { + + static String intructions = "Test the F6, F8, Ctrl-TAB and Ctrl-Shift-TAB keybinding functionality in JSplitPane\n" + + "with different LookAndFeels (switch LookAndFeel with the buttoms at the bottom of the\n" + + "frame \"Test\"):\n\n" + + "1. Move focus to the button \"Button 1\" in the frame \"Test\". Then press F6 several times.\n" + + "The focus should cycle between five buttons in order from 1 to 5.\n\n" + + "2. Move focus to the button \"Button 2\" in the frame \"Test\". Then press F8 three times.\n" + + "The splitters of the splitpanes should be highlited in order:\n" + + "\"JSplitPane 3\", \"JSplitPane 2\", \"JSplitPane 1\".\n\n" + + "3. Move focus to the button \"Button 2\" in the frame \"Test\". Press Ctrl-TAB.\n" + + "The focus should go to the \"Button 4\". Then press Ctrl-TAB again.\n" + + "The focus should go to the first enabled button at the bottom of frame.\n\n" + + "4. Move focus to the button \"Button 4\" in the frame \"Test\". Press Ctrl-Shift-TAB three times.\n" + + "The focus should go through the button \"Button 3\", then \"Button 1\", then to the last\n" + + "enabled button at the bottom of frame."; + static Test test = new Test(); + JFrame fr; + public static void main(String[] argv) throws Exception { + UIManager.setLookAndFeel(UIManager.getCrossPlatformLookAndFeelClassName()); + SwingUtilities.invokeAndWait(new Runnable() { + public void run() { + new bug4514858().createAndShowGUI(); + } + }); + test.waitTestResult(); + } + public void createAndShowGUI() { + fr = new JFrame("Test"); + + //------------------------------------------------------------- + JButton left2 = new JButton("Button 1"); + + JButton left3 = new JButton("Button 2"); + JButton right3 = new JButton("Button 3"); + + JSplitPane right2 = new JSplitPane(JSplitPane.VERTICAL_SPLIT, left3, right3); + right2.setBorder(new TitledBorder("JSplitPane 3")); + + JSplitPane left1 = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, left2, right2); + left1.setBorder(new TitledBorder("JSplitPane 2")); + + JButton left4 = new JButton("Button 4"); + JButton right4 = new JButton("Button 5"); + + JSplitPane right1 = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, left4, right4); + right1.setBorder(new TitledBorder("JSplitPane 4")); + + JSplitPane sp = new JSplitPane(JSplitPane.VERTICAL_SPLIT, left1, right1); + sp.setBorder(new TitledBorder("JSplitPane 1")); + fr.getContentPane().add(sp); + + //------------------------------------------------------------- + JPanel p = new JPanel(); + + JButton metal = new JButton("Metal"); + metal.setActionCommand("Metal"); + metal.setEnabled(isSupportedLAF("javax.swing.plaf.metal.MetalLookAndFeel")); + metal.addActionListener(this); + p.add(metal); + + JButton motif = new JButton("Motif"); + motif.setActionCommand("Motif"); + motif.setEnabled(isSupportedLAF("com.sun.java.swing.plaf.motif.MotifLookAndFeel")); + motif.addActionListener(this); + p.add(motif); + + JButton windows = new JButton("Windows"); + windows.setActionCommand("Windows"); + windows.setEnabled(isSupportedLAF("com.sun.java.swing.plaf.windows.WindowsLookAndFeel")); + windows.addActionListener(this); + p.add(windows); + + fr.getContentPane().add(p, BorderLayout.SOUTH); + + fr.pack(); + fr.setVisible(true); + + JFrame instrFrame = test.createTestFrame("bug4514858 instructions", null, intructions, 250); + instrFrame.setBounds(fr.getWidth() + 50, fr.getHeight(), 600, 400); + instrFrame.setVisible(true); + } + + private boolean isSupportedLAF(String str) { + try { + Class c = Class.forName(str); + LookAndFeel laf = (LookAndFeel)c.newInstance(); + return laf.isSupportedLookAndFeel(); + } catch (Exception e) { + return false; + } + } + + public void actionPerformed(ActionEvent e) { + String s = e.getActionCommand(); + if (s.equals("Metal")) { + s = "javax.swing.plaf.metal.MetalLookAndFeel"; + } else if (s.equals("Motif")) { + s = "com.sun.java.swing.plaf.motif.MotifLookAndFeel"; + } else { + s = "com.sun.java.swing.plaf.windows.WindowsLookAndFeel"; + } + try { + UIManager.setLookAndFeel(s); + SwingUtilities.updateComponentTreeUI(fr); + fr.pack(); + } catch(Exception ex) { + ex.printStackTrace(); + throw new RuntimeException(ex); + } + } + static class Test { + private boolean pass; + JFrame createTestFrame(String name, Component topComponent, String instructions, int instrHeight) { + final String PASS = "Pass"; + final String FAIL = "Fail"; + JFrame frame = new JFrame(name); + frame.setLayout(new BorderLayout()); + + JPanel testButtonsPanel = new JPanel(); + testButtonsPanel.setMaximumSize(new Dimension(Integer.MAX_VALUE, 20)); + + ActionListener btnAL = new ActionListener() { + public void actionPerformed(ActionEvent event) { + switch (event.getActionCommand()) { + case PASS: + pass(); + break; + default: + throw new RuntimeException("Test failed."); + } + } + }; + JButton passBtn = new JButton(PASS); + passBtn.addActionListener(btnAL); + passBtn.setActionCommand(PASS); + + JButton failBtn = new JButton(FAIL); + failBtn.addActionListener(btnAL); + failBtn.setActionCommand(FAIL); + + testButtonsPanel.add(BorderLayout.WEST, passBtn); + testButtonsPanel.add(BorderLayout.EAST, failBtn); + + JTextArea instrText = new JTextArea(); + instrText.setLineWrap(true); + instrText.setEditable(false); + JScrollPane instrScrollPane = new JScrollPane(instrText); + instrScrollPane.setMaximumSize(new Dimension(Integer.MAX_VALUE, instrHeight)); + instrText.append(instructions); + + JPanel servicePanel = new JPanel(); + servicePanel.setLayout(new BorderLayout()); + if (topComponent == null) { + frame.add(BorderLayout.CENTER, instrScrollPane); + } else { + servicePanel.add(BorderLayout.CENTER, instrScrollPane); + frame.add(BorderLayout.CENTER, topComponent); + } + servicePanel.add(BorderLayout.SOUTH, testButtonsPanel); + + frame.add(BorderLayout.SOUTH, servicePanel); + return frame; + } + synchronized void pass() { + pass = true; + notifyAll(); + } + synchronized void waitTestResult() throws InterruptedException { + while (!pass) { + wait(); + } + } + } +} From c1c753d0f8cb718769bc9e38d2adfa96a8e9b3d2 Mon Sep 17 00:00:00 2001 From: Vera Akulova Date: Tue, 1 Oct 2013 13:47:50 +0400 Subject: [PATCH 062/131] 7133532: [macosx] closed/javax/swing/JScrollBar/bug4202954/bug4202954.java fails on MacOS Reviewed-by: serb, alexsch --- .../JScrollBar/bug4202954/bug4202954.java | 151 ++++++++++++++++++ 1 file changed, 151 insertions(+) create mode 100644 jdk/test/javax/swing/JScrollBar/bug4202954/bug4202954.java diff --git a/jdk/test/javax/swing/JScrollBar/bug4202954/bug4202954.java b/jdk/test/javax/swing/JScrollBar/bug4202954/bug4202954.java new file mode 100644 index 00000000000..cf5b572906e --- /dev/null +++ b/jdk/test/javax/swing/JScrollBar/bug4202954/bug4202954.java @@ -0,0 +1,151 @@ +/* + * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ +/* @test + @bug 4202954 + @library ../../regtesthelpers + @build Util + @author Michael C. Albers + @run main bug4202954 +*/ + +import java.awt.*; +import java.awt.event.InputEvent; +import javax.swing.*; +import sun.awt.*; + +public class bug4202954 { + static JScrollPane buttonScrollPane; + private static final SunToolkit toolkit = (SunToolkit) Toolkit.getDefaultToolkit(); + static Robot robot; + public static void main(String[] args) throws Exception { + if (OSInfo.getOSType() == OSInfo.OSType.MACOSX) { + UIManager.setLookAndFeel(UIManager.getCrossPlatformLookAndFeelClassName()); + } + + SwingUtilities.invokeAndWait(new Runnable() { + public void run() { + createAndShowGUI(); + } + }); + Point centerOfScrollPane = Util.getCenterPoint(buttonScrollPane); + JButton rightScrollButton = findJButton(buttonScrollPane.getHorizontalScrollBar(), centerOfScrollPane.x, centerOfScrollPane.y); + JButton bottomScrollButton = findJButton(buttonScrollPane.getVerticalScrollBar(), centerOfScrollPane.x, centerOfScrollPane.y); + + if (rightScrollButton == null || bottomScrollButton == null) { + String errMessage = "Test can't be executed: "; + errMessage = errMessage + rightScrollButton == null ? "can't find right button for horizontal scroll bar; " : "" + + bottomScrollButton == null ? "can't find bottom scroll button for vertical scroll bar" : ""; + throw new RuntimeException(errMessage); + } + + robot = new Robot(); + robot.setAutoDelay(50); + + // test right, left and middle mouse buttons for horizontal scroll bar + if (!doTest(rightScrollButton, InputEvent.BUTTON1_DOWN_MASK, true)) { + throw new RuntimeException("Test failed: right arrow button didn't respond on left mouse button."); + } + if (!doTest(rightScrollButton, InputEvent.BUTTON2_DOWN_MASK, false)) { + throw new RuntimeException("Test failed: right arrow button respond on right mouse button."); + } + if (!doTest(rightScrollButton, InputEvent.BUTTON3_DOWN_MASK, false)) { + throw new RuntimeException("Test failed: right arrow button respond on middle mouse button."); + } + + // test right, left and middle mouse buttons for vertical scroll bar + if (!doTest(bottomScrollButton, InputEvent.BUTTON1_DOWN_MASK, true)) { + throw new RuntimeException("Test failed: bottom arrow button didn't respond on left mouse button."); + } + if (!doTest(bottomScrollButton, InputEvent.BUTTON2_DOWN_MASK, false)) { + throw new RuntimeException("Test failed: bottom arrow button respond on right mouse button."); + } + if (!doTest(bottomScrollButton, InputEvent.BUTTON3_DOWN_MASK, false)) { + throw new RuntimeException("Test failed: bottom arrow button respond on middle mouse button."); + } + } + public static void createAndShowGUI() { + JPanel buttonPanel = new JPanel(); + buttonPanel.setLayout(new GridLayout(5,5, 15,15)); + int buttonCount = 1; + while (buttonCount <= 25) { + buttonPanel.add(new JButton("Button #"+buttonCount)); + buttonCount++; + } + buttonScrollPane = new JScrollPane(); + buttonScrollPane.setViewportView(buttonPanel); + + JFrame testFrame = new JFrame("bug4202954"); + testFrame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); + testFrame.setLayout(new BorderLayout()); + testFrame.add(BorderLayout.CENTER, buttonScrollPane); + testFrame.setSize(450, 100); + testFrame.setVisible(true); + } + public static JButton findJButton(final JScrollBar scrollBar, final int minX, final int minY) throws Exception { + JButton button = Util.invokeOnEDT(new java.util.concurrent.Callable() { + @Override + public JButton call() throws Exception { + for (Component c: scrollBar.getComponents()) { + if (c instanceof JButton) { + Point p = c.getLocationOnScreen(); + if (p.x > minX && p.y > minY) { + return (JButton) c; + } + } + } + return null; + } + }); + return button; + } + public static void clickMouseOnComponent(Component c, int buttons) throws Exception { + Point p = Util.getCenterPoint(c); + robot.mouseMove(p.x, p.y); + robot.mousePress(buttons); + robot.mouseRelease(buttons); + } + public static boolean doTest(JButton scrollButton, int buttons, boolean expectScroll) throws Exception { + java.util.concurrent.Callable horizontalValue = new java.util.concurrent.Callable() { + @Override + public Integer call() throws Exception { + return buttonScrollPane.getHorizontalScrollBar().getValue(); + } + }; + java.util.concurrent.Callable verticalValue = new java.util.concurrent.Callable() { + @Override + public Integer call() throws Exception { + return buttonScrollPane.getVerticalScrollBar().getValue(); + } + }; + Integer oldHValue = Util.invokeOnEDT(horizontalValue); + Integer oldVValue = Util.invokeOnEDT(verticalValue); + + clickMouseOnComponent(scrollButton, buttons); + toolkit.realSync(); + + int newHValue = Util.invokeOnEDT(horizontalValue); + int newVValue = Util.invokeOnEDT(verticalValue); + + return (oldHValue != newHValue || oldVValue != newVValue) == expectScroll; + } +} From f5caf587e739a9ee7ec49fec3d9b1d7eb3136ec6 Mon Sep 17 00:00:00 2001 From: Vera Akulova Date: Tue, 1 Oct 2013 14:38:47 +0400 Subject: [PATCH 063/131] 8025707: Frogot to add a file to fix for JDK-8012461 Reviewed-by: serb, alexsch --- .../plaf/synth/SynthButtonUI/6276188/red.gif | Bin 0 -> 1214 bytes 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 jdk/test/javax/swing/plaf/synth/SynthButtonUI/6276188/red.gif diff --git a/jdk/test/javax/swing/plaf/synth/SynthButtonUI/6276188/red.gif b/jdk/test/javax/swing/plaf/synth/SynthButtonUI/6276188/red.gif new file mode 100644 index 0000000000000000000000000000000000000000..12e1f75f8a39a51c916b9fcf0dd9ec6a21938f4e GIT binary patch literal 1214 zcmYjQ3rt&882$>oNEngk&P!_2ZIGFzuqC1+Sal+C%6P3{X0Tac!);j@6GO5DFl$_G zm8Uu?bAybnRdg$$u23H3RZw&*bUX|w7+|#Ybpf~GKsqzY_1p_Fp4^=L_x#`a&-Z`d zIR}#ytQ0`+Gnq;1o2EhmL zA@JtO0E&f<<}vI_U{Ea>EuiYpH+ZO8TBn9e^}dn|F6T51rveAj6`)qcAEC-rdQtud z82(%vl}y!S8(i!3H+6oEyJ2Ob(cMgrUis>n{Dz>q+BH;?5g3kM$ungjAJ z3Th-$CrKk1rnM%->(kIQiP8QOjxRA&3Q{u%(m*&7%F`F4E(U(7(2U7o&-NBFw3uHe zRK=toKYxISz#=fwPd5K=2x)>4zOb?XIN%6C0dWF!2JkL}UI%F`)QvVDBlNW@ri-D6 zpu?lE*F2zTgpm!;5_tiQ(Bri9391d638;!-0A3;{2qjHGHpWC?$ltrd%ElDC3QzH- zEwQ8n!J~elP78lDXrZVClKaqCL9K$S02~EQ2i_M!Jv|3C2UR{oC=ql5hZJAPS~S!e zVj~b+4BtJ57L5OqLo^2sfpY>Mfeqoo?H6$@IGPv5sz7`sG-<@Jw;^2vs|N2yg#4V3 zb@z4lFMH_l-%&R~#9}zpAFT)FSh-2^^n&is?@X&muv&JwF>A2p z8~f#$6GL^$=Ig^(0toNomfT z9cpWuyqPmlu|2i@+uzN(o*A8{J z-x7+`~F;H2* zGu_(r_X<1SbZpex``Ewivg_0Ptm}^-tt`!r_Vtl_5+rk|w}j_9J`CP%bZA23Scg`e zD06=FRA#R8W63F_vqW0RI!hx;Wbx-KLHMY*e94?peJCGBo-f1Vb%;I7U{jPhK3EAzDH3+1T>&!w!w1<&Q2k|=M@ M$xBaXCgA0N0hQ* Date: Tue, 1 Oct 2013 18:40:35 +0400 Subject: [PATCH 064/131] 8025145: [macosx]: java 7 does not recognize tiff image on clipboard Reviewed-by: anthony, serb --- jdk/src/macosx/lib/flavormap.properties | 1 + 1 file changed, 1 insertion(+) diff --git a/jdk/src/macosx/lib/flavormap.properties b/jdk/src/macosx/lib/flavormap.properties index 4a9f5fe3ffe..b00f2c2c3a6 100644 --- a/jdk/src/macosx/lib/flavormap.properties +++ b/jdk/src/macosx/lib/flavormap.properties @@ -76,5 +76,6 @@ FILE_NAME=application/x-java-file-list;class=java.util.List text/uri-list=application/x-java-file-list;class=java.util.List PNG=image/x-java-image;class=java.awt.Image JFIF=image/x-java-image;class=java.awt.Image +TIFF=image/x-java-image;class=java.awt.Image RICH_TEXT=text/rtf HTML=text/html;charset=utf-8;eoln="\r\n";terminators=1 From 4ff41501d152a237e0719c53ac70bf4796f31ba5 Mon Sep 17 00:00:00 2001 From: Phil Race Date: Tue, 1 Oct 2013 15:36:53 -0700 Subject: [PATCH 065/131] 8007386: On physical machine (video card is Intel Q45) the text is blank Reviewed-by: prr, jchen --- .../sun/awt/X11GraphicsEnvironment.java | 9 ++++- .../native/sun/java2d/x11/XRBackendNative.c | 39 +++++++++++++++++-- 2 files changed, 43 insertions(+), 5 deletions(-) diff --git a/jdk/src/solaris/classes/sun/awt/X11GraphicsEnvironment.java b/jdk/src/solaris/classes/sun/awt/X11GraphicsEnvironment.java index 4e1c816fd18..47449f25c91 100644 --- a/jdk/src/solaris/classes/sun/awt/X11GraphicsEnvironment.java +++ b/jdk/src/solaris/classes/sun/awt/X11GraphicsEnvironment.java @@ -96,6 +96,7 @@ public class X11GraphicsEnvironment // Now check for XRender system property boolean xRenderRequested = true; + boolean xRenderIgnoreLinuxVersion = false; String xProp = System.getProperty("sun.java2d.xrender"); if (xProp != null) { if (xProp.equals("false") || xProp.equals("f")) { @@ -104,6 +105,10 @@ public class X11GraphicsEnvironment xRenderRequested = true; xRenderVerbose = true; } + + if(xProp.equalsIgnoreCase("t") || xProp.equalsIgnoreCase("true")) { + xRenderIgnoreLinuxVersion = true; + } } // initialize the X11 display connection @@ -121,7 +126,7 @@ public class X11GraphicsEnvironment // only attempt to initialize Xrender if it was requested if (xRenderRequested) { - xRenderAvailable = initXRender(xRenderVerbose); + xRenderAvailable = initXRender(xRenderVerbose, xRenderIgnoreLinuxVersion); if (xRenderVerbose && !xRenderAvailable) { System.out.println( "Could not enable XRender pipeline"); @@ -159,7 +164,7 @@ public class X11GraphicsEnvironment private static boolean xRenderVerbose; private static boolean xRenderAvailable; - private static native boolean initXRender(boolean verbose); + private static native boolean initXRender(boolean verbose, boolean ignoreLinuxVersion); public static boolean isXRenderAvailable() { return xRenderAvailable; } diff --git a/jdk/src/solaris/native/sun/java2d/x11/XRBackendNative.c b/jdk/src/solaris/native/sun/java2d/x11/XRBackendNative.c index cbcf0c357e3..c015abb8b07 100644 --- a/jdk/src/solaris/native/sun/java2d/x11/XRBackendNative.c +++ b/jdk/src/solaris/native/sun/java2d/x11/XRBackendNative.c @@ -31,6 +31,10 @@ #include +#ifdef __linux__ + #include +#endif + /* On Solaris 10 updates 8, 9, the render.h file defines these * protocol values but does not define the structs in Xrender.h. * Thus in order to get these always defined on Solaris 10 @@ -131,7 +135,7 @@ static #define MAX_PAYLOAD (262140u - 36u) #define MAXUINT (0xffffffffu) -static jboolean IsXRenderAvailable(jboolean verbose) { +static jboolean IsXRenderAvailable(jboolean verbose, jboolean ignoreLinuxVersion) { void *xrenderlib; @@ -253,6 +257,31 @@ static jboolean IsXRenderAvailable(jboolean verbose) { } #endif +#ifdef __linux__ + /* + * Check for Linux >= 3.5 (Ubuntu 12.04.02 LTS) to avoid hitting + * https://bugs.freedesktop.org/show_bug.cgi?id=48045 + */ + struct utsname utsbuf; + if(uname(&utsbuf) >= 0) { + int major, minor, revision; + if(sscanf(utsbuf.release, "%i.%i.%i", &major, &minor, &revision) == 3) { + if(major < 3 || (major == 3 && minor < 5)) { + if(!ignoreLinuxVersion) { + available = JNI_FALSE; + } + else if(verbose) { + printf("WARNING: Linux < 3.5 detected.\n" + "The pipeline will be enabled, but graphical " + "artifacts can occur with old graphic drivers.\n" + "See the release notes for more details.\n"); + fflush(stdout); + } + } + } + } +#endif // __linux__ + return available; } /* @@ -262,7 +291,7 @@ static jboolean IsXRenderAvailable(jboolean verbose) { */ JNIEXPORT jboolean JNICALL Java_sun_awt_X11GraphicsEnvironment_initXRender -(JNIEnv *env, jclass x11ge, jboolean verbose) +(JNIEnv *env, jclass x11ge, jboolean verbose, jboolean ignoreLinuxVersion) { #ifndef HEADLESS static jboolean xrenderAvailable = JNI_FALSE; @@ -277,7 +306,7 @@ Java_sun_awt_X11GraphicsEnvironment_initXRender } #endif AWT_LOCK(); - xrenderAvailable = IsXRenderAvailable(verbose); + xrenderAvailable = IsXRenderAvailable(verbose, ignoreLinuxVersion); AWT_UNLOCK(); firstTime = JNI_FALSE; } @@ -294,9 +323,11 @@ Java_sun_java2d_xr_XRBackendNative_initIDs(JNIEnv *env, jclass cls) { XImage* defaultImg; jfieldID maskImgID; jlong fmt8; + jlong fmt24; jlong fmt32; jfieldID a8ID = (*env)->GetStaticFieldID(env, cls, "FMTPTR_A8", "J"); + jfieldID rgb24ID = (*env)->GetStaticFieldID(env, cls, "FMTPTR_ARGB24", "J"); jfieldID argb32ID = (*env)->GetStaticFieldID(env, cls, "FMTPTR_ARGB32", "J"); if (awt_display == (Display *)NULL) { @@ -304,9 +335,11 @@ Java_sun_java2d_xr_XRBackendNative_initIDs(JNIEnv *env, jclass cls) { } fmt8 = ptr_to_jlong(XRenderFindStandardFormat(awt_display, PictStandardA8)); + fmt24 = ptr_to_jlong(XRenderFindStandardFormat(awt_display, PictStandardRGB24)); fmt32 = ptr_to_jlong(XRenderFindStandardFormat(awt_display, PictStandardARGB32)); (*env)->SetStaticLongField(env, cls, a8ID, fmt8); + (*env)->SetStaticLongField(env, cls, rgb24ID, fmt24); (*env)->SetStaticLongField(env, cls, argb32ID, fmt32); maskData = (char *) malloc(32*32); From e5260cc5649783c1cee74d5f6bc73d1cdc1233b7 Mon Sep 17 00:00:00 2001 From: Vadim Pakhnushev Date: Wed, 2 Oct 2013 10:06:28 +0400 Subject: [PATCH 066/131] 8024343: Change different color with the "The XOR alternation color" combobox, the color of the image can not shown immediately Reviewed-by: ceisserer, prr, bae --- .../classes/sun/java2d/xr/XRSurfaceData.java | 14 +- .../sun/java2d/AcceleratedXORModeTest.java | 143 ++++++++++++++++++ 2 files changed, 150 insertions(+), 7 deletions(-) create mode 100644 jdk/test/sun/java2d/AcceleratedXORModeTest.java diff --git a/jdk/src/solaris/classes/sun/java2d/xr/XRSurfaceData.java b/jdk/src/solaris/classes/sun/java2d/xr/XRSurfaceData.java index fa0598774df..014a98be971 100644 --- a/jdk/src/solaris/classes/sun/java2d/xr/XRSurfaceData.java +++ b/jdk/src/solaris/classes/sun/java2d/xr/XRSurfaceData.java @@ -457,15 +457,15 @@ public abstract class XRSurfaceData extends XSurfaceData { if (sg2d != null && sg2d.compositeState == SunGraphics2D.COMP_XOR) { if (validatedXorComp != sg2d.getComposite()) { validatedXorComp = (XORComposite) sg2d.getComposite(); - int xorpixelmod = validatedXorComp.getXorPixel(); renderQueue.setGCMode(xgc, false); + } - // validate pixel - int pixel = sg2d.pixel; - if (validatedGCForegroundPixel != pixel) { - renderQueue.setGCForeground(xgc, pixel ^ xorpixelmod); - validatedGCForegroundPixel = pixel; - } + // validate pixel + int pixel = sg2d.pixel; + if (validatedGCForegroundPixel != pixel) { + int xorpixelmod = validatedXorComp.getXorPixel(); + renderQueue.setGCForeground(xgc, pixel ^ xorpixelmod); + validatedGCForegroundPixel = pixel; } if (updateGCClip) { diff --git a/jdk/test/sun/java2d/AcceleratedXORModeTest.java b/jdk/test/sun/java2d/AcceleratedXORModeTest.java new file mode 100644 index 00000000000..e255cc39d48 --- /dev/null +++ b/jdk/test/sun/java2d/AcceleratedXORModeTest.java @@ -0,0 +1,143 @@ +/* + * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* +* @test +* @bug 8024343 +* @summary Test verifies that accelerated pipelines +* correctly draws primitives in XOR mode. +* @run main/othervm -Dsun.java2d.xrender=True AcceleratedXORModeTest +*/ + +import java.awt.Color; +import java.awt.Graphics2D; +import java.awt.GraphicsConfiguration; +import java.awt.GraphicsEnvironment; +import java.awt.image.BufferedImage; +import java.awt.image.VolatileImage; +import java.io.File; +import java.io.IOException; +import javax.imageio.ImageIO; + +public class AcceleratedXORModeTest { + public static void main(String argv[]) { + String fileName = argv.length > 0 ? argv[0] : null; + new AcceleratedXORModeTest(fileName).test(); + } + + static final Color backColor = Color.red; + static final Color color1 = Color.green; + static final Color color2 = Color.yellow; + static final Color xorColor1 = Color.blue; + static final Color xorColor2 = Color.white; + + static final int width = 700, height = 300; + + VolatileImage vImg = null; + String fileName; + + public AcceleratedXORModeTest(String fileName) { + this.fileName = fileName; + } + + void draw(Graphics2D g) { + g.setColor(backColor); + g.fillRect(0, 0, width, height); + g.setXORMode(xorColor1); + drawPattern(g, 100); + g.setXORMode(xorColor2); + drawPattern(g, 400); + g.dispose(); + } + + void test(BufferedImage bi) { + comparePattern(bi, 150, xorColor1.getRGB()); + comparePattern(bi, 450, xorColor2.getRGB()); + } + + void comparePattern(BufferedImage bi, int startX, int xorColor) { + int[] expectedColors = { + backColor.getRGB() ^ color1.getRGB() ^ xorColor, + backColor.getRGB() ^ color1.getRGB() ^ xorColor ^ + color2.getRGB() ^ xorColor, + backColor.getRGB() ^ color2.getRGB() ^ xorColor + }; + for (int i = 0; i < 3; i++) { + int x = startX + 100 * i; + int rgb = bi.getRGB(x, 150); + if (rgb != expectedColors[i]) { + String msg = "Colors mismatch: x = " + x + + ", got " + new Color(rgb) + ", expected " + + new Color(expectedColors[i]); + System.err.println(msg); + write(bi); + throw new RuntimeException("FAILED: " + msg); + } + } + } + + void drawPattern(Graphics2D g, int x) { + g.setColor(color1); + g.fillRect(x, 0, 200, 300); + g.setColor(color2); + g.fillRect(x+100, 0, 200, 300); + } + + GraphicsConfiguration getDefaultGC() { + return GraphicsEnvironment.getLocalGraphicsEnvironment(). + getDefaultScreenDevice().getDefaultConfiguration(); + } + + void createVImg() { + if (vImg != null) { + vImg.flush(); + vImg = null; + } + vImg = getDefaultGC().createCompatibleVolatileImage(width, height); + } + + void write(BufferedImage bi) { + if (fileName != null) { + try { + ImageIO.write(bi, "png", new File(fileName)); + } catch (IOException e) { + System.err.println("Can't write image file " + fileName); + } + } + } + + void test() { + createVImg(); + do { + int valCode = vImg.validate(getDefaultGC()); + if (valCode == VolatileImage.IMAGE_INCOMPATIBLE) { + createVImg(); + } + Graphics2D g = vImg.createGraphics(); + draw(g); + BufferedImage bi = vImg.getSnapshot(); + test(bi); + write(bi); + } while (vImg.contentsLost()); + } +} From 195b490063e6c7b293392a5de42ce8d405bc5d69 Mon Sep 17 00:00:00 2001 From: Petr Pchelko Date: Wed, 2 Oct 2013 11:18:17 +0400 Subject: [PATCH 067/131] 7124363: [macosx] ClassCastException: CFileDialog cannot be cast to LWWindowPeer Reviewed-by: anthony, serb --- jdk/src/macosx/classes/sun/lwawt/LWWindowPeer.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/jdk/src/macosx/classes/sun/lwawt/LWWindowPeer.java b/jdk/src/macosx/classes/sun/lwawt/LWWindowPeer.java index 632fe844e7b..260e7639551 100644 --- a/jdk/src/macosx/classes/sun/lwawt/LWWindowPeer.java +++ b/jdk/src/macosx/classes/sun/lwawt/LWWindowPeer.java @@ -393,8 +393,12 @@ public class LWWindowPeer @Override public void setModalBlocked(Dialog blocker, boolean blocked) { synchronized (getPeerTreeLock()) { - this.blocker = !blocked ? null : - (LWWindowPeer) AWTAccessor.getComponentAccessor().getPeer(blocker); + ComponentPeer peer = AWTAccessor.getComponentAccessor().getPeer(blocker); + if (blocked && (peer instanceof LWWindowPeer)) { + this.blocker = (LWWindowPeer) peer; + } else { + this.blocker = null; + } } platformWindow.setModalBlocked(blocked); From d5ec67a6e552530d0c2ca3a787df7dcd4b962d6a Mon Sep 17 00:00:00 2001 From: Petr Pchelko Date: Wed, 2 Oct 2013 11:32:56 +0400 Subject: [PATCH 068/131] 8024163: [macosx] NullPointerException at javax.swing.TransferHandler$DropHandler.handleDrag since jdk8b93, 7u40b28 Reviewed-by: anthony, serb --- .../lwawt/macosx/CDropTargetContextPeer.java | 71 +++++++--- jdk/src/macosx/native/sun/awt/CDropTarget.m | 5 +- .../ExtraDragEnterTest.java | 133 ++++++++++++++++++ .../MissedDragExitTest.java | 128 +++++++++++++++++ 4 files changed, 314 insertions(+), 23 deletions(-) create mode 100644 jdk/test/java/awt/dnd/DropTargetEnterExitTest/ExtraDragEnterTest.java create mode 100644 jdk/test/java/awt/dnd/DropTargetEnterExitTest/MissedDragExitTest.java diff --git a/jdk/src/macosx/classes/sun/lwawt/macosx/CDropTargetContextPeer.java b/jdk/src/macosx/classes/sun/lwawt/macosx/CDropTargetContextPeer.java index ad6171fe67a..4c71a224996 100644 --- a/jdk/src/macosx/classes/sun/lwawt/macosx/CDropTargetContextPeer.java +++ b/jdk/src/macosx/classes/sun/lwawt/macosx/CDropTargetContextPeer.java @@ -26,6 +26,7 @@ package sun.lwawt.macosx; import java.awt.*; +import java.awt.dnd.DropTarget; import sun.awt.dnd.SunDropTargetContextPeer; import sun.awt.dnd.SunDropTargetEvent; @@ -38,7 +39,7 @@ final class CDropTargetContextPeer extends SunDropTargetContextPeer { private long fNativeDropTransfer = 0; private long fNativeDataAvailable = 0; private Object fNativeData = null; - private boolean insideTarget = true; + private DropTarget insideTarget = null; Object awtLockAccess = new Object(); @@ -88,26 +89,19 @@ final class CDropTargetContextPeer extends SunDropTargetContextPeer { return fNativeData; } - // We need to take care of dragExit message because for some reason it is not being - // generated for lightweight components + // We need to take care of dragEnter and dragExit messages because + // native system generates them only for heavyweights @Override protected void processMotionMessage(SunDropTargetEvent event, boolean operationChanged) { - Component eventSource = (Component)event.getComponent(); - Point screenPoint = event.getPoint(); - SwingUtilities.convertPointToScreen(screenPoint, eventSource); - Rectangle screenBounds = new Rectangle(eventSource.getLocationOnScreen().x, - eventSource.getLocationOnScreen().y, - eventSource.getWidth(), eventSource.getHeight()); - if(insideTarget) { - if(!screenBounds.contains(screenPoint)) { + boolean eventInsideTarget = isEventInsideTarget(event); + if (event.getComponent().getDropTarget() == insideTarget) { + if (!eventInsideTarget) { processExitMessage(event); - insideTarget = false; return; } } else { - if(screenBounds.contains(screenPoint)) { + if (eventInsideTarget) { processEnterMessage(event); - insideTarget = true; } else { return; } @@ -115,17 +109,52 @@ final class CDropTargetContextPeer extends SunDropTargetContextPeer { super.processMotionMessage(event, operationChanged); } + /** + * Could be called when DnD enters a heavyweight or synthesized in processMotionMessage + */ + @Override + protected void processEnterMessage(SunDropTargetEvent event) { + Component c = event.getComponent(); + DropTarget dt = event.getComponent().getDropTarget(); + if (isEventInsideTarget(event) + && dt != insideTarget + && c.isShowing() + && dt != null + && dt.isActive()) { + insideTarget = dt; + super.processEnterMessage(event); + } + } + + /** + * Could be called when DnD exits a heavyweight or synthesized in processMotionMessage + */ + @Override + protected void processExitMessage(SunDropTargetEvent event) { + if (event.getComponent().getDropTarget() == insideTarget) { + insideTarget = null; + super.processExitMessage(event); + } + } + @Override protected void processDropMessage(SunDropTargetEvent event) { - Component eventSource = (Component)event.getComponent(); + if (isEventInsideTarget(event)) { + super.processDropMessage(event); + insideTarget = null; + } + } + + private boolean isEventInsideTarget(SunDropTargetEvent event) { + Component eventSource = event.getComponent(); Point screenPoint = event.getPoint(); SwingUtilities.convertPointToScreen(screenPoint, eventSource); - Rectangle screenBounds = new Rectangle(eventSource.getLocationOnScreen().x, - eventSource.getLocationOnScreen().y, - eventSource.getWidth(), eventSource.getHeight()); - if(screenBounds.contains(screenPoint)) { - super.processDropMessage(event); - } + Point locationOnScreen = eventSource.getLocationOnScreen(); + Rectangle screenBounds = new Rectangle(locationOnScreen.x, + locationOnScreen.y, + eventSource.getWidth(), + eventSource.getHeight()); + return screenBounds.contains(screenPoint); } @Override diff --git a/jdk/src/macosx/native/sun/awt/CDropTarget.m b/jdk/src/macosx/native/sun/awt/CDropTarget.m index 260bbdec82e..a1c47f8adcd 100644 --- a/jdk/src/macosx/native/sun/awt/CDropTarget.m +++ b/jdk/src/macosx/native/sun/awt/CDropTarget.m @@ -477,6 +477,8 @@ extern JNFClassInfo jc_CDropTargetContextPeer; sDraggingExited = FALSE; sDraggingLocation = [sender draggingLocation]; NSPoint javaLocation = [fView convertPoint:sDraggingLocation fromView:nil]; + javaLocation.y = fView.window.frame.size.height - javaLocation.y; + DLog5(@"+ dragEnter: loc native %f, %f, java %f, %f\n", sDraggingLocation.x, sDraggingLocation.y, javaLocation.x, javaLocation.y); ////////// BEGIN Calculate the current drag actions ////////// @@ -570,8 +572,7 @@ extern JNFClassInfo jc_CDropTargetContextPeer; // Should we notify Java things have changed? if (sDraggingError == FALSE && notifyJava) { NSPoint javaLocation = [fView convertPoint:sDraggingLocation fromView:nil]; - // For some reason even after the convertPoint drag events come with the y coordinate reverted - javaLocation.y = fView.window.frame.size.height - javaLocation.y; + javaLocation.y = fView.window.frame.size.height - javaLocation.y; //DLog5(@" : dragMoved: loc native %f, %f, java %f, %f\n", sDraggingLocation.x, sDraggingLocation.y, javaLocation.x, javaLocation.y); jlongArray formats = sDraggingFormats; diff --git a/jdk/test/java/awt/dnd/DropTargetEnterExitTest/ExtraDragEnterTest.java b/jdk/test/java/awt/dnd/DropTargetEnterExitTest/ExtraDragEnterTest.java new file mode 100644 index 00000000000..16d938f98f6 --- /dev/null +++ b/jdk/test/java/awt/dnd/DropTargetEnterExitTest/ExtraDragEnterTest.java @@ -0,0 +1,133 @@ +/* + * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/** + * @test + * @bug 8024163 + * @summary Checks the dragEnter event is correctly generated + * @library ../../regtesthelpers + * @build Util + * @compile ExtraDragEnterTest.java + * @run main/othervm ExtraDragEnterTest + * @author Petr Pchelko + */ + +import test.java.awt.regtesthelpers.Util; + +import javax.swing.*; +import java.awt.*; +import java.awt.datatransfer.StringSelection; +import java.awt.dnd.DnDConstants; +import java.awt.dnd.DragGestureEvent; +import java.awt.dnd.DragGestureListener; +import java.awt.dnd.DragSource; +import java.awt.dnd.DropTarget; +import java.awt.dnd.DropTargetAdapter; +import java.awt.dnd.DropTargetDragEvent; +import java.awt.dnd.DropTargetDropEvent; +import java.awt.event.InputEvent; +import java.util.concurrent.atomic.AtomicInteger; + +public class ExtraDragEnterTest { + + private static final int FRAME_SIZE = 100; + private static final int FRAME_LOCATION = 100; + + private static AtomicInteger dragEnterCalled = new AtomicInteger(0); + + private static volatile Panel mainPanel; + private static volatile Frame f; + + private static void initAndShowUI() { + f = new Frame("Test frame"); + f.setBounds(FRAME_LOCATION,FRAME_LOCATION,FRAME_SIZE,FRAME_SIZE); + mainPanel = new Panel(); + mainPanel.setBounds(0, 0, FRAME_SIZE, FRAME_SIZE); + mainPanel.setBackground(Color.black); + mainPanel.setLayout(new GridLayout(2, 1)); + + final DraggablePanel dragSource = new DraggablePanel(); + dragSource.setBackground(Color.yellow); + dragSource.setDropTarget(null); + mainPanel.add(dragSource); + + Panel dropTarget = new Panel(); + dropTarget.setBackground(Color.red); + DropTarget dt = new DropTarget(dropTarget, new DropTargetAdapter() { + @Override public void drop(DropTargetDropEvent dtde) { } + + @Override + public void dragEnter(DropTargetDragEvent dtde) { + dragEnterCalled.incrementAndGet(); + } + }); + dropTarget.setDropTarget(dt); + mainPanel.add(dropTarget); + + f.add(mainPanel); + f.setVisible(true); + } + + public static void main(String[] args) throws Throwable { + try { + + SwingUtilities.invokeAndWait(new Runnable() { + @Override + public void run() { + initAndShowUI(); + } + }); + + Robot r = new Robot(); + Util.waitForIdle(r); + Point leftCorner = new Point(mainPanel.getLocationOnScreen()); + leftCorner.translate(5, 5); + Point rightCorner = new Point(mainPanel.getLocationOnScreen()); + rightCorner.translate(mainPanel.getWidth(), mainPanel.getHeight()); + rightCorner.translate(-5, -5); + Util.drag(r, leftCorner, rightCorner, InputEvent.BUTTON1_MASK); + Util.waitForIdle(r); + + int called = dragEnterCalled.get(); + if (called != 1) { + throw new RuntimeException("Failed. Drag enter called " + called + " times. Expected 1" ); + } + } finally { + if (f != null) { + f.dispose(); + } + } + } + + private static class DraggablePanel extends Panel implements DragGestureListener { + + public DraggablePanel() { + (new DragSource()).createDefaultDragGestureRecognizer(this, DnDConstants.ACTION_COPY, this); + } + + @Override + public void dragGestureRecognized(DragGestureEvent dge) { + dge.startDrag(Cursor.getDefaultCursor(), new StringSelection("test")); + } + } +} diff --git a/jdk/test/java/awt/dnd/DropTargetEnterExitTest/MissedDragExitTest.java b/jdk/test/java/awt/dnd/DropTargetEnterExitTest/MissedDragExitTest.java new file mode 100644 index 00000000000..3863667c8b2 --- /dev/null +++ b/jdk/test/java/awt/dnd/DropTargetEnterExitTest/MissedDragExitTest.java @@ -0,0 +1,128 @@ +/* + * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/** + * @test + * @bug 8024163 + * @summary Checks that dragExit is generated when the new DropTarget is created under the drag + * @library ../../regtesthelpers + * @build Util + * @compile MissedDragExitTest.java + * @run main/othervm MissedDragExitTest + * @author Petr Pchelko + */ + +import test.java.awt.regtesthelpers.Util; + +import javax.swing.*; +import java.awt.*; +import java.awt.datatransfer.StringSelection; +import java.awt.dnd.DnDConstants; +import java.awt.dnd.DragGestureEvent; +import java.awt.dnd.DragGestureListener; +import java.awt.dnd.DragSource; +import java.awt.dnd.DropTarget; +import java.awt.dnd.DropTargetAdapter; +import java.awt.dnd.DropTargetDragEvent; +import java.awt.dnd.DropTargetDropEvent; +import java.awt.dnd.DropTargetEvent; +import java.awt.event.InputEvent; + +public class MissedDragExitTest { + + private static final int FRAME_SIZE = 100; + private static final int FRAME_LOCATION = 100; + + private static volatile boolean dragExitCalled = false; + + private static volatile Frame f; + + private static void initAndShowUI() { + f = new Frame("Test frame"); + f.setBounds(FRAME_LOCATION,FRAME_LOCATION,FRAME_SIZE,FRAME_SIZE); + + final DraggablePanel dragSource = new DraggablePanel(); + dragSource.setBackground(Color.yellow); + DropTarget dt = new DropTarget(dragSource, new DropTargetAdapter() { + @Override public void drop(DropTargetDropEvent dtde) { } + + @Override + public void dragExit(DropTargetEvent dte) { + dragExitCalled = true; + } + + @Override + public void dragOver(DropTargetDragEvent dtde) { + Panel newDropTarget = new Panel(); + newDropTarget.setDropTarget(new DropTarget()); + newDropTarget.setBackground(Color.red); + newDropTarget.setBounds(0, 0, FRAME_SIZE, FRAME_SIZE); + dragSource.add(newDropTarget); + } + }); + dragSource.setDropTarget(dt); + f.add(dragSource); + + f.setVisible(true); + } + + public static void main(String[] args) throws Throwable { + try { + + SwingUtilities.invokeAndWait(new Runnable() { + @Override + public void run() { + initAndShowUI(); + } + }); + + Robot r = new Robot(); + Util.waitForIdle(r); + Util.drag(r, + new Point(FRAME_LOCATION + FRAME_SIZE / 3, FRAME_LOCATION + FRAME_SIZE / 3), + new Point(FRAME_LOCATION + FRAME_SIZE / 3 * 2, FRAME_LOCATION + FRAME_SIZE / 3 * 2), + InputEvent.BUTTON1_MASK); + Util.waitForIdle(r); + + if (!dragExitCalled) { + throw new RuntimeException("Failed. Drag exit was not called" ); + } + } finally { + if (f != null) { + f.dispose(); + } + } + } + + private static class DraggablePanel extends Panel implements DragGestureListener { + + public DraggablePanel() { + (new DragSource()).createDefaultDragGestureRecognizer(this, DnDConstants.ACTION_COPY, this); + } + + @Override + public void dragGestureRecognized(DragGestureEvent dge) { + dge.startDrag(Cursor.getDefaultCursor(), new StringSelection("test")); + } + } +} From a8abc64da914628b908cdb79218b2edb93bfdbf3 Mon Sep 17 00:00:00 2001 From: Petr Pchelko Date: Wed, 2 Oct 2013 11:50:58 +0400 Subject: [PATCH 069/131] 8024600: [macosx] code prevents use of -Xlint:auxiliaryclass,empty in jdk build Reviewed-by: anthony, serb --- .../apple/eawt/_AppEventLegacyHandler.java | 4 - .../com/apple/eawt/_OpenAppHandler.java | 30 ++++ .../com/apple/laf/AquaComboBoxRenderer.java | 130 --------------- .../laf/AquaComboBoxRendererInternal.java | 157 ++++++++++++++++++ .../classes/com/apple/laf/AquaMenuBarUI.java | 5 +- 5 files changed, 190 insertions(+), 136 deletions(-) create mode 100644 jdk/src/macosx/classes/com/apple/eawt/_OpenAppHandler.java create mode 100644 jdk/src/macosx/classes/com/apple/laf/AquaComboBoxRendererInternal.java diff --git a/jdk/src/macosx/classes/com/apple/eawt/_AppEventLegacyHandler.java b/jdk/src/macosx/classes/com/apple/eawt/_AppEventLegacyHandler.java index c870f797839..493999c226c 100644 --- a/jdk/src/macosx/classes/com/apple/eawt/_AppEventLegacyHandler.java +++ b/jdk/src/macosx/classes/com/apple/eawt/_AppEventLegacyHandler.java @@ -31,10 +31,6 @@ import java.util.*; import com.apple.eawt.AppEvent.*; -interface _OpenAppHandler { - void handleOpenApp(); -} - @SuppressWarnings("deprecation") class _AppEventLegacyHandler implements AboutHandler, PreferencesHandler, _OpenAppHandler, AppReOpenedListener, OpenFilesHandler, PrintFilesHandler, QuitHandler { final _AppEventHandler parent; diff --git a/jdk/src/macosx/classes/com/apple/eawt/_OpenAppHandler.java b/jdk/src/macosx/classes/com/apple/eawt/_OpenAppHandler.java new file mode 100644 index 00000000000..97daaad65c7 --- /dev/null +++ b/jdk/src/macosx/classes/com/apple/eawt/_OpenAppHandler.java @@ -0,0 +1,30 @@ +/* + * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package com.apple.eawt; + +interface _OpenAppHandler { + void handleOpenApp(); +} \ No newline at end of file diff --git a/jdk/src/macosx/classes/com/apple/laf/AquaComboBoxRenderer.java b/jdk/src/macosx/classes/com/apple/laf/AquaComboBoxRenderer.java index 4b31dfff19d..fc60e533c6e 100644 --- a/jdk/src/macosx/classes/com/apple/laf/AquaComboBoxRenderer.java +++ b/jdk/src/macosx/classes/com/apple/laf/AquaComboBoxRenderer.java @@ -25,141 +25,11 @@ package com.apple.laf; -import java.awt.*; - import javax.swing.*; import javax.swing.plaf.UIResource; -import sun.swing.SwingUtilities2; - class AquaComboBoxRenderer extends AquaComboBoxRendererInternal implements UIResource { public AquaComboBoxRenderer(final JComboBox comboBox) { super(comboBox); } } - -class AquaComboBoxRendererInternal extends JLabel implements ListCellRenderer { - final JComboBox fComboBox; - boolean fSelected; - boolean fChecked; - boolean fInList; - boolean fEditable; - boolean fDrawCheckedItem = true; - - // Provides space for a checkbox, and is translucent - public AquaComboBoxRendererInternal(final JComboBox comboBox) { - super(); - fComboBox = comboBox; - } - - // Don't include checkIcon space, because this is also used for button size calculations - // - the popup-size calc will get checkIcon space from getInsets - public Dimension getPreferredSize() { - // From BasicComboBoxRenderer - trick to avoid zero-height items - final Dimension size; - - final String text = getText(); - if ((text == null) || ("".equals(text))) { - setText(" "); - size = super.getPreferredSize(); - setText(""); - } else { - size = super.getPreferredSize(); - } - return size; - } - - // Don't paint the border here, it gets painted by the UI - protected void paintBorder(final Graphics g) { - - } - - public int getBaseline(int width, int height) { - return super.getBaseline(width, height) - 1; - } - - // Really means is the one with the mouse over it - public Component getListCellRendererComponent(final JList list, final Object value, int index, final boolean isSelected, final boolean cellHasFocus) { - fInList = (index >= 0); // When the button wants the item painted, it passes in -1 - fSelected = isSelected; - if (index < 0) { - index = fComboBox.getSelectedIndex(); - } - - // changed this to not ask for selected index but directly compare the current item and selected item - // different from basic because basic has no concept of checked, just has the last one selected, - // and the user changes selection. We have selection and a check mark. - // we used to call fComboBox.getSelectedIndex which ends up being a very bad call for large checkboxes - // it does a linear compare of every object in the checkbox until it finds the selected one, so if - // we have a 5000 element list we will 5000 * (selected index) .equals() of objects. - // See Radar #3141307 - - // Fix for Radar # 3204287 where we ask for an item at a negative index! - if (index >= 0) { - final Object item = fComboBox.getItemAt(index); - fChecked = fInList && item != null && item.equals(fComboBox.getSelectedItem()); - } else { - fChecked = false; - } - - fEditable = fComboBox.isEditable(); - if (isSelected) { - if (fEditable) { - setBackground(UIManager.getColor("List.selectionBackground")); - setForeground(UIManager.getColor("List.selectionForeground")); - } else { - setBackground(list.getSelectionBackground()); - setForeground(list.getSelectionForeground()); - } - } else { - if (fEditable) { - setBackground(UIManager.getColor("List.background")); - setForeground(UIManager.getColor("List.foreground")); - } else { - setBackground(list.getBackground()); - setForeground(list.getForeground()); - } - } - - setFont(list.getFont()); - - if (value instanceof Icon) { - setIcon((Icon)value); - } else { - setText((value == null) ? " " : value.toString()); - } - return this; - } - - public Insets getInsets(Insets insets) { - if (insets == null) insets = new Insets(0, 0, 0, 0); - insets.top = 1; - insets.bottom = 1; - insets.right = 5; - insets.left = (fInList && !fEditable ? 16 + 7 : 5); - return insets; - } - - protected void setDrawCheckedItem(final boolean drawCheckedItem) { - this.fDrawCheckedItem = drawCheckedItem; - } - - // Paint this component, and a checkbox if it's the selected item and not in the button - protected void paintComponent(final Graphics g) { - if (fInList) { - if (fSelected && !fEditable) { - AquaMenuPainter.instance().paintSelectedMenuItemBackground(g, getWidth(), getHeight()); - } else { - g.setColor(getBackground()); - g.fillRect(0, 0, getWidth(), getHeight()); - } - - if (fChecked && !fEditable && fDrawCheckedItem) { - final int y = getHeight() - 4; - g.setColor(getForeground()); - SwingUtilities2.drawString(fComboBox, g, "\u2713", 6, y); - } - } - super.paintComponent(g); - } -} diff --git a/jdk/src/macosx/classes/com/apple/laf/AquaComboBoxRendererInternal.java b/jdk/src/macosx/classes/com/apple/laf/AquaComboBoxRendererInternal.java new file mode 100644 index 00000000000..a93560a1f71 --- /dev/null +++ b/jdk/src/macosx/classes/com/apple/laf/AquaComboBoxRendererInternal.java @@ -0,0 +1,157 @@ +/* + * 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.apple.laf; + +import sun.swing.SwingUtilities2; + +import javax.swing.*; +import java.awt.*; + +class AquaComboBoxRendererInternal extends JLabel implements ListCellRenderer { + final JComboBox fComboBox; + boolean fSelected; + boolean fChecked; + boolean fInList; + boolean fEditable; + boolean fDrawCheckedItem = true; + + // Provides space for a checkbox, and is translucent + public AquaComboBoxRendererInternal(final JComboBox comboBox) { + super(); + fComboBox = comboBox; + } + + // Don't include checkIcon space, because this is also used for button size calculations + // - the popup-size calc will get checkIcon space from getInsets + public Dimension getPreferredSize() { + // From BasicComboBoxRenderer - trick to avoid zero-height items + final Dimension size; + + final String text = getText(); + if ((text == null) || ("".equals(text))) { + setText(" "); + size = super.getPreferredSize(); + setText(""); + } else { + size = super.getPreferredSize(); + } + return size; + } + + // Don't paint the border here, it gets painted by the UI + protected void paintBorder(final Graphics g) { + + } + + public int getBaseline(int width, int height) { + return super.getBaseline(width, height) - 1; + } + + // Really means is the one with the mouse over it + public Component getListCellRendererComponent(final JList list, final Object value, int index, final boolean isSelected, final boolean cellHasFocus) { + fInList = (index >= 0); // When the button wants the item painted, it passes in -1 + fSelected = isSelected; + if (index < 0) { + index = fComboBox.getSelectedIndex(); + } + + // changed this to not ask for selected index but directly compare the current item and selected item + // different from basic because basic has no concept of checked, just has the last one selected, + // and the user changes selection. We have selection and a check mark. + // we used to call fComboBox.getSelectedIndex which ends up being a very bad call for large checkboxes + // it does a linear compare of every object in the checkbox until it finds the selected one, so if + // we have a 5000 element list we will 5000 * (selected index) .equals() of objects. + // See Radar #3141307 + + // Fix for Radar # 3204287 where we ask for an item at a negative index! + if (index >= 0) { + final Object item = fComboBox.getItemAt(index); + fChecked = fInList && item != null && item.equals(fComboBox.getSelectedItem()); + } else { + fChecked = false; + } + + fEditable = fComboBox.isEditable(); + if (isSelected) { + if (fEditable) { + setBackground(UIManager.getColor("List.selectionBackground")); + setForeground(UIManager.getColor("List.selectionForeground")); + } else { + setBackground(list.getSelectionBackground()); + setForeground(list.getSelectionForeground()); + } + } else { + if (fEditable) { + setBackground(UIManager.getColor("List.background")); + setForeground(UIManager.getColor("List.foreground")); + } else { + setBackground(list.getBackground()); + setForeground(list.getForeground()); + } + } + + setFont(list.getFont()); + + if (value instanceof Icon) { + setIcon((Icon)value); + } else { + setText((value == null) ? " " : value.toString()); + } + return this; + } + + public Insets getInsets(Insets insets) { + if (insets == null) insets = new Insets(0, 0, 0, 0); + insets.top = 1; + insets.bottom = 1; + insets.right = 5; + insets.left = (fInList && !fEditable ? 16 + 7 : 5); + return insets; + } + + protected void setDrawCheckedItem(final boolean drawCheckedItem) { + this.fDrawCheckedItem = drawCheckedItem; + } + + // Paint this component, and a checkbox if it's the selected item and not in the button + protected void paintComponent(final Graphics g) { + if (fInList) { + if (fSelected && !fEditable) { + AquaMenuPainter.instance().paintSelectedMenuItemBackground(g, getWidth(), getHeight()); + } else { + g.setColor(getBackground()); + g.fillRect(0, 0, getWidth(), getHeight()); + } + + if (fChecked && !fEditable && fDrawCheckedItem) { + final int y = getHeight() - 4; + g.setColor(getForeground()); + SwingUtilities2.drawString(fComboBox, g, "\u2713", 6, y); + } + } + super.paintComponent(g); + } +} diff --git a/jdk/src/macosx/classes/com/apple/laf/AquaMenuBarUI.java b/jdk/src/macosx/classes/com/apple/laf/AquaMenuBarUI.java index da6a01e0348..e2a4caf5ad9 100644 --- a/jdk/src/macosx/classes/com/apple/laf/AquaMenuBarUI.java +++ b/jdk/src/macosx/classes/com/apple/laf/AquaMenuBarUI.java @@ -73,8 +73,9 @@ public class AquaMenuBarUI extends BasicMenuBarUI implements ScreenMenuBarProvid public Dimension getPreferredSize(final JComponent c) { if (isScreenMenuBar((JMenuBar)c)) { - if (setScreenMenuBar((JFrame)(c.getTopLevelAncestor()))) ; - return new Dimension(0, 0); + if (setScreenMenuBar((JFrame)(c.getTopLevelAncestor()))) { + return new Dimension(0, 0); + } } return null; } From efe326ede952edef7078b61a9235d41b5c4d63ee Mon Sep 17 00:00:00 2001 From: Petr Pchelko Date: Wed, 2 Oct 2013 16:58:13 +0400 Subject: [PATCH 070/131] 8024158: [macosx] java/awt/EventDispatchThread/LoopRobustness/LoopRobustness still failed after fix JDK-8022247; since jdk8b96 Reviewed-by: art, leonidr --- jdk/src/macosx/classes/sun/lwawt/LWWindowPeer.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/jdk/src/macosx/classes/sun/lwawt/LWWindowPeer.java b/jdk/src/macosx/classes/sun/lwawt/LWWindowPeer.java index 260e7639551..105899034fc 100644 --- a/jdk/src/macosx/classes/sun/lwawt/LWWindowPeer.java +++ b/jdk/src/macosx/classes/sun/lwawt/LWWindowPeer.java @@ -1150,8 +1150,11 @@ public class LWWindowPeer return false; } - Window currentActive = KeyboardFocusManager. - getCurrentKeyboardFocusManager().getActiveWindow(); + AppContext targetAppContext = AWTAccessor.getComponentAccessor().getAppContext(getTarget()); + KeyboardFocusManager kfm = AWTAccessor.getKeyboardFocusManagerAccessor() + .getCurrentKeyboardFocusManager(targetAppContext); + Window currentActive = kfm.getActiveWindow(); + Window opposite = LWKeyboardFocusManagerPeer.getInstance(). getCurrentFocusedWindow(); From 33ff5ac952e17daf8c0e1c0d8af038fcfe0aa7ce Mon Sep 17 00:00:00 2001 From: Leonid Romanov Date: Wed, 2 Oct 2013 17:06:09 +0400 Subject: [PATCH 071/131] 8023994: Right click on the icon added to the system tray for the first time, java.lang.IllegalArgumentException thrown Reviewed-by: anthony, serb --- jdk/src/solaris/classes/sun/awt/X11/XBaseMenuWindow.java | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/jdk/src/solaris/classes/sun/awt/X11/XBaseMenuWindow.java b/jdk/src/solaris/classes/sun/awt/X11/XBaseMenuWindow.java index 783f4acb935..2d611b7a720 100644 --- a/jdk/src/solaris/classes/sun/awt/X11/XBaseMenuWindow.java +++ b/jdk/src/solaris/classes/sun/awt/X11/XBaseMenuWindow.java @@ -116,6 +116,8 @@ abstract public class XBaseMenuWindow extends XWindow { protected Point grabInputPoint = null; protected boolean hasPointerMoved = false; + private AppContext disposeAppContext; + /************************************************ * * Mapping data @@ -174,6 +176,8 @@ abstract public class XBaseMenuWindow extends XWindow { XBaseMenuWindow() { super(new XCreateWindowParams(new Object[] { DELAYED, Boolean.TRUE})); + + disposeAppContext = AppContext.getAppContext(); } /************************************************ @@ -904,12 +908,12 @@ abstract public class XBaseMenuWindow extends XWindow { */ public void dispose() { setDisposed(true); - InvocationEvent ev = new InvocationEvent(target, new Runnable() { + + SunToolkit.invokeLaterOnAppContext(disposeAppContext, new Runnable() { public void run() { doDispose(); } }); - super.postEvent(ev); } /** @@ -923,7 +927,6 @@ abstract public class XBaseMenuWindow extends XWindow { if (oldData != null) { oldData.invalidate(); } - XToolkit.targetDisposedPeer(target, this); destroy(); } From 12a77079615653f80ced4950ecad371642a302ec Mon Sep 17 00:00:00 2001 From: Sergey Bylokhov Date: Wed, 2 Oct 2013 21:02:04 +0400 Subject: [PATCH 072/131] 8013563: Memory leak in JFrame on Linux Reviewed-by: anthony, art --- jdk/src/share/classes/java/awt/Window.java | 30 +++++--- .../awt/Window/WindowsLeak/WindowsLeak.java | 71 +++++++++++++++++++ 2 files changed, 93 insertions(+), 8 deletions(-) create mode 100644 jdk/test/java/awt/Window/WindowsLeak/WindowsLeak.java diff --git a/jdk/src/share/classes/java/awt/Window.java b/jdk/src/share/classes/java/awt/Window.java index 7471683749e..1994f479521 100644 --- a/jdk/src/share/classes/java/awt/Window.java +++ b/jdk/src/share/classes/java/awt/Window.java @@ -226,6 +226,7 @@ public class Window extends Container implements Accessible { boolean syncLWRequests = false; transient boolean beforeFirstShow = true; private transient boolean disposing = false; + transient WindowDisposerRecord disposerRecord = null; static final int OPENED = 0x01; @@ -437,18 +438,28 @@ public class Window extends Container implements Accessible { transient Object anchor = new Object(); static class WindowDisposerRecord implements sun.java2d.DisposerRecord { - final WeakReference owner; + WeakReference owner; final WeakReference weakThis; final WeakReference context; + WindowDisposerRecord(AppContext context, Window victim) { - owner = new WeakReference(victim.getOwner()); weakThis = victim.weakThis; this.context = new WeakReference(context); } + + public void updateOwner() { + Window victim = weakThis.get(); + owner = (victim == null) + ? null + : new WeakReference(victim.getOwner()); + } + public void dispose() { - Window parent = owner.get(); - if (parent != null) { - parent.removeOwnedWindow(weakThis); + if (owner != null) { + Window parent = owner.get(); + if (parent != null) { + parent.removeOwnedWindow(weakThis); + } } AppContext ac = context.get(); if (null != ac) { @@ -502,6 +513,8 @@ public class Window extends Container implements Accessible { } modalExclusionType = Dialog.ModalExclusionType.NO_EXCLUDE; + disposerRecord = new WindowDisposerRecord(appContext, this); + sun.java2d.Disposer.addRecord(anchor, disposerRecord); SunToolkit.checkAndSetPolicy(this); } @@ -619,9 +632,8 @@ public class Window extends Container implements Accessible { owner.addOwnedWindow(weakThis); } - // Fix for 6758673: this call is moved here from init(gc), because // WindowDisposerRecord requires a proper value of parent field. - Disposer.addRecord(anchor, new WindowDisposerRecord(appContext, this)); + disposerRecord.updateOwner(); } /** @@ -2774,6 +2786,7 @@ public class Window extends Container implements Accessible { void connectOwnedWindow(Window child) { child.parent = this; addOwnedWindow(child.weakThis); + child.disposerRecord.updateOwner(); } private void addToWindowList() { @@ -2936,7 +2949,8 @@ public class Window extends Container implements Accessible { weakThis = new WeakReference<>(this); anchor = new Object(); - sun.java2d.Disposer.addRecord(anchor, new WindowDisposerRecord(appContext, this)); + disposerRecord = new WindowDisposerRecord(appContext, this); + sun.java2d.Disposer.addRecord(anchor, disposerRecord); addToWindowList(); initGC(null); diff --git a/jdk/test/java/awt/Window/WindowsLeak/WindowsLeak.java b/jdk/test/java/awt/Window/WindowsLeak/WindowsLeak.java new file mode 100644 index 00000000000..dd776a8d299 --- /dev/null +++ b/jdk/test/java/awt/Window/WindowsLeak/WindowsLeak.java @@ -0,0 +1,71 @@ +/* + * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @bug 8013563 + * @summary Tests that windows are removed from windows list + * @run main/othervm -Xms32M -Xmx32M WindowsLeak +*/ + +import java.awt.*; +import sun.awt.AppContext; + +import java.lang.ref.WeakReference; + +import java.util.Vector; + +public class WindowsLeak { + + public static void main(String[] args) { + for (int i = 0; i < 100; i++) + { + Frame f = new Frame(); + f.pack(); + f.dispose(); + } + + Vector garbage = new Vector(); + while (true) + { + try + { + garbage.add(new byte[1000]); + } + catch (OutOfMemoryError e) + { + break; + } + } + garbage = null; + + Vector> windowList = + (Vector>) AppContext.getAppContext().get(Window.class); + + if (windowList != null && !windowList.isEmpty()) { + throw new RuntimeException("Test FAILED: Window list is not empty: " + windowList.size()); + } + + System.out.println("Test PASSED"); + } +} From d7d6a076178e6a8108377926d61d20aae9694e65 Mon Sep 17 00:00:00 2001 From: Phil Race Date: Wed, 2 Oct 2013 11:16:07 -0700 Subject: [PATCH 073/131] 8025837: Extraneous changes in the fix for 8007386 Reviewed-by: jgodinez, jchen --- jdk/src/solaris/native/sun/java2d/x11/XRBackendNative.c | 4 ---- 1 file changed, 4 deletions(-) diff --git a/jdk/src/solaris/native/sun/java2d/x11/XRBackendNative.c b/jdk/src/solaris/native/sun/java2d/x11/XRBackendNative.c index c015abb8b07..1705c28f4fb 100644 --- a/jdk/src/solaris/native/sun/java2d/x11/XRBackendNative.c +++ b/jdk/src/solaris/native/sun/java2d/x11/XRBackendNative.c @@ -323,11 +323,9 @@ Java_sun_java2d_xr_XRBackendNative_initIDs(JNIEnv *env, jclass cls) { XImage* defaultImg; jfieldID maskImgID; jlong fmt8; - jlong fmt24; jlong fmt32; jfieldID a8ID = (*env)->GetStaticFieldID(env, cls, "FMTPTR_A8", "J"); - jfieldID rgb24ID = (*env)->GetStaticFieldID(env, cls, "FMTPTR_ARGB24", "J"); jfieldID argb32ID = (*env)->GetStaticFieldID(env, cls, "FMTPTR_ARGB32", "J"); if (awt_display == (Display *)NULL) { @@ -335,11 +333,9 @@ Java_sun_java2d_xr_XRBackendNative_initIDs(JNIEnv *env, jclass cls) { } fmt8 = ptr_to_jlong(XRenderFindStandardFormat(awt_display, PictStandardA8)); - fmt24 = ptr_to_jlong(XRenderFindStandardFormat(awt_display, PictStandardRGB24)); fmt32 = ptr_to_jlong(XRenderFindStandardFormat(awt_display, PictStandardARGB32)); (*env)->SetStaticLongField(env, cls, a8ID, fmt8); - (*env)->SetStaticLongField(env, cls, rgb24ID, fmt24); (*env)->SetStaticLongField(env, cls, argb32ID, fmt32); maskData = (char *) malloc(32*32); From e43112a8ad8a4e3706b20929dfedcac81d4d0e86 Mon Sep 17 00:00:00 2001 From: Phil Race Date: Wed, 2 Oct 2013 11:22:07 -0700 Subject: [PATCH 074/131] 7179526: xrender : closed/sun/java2d/volatileImage/LineClipTest.java failed since jdk8b36 Reviewed-by: prr, jchen --- .../sun/java2d/xr/GrowableRectArray.java | 14 + .../classes/sun/java2d/xr/MaskTile.java | 92 ---- .../sun/java2d/xr/MaskTileManager.java | 39 +- .../classes/sun/java2d/xr/XRDrawLine.java | 425 +++++++++++++++ .../classes/sun/java2d/xr/XRRenderer.java | 56 +- jdk/test/java/awt/Graphics/LineClipTest.java | 504 ++++++++++++++++++ 6 files changed, 988 insertions(+), 142 deletions(-) create mode 100644 jdk/src/solaris/classes/sun/java2d/xr/XRDrawLine.java create mode 100644 jdk/test/java/awt/Graphics/LineClipTest.java diff --git a/jdk/src/solaris/classes/sun/java2d/xr/GrowableRectArray.java b/jdk/src/solaris/classes/sun/java2d/xr/GrowableRectArray.java index ee5bd62bd84..7defecfdadf 100644 --- a/jdk/src/solaris/classes/sun/java2d/xr/GrowableRectArray.java +++ b/jdk/src/solaris/classes/sun/java2d/xr/GrowableRectArray.java @@ -38,6 +38,20 @@ public class GrowableRectArray extends GrowableIntArray { super(RECT_SIZE, initialSize); } + public final void pushRectValues(int x, int y, int width, int height) { + int currSize = size; + size += RECT_SIZE; + + if (size >= array.length) { + growArray(); + } + + array[currSize] = x; + array[currSize + 1] = y; + array[currSize + 2] = width; + array[currSize + 3] = height; + } + public final void setX(int index, int x) { array[getCellIndex(index)] = x; } diff --git a/jdk/src/solaris/classes/sun/java2d/xr/MaskTile.java b/jdk/src/solaris/classes/sun/java2d/xr/MaskTile.java index 25d110fe7d2..c3315fac3b3 100644 --- a/jdk/src/solaris/classes/sun/java2d/xr/MaskTile.java +++ b/jdk/src/solaris/classes/sun/java2d/xr/MaskTile.java @@ -41,98 +41,6 @@ public class MaskTile { dirtyArea = new DirtyRegion(); } - public void addRect(int x, int y, int width, int height) { - int index = rects.getNextIndex(); - rects.setX(index, x); - rects.setY(index, y); - rects.setWidth(index, width); - rects.setHeight(index, height); - } - - public void addLine(int x1, int y1, int x2, int y2) { - /* - * EXA is not able to accalerate diagonal lines, we try to "guide" it a - * bit to avoid excessive migration See project documentation for an - * detailed explanation - */ - DirtyRegion region = new DirtyRegion(); - region.setDirtyLineRegion(x1, y1, x2, y2); - int xDiff = region.x2 - region.x; - int yDiff = region.y2 - region.y; - - if (xDiff == 0 || yDiff == 0) { - addRect(region.x, region.y, - region.x2 - region.x + 1, region.y2 - region.y + 1); - } else if (xDiff == 1 && yDiff == 1) { - addRect(x1, y1, 1, 1); - addRect(x2, y2, 1, 1); - } else { - lineToRects(x1, y1, x2, y2); - } - } - - private void lineToRects(int xstart, int ystart, int xend, int yend) { - int x, y, t, dx, dy, incx, incy, pdx, pdy, ddx, ddy, es, el, err; - - /* Entfernung in beiden Dimensionen berechnen */ - dx = xend - xstart; - dy = yend - ystart; - - /* Vorzeichen des Inkrements bestimmen */ - incx = dx > 0 ? 1 : (dx < 0) ? -1 : 0; - incy = dy > 0 ? 1 : (dy < 0) ? -1 : 0; - if (dx < 0) - dx = -dx; - if (dy < 0) - dy = -dy; - - /* feststellen, welche Entfernung groesser ist */ - if (dx > dy) { - /* x ist schnelle Richtung */ - pdx = incx; - pdy = 0; /* pd. ist Parallelschritt */ - ddx = incx; - ddy = incy; /* dd. ist Diagonalschritt */ - es = dy; - el = dx; /* Fehlerschritte schnell, langsam */ - } else { - /* y ist schnelle Richtung */ - pdx = 0; - pdy = incy; /* pd. ist Parallelschritt */ - ddx = incx; - ddy = incy; /* dd. ist Diagonalschritt */ - es = dx; - el = dy; /* Fehlerschritte schnell, langsam */ - } - - /* Initialisierungen vor Schleifenbeginn */ - x = xstart; - y = ystart; - err = el / 2; - addRect(x, y, 1, 1); - - /* Pixel berechnen */ - for (t = 0; t < el; ++t) /* t zaehlt die Pixel, el ist auch Anzahl */ - { - /* Aktualisierung Fehlerterm */ - err -= es; - if (err < 0) { - /* Fehlerterm wieder positiv (>=0) machen */ - err += el; - /* Schritt in langsame Richtung, Diagonalschritt */ - x += ddx; - y += ddy; - } else { - /* Schritt in schnelle Richtung, Parallelschritt */ - x += pdx; - y += pdy; - } - addRect(x, y, 1, 1); - // SetPixel(x,y); - // System.out.println(x+":"+y); - } - } - public void calculateDirtyAreas() { for (int i=0; i < rects.getSize(); i++) { diff --git a/jdk/src/solaris/classes/sun/java2d/xr/MaskTileManager.java b/jdk/src/solaris/classes/sun/java2d/xr/MaskTileManager.java index b7baf36ceba..9b2be2744fb 100644 --- a/jdk/src/solaris/classes/sun/java2d/xr/MaskTileManager.java +++ b/jdk/src/solaris/classes/sun/java2d/xr/MaskTileManager.java @@ -54,10 +54,6 @@ public class MaskTileManager { int maskPixmap; int maskPicture; long maskGC; - int lineMaskPixmap; - int lineMaskPicture; - long drawLineGC; - long clearLineGC; public MaskTileManager(XRCompositeManager xrMgr, int parentXid) { tileList = new ArrayList(); @@ -71,34 +67,6 @@ public class MaskTileManager { 0, 0, MASK_SIZE, MASK_SIZE); maskGC = con.createGC(maskPixmap); con.setGCExposures(maskGC, false); - - lineMaskPixmap = con.createPixmap(parentXid, 8, MASK_SIZE, MASK_SIZE); - lineMaskPicture = - con.createPicture(lineMaskPixmap, XRUtils.PictStandardA8); - con.renderRectangle(lineMaskPicture, XRUtils.PictOpClear, - new XRColor(Color.black), 0, 0, MASK_SIZE, MASK_SIZE); - - drawLineGC = con.createGC(lineMaskPixmap); - con.setGCExposures(drawLineGC, false); - con.setGCForeground(drawLineGC, 255); - - clearLineGC = con.createGC(lineMaskPixmap); - con.setGCExposures(clearLineGC, false); - con.setGCForeground(clearLineGC, 0); - } - - /** - * Adds a rectangle to the mask. - */ - public void addRect(int x, int y, int width, int height) { - mainTile.addRect(x, y, width, height); - } - - /** - * Adds a line to the mask. - */ - public void addLine(int x1, int y1, int x2, int y2) { - mainTile.addLine(x1, y1, x2, y2); } /** @@ -324,4 +292,11 @@ public class MaskTileManager { rects.setY(index, 0); } } + + /** + * @return MainTile to which rectangles are added before composition. + */ + public MaskTile getMainTile() { + return mainTile; + } } diff --git a/jdk/src/solaris/classes/sun/java2d/xr/XRDrawLine.java b/jdk/src/solaris/classes/sun/java2d/xr/XRDrawLine.java new file mode 100644 index 00000000000..66b595e9455 --- /dev/null +++ b/jdk/src/solaris/classes/sun/java2d/xr/XRDrawLine.java @@ -0,0 +1,425 @@ +/* + * 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. + */ + +/** + * Bresenham line-drawing implementation decomposing line segments + * into a series of rectangles. + * This is required, because xrender doesn't support line primitives directly. + * The code here is an almost 1:1 port of the existing C-source contained in + * sun/java2d/loop/DrawLine.c and sun/java2d/loop/LoopMacros.h + */ +package sun.java2d.xr; + +public class XRDrawLine { + static final int BIG_MAX = ((1 << 29) - 1); + static final int BIG_MIN = (-(1 << 29)); + + static final int OUTCODE_TOP = 1; + static final int OUTCODE_BOTTOM = 2; + static final int OUTCODE_LEFT = 4; + static final int OUTCODE_RIGHT = 8; + + int x1, y1, x2, y2; + int ucX1, ucY1, ucX2, ucY2; + + DirtyRegion region = new DirtyRegion(); + + protected void rasterizeLine(GrowableRectArray rectBuffer, int _x1, + int _y1, int _x2, int _y2, int cxmin, int cymin, int cxmax, + int cymax, boolean clip, boolean overflowCheck) { + float diagF; + int error; + int steps; + int errminor, errmajor; + boolean xmajor; + int dx, dy, ax, ay; + + initCoordinates(_x1, _y1, _x2, _y2, overflowCheck); + + dx = x2 - x1; + dy = y2 - y1; + ax = Math.abs(dx); + ay = Math.abs(dy); + xmajor = (ax >= ay); + diagF = ((float) ax) / ay; + + if (clip + && !clipCoordinates(cxmin, cymin, cxmax, cymax, xmajor, dx, dy, + ax, ay)) { + // whole line was clipped away + return; + } + + region.setDirtyLineRegion(x1, y1, x2, y2); + int xDiff = region.x2 - region.x; + int yDiff = region.y2 - region.y; + + if (xDiff == 0 || yDiff == 0) { + // horizontal / diagonal lines can be represented by a single + // rectangle + rectBuffer.pushRectValues(region.x, region.y, region.x2 - region.x + + 1, region.y2 - region.y + 1); + return; + } + + // Setup bresenham + if (xmajor) { + errmajor = ay * 2; + errminor = ax * 2; + ax = -ax; /* For clipping adjustment below */ + steps = x2 - x1; + } else { + errmajor = ax * 2; + errminor = ay * 2; + ay = -ay; /* For clipping adjustment below */ + steps = y2 - y1; + } + + if ((steps = (Math.abs(steps) + 1)) == 0) { + return; + } + + error = -(errminor / 2); + + if (y1 != ucY1) { + int ysteps = y1 - ucY1; + if (ysteps < 0) { + ysteps = -ysteps; + } + error += ysteps * ax * 2; + } + + if (x1 != ucX1) { + int xsteps = x1 - ucX1; + if (xsteps < 0) { + xsteps = -xsteps; + } + error += xsteps * ay * 2; + } + error += errmajor; + errminor -= errmajor; + + int xStep = (dx > 0 ? 1 : -1); + int yStep = (dy > 0 ? 1 : -1); + int orthogonalXStep = xmajor ? xStep : 0; + int orthogonalYStep = !xmajor ? yStep : 0; + + /* + * For lines which proceed in one direction faster, we try to generate + * rectangles instead of points. Otherwise we try to avoid the extra + * work... + */ + if (diagF <= 0.9 || diagF >= 1.1) { + lineToRects(rectBuffer, steps, error, errmajor, errminor, xStep, + yStep, orthogonalXStep, orthogonalYStep); + } else { + lineToPoints(rectBuffer, steps, error, errmajor, errminor, xStep, + yStep, orthogonalXStep, orthogonalYStep); + } + } + + private void lineToPoints(GrowableRectArray rectBuffer, int steps, + int error, int errmajor, int errminor, int xStep, int yStep, + int orthogonalXStep, int orthogonalYStep) { + int x = x1, y = y1; + + do { + rectBuffer.pushRectValues(x, y, 1, 1); + + // "Traditional" Bresenham line drawing + if (error < 0) { + error += errmajor; + x += orthogonalXStep; + y += orthogonalYStep; + } else { + error -= errminor; + x += xStep; + y += yStep; + } + } while (--steps > 0); + } + + private void lineToRects(GrowableRectArray rectBuffer, int steps, + int error, int errmajor, int errminor, int xStep, int yStep, + int orthogonalXStep, int orthogonalYStep) { + int x = x1, y = y1; + int rectX = Integer.MIN_VALUE, rectY = 0; + int rectW = 0, rectH = 0; + + do { + // Combine the resulting rectangles + // for steps performed in a single direction. + if (y == rectY) { + if (x == (rectX + rectW)) { + rectW++; + } else if (x == (rectX - 1)) { + rectX--; + rectW++; + } + } else if (x == rectX) { + if (y == (rectY + rectH)) { + rectH++; + } else if (y == (rectY - 1)) { + rectY--; + rectH++; + } + } else { + // Diagonal step: add the previous rectangle to the list, + // iff it was "real" (= not initialized before the first + // iteration) + if (rectX != Integer.MIN_VALUE) { + rectBuffer.pushRectValues(rectX, rectY, rectW, rectH); + } + rectX = x; + rectY = y; + rectW = rectH = 1; + } + + // "Traditional" Bresenham line drawing + if (error < 0) { + error += errmajor; + x += orthogonalXStep; + y += orthogonalYStep; + } else { + error -= errminor; + x += xStep; + y += yStep; + } + } while (--steps > 0); + + // Add last rectangle which isn't handled by the combination-code + // anymore + rectBuffer.pushRectValues(rectX, rectY, rectW, rectH); + } + + private boolean clipCoordinates(int cxmin, int cymin, int cxmax, int cymax, + boolean xmajor, int dx, int dy, int ax, int ay) { + int outcode1, outcode2; + + outcode1 = outcode(x1, y1, cxmin, cymin, cxmax, cymax); + outcode2 = outcode(x2, y2, cxmin, cymin, cxmax, cymax); + + while ((outcode1 | outcode2) != 0) { + int xsteps = 0, ysteps = 0; + + if ((outcode1 & outcode2) != 0) { + return false; + } + + if (outcode1 != 0) { + if ((outcode1 & (OUTCODE_TOP | OUTCODE_BOTTOM)) != 0) { + if ((outcode1 & OUTCODE_TOP) != 0) { + y1 = cymin; + } else { + y1 = cymax; + } + ysteps = y1 - ucY1; + if (ysteps < 0) { + ysteps = -ysteps; + } + xsteps = 2 * ysteps * ax + ay; + if (xmajor) { + xsteps += ay - ax - 1; + } + xsteps = xsteps / (2 * ay); + if (dx < 0) { + xsteps = -xsteps; + } + x1 = ucX1 + (int) xsteps; + } else if ((outcode1 & (OUTCODE_LEFT | OUTCODE_RIGHT)) != 0) { + if ((outcode1 & OUTCODE_LEFT) != 0) { + x1 = cxmin; + } else { + x1 = cxmax; + } + xsteps = x1 - ucX1; + if (xsteps < 0) { + xsteps = -xsteps; + } + ysteps = 2 * xsteps * ay + ax; + if (!xmajor) { + ysteps += ax - ay - 1; + } + ysteps = ysteps / (2 * ax); + if (dy < 0) { + ysteps = -ysteps; + } + y1 = ucY1 + (int) ysteps; + } + outcode1 = outcode(x1, y1, cxmin, cymin, cxmax, cymax); + } else { + if ((outcode2 & (OUTCODE_TOP | OUTCODE_BOTTOM)) != 0) { + if ((outcode2 & OUTCODE_TOP) != 0) { + y2 = cymin; + } else { + y2 = cymax; + } + ysteps = y2 - ucY2; + if (ysteps < 0) { + ysteps = -ysteps; + } + xsteps = 2 * ysteps * ax + ay; + if (xmajor) { + xsteps += ay - ax; + } else { + xsteps -= 1; + } + xsteps = xsteps / (2 * ay); + if (dx > 0) { + xsteps = -xsteps; + } + x2 = ucX2 + (int) xsteps; + } else if ((outcode2 & (OUTCODE_LEFT | OUTCODE_RIGHT)) != 0) { + if ((outcode2 & OUTCODE_LEFT) != 0) { + x2 = cxmin; + } else { + x2 = cxmax; + } + xsteps = x2 - ucX2; + if (xsteps < 0) { + xsteps = -xsteps; + } + ysteps = 2 * xsteps * ay + ax; + if (xmajor) { + ysteps -= 1; + } else { + ysteps += ax - ay; + } + ysteps = ysteps / (2 * ax); + if (dy > 0) { + ysteps = -ysteps; + } + y2 = ucY2 + (int) ysteps; + } + outcode2 = outcode(x2, y2, cxmin, cymin, cxmax, cymax); + } + } + + return true; + } + + private void initCoordinates(int x1, int y1, int x2, int y2, + boolean checkOverflow) { + /* + * Part of calculating the Bresenham parameters for line stepping + * involves being able to store numbers that are twice the magnitude of + * the biggest absolute difference in coordinates. Since we want the + * stepping parameters to be stored in jints, we then need to avoid any + * absolute differences more than 30 bits. Thus, we need to preprocess + * the coordinates to reduce their range to 30 bits regardless of + * clipping. We need to cut their range back before we do the clipping + * because the Bresenham stepping values need to be calculated based on + * the "unclipped" coordinates. + * + * Thus, first we perform a "pre-clipping" stage to bring the + * coordinates within the 30-bit range and then we proceed to the + * regular clipping procedure, pretending that these were the original + * coordinates all along. Since this operation occurs based on a + * constant "pre-clip" rectangle of +/- 30 bits without any + * consideration for the final clip, the rounding errors that occur here + * will depend only on the line coordinates and be invariant with + * respect to the particular device/user clip rectangles in effect at + * the time. Thus, rendering a given large-range line will be consistent + * under a variety of clipping conditions. + */ + if (checkOverflow + && (OverflowsBig(x1) || OverflowsBig(y1) || OverflowsBig(x2) || OverflowsBig(y2))) { + /* + * Use doubles to get us into range for "Big" arithmetic. + * + * The math of adjusting an endpoint for clipping can involve an + * intermediate result with twice the number of bits as the original + * coordinate range. Since we want to maintain as much as 30 bits of + * precision in the resulting coordinates, we will get roundoff here + * even using IEEE double-precision arithmetic which cannot carry 60 + * bits of mantissa. Since the rounding errors will be consistent + * for a given set of input coordinates the potential roundoff error + * should not affect the consistency of our rendering. + */ + double x1d = x1; + double y1d = y1; + double x2d = x2; + double y2d = y2; + double dxd = x2d - x1d; + double dyd = y2d - y1d; + + if (x1 < BIG_MIN) { + y1d = y1 + (BIG_MIN - x1) * dyd / dxd; + x1d = BIG_MIN; + } else if (x1 > BIG_MAX) { + y1d = y1 - (x1 - BIG_MAX) * dyd / dxd; + x1d = BIG_MAX; + } + /* Use Y1d instead of _y1 for testing now as we may have modified it */ + if (y1d < BIG_MIN) { + x1d = x1 + (BIG_MIN - y1) * dxd / dyd; + y1d = BIG_MIN; + } else if (y1d > BIG_MAX) { + x1d = x1 - (y1 - BIG_MAX) * dxd / dyd; + y1d = BIG_MAX; + } + if (x2 < BIG_MIN) { + y2d = y2 + (BIG_MIN - x2) * dyd / dxd; + x2d = BIG_MIN; + } else if (x2 > BIG_MAX) { + y2d = y2 - (x2 - BIG_MAX) * dyd / dxd; + x2d = BIG_MAX; + } + /* Use Y2d instead of _y2 for testing now as we may have modified it */ + if (y2d < BIG_MIN) { + x2d = x2 + (BIG_MIN - y2) * dxd / dyd; + y2d = BIG_MIN; + } else if (y2d > BIG_MAX) { + x2d = x2 - (y2 - BIG_MAX) * dxd / dyd; + y2d = BIG_MAX; + } + + x1 = (int) x1d; + y1 = (int) y1d; + x2 = (int) x2d; + y2 = (int) y2d; + } + + this.x1 = ucX1 = x1; + this.y1 = ucY1 = y1; + this.x2 = ucX2 = x2; + this.y2 = ucY2 = y2; + } + + private boolean OverflowsBig(int v) { + return ((v) != (((v) << 2) >> 2)); + } + + private int out(int v, int vmin, int vmax, int cmin, int cmax) { + return ((v < vmin) ? cmin : ((v > vmax) ? cmax : 0)); + } + + private int outcode(int x, int y, int xmin, int ymin, int xmax, int ymax) { + return out(y, ymin, ymax, OUTCODE_TOP, OUTCODE_BOTTOM) + | out(x, xmin, xmax, OUTCODE_LEFT, OUTCODE_RIGHT); + } +} diff --git a/jdk/src/solaris/classes/sun/java2d/xr/XRRenderer.java b/jdk/src/solaris/classes/sun/java2d/xr/XRRenderer.java index 933f5452378..bad9e837f28 100644 --- a/jdk/src/solaris/classes/sun/java2d/xr/XRRenderer.java +++ b/jdk/src/solaris/classes/sun/java2d/xr/XRRenderer.java @@ -53,10 +53,15 @@ import static sun.java2d.xr.XRUtils.clampToUShort; public class XRRenderer implements PixelDrawPipe, PixelFillPipe, ShapeDrawPipe { XRDrawHandler drawHandler; MaskTileManager tileManager; + XRDrawLine lineGen; + GrowableRectArray rectBuffer; public XRRenderer(MaskTileManager tileManager) { this.tileManager = tileManager; + this.rectBuffer = tileManager.getMainTile().getRects(); + this.drawHandler = new XRDrawHandler(); + this.lineGen = new XRDrawLine(); } /** @@ -77,19 +82,15 @@ public class XRRenderer implements PixelDrawPipe, PixelFillPipe, ShapeDrawPipe { int transX2 = Region.clipAdd(x2, sg2d.transX); int transY2 = Region.clipAdd(y2, sg2d.transY); - // Non clipped fast path - if (compClip.contains(transX1, transY1) - && compClip.contains(transX2, transY2)) { - SunToolkit.awtLock(); - try { - validateSurface(sg2d); - tileManager.addLine(transX1, transY1, transX2, transY2); - tileManager.fillMask((XRSurfaceData) sg2d.surfaceData); - } finally { - SunToolkit.awtUnlock(); - } - } else { - draw(sg2d, new Line2D.Float(x1, y1, x2, y2)); + SunToolkit.awtLock(); + try { + validateSurface(sg2d); + lineGen.rasterizeLine(rectBuffer, transX1, transY1, + transX2, transY2, compClip.getLoX(), compClip.getLoY(), + compClip.getHiX(), compClip.getHiY(), true, true); + tileManager.fillMask((XRSurfaceData) sg2d.surfaceData); + } finally { + SunToolkit.awtUnlock(); } } @@ -148,7 +149,7 @@ public class XRRenderer implements PixelDrawPipe, PixelFillPipe, ShapeDrawPipe { SunToolkit.awtLock(); try { validateSurface(sg2d); - tileManager.addRect(x, y, width, height); + rectBuffer.pushRectValues(x, y, width, height); tileManager.fillMask((XRSurfaceData) sg2d.surfaceData); } finally { SunToolkit.awtUnlock(); @@ -199,11 +200,13 @@ public class XRRenderer implements PixelDrawPipe, PixelFillPipe, ShapeDrawPipe { } private class XRDrawHandler extends ProcessPath.DrawHandler { + DirtyRegion region; XRDrawHandler() { // these are bogus values; the caller will use validate() // to ensure that they are set properly prior to each usage super(0, 0, 0, 0); + this.region = new DirtyRegion(); } /** @@ -218,15 +221,32 @@ public class XRRenderer implements PixelDrawPipe, PixelFillPipe, ShapeDrawPipe { } public void drawLine(int x1, int y1, int x2, int y2) { - tileManager.addLine(x1, y1, x2, y2); + region.setDirtyLineRegion(x1, y1, x2, y2); + int xDiff = region.x2 - region.x; + int yDiff = region.y2 - region.y; + + if (xDiff == 0 || yDiff == 0) { + // horizontal / diagonal lines can be represented by a single + // rectangle + rectBuffer.pushRectValues(region.x, region.y, region.x2 - region.x + + 1, region.y2 - region.y + 1); + } else if (xDiff == 1 && yDiff == 1) { + // fast path for pattern commonly generated by + // ProcessPath.DrawHandler + rectBuffer.pushRectValues(x1, y1, 1, 1); + rectBuffer.pushRectValues(x2, y2, 1, 1); + } else { + lineGen.rasterizeLine(rectBuffer, x1, y1, x2, y2, 0, 0, + 0, 0, false, false); + } } public void drawPixel(int x, int y) { - tileManager.addRect(x, y, 1, 1); + rectBuffer.pushRectValues(x, y, 1, 1); } public void drawScanline(int x1, int x2, int y) { - tileManager.addRect(x1, y, x2 - x1 + 1, 1); + rectBuffer.pushRectValues(x1, y, x2 - x1 + 1, 1); } } @@ -263,7 +283,7 @@ public class XRRenderer implements PixelDrawPipe, PixelFillPipe, ShapeDrawPipe { validateSurface(sg2d); int[] spanBox = new int[4]; while (si.nextSpan(spanBox)) { - tileManager.addRect(spanBox[0] + transx, + rectBuffer.pushRectValues(spanBox[0] + transx, spanBox[1] + transy, spanBox[2] - spanBox[0], spanBox[3] - spanBox[1]); diff --git a/jdk/test/java/awt/Graphics/LineClipTest.java b/jdk/test/java/awt/Graphics/LineClipTest.java new file mode 100644 index 00000000000..43410f9dad8 --- /dev/null +++ b/jdk/test/java/awt/Graphics/LineClipTest.java @@ -0,0 +1,504 @@ +/* + * Copyright (c) 2002, 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 4780022 4862193 7179526 + * @summary Tests that clipped lines are drawn over the same pixels + * as unclipped lines (within the clip bounds) + * @run main/timeout=600/othervm -Dsun.java2d.ddforcevram=true LineClipTest + * @run main/timeout=600/othervm LineClipTest + */ + + +/** + * This app tests whether we are drawing clipped lines the same + * as unclipped lines. The problem occurred when we started + * clipping d3d lines using simple integer clipping, which did not + * account for sub-pixel precision and ended up drawing very different + * pixels than the same line drawn unclipped. A supposed fix + * to that problem used floating-point clipping instead, but there + * was some problem with very limited precision inside of d3d + * (presumably in hardware) that caused some variation in pixels. + * We decided that whatever the fix was, we needed a serious + * line check test to make sure that all kinds of different + * lines would be drawn exactly the same inside the clip area, + * regardless of whether clipping was enabled. This test should + * check all kinds of different cases, such as lines that fall + * completely outside, completely inside, start outside and + * end inside, etc., and lines should end and originate in + * all quadrants of the space divided up by the clip box. + * + * The test works as follows: + * We create nine quadrants using the spaces bisected by the + * edges of the clip bounds (note that only one of these + * quadrants is actually visible when clipping is enabled). + * We create several points in each of these quadrants + * (three in each of the invisible quadrants, nine in the + * center/visible quadrant). Our resulting grid looks like + * this: + * + * x x|x x x|x x + * | | + * | | + * | | + * | | + * | | + * x | | x + * ----------------------------------- + * x |x x x| x + * | | + * | | + * x |x x x| x + * | | + * | | + * x |x x x| x + * ----------------------------------- + * x | | x + * | | + * | | + * | | + * | | + * | | + * x x|x x x|x x + * + * The test then draws lines from every point to every other + * point. First, we draw unclipped lines in blue and + * then we draw clipped lines in red. + * At certain times (after every point during the default + * test, after every quadrant of lines if you run with the -quick + * option), we check for errors and draw the current image + * to the screen. Error checking consists of copying the + * VolatileImage to a BufferedImage (because we need access + * to the pixels directly) and checking every pixel in the + * image. The check is simple: everything outside the + * clip bounds should be blue (or the background color) and + * everything inside the clip bounds should be red (or the + * background color). So any blue pixel inside or red + * pixel outside means that there was a drawing error and + * the test fails. + * There are 4 modes that the test can run in (dynamic mode is + * exclusive to the other modes, but the other modes are combinable): + * + * (default): the clip is set + * to a default size (100x100) and the test is run. + * + * -quick: The error + * check is run only after every quadrant of lines is + * drawn. This speeds up the test considerably with + * some less accuracy in error checking (because pixels + * from some lines may overdrawn pixels from other lines + * before we have verified the correctness of those + * pixels). + * + * -dynamic: There is no error checking, but this version + * of the test automatically resizes the clip bounds and + * reruns the test over and over. Nothing besides the + * visual check verifies that the test is running correctly. + * + * -rect: Instead of drawing lines, the test draws rectangles + * to/from all points in all quadrants. This tests similar + * clipping functionality for drawRect(). + * + * n (where "n" is a number): sets the clip size to the + * given value. Just like the default test except that + * the clip size is as specified. + * + * Note: this test must be run with the -Dsun.java2d.ddforcevram=true + * option to force the test image to stay in VRAM. We currently + * punt VRAM images to system memory when we detect lots of + * reads. Since we read the whole buffer on every error check + * to copy it to the BufferedImage), this causes us to punt the + * buffer. A system memory surface will have no d3d capabilities, + * thus we are not testing the d3d line quality when this happens. + * By using the ddforcevram flag, we make sure the buffer + * stays put in VRAM and d3d is used to draw the lines. + */ + +import javax.swing.*; +import java.awt.*; +import java.awt.image.*; + + +public class LineClipTest extends Component implements Runnable { + + int clipBumpVal = 5; + static int clipSize = 100; + int clipX1; + int clipY1; + static final int NUM_QUADS = 9; + Point quadrants[][] = new Point[NUM_QUADS][]; + static boolean dynamic = false; + BufferedImage imageChecker = null; + Color unclippedColor = Color.blue; + Color clippedColor = Color.red; + int testW = -1, testH = -1; + VolatileImage testImage = null; + static boolean keepRunning = false; + static boolean quickTest = false; + static boolean rectTest = false; + static boolean runTestDone = false; + static Frame f = null; + + /** + * Check for errors in the grid. This error check consists of + * copying the buffer into a BufferedImage and reading all pixels + * in that image. No pixel outside the clip bounds should be + * of the color clippedColor and no pixel inside should be + * of the color unclippedColor. Any wrong color returns an error. + */ + boolean gridError(Graphics g) { + boolean error = false; + if (imageChecker == null || (imageChecker.getWidth() != testW) || + (imageChecker.getHeight() != testH)) + { + // Recreate BufferedImage as necessary + GraphicsConfiguration gc = getGraphicsConfiguration(); + ColorModel cm = gc.getColorModel(); + WritableRaster wr = + cm.createCompatibleWritableRaster(getWidth(), getHeight()); + imageChecker = + new BufferedImage(cm, wr, + cm.isAlphaPremultiplied(), null); + } + // Copy buffer to BufferedImage + Graphics gChecker = imageChecker.getGraphics(); + gChecker.drawImage(testImage, 0, 0, this); + + // Set up pixel colors to check against + int clippedPixelColor = clippedColor.getRGB(); + int unclippedPixelColor = unclippedColor.getRGB(); + int wrongPixelColor = clippedPixelColor; + boolean insideClip = false; + for (int row = 0; row < getHeight(); ++row) { + for (int col = 0; col < getWidth(); ++col) { + if (row >= clipY1 && row < (clipY1 + clipSize) && + col >= clipX1 && col < (clipX1 + clipSize)) + { + // Inside clip bounds - should not see unclipped color + wrongPixelColor = unclippedPixelColor; + } else { + // Outside clip - should not see clipped color + wrongPixelColor = clippedPixelColor; + } + int pixel = imageChecker.getRGB(col, row); + if (pixel == wrongPixelColor) { + System.out.println("FAILED: pixel = " + + Integer.toHexString(pixel) + + " at (x, y) = " + col + ", " + row); + // Draw magenta rectangle around problem pixel in buffer + // for visual feedback to user + g.setColor(Color.magenta); + g.drawRect(col - 1, row - 1, 2, 2); + error = true; + } + } + } + return error; + } + + /** + * Draw all test lines and check for errors (unless running + * with -dynamic option) + */ + void drawLineGrid(Graphics screenGraphics, Graphics g) { + // Fill buffer with background color + g.setColor(Color.white); + g.fillRect(0, 0, getWidth(), getHeight()); + + // Now, iterate through all quadrants + for (int srcQuad = 0; srcQuad < NUM_QUADS; ++srcQuad) { + // Draw lines to all other quadrants + for (int dstQuad = 0; dstQuad < NUM_QUADS; ++dstQuad) { + for (int srcPoint = 0; + srcPoint < quadrants[srcQuad].length; + ++srcPoint) + { + // For every point in the source quadrant + int sx = quadrants[srcQuad][srcPoint].x; + int sy = quadrants[srcQuad][srcPoint].y; + for (int dstPoint = 0; + dstPoint < quadrants[dstQuad].length; + ++dstPoint) + { + int dx = quadrants[dstQuad][dstPoint].x; + int dy = quadrants[dstQuad][dstPoint].y; + if (!rectTest) { + // Draw unclipped/clipped lines to every + // point in the dst quadrant + g.setColor(unclippedColor); + g.drawLine(sx, sy, dx, dy); + g.setClip(clipX1, clipY1, clipSize, clipSize); + g.setColor(clippedColor); + g.drawLine(sx,sy, dx, dy); + } else { + // Draw unclipped/clipped rectangles to every + // point in the dst quadrant + g.setColor(unclippedColor); + int w = dx - sx; + int h = dy - sy; + g.drawRect(sx, sy, w, h); + g.setClip(clipX1, clipY1, clipSize, clipSize); + g.setColor(clippedColor); + g.drawRect(sx, sy, w, h); + } + g.setClip(null); + } + if (!dynamic) { + // Draw screen update for visual feedback + screenGraphics.drawImage(testImage, 0, 0, this); + // On default test, check for errors after every + // src point + if (!quickTest && gridError(g)) { + throw new java.lang.RuntimeException("Failed"); + } + } + } + } + if (!dynamic && quickTest && gridError(g)) { + // On quick test, check for errors only after every + // src quadrant + throw new java.lang.RuntimeException("Failed"); + //return; + } + } + if (!dynamic) { + System.out.println("PASSED"); + if (!keepRunning) { + f.dispose(); + } + } + } + + /** + * If we have not yet run the test, or if the window size has + * changed, or if we are running the test in -dynamic mode, + * run the test. Then draw the test buffer to the screen + */ + public void paint(Graphics g) { + if (dynamic || testImage == null || + getWidth() != testW || getHeight() != testH) + { + runTest(g); + } + if (testImage != null) { + g.drawImage(testImage, 0, 0, this); + } + } + + /* + * Create the quadrant of points and run the test to draw all the lines + */ + public void runTest(Graphics screenGraphics) { + if (getWidth() == 0 || getHeight() == 0) { + // May get here before window is really ready + return; + } + clipX1 = (getWidth() - clipSize) / 2; + clipY1 = (getHeight() - clipSize) / 2; + int clipX2 = clipX1 + clipSize; + int clipY2 = clipY1 + clipSize; + int centerX = getWidth()/2; + int centerY = getHeight()/2; + int leftX = 0; + int topY = 0; + int rightX = getWidth() - 1; + int bottomY = getHeight() - 1; + int quadIndex = 0; + // Offsets are used to force diagonal (versus hor/vert) lines + int xOffset = 0; + int yOffset = 0; + + if (quadrants[0] == null) { + for (int i = 0; i < 9; ++i) { + int numPoints = (i == 4) ? 9 : 3; + quadrants[i] = new Point[numPoints]; + } + } + // Upper-left + quadrants[quadIndex] = new Point[] { + new Point(leftX + xOffset, clipY1 - 1 - yOffset), + new Point(leftX + xOffset, topY + yOffset), + new Point(clipX1 - 1 - xOffset, topY + yOffset), + }; + + quadIndex++; + yOffset++; + // Upper-middle + quadrants[quadIndex] = new Point[] { + new Point(clipX1 + 1 + xOffset, topY + yOffset), + new Point(centerX + xOffset, topY + yOffset), + new Point(clipX2 - 1 - xOffset, topY + yOffset), + }; + + quadIndex++; + ++yOffset; + // Upper-right + quadrants[quadIndex] = new Point[] { + new Point(clipX2 + 1 + xOffset, topY + yOffset), + new Point(rightX - xOffset, topY + yOffset), + new Point(rightX - xOffset, clipY1 - 1 - yOffset), + }; + + quadIndex++; + yOffset = 0; + ++xOffset; + // Middle-left + quadrants[quadIndex] = new Point[] { + new Point(leftX + xOffset, clipY1 + 1 + yOffset), + new Point(leftX + xOffset, centerY + yOffset), + new Point(leftX + xOffset, clipY2 - 1 - yOffset), + }; + + quadIndex++; + ++yOffset; + // Middle-middle + quadrants[quadIndex] = new Point[] { + new Point(clipX1 + 1 + xOffset, clipY1 + 1 + yOffset), + new Point(centerX + xOffset, clipY1 + 1 + yOffset), + new Point(clipX2 - 1 - xOffset, clipY1 + 1 + yOffset), + new Point(clipX1 + 1 + xOffset, centerY + yOffset), + new Point(centerX + xOffset, centerY + yOffset), + new Point(clipX2 - 1 - xOffset, centerY + yOffset), + new Point(clipX1 + 1 + xOffset, clipY2 - 1 - yOffset), + new Point(centerX + xOffset, clipY2 - 1 - yOffset), + new Point(clipX2 - 1 - xOffset, clipY2 - 1 - yOffset), + }; + + quadIndex++; + ++yOffset; + // Middle-right + quadrants[quadIndex] = new Point[] { + new Point(rightX - xOffset, clipY1 + 1 + yOffset), + new Point(rightX - xOffset, centerY + yOffset), + new Point(rightX - xOffset, clipY2 - 1 - yOffset), + }; + + quadIndex++; + yOffset = 0; + ++xOffset; + // Lower-left + quadrants[quadIndex] = new Point[] { + new Point(leftX + xOffset, clipY2 + 1 + yOffset), + new Point(leftX + xOffset, bottomY - yOffset), + new Point(clipX1 - 1 - xOffset, bottomY - yOffset), + }; + + quadIndex++; + ++yOffset; + // Lower-middle + quadrants[quadIndex] = new Point[] { + new Point(clipX1 + 1 + xOffset, bottomY - yOffset), + new Point(centerX + xOffset, bottomY - yOffset), + new Point(clipX2 - 1 - xOffset, bottomY - yOffset), + }; + + quadIndex++; + ++yOffset; + // Lower-right + quadrants[quadIndex] = new Point[] { + new Point(clipX2 + 1 + xOffset, bottomY - yOffset), + new Point(rightX - xOffset, bottomY - yOffset), + new Point(rightX - xOffset, clipY2 + 1 + yOffset), + }; + + + if (testImage != null) { + testImage.flush(); + } + testW = getWidth(); + testH = getHeight(); + testImage = createVolatileImage(testW, testH); + Graphics g = testImage.getGraphics(); + do { + int valCode = testImage.validate(getGraphicsConfiguration()); + if (valCode == VolatileImage.IMAGE_INCOMPATIBLE) { + testImage.flush(); + testImage = createVolatileImage(testW, testH); + g = testImage.getGraphics(); + } + drawLineGrid(screenGraphics, g); + } while (testImage.contentsLost()); + if (dynamic) { + // Draw clip box if dynamic + g.setClip(null); + g.setColor(Color.black); + g.drawRect(clipX1, clipY1, clipSize, clipSize); + screenGraphics.drawImage(testImage, 0, 0, this); + } + runTestDone = true; + } + + /** + * When running -dynamic, resize the clip bounds and run the test + * over and over + */ + public void run() { + while (true) { + clipSize += clipBumpVal; + if (clipSize > getWidth() || clipSize < 0) { + clipBumpVal = -clipBumpVal; + clipSize += clipBumpVal; + } + update(getGraphics()); + try { + Thread.sleep(50); + } catch (Exception e) {} + } + } + + public static void main(String args[]) { + for (int i = 0; i < args.length; ++i) { + if (args[i].equals("-dynamic")) { + dynamic = true; + } else if (args[i].equals("-rect")) { + rectTest = true; + } else if (args[i].equals("-quick")) { + quickTest = true; + } else if (args[i].equals("-keep")) { + keepRunning = true; + } else { + // could be clipSize + try { + clipSize = Integer.parseInt(args[i]); + } catch (Exception e) {} + } + } + f = new Frame(); + f.setSize(500, 500); + LineClipTest test = new LineClipTest(); + f.add(test); + if (dynamic) { + Thread t = new Thread(test); + t.start(); + } + f.setVisible(true); + while (!runTestDone) { + // need to make sure jtreg doesn't exit before the + // test is done... + try { + Thread.sleep(50); + } catch (Exception e) {} + } + } +} From e32c2618aa502a8abafed7627d1e2e5db9e208d2 Mon Sep 17 00:00:00 2001 From: Christine Lu Date: Wed, 2 Oct 2013 11:28:07 -0700 Subject: [PATCH 075/131] 8025409: Fix javadoc comments errors and warning reported by doclint report Reviewed-by: anthony, yan --- .../share/classes/java/awt/BorderLayout.java | 2 +- jdk/src/share/classes/java/awt/Button.java | 2 +- jdk/src/share/classes/java/awt/Checkbox.java | 2 +- .../share/classes/java/awt/CheckboxGroup.java | 2 +- .../classes/java/awt/CheckboxMenuItem.java | 2 +- jdk/src/share/classes/java/awt/Choice.java | 2 +- jdk/src/share/classes/java/awt/Color.java | 2 +- .../share/classes/java/awt/EventQueue.java | 4 +- .../share/classes/java/awt/FlowLayout.java | 2 +- .../share/classes/java/awt/FontMetrics.java | 4 +- jdk/src/share/classes/java/awt/Frame.java | 2 +- .../share/classes/java/awt/GridBagLayout.java | 12 ++-- .../share/classes/java/awt/GridLayout.java | 4 +- jdk/src/share/classes/java/awt/Label.java | 2 +- .../classes/java/awt/LinearGradientPaint.java | 2 +- jdk/src/share/classes/java/awt/List.java | 2 +- jdk/src/share/classes/java/awt/MenuBar.java | 2 +- jdk/src/share/classes/java/awt/MenuItem.java | 4 +- .../classes/java/awt/RadialGradientPaint.java | 8 +-- jdk/src/share/classes/java/awt/Scrollbar.java | 6 +- .../share/classes/java/awt/SystemTray.java | 4 +- jdk/src/share/classes/java/awt/TextArea.java | 2 +- jdk/src/share/classes/java/awt/TextField.java | 2 +- jdk/src/share/classes/java/awt/Window.java | 2 +- .../classes/java/awt/font/TextAttribute.java | 26 ++++---- .../java/awt/geom/AffineTransform.java | 2 +- .../share/classes/java/awt/geom/Line2D.java | 6 +- .../classes/java/awt/print/PrinterJob.java | 8 +-- jdk/src/share/classes/javax/print/Doc.java | 6 +- .../share/classes/javax/print/DocFlavor.java | 24 ++++---- .../share/classes/javax/print/MultiDoc.java | 8 +-- .../print/attribute/standard/Finishings.java | 48 +++++++-------- .../attribute/standard/JobStateReasons.java | 2 +- .../standard/MediaPrintableArea.java | 26 ++++---- .../standard/MultipleDocumentHandling.java | 10 ++-- .../standard/PrinterStateReasons.java | 2 +- .../javax/print/attribute/standard/Sides.java | 8 +-- .../classes/javax/swing/JLayeredPane.java | 6 +- .../classes/javax/swing/JOptionPane.java | 12 ++-- .../classes/javax/swing/JScrollPane.java | 6 +- .../classes/javax/swing/JTabbedPane.java | 60 +++++++++---------- .../classes/javax/swing/LookAndFeel.java | 4 +- .../swing/plaf/metal/MetalLookAndFeel.java | 4 +- .../javax/swing/plaf/metal/MetalTreeUI.java | 6 +- .../classes/javax/swing/text/Document.java | 10 ++-- .../javax/swing/text/MaskFormatter.java | 2 +- .../share/classes/javax/swing/text/View.java | 4 +- .../javax/swing/text/html/HTMLDocument.java | 14 ++--- 48 files changed, 191 insertions(+), 191 deletions(-) diff --git a/jdk/src/share/classes/java/awt/BorderLayout.java b/jdk/src/share/classes/java/awt/BorderLayout.java index 9b8644712ea..98bd4d5a9cd 100644 --- a/jdk/src/share/classes/java/awt/BorderLayout.java +++ b/jdk/src/share/classes/java/awt/BorderLayout.java @@ -96,7 +96,7 @@ import java.util.Hashtable; * alt="Diagram of an applet demonstrating BorderLayout. * Each section of the BorderLayout contains a Button corresponding to its position in the layout, one of: * North, West, Center, East, or South." - * ALIGN=center HSPACE=10 VSPACE=7> + * style="float:center; margin: 7px 10px;"> *

            * The code for this applet is as follows: *

            diff --git a/jdk/src/share/classes/java/awt/Button.java b/jdk/src/share/classes/java/awt/Button.java index 9fe42d41cbc..83506b6fdb1 100644 --- a/jdk/src/share/classes/java/awt/Button.java +++ b/jdk/src/share/classes/java/awt/Button.java @@ -40,7 +40,7 @@ import javax.accessibility.*; * under the Solaris operating system: *

            * The following context describes the graphic + * style="float:center; margin: 7px 10px;"> *

            * The first view shows the button as it appears normally. * The second view shows the button diff --git a/jdk/src/share/classes/java/awt/Checkbox.java b/jdk/src/share/classes/java/awt/Checkbox.java index f0486f35e45..7568b0c5aee 100644 --- a/jdk/src/share/classes/java/awt/Checkbox.java +++ b/jdk/src/share/classes/java/awt/Checkbox.java @@ -53,7 +53,7 @@ import javax.accessibility.*; * created by this code example: *

            * The following context describes the graphic. + * style="float:center; margin: 7px 10px;"> *

            * The button labeled one is in the "on" state, and the * other two are in the "off" state. In this example, which uses the diff --git a/jdk/src/share/classes/java/awt/CheckboxGroup.java b/jdk/src/share/classes/java/awt/CheckboxGroup.java index e953daabaaa..25b0697f117 100644 --- a/jdk/src/share/classes/java/awt/CheckboxGroup.java +++ b/jdk/src/share/classes/java/awt/CheckboxGroup.java @@ -48,7 +48,7 @@ package java.awt; *

            * Shows three checkboxes, arranged vertically, labeled one, two, and three. Checkbox one is in the on state. + * style="float:center; margin: 7px 10px;"> *

            * @author Sami Shaio * @see java.awt.Checkbox diff --git a/jdk/src/share/classes/java/awt/CheckboxMenuItem.java b/jdk/src/share/classes/java/awt/CheckboxMenuItem.java index ad12d4c29a9..4da887ee242 100644 --- a/jdk/src/share/classes/java/awt/CheckboxMenuItem.java +++ b/jdk/src/share/classes/java/awt/CheckboxMenuItem.java @@ -44,7 +44,7 @@ import sun.awt.AWTAccessor; *

            * Menu labeled Examples, containing items Basic, Simple, Check, and More Examples. The Check item is a CheckBoxMenuItem instance, in the off state. + * style="float:center; margin: 7px 10px;"> *

            * The item labeled Check shows a check box menu item * in its "off" state. diff --git a/jdk/src/share/classes/java/awt/Choice.java b/jdk/src/share/classes/java/awt/Choice.java index e026953b203..e74bd094fb6 100644 --- a/jdk/src/share/classes/java/awt/Choice.java +++ b/jdk/src/share/classes/java/awt/Choice.java @@ -52,7 +52,7 @@ import javax.accessibility.*; * it appears as follows in its normal state: *

            * The following text describes the graphic + * style="float:center; margin: 7px 10px;"> *

            * In the picture, "Green" is the current choice. * Pushing the mouse button down on the object causes a menu to diff --git a/jdk/src/share/classes/java/awt/Color.java b/jdk/src/share/classes/java/awt/Color.java index 51d46a45f70..464fe987316 100644 --- a/jdk/src/share/classes/java/awt/Color.java +++ b/jdk/src/share/classes/java/awt/Color.java @@ -823,7 +823,7 @@ public class Color implements Paint, java.io.Serializable { *

            * The integer that is returned by HSBtoRGB encodes the * value of a color in bits 0-23 of an integer value that is the same - * format used by the method {@link #getRGB() getRGB}. + * format used by the method {@link #getRGB() getRGB}. * This integer can be supplied as an argument to the * Color constructor that takes a single integer argument. * @param hue the hue component of the color diff --git a/jdk/src/share/classes/java/awt/EventQueue.java b/jdk/src/share/classes/java/awt/EventQueue.java index 1a04dcb507a..d6a1dabfc72 100644 --- a/jdk/src/share/classes/java/awt/EventQueue.java +++ b/jdk/src/share/classes/java/awt/EventQueue.java @@ -652,7 +652,7 @@ public class EventQueue { * Dispatches an event. The manner in which the event is * dispatched depends upon the type of the event and the * type of the event's source object: - *

            + *

            * * * @@ -680,7 +680,7 @@ public class EventQueue { * * *
            Event TypeNo action (ignored)
            - *

            + *

            * @param event an instance of java.awt.AWTEvent, * or a subclass of it * @throws NullPointerException if event is null diff --git a/jdk/src/share/classes/java/awt/FlowLayout.java b/jdk/src/share/classes/java/awt/FlowLayout.java index 228035d10f1..4675bbc573e 100644 --- a/jdk/src/share/classes/java/awt/FlowLayout.java +++ b/jdk/src/share/classes/java/awt/FlowLayout.java @@ -54,7 +54,7 @@ import java.io.IOException; *

            * Graphic of Layout for Three Buttons + * style="float:center; margin: 7px 10px;"> *

            * Here is the code for this applet: *

            diff --git a/jdk/src/share/classes/java/awt/FontMetrics.java b/jdk/src/share/classes/java/awt/FontMetrics.java index 31f2e764f88..cd6c0fbbaf2 100644 --- a/jdk/src/share/classes/java/awt/FontMetrics.java +++ b/jdk/src/share/classes/java/awt/FontMetrics.java @@ -51,8 +51,8 @@ import java.text.CharacterIterator; *

          • {@link #charsWidth(char[], int, int)} *
          *

          - * The letter 'p' showing its 'reference point' + * The letter 'p' showing its 'reference point' * Note that the implementations of these methods are * inefficient, so they are usually overridden with more efficient * toolkit-specific implementations. diff --git a/jdk/src/share/classes/java/awt/Frame.java b/jdk/src/share/classes/java/awt/Frame.java index c7f5d4bcb80..7a7f02fd862 100644 --- a/jdk/src/share/classes/java/awt/Frame.java +++ b/jdk/src/share/classes/java/awt/Frame.java @@ -83,7 +83,7 @@ import javax.accessibility.*; * Diagram of virtual device encompassing three physical screens and one primary physical screen. The primary physical screen
  * shows (0,0) coords while a different physical screen shows (-80,-100) coords. + * style="float:center; margin: 7px 10px;"> *

          * In such an environment, when calling setLocation, * you must pass a virtual coordinate to this method. Similarly, diff --git a/jdk/src/share/classes/java/awt/GridBagLayout.java b/jdk/src/share/classes/java/awt/GridBagLayout.java index fb306a8d3b4..1362e57dd76 100644 --- a/jdk/src/share/classes/java/awt/GridBagLayout.java +++ b/jdk/src/share/classes/java/awt/GridBagLayout.java @@ -125,9 +125,9 @@ import java.util.Arrays; *

          * - * - * - * + * + * + * * * * * *

          Absolute Values

          Orientation Relative Values

          Baseline Relative Values

          Absolute Values

          Orientation Relative Values

          Baseline Relative Values

          @@ -201,7 +201,7 @@ import java.util.Arrays; *
          * The following text describes this graphic (Figure 1). + * alt="The following text describes this graphic (Figure 1)." style="float:center"> *
          * This layout consists of three components: @@ -255,10 +255,10 @@ import java.util.Arrays; *
          * * * * * diff --git a/jdk/src/share/classes/java/awt/GridLayout.java b/jdk/src/share/classes/java/awt/GridLayout.java index b08802e8e9d..596208c3e65 100644 --- a/jdk/src/share/classes/java/awt/GridLayout.java +++ b/jdk/src/share/classes/java/awt/GridLayout.java @@ -55,7 +55,7 @@ package java.awt; * If the container's ComponentOrientation property is horizontal * and right-to-left, the example produces the output shown in Figure 2. *

          - *

          - * The preceeding text describes this graphic (Figure 1). + * The preceeding text describes this graphic (Figure 1). * - * The preceeding text describes this graphic (Figure 2). + * The preceeding text describes this graphic (Figure 2). *
          Figure 2: Horizontal, Left-to-Right
          + *
          * *
          Shows 6 buttons in rows of 2. Row 1 shows buttons 1 then 2.
@@ -73,7 +73,7 @@ package java.awt;
  *
  * <td>Figure 2: Horizontal, Right-to-Left</td>
  * </tr>
- * </table></center>
+ * </table>
  * <p>
  * When both the number of rows and the number of columns have
  * been set to non-zero values, either by a constructor or
diff --git a/jdk/src/share/classes/java/awt/Label.java b/jdk/src/share/classes/java/awt/Label.java
index c5f174a757f..1772875d5ff 100644
--- a/jdk/src/share/classes/java/awt/Label.java
+++ b/jdk/src/share/classes/java/awt/Label.java
@@ -46,7 +46,7 @@ import javax.accessibility.*;
  * produces the following labels:
  * <p>
  * <img src= + * style="float:center; margin: 7px 10px;"> * * @author Sami Shaio * @since JDK1.0 diff --git a/jdk/src/share/classes/java/awt/LinearGradientPaint.java b/jdk/src/share/classes/java/awt/LinearGradientPaint.java index ffb5c9b2d09..e9fbcfc5d86 100644 --- a/jdk/src/share/classes/java/awt/LinearGradientPaint.java +++ b/jdk/src/share/classes/java/awt/LinearGradientPaint.java @@ -94,7 +94,7 @@ import java.beans.ConstructorProperties; * of the three cycle methods: *

          *

          - * + * LinearGradientPaint *
          * * @see java.awt.Paint diff --git a/jdk/src/share/classes/java/awt/List.java b/jdk/src/share/classes/java/awt/List.java index 92a1867d882..dba6ac0bcdf 100644 --- a/jdk/src/share/classes/java/awt/List.java +++ b/jdk/src/share/classes/java/awt/List.java @@ -61,7 +61,7 @@ import javax.accessibility.*; * scrolling list: *

          * Shows a list containing: Venus, Earth, JavaSoft, and Mars. Javasoft is selected. + * alt="Shows a list containing: Venus, Earth, JavaSoft, and Mars. Javasoft is selected." style="float:center; margin: 7px 10px;"> *

          * If the List allows multiple selections, then clicking on * an item that is already selected deselects it. In the preceding diff --git a/jdk/src/share/classes/java/awt/MenuBar.java b/jdk/src/share/classes/java/awt/MenuBar.java index feae49a4db5..2c494ade097 100644 --- a/jdk/src/share/classes/java/awt/MenuBar.java +++ b/jdk/src/share/classes/java/awt/MenuBar.java @@ -45,7 +45,7 @@ import javax.accessibility.*; * Diagram of MenuBar containing 2 menus: Examples and Options.
  * Examples menu is expanded showing items: Basic, Simple, Check, and More Examples. + * style="float:center; margin: 7px 10px;"> *

          * A menu bar handles keyboard shortcuts for menu items, passing them * along to its child menus. diff --git a/jdk/src/share/classes/java/awt/MenuItem.java b/jdk/src/share/classes/java/awt/MenuItem.java index 4838d187a89..b660e20d96d 100644 --- a/jdk/src/share/classes/java/awt/MenuItem.java +++ b/jdk/src/share/classes/java/awt/MenuItem.java @@ -42,8 +42,8 @@ import sun.awt.AWTAccessor; *

          * This picture of a menu bar shows five menu items: * The following text describes this graphic. - *
          + * style="float:center; margin: 7px 10px;"> + *
          * The first two items are simple menu items, labeled * "Basic" and "Simple". * Following these two items is a separator, which is itself diff --git a/jdk/src/share/classes/java/awt/RadialGradientPaint.java b/jdk/src/share/classes/java/awt/RadialGradientPaint.java index c9cc43a8e32..a0bf944b93c 100644 --- a/jdk/src/share/classes/java/awt/RadialGradientPaint.java +++ b/jdk/src/share/classes/java/awt/RadialGradientPaint.java @@ -80,14 +80,14 @@ import java.beans.ConstructorProperties; * from the focus point. The following figure shows that the distance AB * is equal to the distance BC, and the distance AD is equal to the distance DE. *

          - * + * RadialGradientPaint-3 *
          * If the gradient and graphics rendering transforms are uniformly scaled and * the user sets the focus so that it coincides with the center of the circle, * the gradient color proportions are equal for any line drawn from the center. * The following figure shows the distances AB, BC, AD, and DE. They are all equal. *
          - * + * RadialGradientPaint-4 *
          * Note that some minor variations in distances may occur due to sampling at * the granularity of a pixel. @@ -117,7 +117,7 @@ import java.beans.ConstructorProperties; * (centered) focus for each of the three cycle methods: *

          *

          - * + * RadialGradientPaint-1 *
          * *

          @@ -141,7 +141,7 @@ import java.beans.ConstructorProperties; * focus for each of the three cycle methods: *

          *

          - * + * RadialGradientPaint-2 *
          * * @see java.awt.Paint diff --git a/jdk/src/share/classes/java/awt/Scrollbar.java b/jdk/src/share/classes/java/awt/Scrollbar.java index 8ecf5783057..9849480719d 100644 --- a/jdk/src/share/classes/java/awt/Scrollbar.java +++ b/jdk/src/share/classes/java/awt/Scrollbar.java @@ -42,7 +42,7 @@ import javax.accessibility.*; * the red, green, and blue components of a color: *

          * Image shows 3 vertical sliders, side-by-side. + * style="float:center; margin: 7px 10px;"> *

          * Each scroll bar in this example could be created with * code similar to the following: @@ -60,7 +60,7 @@ import javax.accessibility.*; *

          * Image shows horizontal slider with starting range of 0 and ending range of 300. The slider thumb is labeled 60. + * style="float:center; margin: 7px 10px;"> *

          * The value range represented by the bubble in this example * is the visible amount. The horizontal scroll bar @@ -295,7 +295,7 @@ public class Scrollbar extends Component implements Adjustable, Accessible { * Constructs a new vertical scroll bar. * The default properties of the scroll bar are listed in * the following table: - *

          + *

          * * * diff --git a/jdk/src/share/classes/java/awt/SystemTray.java b/jdk/src/share/classes/java/awt/SystemTray.java index 84e89265c78..20ba912870c 100644 --- a/jdk/src/share/classes/java/awt/SystemTray.java +++ b/jdk/src/share/classes/java/awt/SystemTray.java @@ -361,7 +361,7 @@ public class SystemTray { /** * Adds a {@code PropertyChangeListener} to the list of listeners for the * specific property. The following properties are currently supported: - *

          + *

          *

          Property
          * * @@ -384,7 +384,7 @@ public class SystemTray { * The property is accessed by the {@link #getSystemTray} method. * *
          Property
          - *

          + *

          * The {@code listener} listens to property changes only in this context. *

          * If {@code listener} is {@code null}, no exception is thrown diff --git a/jdk/src/share/classes/java/awt/TextArea.java b/jdk/src/share/classes/java/awt/TextArea.java index 8b16d9ec61d..6fc979f2835 100644 --- a/jdk/src/share/classes/java/awt/TextArea.java +++ b/jdk/src/share/classes/java/awt/TextArea.java @@ -42,7 +42,7 @@ import javax.accessibility.*; * The following image shows the appearance of a text area: *

          * A TextArea showing the word 'Hello!' + * style="float:center; margin: 7px 10px;"> *

          * This text area could be created by the following line of code: *

          diff --git a/jdk/src/share/classes/java/awt/TextField.java b/jdk/src/share/classes/java/awt/TextField.java index cbaf649f100..cfdaf51e213 100644 --- a/jdk/src/share/classes/java/awt/TextField.java +++ b/jdk/src/share/classes/java/awt/TextField.java @@ -42,7 +42,7 @@ import javax.accessibility.*; * display the predefined text "Hello". *

          * The preceding text describes this image. + * style="float:center; margin: 7px 10px;"> *

          * Here is the code that produces these four text fields: *

          diff --git a/jdk/src/share/classes/java/awt/Window.java b/jdk/src/share/classes/java/awt/Window.java index 1994f479521..1df36b1abda 100644 --- a/jdk/src/share/classes/java/awt/Window.java +++ b/jdk/src/share/classes/java/awt/Window.java @@ -85,7 +85,7 @@ import sun.util.logging.PlatformLogger; *

          * Diagram shows virtual device containing 4 physical screens. Primary physical screen shows coords (0,0), other screen shows (-80,-100). + * style="float:center; margin: 7px 10px;"> *

          * In such an environment, when calling {@code setLocation}, * you must pass a virtual coordinate to this method. Similarly, diff --git a/jdk/src/share/classes/java/awt/font/TextAttribute.java b/jdk/src/share/classes/java/awt/font/TextAttribute.java index 50d47dace20..c462636348f 100644 --- a/jdk/src/share/classes/java/awt/font/TextAttribute.java +++ b/jdk/src/share/classes/java/awt/font/TextAttribute.java @@ -97,10 +97,10 @@ import java.util.HashMap; *

          Summary of attributes

          *

          * - * - * + * * * * @@ -115,7 +115,7 @@ import java.util.HashMap; * * - * + * * * * @@ -127,7 +127,7 @@ import java.util.HashMap; * * * - * + * * * * @@ -139,7 +139,7 @@ import java.util.HashMap; * * * - * + * * * * @@ -151,7 +151,7 @@ import java.util.HashMap; * * * - * + * * * * @@ -163,7 +163,7 @@ import java.util.HashMap; * * * - * + * * * * @@ -175,7 +175,7 @@ import java.util.HashMap; * * * - * + * * * * @@ -187,7 +187,7 @@ import java.util.HashMap; * * * - * + * * * * @@ -199,7 +199,7 @@ import java.util.HashMap; * * * - * + * * * * @@ -211,7 +211,7 @@ import java.util.HashMap; * * * - * + * * * * @@ -223,7 +223,7 @@ import java.util.HashMap; * * * - * + * * * * @@ -235,7 +235,7 @@ import java.util.HashMap; * * * - * + * * * * diff --git a/jdk/src/share/classes/java/awt/geom/AffineTransform.java b/jdk/src/share/classes/java/awt/geom/AffineTransform.java index 751deac2497..0977cf8eaa4 100644 --- a/jdk/src/share/classes/java/awt/geom/AffineTransform.java +++ b/jdk/src/share/classes/java/awt/geom/AffineTransform.java @@ -47,7 +47,7 @@ import java.beans.ConstructorProperties; * [ 1 ] [ 0 0 1 ] [ 1 ] [ 1 ] * *

          - *

          Handling 90-Degree Rotations

          + *

          Handling 90-Degree Rotations

          *

          * In some variations of the rotate methods in the * AffineTransform class, a double-precision argument diff --git a/jdk/src/share/classes/java/awt/geom/Line2D.java b/jdk/src/share/classes/java/awt/geom/Line2D.java index 2eccbd0c5ad..35f70ad5d4d 100644 --- a/jdk/src/share/classes/java/awt/geom/Line2D.java +++ b/jdk/src/share/classes/java/awt/geom/Line2D.java @@ -82,7 +82,7 @@ public abstract class Line2D implements Shape, Cloneable { public float y2; /** - * Constructs and initializes a Line with coordinates (0, 0) -> (0, 0). + * Constructs and initializes a Line with coordinates (0, 0) → (0, 0). * @since 1.2 */ public Float() { @@ -249,7 +249,7 @@ public abstract class Line2D implements Shape, Cloneable { public double y2; /** - * Constructs and initializes a Line with coordinates (0, 0) -> (0, 0). + * Constructs and initializes a Line with coordinates (0, 0) → (0, 0). * @since 1.2 */ public Double() { @@ -623,7 +623,7 @@ public abstract class Line2D implements Shape, Cloneable { * specified line segment * @param y2 the Y coordinate of the end point of the * specified line segment - * @return if this line segment and the specified line segment + * @return {@code } if this line segment and the specified line segment * intersect each other; false otherwise. * @since 1.2 */ diff --git a/jdk/src/share/classes/java/awt/print/PrinterJob.java b/jdk/src/share/classes/java/awt/print/PrinterJob.java index 2735ef7ed5b..6ac1133b635 100644 --- a/jdk/src/share/classes/java/awt/print/PrinterJob.java +++ b/jdk/src/share/classes/java/awt/print/PrinterJob.java @@ -98,7 +98,7 @@ public abstract class PrinterJob { * Calling this method is equivalent to calling * {@link javax.print.PrintServiceLookup#lookupPrintServices( * DocFlavor, AttributeSet) - * PrintServiceLookup.lookupPrintServices()} + * PrintServiceLookup.lookupPrintServices()} * and specifying a Pageable DocFlavor. * @return a possibly empty array of 2D print services. * @since 1.4 @@ -136,8 +136,8 @@ public abstract class PrinterJob { * PrinterJob instances which support print services. * Calling this method is equivalent to calling * {@link javax.print.StreamPrintServiceFactory#lookupStreamPrintServiceFactories(DocFlavor, String) - * StreamPrintServiceFactory.lookupStreamPrintServiceFactories() - * } and specifying a Pageable DocFlavor. + * StreamPrintServiceFactory.lookupStreamPrintServiceFactories() + * } and specifying a Pageable DocFlavor. * * @param mimeType the required output format, or null to mean any format. * @return a possibly empty array of 2D stream print service factories. @@ -155,7 +155,7 @@ public abstract class PrinterJob { /** * A PrinterJob object should be created using the - * static {@link #getPrinterJob() getPrinterJob} method. + * static {@link #getPrinterJob() getPrinterJob} method. */ public PrinterJob() { } diff --git a/jdk/src/share/classes/javax/print/Doc.java b/jdk/src/share/classes/javax/print/Doc.java index 04d92d2e4a8..187873135a8 100644 --- a/jdk/src/share/classes/javax/print/Doc.java +++ b/jdk/src/share/classes/javax/print/Doc.java @@ -65,8 +65,8 @@ import javax.print.attribute.DocAttributeSet; * representation object "consumes" the print data as the caller obtains the * print data, such as a print data representation object which is a stream. * Once the Print Job has called {@link #getPrintData() - * getPrintData()} and obtained the stream, any further calls to - * {@link #getPrintData() getPrintData()} will return the same + * getPrintData()} and obtained the stream, any further calls to + * {@link #getPrintData() getPrintData()} will return the same * stream object upon which reading may already be in progress, not a new * stream object that will re-read the print data from the beginning. Specifying * a doc object to behave this way simplifies the implementation of doc objects, @@ -83,7 +83,7 @@ import javax.print.attribute.DocAttributeSet; * object is constructed. In this case the doc object might provide a "lazy" * implementation that generates the print data representation object (and/or * the print data) only when the Print Job calls for it (when the Print Job - * calls the {@link #getPrintData() getPrintData()} method). + * calls the {@link #getPrintData() getPrintData()} method). *

          * There is no restriction on the number of client threads that may be * simultaneously accessing the same doc. Therefore, all implementations of diff --git a/jdk/src/share/classes/javax/print/DocFlavor.java b/jdk/src/share/classes/javax/print/DocFlavor.java index 5b3f10c2486..c5d96af423e 100644 --- a/jdk/src/share/classes/javax/print/DocFlavor.java +++ b/jdk/src/share/classes/javax/print/DocFlavor.java @@ -53,7 +53,7 @@ import java.io.Serializable; *

        • * Representation class name. This specifies the fully-qualified name of * the class of the object from which the actual print data comes, as returned - * by the {@link java.lang.Class#getName() Class.getName()} method. + * by the {@link java.lang.Class#getName() Class.getName()} method. * (Thus the class name for byte[] is "[B", for * char[] it is "[C".) * @@ -174,7 +174,7 @@ import java.io.Serializable; * platform for data (eg files) stored in that platform's encoding. * A CharSet which corresponds to this and is suitable for use in a * mime-type for a DocFlavor can be obtained - * from {@link DocFlavor#hostEncoding DocFlavor.hostEncoding} + * from {@link DocFlavor#hostEncoding DocFlavor.hostEncoding} * This may not always be the primary IANA name but is guaranteed to be * understood by this VM. * For common flavors, the pre-defined *HOST DocFlavors may be used. @@ -669,7 +669,7 @@ public class DocFlavor implements Serializable, Cloneable { /** * Doc flavor with MIME type = "text/plain", * encoded in the host platform encoding. - * See {@link DocFlavor#hostEncoding hostEncoding} + * See {@link DocFlavor#hostEncoding hostEncoding} * Print data representation class name = * "[B" (byte array). */ @@ -728,7 +728,7 @@ public class DocFlavor implements Serializable, Cloneable { /** * Doc flavor with MIME type = "text/html", * encoded in the host platform encoding. - * See {@link DocFlavor#hostEncoding hostEncoding} + * See {@link DocFlavor#hostEncoding hostEncoding} * Print data representation class name = * "[B" (byte array). */ @@ -838,7 +838,7 @@ public class DocFlavor implements Serializable, Cloneable { /** * Class DocFlavor.INPUT_STREAM provides predefined static constant * DocFlavor objects for example doc flavors using a byte stream ({@link - * java.io.InputStream java.io.InputStream}) as the print + * java.io.InputStream java.io.InputStream}) as the print * data representation class. *

          * @@ -868,7 +868,7 @@ public class DocFlavor implements Serializable, Cloneable { /** * Doc flavor with MIME type = "text/plain", * encoded in the host platform encoding. - * See {@link DocFlavor#hostEncoding hostEncoding} + * See {@link DocFlavor#hostEncoding hostEncoding} * Print data representation class name = * "java.io.InputStream" (byte stream). */ @@ -925,7 +925,7 @@ public class DocFlavor implements Serializable, Cloneable { /** * Doc flavor with MIME type = "text/html", * encoded in the host platform encoding. - * See {@link DocFlavor#hostEncoding hostEncoding} + * See {@link DocFlavor#hostEncoding hostEncoding} * Print data representation class name = * "java.io.InputStream" (byte stream). */ @@ -1041,7 +1041,7 @@ public class DocFlavor implements Serializable, Cloneable { * Class DocFlavor.URL provides predefined static constant DocFlavor * objects. * For example doc flavors using a Uniform Resource Locator ({@link - * java.net.URL java.net.URL}) as the print data + * java.net.URL java.net.URL}) as the print data * representation class. *

          * @@ -1068,7 +1068,7 @@ public class DocFlavor implements Serializable, Cloneable { /** * Doc flavor with MIME type = "text/plain", * encoded in the host platform encoding. - * See {@link DocFlavor#hostEncoding hostEncoding} + * See {@link DocFlavor#hostEncoding hostEncoding} * Print data representation class name = * "java.net.URL" (byte stream). */ @@ -1125,7 +1125,7 @@ public class DocFlavor implements Serializable, Cloneable { /** * Doc flavor with MIME type = "text/html", * encoded in the host platform encoding. - * See {@link DocFlavor#hostEncoding hostEncoding} + * See {@link DocFlavor#hostEncoding hostEncoding} * Print data representation class name = * "java.net.URL" (byte stream). */ @@ -1280,7 +1280,7 @@ public class DocFlavor implements Serializable, Cloneable { /** * Class DocFlavor.STRING provides predefined static constant DocFlavor * objects for example doc flavors using a string ({@link java.lang.String - * java.lang.String}) as the print data representation class. + * java.lang.String}) as the print data representation class. * As such, the character set is Unicode. *

          * @@ -1328,7 +1328,7 @@ public class DocFlavor implements Serializable, Cloneable { /** * Class DocFlavor.READER provides predefined static constant DocFlavor * objects for example doc flavors using a character stream ({@link - * java.io.Reader java.io.Reader}) as the print data + * java.io.Reader java.io.Reader}) as the print data * representation class. As such, the character set is Unicode. *

          * diff --git a/jdk/src/share/classes/javax/print/MultiDoc.java b/jdk/src/share/classes/javax/print/MultiDoc.java index 69a1756d883..4813a59931b 100644 --- a/jdk/src/share/classes/javax/print/MultiDoc.java +++ b/jdk/src/share/classes/javax/print/MultiDoc.java @@ -39,9 +39,9 @@ import java.io.IOException; * docs. A multidoc object is like a node in the linked list, containing the * current doc in the list and a pointer to the next node (multidoc) in the * list. The Print Job can call the multidoc's {@link #getDoc() - * getDoc()} method to get the current doc. When it's ready to go + * getDoc()} method to get the current doc. When it's ready to go * on to the next doc, the Print Job can call the multidoc's {@link #next() - * next()} method to get the next multidoc, which contains the + * next()} method to get the next multidoc, which contains the * next doc. So Print Job code for accessing a multidoc might look like this: *

            *      void processMultiDoc(MultiDoc theMultiDoc) {
          @@ -88,12 +88,12 @@ import java.io.IOException;
           * multiple docs to a Print Job, every Print Service proxy that supports
            * multidoc print jobs is required to access a MultiDoc object using the
            * interleaved pattern. That is, given a MultiDoc object, the print service
          - * proxy will call {@link #getDoc() getDoc()} one or more times
          + * proxy will call {@link #getDoc() getDoc()} one or more times
            * until it successfully obtains the current Doc object. The print service proxy
            * will then obtain the current doc's print data, not proceeding until all the
            * print data is obtained or an unrecoverable error occurs. If it is able to
            * continue, the print service proxy will then call {@link #next()
          - * next()} one or more times until it successfully obtains either
          + * next()} one or more times until it successfully obtains either
            * the next MultiDoc object or an indication that there are no more. An
            * implementation of interface MultiDoc can assume the print service proxy will
            * follow this interleaved pattern; for any other pattern of usage, the MultiDoc
          diff --git a/jdk/src/share/classes/javax/print/attribute/standard/Finishings.java b/jdk/src/share/classes/javax/print/attribute/standard/Finishings.java
          index 3f09cd9088f..65332e54e1c 100644
          --- a/jdk/src/share/classes/javax/print/attribute/standard/Finishings.java
          +++ b/jdk/src/share/classes/javax/print/attribute/standard/Finishings.java
          @@ -42,16 +42,16 @@ import javax.print.attribute.PrintJobAttribute;
            * Standard Finishings values are:
            * 
        • KeyValue TypePrincipal Constants"Default" (use platform default)
          {@link #WEIGHT}NumberWEIGHT_REGULAR, WEIGHT_BOLDWIDTH_CONDENSED, WIDTH_REGULAR,
          WIDTH_EXTENDED
          WIDTH_REGULAR
          {@link #POSTURE}NumberPOSTURE_REGULAR, POSTURE_OBLIQUEnone12.0
          {@link #TRANSFORM}{@link TransformAttribute}See TransformAttribute {@link TransformAttribute#IDENTITY IDENTITY}SUPERSCRIPT_SUPER, SUPERSCRIPT_SUB0 (use the standard glyphs and metrics)
          {@link #FONT}{@link java.awt.Font}nonenonenull (draw text using font glyphs)
          {@link #FOREGROUND}{@link java.awt.Paint}nonenonenull (do not render background)
          {@link #UNDERLINE}IntegerUNDERLINE_ONSTRIKETHROUGH_ONfalse (do not render strikethrough)
          {@link #RUN_DIRECTION}BooleanRUN_DIRECTION_LTR
          RUN_DIRECTION_RTL
          none0 (use base line direction)
          {@link #JUSTIFICATION}NumberJUSTIFICATION_FULL(see class)null (do not apply input highlighting)
          {@link #INPUT_METHOD_UNDERLINE}IntegerUNDERLINE_LOW_ONE_PIXEL,
          UNDERLINE_LOW_TWO_PIXEL
          SWAP_COLORS_ONfalse (do not swap colors)
          {@link #NUMERIC_SHAPING}{@link java.awt.font.NumericShaper}noneKERNING_ON0 (do not request kerning)
          {@link #LIGATURES}IntegerLIGATURES_ON
          * - * - * - * - * * @@ -78,70 +78,70 @@ import javax.print.attribute.PrintJobAttribute; * corner or an edge as if the document were a portrait document: *
          + * *   * + * * {@link #NONE NONE} * + * * {@link #STAPLE STAPLE} * + * * {@link #EDGE_STITCH EDGE_STITCH} *
          * - * - * - * - * - * * * - * - * - * - * - * * * - * - * - * - * - * * * - * - * - * - * - * * diff --git a/jdk/src/share/classes/javax/print/attribute/standard/JobStateReasons.java b/jdk/src/share/classes/javax/print/attribute/standard/JobStateReasons.java index 9cb104b5c11..d9e225f621f 100644 --- a/jdk/src/share/classes/javax/print/attribute/standard/JobStateReasons.java +++ b/jdk/src/share/classes/javax/print/attribute/standard/JobStateReasons.java @@ -110,7 +110,7 @@ public final class JobStateReasons * The underlying hash set's initial capacity and load factor are as * specified in the superclass constructor {@link * java.util.HashSet#HashSet(java.util.Collection) - * HashSet(Collection)}. + * HashSet(Collection)}. * * @param collection Collection to copy. * diff --git a/jdk/src/share/classes/javax/print/attribute/standard/MediaPrintableArea.java b/jdk/src/share/classes/javax/print/attribute/standard/MediaPrintableArea.java index a800f7c6c42..9f33f054e77 100644 --- a/jdk/src/share/classes/javax/print/attribute/standard/MediaPrintableArea.java +++ b/jdk/src/share/classes/javax/print/attribute/standard/MediaPrintableArea.java @@ -56,7 +56,7 @@ import javax.print.attribute.PrintRequestAttribute; * any specified finishings. * PrintService provides the method to query the supported * values of an attribute in a suitable context : - * See {@link javax.print.PrintService#getSupportedAttributeValues(Class,DocFlavor, AttributeSet) PrintService.getSupportedAttributeValues()} + * See {@link javax.print.PrintService#getSupportedAttributeValues(Class,DocFlavor, AttributeSet) PrintService.getSupportedAttributeValues()} *

          * The rectangular printable area is defined thus: * The (x,y) origin is positioned at the top-left of the paper in portrait @@ -153,8 +153,8 @@ public final class MediaPrintableArea * Get the printable area as an array of 4 values in the order * x, y, w, h. The values returned are in the given units. * @param units - * Unit conversion factor, e.g. {@link #INCH INCH} or - * {@link #MM MM}. + * Unit conversion factor, e.g. {@link #INCH INCH} or + * {@link #MM MM}. * * @return printable area as array of x, y, w, h in the specified units. * @@ -170,8 +170,8 @@ public final class MediaPrintableArea * Get the x location of the origin of the printable area in the * specified units. * @param units - * Unit conversion factor, e.g. {@link #INCH INCH} or - * {@link #MM MM}. + * Unit conversion factor, e.g. {@link #INCH INCH} or + * {@link #MM MM}. * * @return x location of the origin of the printable area in the * specified units. @@ -187,8 +187,8 @@ public final class MediaPrintableArea * Get the y location of the origin of the printable area in the * specified units. * @param units - * Unit conversion factor, e.g. {@link #INCH INCH} or - * {@link #MM MM}. + * Unit conversion factor, e.g. {@link #INCH INCH} or + * {@link #MM MM}. * * @return y location of the origin of the printable area in the * specified units. @@ -203,8 +203,8 @@ public final class MediaPrintableArea /** * Get the width of the printable area in the specified units. * @param units - * Unit conversion factor, e.g. {@link #INCH INCH} or - * {@link #MM MM}. + * Unit conversion factor, e.g. {@link #INCH INCH} or + * {@link #MM MM}. * * @return width of the printable area in the specified units. * @@ -218,8 +218,8 @@ public final class MediaPrintableArea /** * Get the height of the printable area in the specified units. * @param units - * Unit conversion factor, e.g. {@link #INCH INCH} or - * {@link #MM MM}. + * Unit conversion factor, e.g. {@link #INCH INCH} or + * {@link #MM MM}. * * @return height of the printable area in the specified units. * @@ -292,8 +292,8 @@ public final class MediaPrintableArea * given units. * * @param units - * Unit conversion factor, e.g. {@link #INCH INCH} or - * {@link #MM MM}. + * Unit conversion factor, e.g. {@link #INCH INCH} or + * {@link #MM MM}. * @param unitsName * Units name string, e.g. "in" or "mm". If * null, no units name is appended to the result. diff --git a/jdk/src/share/classes/javax/print/attribute/standard/MultipleDocumentHandling.java b/jdk/src/share/classes/javax/print/attribute/standard/MultipleDocumentHandling.java index 6c43fd6f5e9..30f4fe0a5f0 100644 --- a/jdk/src/share/classes/javax/print/attribute/standard/MultipleDocumentHandling.java +++ b/jdk/src/share/classes/javax/print/attribute/standard/MultipleDocumentHandling.java @@ -71,7 +71,7 @@ import javax.print.attribute.PrintJobAttribute; *

            *
          • * {@link #SINGLE_DOCUMENT - * SINGLE_DOCUMENT}. If a print job has multiple + * SINGLE_DOCUMENT}. If a print job has multiple * documents -- say, the document data is called a and * b -- then the result of processing all the document data * (a and then b) must be treated as a single sequence @@ -86,7 +86,7 @@ import javax.print.attribute.PrintJobAttribute; *

            *

          • * {@link #SEPARATE_DOCUMENTS_UNCOLLATED_COPIES - * SEPARATE_DOCUMENTS_UNCOLLATED_COPIES}. If a print job + * SEPARATE_DOCUMENTS_UNCOLLATED_COPIES}. If a print job * has multiple documents -- say, the document data is called a and * b -- then the result of processing the data in each document * instance must be treated as a single sequence of media sheets for finishing @@ -99,7 +99,7 @@ import javax.print.attribute.PrintJobAttribute; *

            *

          • * {@link #SEPARATE_DOCUMENTS_COLLATED_COPIES - * SEPARATE_DOCUMENTS_COLLATED_COPIES}. If a print job + * SEPARATE_DOCUMENTS_COLLATED_COPIES}. If a print job * has multiple documents -- say, the document data is called a and * b -- then the result of processing the data in each document * instance must be treated as a single sequence of media sheets for finishing @@ -112,7 +112,7 @@ import javax.print.attribute.PrintJobAttribute; *

            *

          • * {@link #SINGLE_DOCUMENT_NEW_SHEET - * SINGLE_DOCUMENT_NEW_SHEET}. Same as SINGLE_DOCUMENT, + * SINGLE_DOCUMENT_NEW_SHEET}. Same as SINGLE_DOCUMENT, * except that the printer must ensure that the first impression of each * document instance in the job is placed on a new media sheet. This value * allows multiple documents to be stapled together with a single staple where @@ -127,7 +127,7 @@ import javax.print.attribute.PrintJobAttribute; * next document or document copy on to a new sheet. *

            * In addition, if a {@link Finishings Finishings} attribute of - * {@link Finishings#STAPLE STAPLE} is specified, then: + * {@link Finishings#STAPLE STAPLE} is specified, then: *

              *
            • * With SINGLE_DOCUMENT, documents a and b are diff --git a/jdk/src/share/classes/javax/print/attribute/standard/PrinterStateReasons.java b/jdk/src/share/classes/javax/print/attribute/standard/PrinterStateReasons.java index 48707636f77..52758fadd0d 100644 --- a/jdk/src/share/classes/javax/print/attribute/standard/PrinterStateReasons.java +++ b/jdk/src/share/classes/javax/print/attribute/standard/PrinterStateReasons.java @@ -129,7 +129,7 @@ public final class PrinterStateReasons * Severity} mappings as the given map. The underlying hash map's initial * capacity and load factor are as specified in the superclass constructor * {@link java.util.HashMap#HashMap(java.util.Map) - * HashMap(Map)}. + * HashMap(Map)}. * * @param map Map to copy. * diff --git a/jdk/src/share/classes/javax/print/attribute/standard/Sides.java b/jdk/src/share/classes/javax/print/attribute/standard/Sides.java index eaff96b2eb6..93fed683e51 100644 --- a/jdk/src/share/classes/javax/print/attribute/standard/Sides.java +++ b/jdk/src/share/classes/javax/print/attribute/standard/Sides.java @@ -134,7 +134,7 @@ public final class Sides extends EnumSyntax * sides of consecutive media sheets, such that the orientation of each * pair of print-stream pages on the medium would be correct for the * reader as if for binding on the long edge. This imposition is also - * known as "duplex" (see {@link #DUPLEX DUPLEX}). + * known as "duplex" (see {@link #DUPLEX DUPLEX}). */ public static final Sides TWO_SIDED_LONG_EDGE = new Sides(1); @@ -143,19 +143,19 @@ public final class Sides extends EnumSyntax * sides of consecutive media sheets, such that the orientation of each * pair of print-stream pages on the medium would be correct for the * reader as if for binding on the short edge. This imposition is also - * known as "tumble" (see {@link #TUMBLE TUMBLE}). + * known as "tumble" (see {@link #TUMBLE TUMBLE}). */ public static final Sides TWO_SIDED_SHORT_EDGE = new Sides(2); /** * An alias for "two sided long edge" (see {@link #TWO_SIDED_LONG_EDGE - * TWO_SIDED_LONG_EDGE}). + * TWO_SIDED_LONG_EDGE}). */ public static final Sides DUPLEX = TWO_SIDED_LONG_EDGE; /** * An alias for "two sided short edge" (see {@link #TWO_SIDED_SHORT_EDGE - * TWO_SIDED_SHORT_EDGE}). + * TWO_SIDED_SHORT_EDGE}). */ public static final Sides TUMBLE = TWO_SIDED_SHORT_EDGE; diff --git a/jdk/src/share/classes/javax/swing/JLayeredPane.java b/jdk/src/share/classes/javax/swing/JLayeredPane.java index 3b61f28f1c6..bf5bc695cd3 100644 --- a/jdk/src/share/classes/javax/swing/JLayeredPane.java +++ b/jdk/src/share/classes/javax/swing/JLayeredPane.java @@ -44,12 +44,12 @@ import javax.accessibility.*; * How to Use a Layered Pane, * a section in The Java Tutorial. *

              - *

          + * *   * + * * {@link #STAPLE_TOP_LEFT STAPLE_TOP_LEFT} * + * * {@link #EDGE_STITCH_LEFT EDGE_STITCH_LEFT} * + * * {@link #STAPLE_DUAL_LEFT STAPLE_DUAL_LEFT} * + * *   *
          + * *   * + * * {@link #STAPLE_BOTTOM_LEFT STAPLE_BOTTOM_LEFT} * + * * {@link #EDGE_STITCH_TOP EDGE_STITCH_TOP} * + * * {@link #STAPLE_DUAL_TOP STAPLE_DUAL_TOP} * + * *   *
          + * *   * + * * {@link #STAPLE_TOP_RIGHT STAPLE_TOP_RIGHT} * + * * {@link #EDGE_STITCH_RIGHT EDGE_STITCH_RIGHT} * + * * {@link #STAPLE_DUAL_RIGHT STAPLE_DUAL_RIGHT} * + * *   *
          + * *   * + * * {@link #STAPLE_BOTTOM_RIGHT STAPLE_BOTTOM_RIGHT} * + * * {@link #EDGE_STITCH_BOTTOM EDGE_STITCH_BOTTOM} * + * * {@link #STAPLE_DUAL_BOTTOM STAPLE_DUAL_BOTTOM} * + * *   *
          + *
          * * * *
          - *

          The following text describes this image. + * WIDTH="269" HEIGHT="264" STYLE="FLOAT:BOTTOM; BORDER=0"> *

          diff --git a/jdk/src/share/classes/javax/swing/JOptionPane.java b/jdk/src/share/classes/javax/swing/JOptionPane.java index c532cf619c0..23ed02f6bb8 100644 --- a/jdk/src/share/classes/javax/swing/JOptionPane.java +++ b/jdk/src/share/classes/javax/swing/JOptionPane.java @@ -108,16 +108,16 @@ import static javax.swing.ClientPropertyKey.PopupFactory_FORCE_HEAVYWEIGHT_POPUP * the caller until the user's interaction is complete. *

          * - * + *
          * - * - * + * + * * * - * + * * * - * + * * *
          iconmessageiconmessage
          input valueinput value
          option buttonsoption buttons
          * @@ -127,7 +127,7 @@ import static javax.swing.ClientPropertyKey.PopupFactory_FORCE_HEAVYWEIGHT_POPUP * ultimately responsible for the final result. In particular, the * look-and-feels will adjust the layout to accommodate the option pane's * ComponentOrientation property. - *
          + *
          *

          * Parameters:
          * The parameters to these methods follow consistent patterns: diff --git a/jdk/src/share/classes/javax/swing/JScrollPane.java b/jdk/src/share/classes/javax/swing/JScrollPane.java index 25918e5a3c5..7d30b7dffcc 100644 --- a/jdk/src/share/classes/javax/swing/JScrollPane.java +++ b/jdk/src/share/classes/javax/swing/JScrollPane.java @@ -54,12 +54,12 @@ import java.beans.Transient; * a section in The Java Tutorial. Note that * JScrollPane does not support heavyweight components. *

          - * + *
          * * * *
          - *

          The following text describes this image. + * WIDTH="256" HEIGHT="248" STYLE="FLOAT:BOTTOM; BORDER:0px"> *

          diff --git a/jdk/src/share/classes/javax/swing/JTabbedPane.java b/jdk/src/share/classes/javax/swing/JTabbedPane.java index 6c71657781a..f36615a74a9 100644 --- a/jdk/src/share/classes/javax/swing/JTabbedPane.java +++ b/jdk/src/share/classes/javax/swing/JTabbedPane.java @@ -207,7 +207,7 @@ public class JTabbedPane extends JComponent } /** - * Returns the UI object which implements the L&F for this component. + * Returns the UI object which implements the L&F for this component. * * @return a TabbedPaneUI object * @see #setUI @@ -217,7 +217,7 @@ public class JTabbedPane extends JComponent } /** - * Sets the UI object which implements the L&F for this component. + * Sets the UI object which implements the L&F for this component. * * @param ui the new UI object * @see UIDefaults#getUI @@ -250,7 +250,7 @@ public class JTabbedPane extends JComponent /** * Returns the name of the UI class that implements the - * L&F for this component. + * L&F for this component. * * @return the string "TabbedPaneUI" * @see JComponent#getUIClassID @@ -576,7 +576,7 @@ public class JTabbedPane extends JComponent * * @param index the index to be selected * @exception IndexOutOfBoundsException if index is out of range - * (index < -1 || index >= tab count) + * {@code (index < -1 || index >= tab count)} * * @see #getSelectedIndex * @see SingleSelectionModel#setSelectedIndex @@ -924,7 +924,7 @@ public class JTabbedPane extends JComponent * if added to other containers. * @param index the index of the tab to be removed * @exception IndexOutOfBoundsException if index is out of range - * (index < 0 || index >= tab count) + * {@code (index < 0 || index >= tab count)} * * @see #addTab * @see #insertTab @@ -1043,7 +1043,7 @@ public class JTabbedPane extends JComponent * @param index the index of the component to remove from the * tabbedpane * @exception IndexOutOfBoundsException if index is out of range - * (index < 0 || index >= tab count) + * {@code (index < 0 || index >= tab count)} * @see #addTab * @see #removeTabAt */ @@ -1105,7 +1105,7 @@ public class JTabbedPane extends JComponent * @param index the index of the item being queried * @return the title at index * @exception IndexOutOfBoundsException if index is out of range - * (index < 0 || index >= tab count) + * {@code (index < 0 || index >= tab count)} * @see #setTitleAt */ public String getTitleAt(int index) { @@ -1118,7 +1118,7 @@ public class JTabbedPane extends JComponent * @param index the index of the item being queried * @return the icon at index * @exception IndexOutOfBoundsException if index is out of range - * (index < 0 || index >= tab count) + * {@code (index < 0 || index >= tab count)} * * @see #setIconAt */ @@ -1137,7 +1137,7 @@ public class JTabbedPane extends JComponent * @param index the index of the item being queried * @return the icon at index * @exception IndexOutOfBoundsException if index is out of range - * (index < 0 || index >= tab count) + * {@code (index < 0 || index >= tab count)} * * @see #setDisabledIconAt */ @@ -1155,7 +1155,7 @@ public class JTabbedPane extends JComponent * @param index the index of the item being queried * @return a string containing the tool tip text at index * @exception IndexOutOfBoundsException if index is out of range - * (index < 0 || index >= tab count) + * {@code (index < 0 || index >= tab count)} * * @see #setToolTipTextAt * @since 1.3 @@ -1171,7 +1171,7 @@ public class JTabbedPane extends JComponent * @return the Color of the tab background at * index * @exception IndexOutOfBoundsException if index is out of range - * (index < 0 || index >= tab count) + * {@code (index < 0 || index >= tab count)} * * @see #setBackgroundAt */ @@ -1186,7 +1186,7 @@ public class JTabbedPane extends JComponent * @return the Color of the tab foreground at * index * @exception IndexOutOfBoundsException if index is out of range - * (index < 0 || index >= tab count) + * {@code (index < 0 || index >= tab count)} * * @see #setForegroundAt */ @@ -1202,7 +1202,7 @@ public class JTabbedPane extends JComponent * @return true if the tab at index is enabled; * false otherwise * @exception IndexOutOfBoundsException if index is out of range - * (index < 0 || index >= tab count) + * {@code (index < 0 || index >= tab count)} * * @see #setEnabledAt */ @@ -1216,7 +1216,7 @@ public class JTabbedPane extends JComponent * @param index the index of the item being queried * @return the Component at index * @exception IndexOutOfBoundsException if index is out of range - * (index < 0 || index >= tab count) + * {@code (index < 0 || index >= tab count)} * * @see #setComponentAt */ @@ -1281,7 +1281,7 @@ public class JTabbedPane extends JComponent * index is not currently visible in the UI, * or if there is no UI set on this tabbedpane * @exception IndexOutOfBoundsException if index is out of range - * (index < 0 || index >= tab count) + * {@code (index < 0 || index >= tab count)} */ public Rectangle getBoundsAt(int index) { checkIndex(index); @@ -1303,7 +1303,7 @@ public class JTabbedPane extends JComponent * @param index the tab index where the title should be set * @param title the title to be displayed in the tab * @exception IndexOutOfBoundsException if index is out of range - * (index < 0 || index >= tab count) + * {@code (index < 0 || index >= tab count)} * * @see #getTitleAt * @see #setTabComponentAt @@ -1345,7 +1345,7 @@ public class JTabbedPane extends JComponent * @param index the tab index where the icon should be set * @param icon the icon to be displayed in the tab * @exception IndexOutOfBoundsException if index is out of range - * (index < 0 || index >= tab count) + * {@code (index < 0 || index >= tab count)} * * @see #setDisabledIconAt * @see #getIconAt @@ -1389,7 +1389,7 @@ public class JTabbedPane extends JComponent * @param index the tab index where the disabled icon should be set * @param disabledIcon the icon to be displayed in the tab when disabled * @exception IndexOutOfBoundsException if index is out of range - * (index < 0 || index >= tab count) + * {@code (index < 0 || index >= tab count)} * * @see #getDisabledIconAt * @beaninfo @@ -1414,7 +1414,7 @@ public class JTabbedPane extends JComponent * @param index the tab index where the tooltip text should be set * @param toolTipText the tooltip text to be displayed for the tab * @exception IndexOutOfBoundsException if index is out of range - * (index < 0 || index >= tab count) + * {@code (index < 0 || index >= tab count)} * * @see #getToolTipTextAt * @beaninfo @@ -1443,14 +1443,14 @@ public class JTabbedPane extends JComponent * which can be null, in which case the tab's background color * will default to the background color of the tabbedpane. * An internal exception is raised if there is no tab at that index. - *

          + *

          * It is up to the look and feel to honor this property, some may * choose to ignore it. * * @param index the tab index where the background should be set * @param background the color to be displayed in the tab's background * @exception IndexOutOfBoundsException if index is out of range - * (index < 0 || index >= tab count) + * {@code (index < 0 || index >= tab count)} * * @see #getBackgroundAt * @beaninfo @@ -1476,14 +1476,14 @@ public class JTabbedPane extends JComponent * null, in which case the tab's foreground color * will default to the foreground color of this tabbedpane. * An internal exception is raised if there is no tab at that index. - *

          + *

          * It is up to the look and feel to honor this property, some may * choose to ignore it. * * @param index the tab index where the foreground should be set * @param foreground the color to be displayed as the tab's foreground * @exception IndexOutOfBoundsException if index is out of range - * (index < 0 || index >= tab count) + * {@code (index < 0 || index >= tab count)} * * @see #getForegroundAt * @beaninfo @@ -1510,7 +1510,7 @@ public class JTabbedPane extends JComponent * @param index the tab index which should be enabled/disabled * @param enabled whether or not the tab should be enabled * @exception IndexOutOfBoundsException if index is out of range - * (index < 0 || index >= tab count) + * {@code (index < 0 || index >= tab count)} * * @see #isEnabledAt */ @@ -1530,7 +1530,7 @@ public class JTabbedPane extends JComponent * @param index the tab index where this component is being placed * @param component the component for the tab * @exception IndexOutOfBoundsException if index is out of range - * (index < 0 || index >= tab count) + * {@code (index < 0 || index >= tab count)} * * @see #getComponentAt * @beaninfo @@ -1605,8 +1605,8 @@ public class JTabbedPane extends JComponent * @param tabIndex the index of the tab that the mnemonic refers to * @param mnemonicIndex index into the String to underline * @exception IndexOutOfBoundsException if tabIndex is - * out of range (tabIndex < 0 || tabIndex >= tab - * count) + * out of range ({@code tabIndex < 0 || tabIndex >= tab + * count}) * @exception IllegalArgumentException will be thrown if * mnemonicIndex is >= length of the tab * title , or < -1 @@ -1649,7 +1649,7 @@ public class JTabbedPane extends JComponent * @param tabIndex the index of the tab that the mnemonic refers to * @param mnemonic the key code which represents the mnemonic * @exception IndexOutOfBoundsException if tabIndex is out - * of range (tabIndex < 0 || tabIndex >= tab count) + * of range ({@code tabIndex < 0 || tabIndex >= tab count}) * @see #getMnemonicAt(int) * @see #setDisplayedMnemonicIndexAt(int,int) * @@ -2354,7 +2354,7 @@ public class JTabbedPane extends JComponent * @param component the component to render the title for the * specified tab * @exception IndexOutOfBoundsException if index is out of range - * (index < 0 || index >= tab count) + * {@code (index < 0 || index >= tab count)} * @exception IllegalArgumentException if component has already been * added to this JTabbedPane * @@ -2386,7 +2386,7 @@ public class JTabbedPane extends JComponent * @param index the index of the item being queried * @return the tab component at index * @exception IndexOutOfBoundsException if index is out of range - * (index < 0 || index >= tab count) + * {@code (index < 0 || index >= tab count)} * * @see #setTabComponentAt * @since 1.6 diff --git a/jdk/src/share/classes/javax/swing/LookAndFeel.java b/jdk/src/share/classes/javax/swing/LookAndFeel.java index 5b792c872f2..785512dd52d 100644 --- a/jdk/src/share/classes/javax/swing/LookAndFeel.java +++ b/jdk/src/share/classes/javax/swing/LookAndFeel.java @@ -91,7 +91,7 @@ import java.util.StringTokenizer; * to provide a specific set of defaults. These are documented in the * classes that require the specific default. * - *

          ComponentUIs and defaults

          + *

          ComponentUIs and defaults

          * * All {@code ComponentUIs} typically need to set various properties * on the {@code JComponent} the {@code ComponentUI} is providing the @@ -590,7 +590,7 @@ public abstract class LookAndFeel * Distinct look and feels should have different names, e.g. * a subclass of MotifLookAndFeel that changes the way a few components * are rendered should be called "CDE/Motif My Way"; something - * that would be useful to a user trying to select a L&F from a list + * that would be useful to a user trying to select a L&F from a list * of names. * * @return short identifier for the look and feel diff --git a/jdk/src/share/classes/javax/swing/plaf/metal/MetalLookAndFeel.java b/jdk/src/share/classes/javax/swing/plaf/metal/MetalLookAndFeel.java index 0ca32d24ab0..b6208df57c7 100644 --- a/jdk/src/share/classes/javax/swing/plaf/metal/MetalLookAndFeel.java +++ b/jdk/src/share/classes/javax/swing/plaf/metal/MetalLookAndFeel.java @@ -293,8 +293,8 @@ public class MetalLookAndFeel extends BasicLookAndFeel * * - * *
          Key - * Value + * Key + * Value *
          "desktop" * {@code theme.getDesktopColor()} diff --git a/jdk/src/share/classes/javax/swing/plaf/metal/MetalTreeUI.java b/jdk/src/share/classes/javax/swing/plaf/metal/MetalTreeUI.java index 131a5bdb738..29e7f45db31 100644 --- a/jdk/src/share/classes/javax/swing/plaf/metal/MetalTreeUI.java +++ b/jdk/src/share/classes/javax/swing/plaf/metal/MetalTreeUI.java @@ -46,7 +46,7 @@ import javax.swing.plaf.basic.*; * * * - * + * * * * - * + * * * * - * + * * * *

          Angled

          Angled

          A line is drawn connecting the child to the parent. For handling * of the root node refer to * {@link javax.swing.JTree#setRootVisible} and @@ -54,11 +54,11 @@ import javax.swing.plaf.basic.*; *

          Horizontal

          Horizontal

          A horizontal line is drawn dividing the children of the root node.

          None

          None

          Do not draw any visual indication between nodes.
          diff --git a/jdk/src/share/classes/javax/swing/text/Document.java b/jdk/src/share/classes/javax/swing/text/Document.java index 0e89c3d026f..5ce9b4c93e1 100644 --- a/jdk/src/share/classes/javax/swing/text/Document.java +++ b/jdk/src/share/classes/javax/swing/text/Document.java @@ -46,7 +46,7 @@ import javax.swing.event.*; * used are the location between two characters. As the diagram * below shows, a location in a text document can be referred to * as a position, or an offset. This position is zero-based. - *

          The following text describes this graphic. *

          * In the example, if the content of a document is the @@ -69,7 +69,7 @@ import javax.swing.event.*; * Exactly what structure is modeled is up to a particular Document * implementation. It might be as simple as no structure (i.e. a * simple text field), or it might be something like diagram below. - *

          Diagram shows Book->Chapter->Paragraph *

          * The unit of structure (i.e. a node of the tree) is referred to @@ -122,7 +122,7 @@ import javax.swing.event.*; * generated since that edit is actually the source of the change * rather than a mutation to the Document made through its * api. - *

          The preceeding text describes this graphic. *

          * Referring to the above diagram, suppose that the component shown @@ -267,7 +267,7 @@ public interface Document { * For a removal, the end of the removal range is collapsed * down to the start of the range, and any marks in the removal * range are collapsed down to the start of the range. - *

          Diagram shows removal of 'quick' from 'The quick brown fox.' *

          * If the Document structure changed as result of the removal, @@ -300,7 +300,7 @@ public interface Document { * insertUpdate method on the DocumentListener. * The offset and length of the generated DocumentEvent * will indicate what change was actually made to the Document. - *

          Diagram shows insertion of 'quick' in 'The quick brown fox' *

          * If the Document structure changed as result of the insertion, diff --git a/jdk/src/share/classes/javax/swing/text/MaskFormatter.java b/jdk/src/share/classes/javax/swing/text/MaskFormatter.java index a477e610b96..f54a1768a7b 100644 --- a/jdk/src/share/classes/javax/swing/text/MaskFormatter.java +++ b/jdk/src/share/classes/javax/swing/text/MaskFormatter.java @@ -40,7 +40,7 @@ import javax.swing.*; * * * - * + * * * * diff --git a/jdk/src/share/classes/javax/swing/text/View.java b/jdk/src/share/classes/javax/swing/text/View.java index 8223cc8ed3a..1bd35207094 100644 --- a/jdk/src/share/classes/javax/swing/text/View.java +++ b/jdk/src/share/classes/javax/swing/text/View.java @@ -68,7 +68,7 @@ A view has the following responsibilities: implementation, the minimum span will be <= the preferred span which in turn will be <= the maximum span.

          -

          The above text describes this graphic.

          The minimum set of methods for layout are:

            @@ -95,7 +95,7 @@ A view has the following responsibilities: This allows parent View implementations to cache the child requirements if desired. The calling sequence looks something like the following:

            -

            +

            Sample calling sequence between parent view and child view:
        setSize, getMinimum, getPreferred, getMaximum, getAlignment, setSize diff --git a/jdk/src/share/classes/javax/swing/text/html/HTMLDocument.java b/jdk/src/share/classes/javax/swing/text/html/HTMLDocument.java index 71f26093252..7f11b299939 100644 --- a/jdk/src/share/classes/javax/swing/text/html/HTMLDocument.java +++ b/jdk/src/share/classes/javax/swing/text/html/HTMLDocument.java @@ -195,14 +195,14 @@ import static sun.swing.SwingUtilities2.IMPLIED_CR; *

          * * - * * - * * - * * - * * - * * - * * - *
          Character 

          Description

          Description

          #setOuterHTML
          + * *
          *

          Paragraph 1

          *

          Paragraph 2

          *
          *
          + * *
          *
            *
          • List Item
          • @@ -212,7 +212,7 @@ import static sun.swing.SwingUtilities2.IMPLIED_CR; *
          *
          + * *
          *

          Paragraph 1

          *

          Paragraph 2

          @@ -222,7 +222,7 @@ import static sun.swing.SwingUtilities2.IMPLIED_CR; *
          *
          + * *
            *
          • List Item
          • *
          @@ -232,7 +232,7 @@ import static sun.swing.SwingUtilities2.IMPLIED_CR; * *
          + * *
          *

          Paragraph 1

          *

          Paragraph 2

          @@ -242,7 +242,7 @@ import static sun.swing.SwingUtilities2.IMPLIED_CR; * *
          + * *
          *
            *
          • List Item
          • @@ -250,7 +250,7 @@ import static sun.swing.SwingUtilities2.IMPLIED_CR; *
          *
          + * *
            *
          • List Item
          • *
          From 88a74de88a919d445d8498dab14d442fbb040f68 Mon Sep 17 00:00:00 2001 From: Andrew Brygin Date: Thu, 3 Oct 2013 11:28:37 +0400 Subject: [PATCH 076/131] 8022632: Reading a PNG file fails because of WBMPImageReaderSpi.canDecodeInput() Reviewed-by: prr, jgodinez --- .../plugins/wbmp/WBMPImageReaderSpi.java | 68 ++++++------- .../imageio/plugins/wbmp/StreamResetTest.java | 97 +++++++++++++++++++ 2 files changed, 131 insertions(+), 34 deletions(-) create mode 100644 jdk/test/javax/imageio/plugins/wbmp/StreamResetTest.java diff --git a/jdk/src/share/classes/com/sun/imageio/plugins/wbmp/WBMPImageReaderSpi.java b/jdk/src/share/classes/com/sun/imageio/plugins/wbmp/WBMPImageReaderSpi.java index 38fb6d78b36..95d572ff7fd 100644 --- a/jdk/src/share/classes/com/sun/imageio/plugins/wbmp/WBMPImageReaderSpi.java +++ b/jdk/src/share/classes/com/sun/imageio/plugins/wbmp/WBMPImageReaderSpi.java @@ -85,42 +85,42 @@ public class WBMPImageReaderSpi extends ImageReaderSpi { ImageInputStream stream = (ImageInputStream)source; stream.mark(); - int type = stream.readByte(); // TypeField - int fixHeaderField = stream.readByte(); - // check WBMP "header" - if (type != 0 || fixHeaderField != 0) { - // while WBMP reader does not support ext WBMP headers + try { + int type = stream.readByte(); // TypeField + int fixHeaderField = stream.readByte(); + // check WBMP "header" + if (type != 0 || fixHeaderField != 0) { + // while WBMP reader does not support ext WBMP headers + return false; + } + + int width = ReaderUtil.readMultiByteInteger(stream); + int height = ReaderUtil.readMultiByteInteger(stream); + // check image dimension + if (width <= 0 || height <= 0) { + return false; + } + + long dataLength = stream.length(); + if (dataLength == -1) { + // We can't verify that amount of data in the stream + // corresponds to image dimension because we do not know + // the length of the data stream. + // Assuming that wbmp image are used for mobile devices, + // let's introduce an upper limit for image dimension. + // In case if exact amount of raster data is unknown, + // let's reject images with dimension above the limit. + return (width < MAX_WBMP_WIDTH) && (height < MAX_WBMP_HEIGHT); + } + + dataLength -= stream.getStreamPosition(); + + long scanSize = (width / 8) + ((width % 8) == 0 ? 0 : 1); + + return (dataLength == scanSize * height); + } finally { stream.reset(); - return false; } - - int width = ReaderUtil.readMultiByteInteger(stream); - int height = ReaderUtil.readMultiByteInteger(stream); - // check image dimension - if (width <= 0 || height <= 0) { - stream.reset(); - return false; - } - - long dataLength = stream.length(); - if (dataLength == -1) { - // We can't verify that amount of data in the stream - // corresponds to image dimension because we do not know - // the length of the data stream. - // Assuming that wbmp image are used for mobile devices, - // let's introduce an upper limit for image dimension. - // In case if exact amount of raster data is unknown, - // let's reject images with dimension above the limit. - stream.reset(); - return (width < MAX_WBMP_WIDTH) && (height < MAX_WBMP_HEIGHT); - } - - dataLength -= stream.getStreamPosition(); - stream.reset(); - - long scanSize = (width / 8) + ((width % 8) == 0 ? 0 : 1); - - return (dataLength == scanSize * height); } public ImageReader createReaderInstance(Object extension) diff --git a/jdk/test/javax/imageio/plugins/wbmp/StreamResetTest.java b/jdk/test/javax/imageio/plugins/wbmp/StreamResetTest.java new file mode 100644 index 00000000000..a51880e67fb --- /dev/null +++ b/jdk/test/javax/imageio/plugins/wbmp/StreamResetTest.java @@ -0,0 +1,97 @@ +/* + * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/** + * @test + * @bug 8022632 + * @summary Test verifies that SPI of WBMP image reader + * restores the stream position if an IOException + * occurs during processing of image header. + * @run main StreamResetTest + */ + + +import java.io.IOException; +import javax.imageio.ImageIO; +import javax.imageio.ImageReader; +import javax.imageio.spi.ImageReaderSpi; +import javax.imageio.stream.ImageInputStreamImpl; + +public class StreamResetTest { + + public static void main(String[] args) { + IOException expectedException = null; + TestStream iis = new TestStream(); + + ImageReader wbmp = ImageIO.getImageReadersByFormatName("WBMP").next(); + if (wbmp == null) { + System.out.println("No WBMP reader: skip the test"); + return; + } + + ImageReaderSpi spi = wbmp.getOriginatingProvider(); + + iis.checkPosition(); + + try { + spi.canDecodeInput(iis); + } catch (IOException e) { + expectedException = e; + } + + if (expectedException == null) { + throw new RuntimeException("Test FAILED: stream was not used"); + } + + iis.checkPosition(); + + System.out.println("Test PASSED"); + + } + + private static class TestStream extends ImageInputStreamImpl { + private final int errorPos = 1; + + @Override + public int read() throws IOException { + if (streamPos == errorPos) { + throw new IOException("Test exception"); + } + streamPos++; + + return 0x03; + } + + @Override + public int read(byte[] b, int off, int len) throws IOException { + streamPos += len; + return len; + } + + public void checkPosition() { + if (streamPos != 0) { + throw new RuntimeException("Test FAILED"); + } + } + } +} From cea15b4dee3ca87ec56f0d034c896ac3cee041e5 Mon Sep 17 00:00:00 2001 From: Oleg Pekhovskiy Date: Thu, 3 Oct 2013 16:51:56 +0400 Subject: [PATCH 077/131] 8013553: [macosx] java.awt.FileDialog removes file extensions Reviewed-by: leonidr, serb --- jdk/src/macosx/native/sun/awt/CFileDialog.m | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/jdk/src/macosx/native/sun/awt/CFileDialog.m b/jdk/src/macosx/native/sun/awt/CFileDialog.m index af92c77bed3..74ea1fb6883 100644 --- a/jdk/src/macosx/native/sun/awt/CFileDialog.m +++ b/jdk/src/macosx/native/sun/awt/CFileDialog.m @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -93,6 +93,14 @@ canChooseDirectories:(BOOL)inChooseDirectories - (void)safeSaveOrLoad { NSSavePanel *thePanel = nil; + /* + * 8013553: turns off extension hiding for the native file dialog. + * This way is used because setExtensionHidden(NO) doesn't work + * as expected. + */ + NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults]; + [defaults setBool:NO forKey:@"NSNavLastUserSetHideExtensionButtonState"]; + if (fMode == java_awt_FileDialog_SAVE) { thePanel = [NSSavePanel savePanel]; [thePanel setAllowsOtherFileTypes:YES]; From 5319e7da59d2b2c5197bc93cb50d9b3afcc00386 Mon Sep 17 00:00:00 2001 From: Anthony Petrov Date: Thu, 3 Oct 2013 18:01:25 +0400 Subject: [PATCH 078/131] 7174704: [macosx] New issue in 7u6 b12: HeadlessPrintingTest failure Load the lwawt native library on Mac regardless of the headless/headful mode. Also, some minor cleanup. Reviewed-by: art, serb --- jdk/src/macosx/native/sun/awt/awt.m | 4 +- .../solaris/native/sun/awt/awt_LoadLibrary.c | 53 ++++--------------- 2 files changed, 14 insertions(+), 43 deletions(-) diff --git a/jdk/src/macosx/native/sun/awt/awt.m b/jdk/src/macosx/native/sun/awt/awt.m index 5e7942aa016..e730a5ca920 100644 --- a/jdk/src/macosx/native/sun/awt/awt.m +++ b/jdk/src/macosx/native/sun/awt/awt.m @@ -227,7 +227,7 @@ static void AWT_NSUncaughtExceptionHandler(NSException *exception) { id jrsAppKitAWTClass = objc_getClass("JRSAppKitAWT"); SEL markAppSel = @selector(markAppIsDaemon); if (![jrsAppKitAWTClass respondsToSelector:markAppSel]) return NO; - return (BOOL)[jrsAppKitAWTClass performSelector:markAppSel]; + return [jrsAppKitAWTClass performSelector:markAppSel] ? YES : NO; } + (void)appKitIsRunning:(id)arg { @@ -337,6 +337,8 @@ AWT_ASSERT_APPKIT_THREAD; // Headless mode trumps either ordinary AWT or SWT-in-AWT mode. Declare us a daemon and return. if (headless) { + // Note that we don't install run loop observers in headless mode + // because we don't need them (see 7174704) if (!forceEmbeddedMode) { setUpAppKitThreadName(); } diff --git a/jdk/src/solaris/native/sun/awt/awt_LoadLibrary.c b/jdk/src/solaris/native/sun/awt/awt_LoadLibrary.c index 378db5850ab..c056e8eac87 100644 --- a/jdk/src/solaris/native/sun/awt/awt_LoadLibrary.c +++ b/jdk/src/solaris/native/sun/awt/awt_LoadLibrary.c @@ -79,10 +79,8 @@ JNIEXPORT jboolean JNICALL AWTIsHeadless() { #ifdef MACOSX - #define XAWT_PATH "/libawt_xawt.dylib" #define LWAWT_PATH "/libawt_lwawt.dylib" #define DEFAULT_PATH LWAWT_PATH - #define HEADLESS_PATH "/libawt_headless.dylib" #else #define XAWT_PATH "/libawt_xawt.so" #define DEFAULT_PATH XAWT_PATH @@ -100,11 +98,6 @@ AWT_OnLoad(JavaVM *vm, void *reserved) struct utsname name; JNIEnv *env = (JNIEnv *)JNU_GetEnv(vm, JNI_VERSION_1_2); void *v; - char *envvar; - int xt_before_xm = 0; - int XAWT = 0; - jstring toolkit = NULL; - jstring propname = NULL; jstring fmanager = NULL; jstring fmProp = NULL; @@ -124,56 +117,32 @@ AWT_OnLoad(JavaVM *vm, void *reserved) /* * The code below is responsible for: * 1. Loading appropriate awt library, i.e. libawt_xawt or libawt_headless - * 2. Setting "awt.toolkit" system property to use the appropriate Java toolkit class, - * (if user has specified the toolkit in env varialble) + * 2. Set the "sun.font.fontmanager" system property. */ - propname = (*env)->NewStringUTF(env, "awt.toolkit"); fmProp = (*env)->NewStringUTF(env, "sun.font.fontmanager"); - tk = DEFAULT_PATH; /* default value, may be changed below */ - - /* Check if toolkit is specified in env variable */ - envvar = getenv("AWT_TOOLKIT"); - if (envvar && (strstr(envvar, "XToolkit"))) { - toolkit = (*env)->NewStringUTF(env, "sun.awt.X11.XToolkit"); - tk = XAWT_PATH; - fmanager = (*env)->NewStringUTF(env, "sun.awt.X11FontManager"); #ifdef MACOSX - } else { fmanager = (*env)->NewStringUTF(env, "sun.font.CFontManager"); tk = LWAWT_PATH; +#else + fmanager = (*env)->NewStringUTF(env, "sun.awt.X11FontManager"); + tk = XAWT_PATH; #endif - } - /* If user specified toolkit then set java system property */ - if (toolkit && propname) { - JNU_CallStaticMethodByName (env, - NULL, - "java/lang/System", - "setProperty", - "(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;", - propname,toolkit); - } if (fmanager && fmProp) { - JNU_CallStaticMethodByName (env, - NULL, - "java/lang/System", - "setProperty", - "(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;", - fmProp, fmanager); + JNU_CallStaticMethodByName(env, NULL, "java/lang/System", "setProperty", + "(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;", + fmProp, fmanager); } - /* Calculate library name to load */ +#ifndef MACOSX if (AWTIsHeadless()) { tk = HEADLESS_PATH; } +#endif + + /* Calculate library name to load */ strncpy(p, tk, MAXPATHLEN-len-1); - if (toolkit) { - (*env)->DeleteLocalRef(env, toolkit); - } - if (propname) { - (*env)->DeleteLocalRef(env, propname); - } if (fmProp) { (*env)->DeleteLocalRef(env, fmProp); } From 5520d11d0c5ee5294590ddeee956425c6f444246 Mon Sep 17 00:00:00 2001 From: Alexander Scherbatiy Date: Thu, 3 Oct 2013 19:02:45 +0400 Subject: [PATCH 079/131] 7092283: Property Window.locationByPlatform is not cleared by calling setVisible(false) Reviewed-by: anthony, serb --- jdk/src/share/classes/java/awt/Window.java | 7 +- .../LocationByPlatformTest.java | 75 +++++++++++++++++++ 2 files changed, 81 insertions(+), 1 deletion(-) create mode 100644 jdk/test/java/awt/Window/LocationByPlatform/LocationByPlatformTest.java diff --git a/jdk/src/share/classes/java/awt/Window.java b/jdk/src/share/classes/java/awt/Window.java index 1df36b1abda..1575b8b2d66 100644 --- a/jdk/src/share/classes/java/awt/Window.java +++ b/jdk/src/share/classes/java/awt/Window.java @@ -1034,7 +1034,9 @@ public class Window extends Container implements Accessible { closeSplashScreen(); Dialog.checkShouldBeBlocked(this); super.show(); - locationByPlatform = false; + synchronized (getTreeLock()) { + this.locationByPlatform = false; + } for (int i = 0; i < ownedWindowList.size(); i++) { Window child = ownedWindowList.elementAt(i).get(); if ((child != null) && child.showWithParent) { @@ -1107,6 +1109,9 @@ public class Window extends Container implements Accessible { modalBlocker.unblockWindow(this); } super.hide(); + synchronized (getTreeLock()) { + this.locationByPlatform = false; + } } final void clearMostRecentFocusOwnerOnHide() { diff --git a/jdk/test/java/awt/Window/LocationByPlatform/LocationByPlatformTest.java b/jdk/test/java/awt/Window/LocationByPlatform/LocationByPlatformTest.java new file mode 100644 index 00000000000..44f670b5597 --- /dev/null +++ b/jdk/test/java/awt/Window/LocationByPlatform/LocationByPlatformTest.java @@ -0,0 +1,75 @@ +/* + * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/** + * @test + * @bug 7092283 + * @author Alexander Scherbatiy + * @summary Property Window.locationByPlatform is not cleared by calling + * setVisible(false) + * @run main LocationByPlatformTest + */ +import java.awt.Window; + +public class LocationByPlatformTest { + + public static void main(String[] args) { + + Window window = new Window(null); + window.setSize(100, 100); + window.setLocationByPlatform(true); + + if (!window.isLocationByPlatform()) { + throw new RuntimeException("Location by platform is not set"); + } + + window.setLocation(10, 10); + + if (window.isLocationByPlatform()) { + throw new RuntimeException("Location by platform is not cleared"); + } + + window.setLocationByPlatform(true); + window.setBounds(20, 20, 50, 50); + + if (window.isLocationByPlatform()) { + throw new RuntimeException("Location by platform is not cleared"); + } + + window.setLocationByPlatform(true); + window.setVisible(false); + + if (window.isLocationByPlatform()) { + throw new RuntimeException("Location by platform is not cleared"); + } + + window.setLocationByPlatform(true); + window.setVisible(true); + + if (window.isLocationByPlatform()) { + throw new RuntimeException("Location by platform is not cleared"); + } + + window.dispose(); + } +} From 85c942f353bb02c7b7fca533e1cc81b6c73900b5 Mon Sep 17 00:00:00 2001 From: Johnny Chen Date: Thu, 3 Oct 2013 13:16:31 -0700 Subject: [PATCH 080/131] 8025280: [parfait] warnings from b107 for jdk.src.share.native.sun.java2d.loops: JNI exception pending, JNI critical region violation Reviewed-by: prr, jgodinez --- jdk/src/share/native/sun/java2d/loops/Blit.c | 5 +- .../share/native/sun/java2d/loops/BlitBg.c | 5 +- .../share/native/sun/java2d/loops/DrawPath.c | 36 ++++++++---- .../native/sun/java2d/loops/DrawPolygons.c | 9 ++- .../share/native/sun/java2d/loops/FillPath.c | 38 +++++++++---- .../sun/java2d/loops/GraphicsPrimitiveMgr.c | 57 ++++++++++--------- .../share/native/sun/java2d/loops/MaskBlit.c | 12 +++- .../share/native/sun/java2d/loops/MaskFill.c | 5 ++ .../native/sun/java2d/loops/ScaledBlit.c | 5 +- .../native/sun/java2d/loops/TransformHelper.c | 7 ++- 10 files changed, 121 insertions(+), 58 deletions(-) diff --git a/jdk/src/share/native/sun/java2d/loops/Blit.c b/jdk/src/share/native/sun/java2d/loops/Blit.c index 58f2b9462a5..d6302b319c5 100644 --- a/jdk/src/share/native/sun/java2d/loops/Blit.c +++ b/jdk/src/share/native/sun/java2d/loops/Blit.c @@ -60,8 +60,11 @@ Java_sun_java2d_loops_Blit_Blit } srcOps = SurfaceData_GetOps(env, srcData); + if (srcOps == 0) { + return; + } dstOps = SurfaceData_GetOps(env, dstData); - if (srcOps == 0 || dstOps == 0) { + if (dstOps == 0) { return; } diff --git a/jdk/src/share/native/sun/java2d/loops/BlitBg.c b/jdk/src/share/native/sun/java2d/loops/BlitBg.c index 9738bec7984..fe3ba39e0e0 100644 --- a/jdk/src/share/native/sun/java2d/loops/BlitBg.c +++ b/jdk/src/share/native/sun/java2d/loops/BlitBg.c @@ -60,8 +60,11 @@ JNIEXPORT void JNICALL Java_sun_java2d_loops_BlitBg_BlitBg } srcOps = SurfaceData_GetOps(env, srcData); + if (srcOps == 0) { + return; + } dstOps = SurfaceData_GetOps(env, dstData); - if (srcOps == 0 || dstOps == 0) { + if (dstOps == 0) { return; } diff --git a/jdk/src/share/native/sun/java2d/loops/DrawPath.c b/jdk/src/share/native/sun/java2d/loops/DrawPath.c index 6b51eeedb62..d96c7f8f1bf 100644 --- a/jdk/src/share/native/sun/java2d/loops/DrawPath.c +++ b/jdk/src/share/native/sun/java2d/loops/DrawPath.c @@ -75,7 +75,8 @@ JNIEXPORT void JNICALL Java_sun_java2d_loops_DrawPath_DrawPath CompositeInfo compInfo; jint ret; NativePrimitive *pPrim = GetNativePrim(env, self); - jint stroke = (*env)->GetIntField(env, sg2d, sg2dStrokeHintID); + jint stroke; + jboolean throwExc = JNI_FALSE; if (pPrim == NULL) { return; @@ -84,6 +85,8 @@ JNIEXPORT void JNICALL Java_sun_java2d_loops_DrawPath_DrawPath GrPrim_Sg2dGetCompInfo(env, sg2d, pPrim, &compInfo); } + stroke = (*env)->GetIntField(env, sg2d, sg2dStrokeHintID); + sdOps = SurfaceData_GetOps(env, sData); if (sdOps == 0) { return; @@ -112,6 +115,10 @@ JNIEXPORT void JNICALL Java_sun_java2d_loops_DrawPath_DrawPath maxCoords = (*env)->GetArrayLength(env, coordsArray); coords = (jfloat*)(*env)->GetPrimitiveArrayCritical( env, coordsArray, NULL); + if (coords == NULL) { + SurfaceData_InvokeUnlock(env, sdOps, &rasInfo); + return; + } if (ret == SD_SLOWLOCK) { GrPrim_RefineBounds(&rasInfo.bounds, transX, transY, @@ -157,22 +164,29 @@ JNIEXPORT void JNICALL Java_sun_java2d_loops_DrawPath_DrawPath drawHandler.yMax = rasInfo.bounds.y2; drawHandler.pData = &dHData; - if (!doDrawPath(&drawHandler, NULL, transX, transY, - coords, maxCoords, types, numTypes, - (stroke == sunHints_INTVAL_STROKE_PURE)? - PH_STROKE_PURE : PH_STROKE_DEFAULT)) - { - JNU_ThrowArrayIndexOutOfBoundsException(env, - "coords array"); - } + if (types != NULL) { + if (!doDrawPath(&drawHandler, NULL, transX, transY, + coords, maxCoords, types, numTypes, + (stroke == sunHints_INTVAL_STROKE_PURE)? + PH_STROKE_PURE : PH_STROKE_DEFAULT)) + { + throwExc = JNI_TRUE; + } - (*env)->ReleasePrimitiveArrayCritical(env, typesArray, types, - JNI_ABORT); + (*env)->ReleasePrimitiveArrayCritical(env, typesArray, types, + JNI_ABORT); + } } } SurfaceData_InvokeRelease(env, sdOps, &rasInfo); } (*env)->ReleasePrimitiveArrayCritical(env, coordsArray, coords, JNI_ABORT); + + if (throwExc) { + JNU_ThrowArrayIndexOutOfBoundsException(env, + "coords array"); + } + SurfaceData_InvokeUnlock(env, sdOps, &rasInfo); } diff --git a/jdk/src/share/native/sun/java2d/loops/DrawPolygons.c b/jdk/src/share/native/sun/java2d/loops/DrawPolygons.c index e7ab0a06f01..5cec234620c 100644 --- a/jdk/src/share/native/sun/java2d/loops/DrawPolygons.c +++ b/jdk/src/share/native/sun/java2d/loops/DrawPolygons.c @@ -186,10 +186,15 @@ Java_sun_java2d_loops_DrawPolygons_DrawPolygons } xPointsPtr = (*env)->GetPrimitiveArrayCritical(env, xPointsArray, NULL); - yPointsPtr = (*env)->GetPrimitiveArrayCritical(env, yPointsArray, NULL); - if (!xPointsPtr || !yPointsPtr) { + if (!xPointsPtr) { ok = JNI_FALSE; } + if (ok) { + yPointsPtr = (*env)->GetPrimitiveArrayCritical(env, yPointsArray, NULL); + if (!yPointsPtr) { + ok = JNI_FALSE; + } + } } if (ok) { diff --git a/jdk/src/share/native/sun/java2d/loops/FillPath.c b/jdk/src/share/native/sun/java2d/loops/FillPath.c index 3411c579aa6..a7b77c09782 100644 --- a/jdk/src/share/native/sun/java2d/loops/FillPath.c +++ b/jdk/src/share/native/sun/java2d/loops/FillPath.c @@ -64,7 +64,8 @@ JNIEXPORT void JNICALL Java_sun_java2d_loops_FillPath_FillPath CompositeInfo compInfo; jint ret; NativePrimitive *pPrim = GetNativePrim(env, self); - jint stroke = (*env)->GetIntField(env, sg2d, sg2dStrokeHintID); + jint stroke; + jboolean throwExc = JNI_FALSE; if (pPrim == NULL) { return; @@ -73,6 +74,8 @@ JNIEXPORT void JNICALL Java_sun_java2d_loops_FillPath_FillPath GrPrim_Sg2dGetCompInfo(env, sg2d, pPrim, &compInfo); } + stroke = (*env)->GetIntField(env, sg2d, sg2dStrokeHintID); + sdOps = SurfaceData_GetOps(env, sData); if (sdOps == 0) { return; @@ -102,6 +105,10 @@ JNIEXPORT void JNICALL Java_sun_java2d_loops_FillPath_FillPath maxCoords = (*env)->GetArrayLength(env, coordsArray); coords = (jfloat*)(*env)->GetPrimitiveArrayCritical( env, coordsArray, NULL); + if (coords == NULL) { + SurfaceData_InvokeUnlock(env, sdOps, &rasInfo); + return; + } if (ret == SD_SLOWLOCK) { GrPrim_RefineBounds(&rasInfo.bounds, transX, transY, @@ -146,24 +153,31 @@ JNIEXPORT void JNICALL Java_sun_java2d_loops_FillPath_FillPath drawHandler.yMax = rasInfo.bounds.y2; drawHandler.pData = &dHData; - if (!doFillPath(&drawHandler, - transX, transY, coords, - maxCoords, types, numTypes, - (stroke == sunHints_INTVAL_STROKE_PURE)? - PH_STROKE_PURE : PH_STROKE_DEFAULT, - fillRule)) - { - JNU_ThrowArrayIndexOutOfBoundsException(env, - "coords array"); - } + if (types != NULL) { + if (!doFillPath(&drawHandler, + transX, transY, coords, + maxCoords, types, numTypes, + (stroke == sunHints_INTVAL_STROKE_PURE)? + PH_STROKE_PURE : PH_STROKE_DEFAULT, + fillRule)) + { + throwExc = JNI_TRUE; + } - (*env)->ReleasePrimitiveArrayCritical(env, typesArray, types, + (*env)->ReleasePrimitiveArrayCritical(env, typesArray, types, JNI_ABORT); + } } } SurfaceData_InvokeRelease(env, sdOps, &rasInfo); } (*env)->ReleasePrimitiveArrayCritical(env, coordsArray, coords, JNI_ABORT); + + if (throwExc) { + JNU_ThrowArrayIndexOutOfBoundsException(env, + "coords array"); + } + SurfaceData_InvokeUnlock(env, sdOps, &rasInfo); } diff --git a/jdk/src/share/native/sun/java2d/loops/GraphicsPrimitiveMgr.c b/jdk/src/share/native/sun/java2d/loops/GraphicsPrimitiveMgr.c index 7e323086c1a..352a5ebeeca 100644 --- a/jdk/src/share/native/sun/java2d/loops/GraphicsPrimitiveMgr.c +++ b/jdk/src/share/native/sun/java2d/loops/GraphicsPrimitiveMgr.c @@ -205,33 +205,36 @@ Java_sun_java2d_loops_GraphicsPrimitiveMgr_registerNativeLoops RegisterFunc RegisterFourByteAbgr; RegisterFunc RegisterFourByteAbgrPre; - RegisterAnyByte(env); - RegisterByteBinary1Bit(env); - RegisterByteBinary2Bit(env); - RegisterByteBinary4Bit(env); - RegisterByteIndexed(env); - RegisterByteGray(env); - RegisterIndex8Gray(env); - RegisterIndex12Gray(env); - RegisterAnyShort(env); - RegisterUshort555Rgb(env); - RegisterUshort565Rgb(env); - RegisterUshort4444Argb(env); - RegisterUshort555Rgbx(env); - RegisterUshortGray(env); - RegisterUshortIndexed(env); - RegisterAny3Byte(env); - RegisterThreeByteBgr(env); - RegisterAnyInt(env); - RegisterIntArgb(env); - RegisterIntArgbPre(env); - RegisterIntArgbBm(env); - RegisterIntRgb(env); - RegisterIntBgr(env); - RegisterIntRgbx(env); - RegisterAny4Byte(env); - RegisterFourByteAbgr(env); - RegisterFourByteAbgrPre(env); + if (!RegisterAnyByte(env) || + !RegisterByteBinary1Bit(env) || + !RegisterByteBinary2Bit(env) || + !RegisterByteBinary4Bit(env) || + !RegisterByteIndexed(env) || + !RegisterByteGray(env) || + !RegisterIndex8Gray(env) || + !RegisterIndex12Gray(env) || + !RegisterAnyShort(env) || + !RegisterUshort555Rgb(env) || + !RegisterUshort565Rgb(env) || + !RegisterUshort4444Argb(env) || + !RegisterUshort555Rgbx(env) || + !RegisterUshortGray(env) || + !RegisterUshortIndexed(env) || + !RegisterAny3Byte(env) || + !RegisterThreeByteBgr(env) || + !RegisterAnyInt(env) || + !RegisterIntArgb(env) || + !RegisterIntArgbPre(env) || + !RegisterIntArgbBm(env) || + !RegisterIntRgb(env) || + !RegisterIntBgr(env) || + !RegisterIntRgbx(env) || + !RegisterAny4Byte(env) || + !RegisterFourByteAbgr(env) || + !RegisterFourByteAbgrPre(env)) + { + return; + } } #define _StartOf(T) ((T *) (&T##s)) diff --git a/jdk/src/share/native/sun/java2d/loops/MaskBlit.c b/jdk/src/share/native/sun/java2d/loops/MaskBlit.c index 2c023411803..3463315bcf6 100644 --- a/jdk/src/share/native/sun/java2d/loops/MaskBlit.c +++ b/jdk/src/share/native/sun/java2d/loops/MaskBlit.c @@ -60,8 +60,11 @@ Java_sun_java2d_loops_MaskBlit_MaskBlit } srcOps = SurfaceData_GetOps(env, srcData); + if (srcOps == 0) { + return; + } dstOps = SurfaceData_GetOps(env, dstData); - if (srcOps == 0 || dstOps == 0) { + if (dstOps == 0) { return; } @@ -96,6 +99,13 @@ Java_sun_java2d_loops_MaskBlit_MaskBlit (maskArray ? (*env)->GetPrimitiveArrayCritical(env, maskArray, 0) : 0); + if (maskArray != NULL && pMask == NULL) { + SurfaceData_InvokeRelease(env, dstOps, &dstInfo); + SurfaceData_InvokeRelease(env, srcOps, &srcInfo); + SurfaceData_InvokeUnlock(env, dstOps, &dstInfo); + SurfaceData_InvokeUnlock(env, srcOps, &srcInfo); + return; + } jint savesx = srcInfo.bounds.x1; jint savedx = dstInfo.bounds.x1; Region_StartIteration(env, &clipInfo); diff --git a/jdk/src/share/native/sun/java2d/loops/MaskFill.c b/jdk/src/share/native/sun/java2d/loops/MaskFill.c index 0003675d43c..2e5d3ed4e12 100644 --- a/jdk/src/share/native/sun/java2d/loops/MaskFill.c +++ b/jdk/src/share/native/sun/java2d/loops/MaskFill.c @@ -84,6 +84,11 @@ Java_sun_java2d_loops_MaskFill_MaskFill (maskArray ? (*env)->GetPrimitiveArrayCritical(env, maskArray, 0) : 0); + if (maskArray != NULL && pMask == NULL) { + SurfaceData_InvokeRelease(env, sdOps, &rasInfo); + SurfaceData_InvokeUnlock(env, sdOps, &rasInfo); + return; + } maskoff += ((rasInfo.bounds.y1 - y) * maskscan + (rasInfo.bounds.x1 - x)); (*pPrim->funcs.maskfill)(pDst, diff --git a/jdk/src/share/native/sun/java2d/loops/ScaledBlit.c b/jdk/src/share/native/sun/java2d/loops/ScaledBlit.c index 625c3662f3c..486a9842b60 100644 --- a/jdk/src/share/native/sun/java2d/loops/ScaledBlit.c +++ b/jdk/src/share/native/sun/java2d/loops/ScaledBlit.c @@ -296,8 +296,11 @@ Java_sun_java2d_loops_ScaledBlit_Scale } srcOps = SurfaceData_GetOps(env, srcData); + if (srcOps == 0) { + return; + } dstOps = SurfaceData_GetOps(env, dstData); - if (srcOps == 0 || dstOps == 0) { + if (dstOps == 0) { return; } diff --git a/jdk/src/share/native/sun/java2d/loops/TransformHelper.c b/jdk/src/share/native/sun/java2d/loops/TransformHelper.c index 72334550250..6d53054ab9c 100644 --- a/jdk/src/share/native/sun/java2d/loops/TransformHelper.c +++ b/jdk/src/share/native/sun/java2d/loops/TransformHelper.c @@ -326,8 +326,11 @@ Java_sun_java2d_loops_TransformHelper_Transform } srcOps = SurfaceData_GetOps(env, srcData); + if (srcOps == 0) { + return; + } dstOps = SurfaceData_GetOps(env, dstData); - if (srcOps == 0 || dstOps == 0) { + if (dstOps == 0) { return; } @@ -411,7 +414,7 @@ Java_sun_java2d_loops_TransformHelper_Transform } if (pEdges == NULL) { - if (numedges > 0) { + if (!(*env)->ExceptionCheck(env) && numedges > 0) { JNU_ThrowInternalError(env, "Unable to allocate edge list"); } SurfaceData_InvokeUnlock(env, dstOps, &dstInfo); From fa90ce8bf8195e34d089d4678b1d70b0f47407b7 Mon Sep 17 00:00:00 2001 From: Johnny Chen Date: Thu, 3 Oct 2013 13:26:45 -0700 Subject: [PATCH 081/131] 8025480: [parfait] "JNI exception pending" warnings from b107 for jdk.src.share.native.sun.java2d Reviewed-by: prr, jgodinez --- jdk/src/share/native/sun/java2d/Disposer.c | 9 ++++++--- jdk/src/share/native/sun/java2d/SurfaceData.c | 4 +++- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/jdk/src/share/native/sun/java2d/Disposer.c b/jdk/src/share/native/sun/java2d/Disposer.c index 5379df637a4..611631732d8 100644 --- a/jdk/src/share/native/sun/java2d/Disposer.c +++ b/jdk/src/share/native/sun/java2d/Disposer.c @@ -38,10 +38,9 @@ Java_sun_java2d_Disposer_initIDs(JNIEnv *env, jclass disposerClass) { addRecordMID = (*env)->GetStaticMethodID(env, disposerClass, "addRecord", "(Ljava/lang/Object;JJ)V"); - if (addRecordMID == 0) { - JNU_ThrowNoSuchMethodError(env, "Disposer.addRecord"); + if (addRecordMID != 0) { + dispClass = (*env)->NewGlobalRef(env, disposerClass); } - dispClass = (*env)->NewGlobalRef(env, disposerClass); } JNIEXPORT void JNICALL @@ -50,6 +49,10 @@ Disposer_AddRecord(JNIEnv *env, jobject obj, GeneralDisposeFunc disposer, jlong if (dispClass == NULL) { /* Needed to initialize the Disposer class as it may be not yet referenced */ jclass clazz = (*env)->FindClass(env, "sun/java2d/Disposer"); + if ((*env)->ExceptionCheck(env)) { + // If there's exception pending, we'll just return. + return; + } } (*env)->CallStaticVoidMethod(env, dispClass, addRecordMID, diff --git a/jdk/src/share/native/sun/java2d/SurfaceData.c b/jdk/src/share/native/sun/java2d/SurfaceData.c index 73d43adf798..d72fa284f8a 100644 --- a/jdk/src/share/native/sun/java2d/SurfaceData.c +++ b/jdk/src/share/native/sun/java2d/SurfaceData.c @@ -237,7 +237,9 @@ SurfaceDataOps *SurfaceData_InitOps(JNIEnv *env, jobject sData, int opsSize) SurfaceData_SetOps(env, sData, ops); if (ops != NULL) { memset(ops, 0, opsSize); - ops->sdObject = (*env)->NewWeakGlobalRef(env, sData); + if (!(*env)->ExceptionCheck(env)) { + ops->sdObject = (*env)->NewWeakGlobalRef(env, sData); + } } return ops; } From 3a01c9493eef71c063fb0e2acf5d976146ef1ed7 Mon Sep 17 00:00:00 2001 From: Johnny Chen Date: Thu, 3 Oct 2013 13:35:26 -0700 Subject: [PATCH 082/131] 8025309: [parfait] JNI-related warnings from b107 for jdk.src.share.native.sun.java2d.pipe Reviewed-by: prr, jgodinez --- .../sun/java2d/pipe/BufferedRenderPipe.c | 6 ++- jdk/src/share/native/sun/java2d/pipe/Region.c | 4 ++ .../sun/java2d/pipe/ShapeSpanIterator.c | 11 +++-- .../native/sun/java2d/pipe/SpanClipRenderer.c | 45 +++++++++++++++---- 4 files changed, 53 insertions(+), 13 deletions(-) diff --git a/jdk/src/share/native/sun/java2d/pipe/BufferedRenderPipe.c b/jdk/src/share/native/sun/java2d/pipe/BufferedRenderPipe.c index 62cc5ef2c7c..849fd2adcc5 100644 --- a/jdk/src/share/native/sun/java2d/pipe/BufferedRenderPipe.c +++ b/jdk/src/share/native/sun/java2d/pipe/BufferedRenderPipe.c @@ -53,6 +53,7 @@ Java_sun_java2d_pipe_BufferedRenderPipe_fillSpans unsigned char *bbuf; jint *ibuf; jint ipos; + jboolean hasException; J2dTraceLn2(J2D_TRACE_INFO, "BufferedRenderPipe_fillSpans: bpos=%d limit=%d", @@ -104,7 +105,10 @@ Java_sun_java2d_pipe_BufferedRenderPipe_fillSpans ibuf[1] = spanCount; // flush the queue - JNU_CallMethodByName(env, NULL, rq, "flushNow", "(I)V", bpos); + JNU_CallMethodByName(env, &hasException, rq, "flushNow", "(I)V", bpos); + if (hasException) { + break; + } // now start a new operation ibuf = (jint *)bbuf; diff --git a/jdk/src/share/native/sun/java2d/pipe/Region.c b/jdk/src/share/native/sun/java2d/pipe/Region.c index 97c682cf0e3..4bafa105ed6 100644 --- a/jdk/src/share/native/sun/java2d/pipe/Region.c +++ b/jdk/src/share/native/sun/java2d/pipe/Region.c @@ -260,6 +260,10 @@ RegionToYXBandedRectangles(JNIEnv *env, /* return; REMIND: What to do here? */ } Region_StartIteration(env, &clipInfo); + if ((*env)->ExceptionCheck(env)) { + return 0; + } + numrects = Region_CountIterationRects(&clipInfo); if ((unsigned long)numrects > initialBufferSize) { *pRect = (RECT_T *) SAFE_SIZE_ARRAY_ALLOC(malloc, numrects, sizeof(RECT_T)); diff --git a/jdk/src/share/native/sun/java2d/pipe/ShapeSpanIterator.c b/jdk/src/share/native/sun/java2d/pipe/ShapeSpanIterator.c index e8580273955..2462307ab9b 100644 --- a/jdk/src/share/native/sun/java2d/pipe/ShapeSpanIterator.c +++ b/jdk/src/share/native/sun/java2d/pipe/ShapeSpanIterator.c @@ -653,12 +653,15 @@ Java_sun_java2d_pipe_ShapeSpanIterator_appendPoly pd->curx = x; pd->cury = y; } + (*env)->ReleasePrimitiveArrayCritical(env, yArray, + yPoints, JNI_ABORT); } - (*env)->ReleasePrimitiveArrayCritical(env, yArray, - yPoints, JNI_ABORT); + (*env)->ReleasePrimitiveArrayCritical(env, xArray, + xPoints, JNI_ABORT); + } + if (xPoints == NULL || yPoints == NULL) { + return; } - (*env)->ReleasePrimitiveArrayCritical(env, xArray, - xPoints, JNI_ABORT); } if (!oom) { HANDLEENDPATH(pd, {oom = JNI_TRUE;}); diff --git a/jdk/src/share/native/sun/java2d/pipe/SpanClipRenderer.c b/jdk/src/share/native/sun/java2d/pipe/SpanClipRenderer.c index ad53574bdeb..2b5190fada0 100644 --- a/jdk/src/share/native/sun/java2d/pipe/SpanClipRenderer.c +++ b/jdk/src/share/native/sun/java2d/pipe/SpanClipRenderer.c @@ -44,21 +44,27 @@ Java_sun_java2d_pipe_SpanClipRenderer_initIDs { /* Region fields */ pBandsArrayID = (*env)->GetFieldID(env, rc, "bands", "[I"); + if (pBandsArrayID == NULL) { + return; + } pEndIndexID = (*env)->GetFieldID(env, rc, "endIndex", "I"); + if (pEndIndexID == NULL) { + return; + } /* RegionIterator fields */ pRegionID = (*env)->GetFieldID(env, ric, "region", "Lsun/java2d/pipe/Region;"); + if (pRegionID == NULL) { + return; + } pCurIndexID = (*env)->GetFieldID(env, ric, "curIndex", "I"); + if (pCurIndexID == NULL) { + return; + } pNumXbandsID = (*env)->GetFieldID(env, ric, "numXbands", "I"); - - if((pBandsArrayID == NULL) - || (pEndIndexID == NULL) - || (pRegionID == NULL) - || (pCurIndexID == NULL) - || (pNumXbandsID == NULL)) - { - JNU_ThrowInternalError(env, "NULL field ID"); + if (pNumXbandsID == NULL) { + return; } } @@ -129,10 +135,14 @@ Java_sun_java2d_pipe_SpanClipRenderer_fillTile if ((*env)->GetArrayLength(env, boxArray) < 4) { JNU_ThrowArrayIndexOutOfBoundsException(env, "band array"); + return; } alphalen = (*env)->GetArrayLength(env, alphaTile); box = (*env)->GetPrimitiveArrayCritical(env, boxArray, 0); + if (box == NULL) { + return; + } w = box[2] - box[0]; h = box[3] - box[1]; @@ -140,9 +150,14 @@ Java_sun_java2d_pipe_SpanClipRenderer_fillTile if (alphalen < offset || (alphalen - offset) / tsize < h) { (*env)->ReleasePrimitiveArrayCritical(env, boxArray, box, 0); JNU_ThrowArrayIndexOutOfBoundsException(env, "alpha tile array"); + return; } alpha = (*env)->GetPrimitiveArrayCritical(env, alphaTile, 0); + if (alpha == NULL) { + (*env)->ReleasePrimitiveArrayCritical(env, boxArray, box, 0); + return; + } fill(alpha, offset, tsize, 0, 0, w, h, (jbyte) 0xff); @@ -182,6 +197,7 @@ Java_sun_java2d_pipe_SpanClipRenderer_eraseTile if ((*env)->GetArrayLength(env, boxArray) < 4) { JNU_ThrowArrayIndexOutOfBoundsException(env, "band array"); + return; } alphalen = (*env)->GetArrayLength(env, alphaTile); @@ -196,6 +212,9 @@ Java_sun_java2d_pipe_SpanClipRenderer_eraseTile } box = (*env)->GetPrimitiveArrayCritical(env, boxArray, 0); + if (box == NULL) { + return; + } lox = box[0]; loy = box[1]; @@ -207,10 +226,20 @@ Java_sun_java2d_pipe_SpanClipRenderer_eraseTile (alphalen - offset - (hix-lox)) / tsize < (hiy - loy - 1)) { (*env)->ReleasePrimitiveArrayCritical(env, boxArray, box, 0); JNU_ThrowArrayIndexOutOfBoundsException(env, "alpha tile array"); + return; } bands = (*env)->GetPrimitiveArrayCritical(env, bandsArray, 0); + if (bands == NULL) { + (*env)->ReleasePrimitiveArrayCritical(env, boxArray, box, 0); + return; + } alpha = (*env)->GetPrimitiveArrayCritical(env, alphaTile, 0); + if (alpha == NULL) { + (*env)->ReleasePrimitiveArrayCritical(env, bandsArray, bands, 0); + (*env)->ReleasePrimitiveArrayCritical(env, boxArray, box, 0); + return; + } curIndex = saveCurIndex; numXbands = saveNumXbands; From 3c27e706c7a3cab21b2a30d2c583d76dda132c55 Mon Sep 17 00:00:00 2001 From: Johnny Chen Date: Thu, 3 Oct 2013 13:41:53 -0700 Subject: [PATCH 083/131] 8025664: [parfait] warnings from b62 for jdk.src.share.native.sun.font Reviewed-by: prr, jgodinez --- .../share/native/sun/font/freetypeScaler.c | 53 ++++++++++--------- 1 file changed, 27 insertions(+), 26 deletions(-) diff --git a/jdk/src/share/native/sun/font/freetypeScaler.c b/jdk/src/share/native/sun/font/freetypeScaler.c index 7e82c4da555..c562f546275 100644 --- a/jdk/src/share/native/sun/font/freetypeScaler.c +++ b/jdk/src/share/native/sun/font/freetypeScaler.c @@ -252,7 +252,6 @@ Java_sun_font_FreetypeFontScaler_initNativeScaler( JNIEnv *env, jobject scaler, jobject font2D, jint type, jint indexInCollection, jboolean supportsCJK, jint filesize) { FTScalerInfo* scalerInfo = NULL; - FT_Stream ftstream; FT_Open_Args ft_open_args; int error; jobject bBuffer; @@ -309,34 +308,36 @@ Java_sun_font_FreetypeFontScaler_initNativeScaler( } } else { /* Truetype */ scalerInfo->fontData = (unsigned char*) malloc(FILEDATACACHESIZE); - ftstream = (FT_Stream) calloc(1, sizeof(FT_StreamRec)); - if (ftstream != NULL && scalerInfo->fontData != NULL) { - scalerInfo->directBuffer = (*env)->NewDirectByteBuffer(env, - scalerInfo->fontData, - FILEDATACACHESIZE); - if (scalerInfo->directBuffer != NULL) { - scalerInfo->directBuffer = (*env)->NewGlobalRef(env, - scalerInfo->directBuffer); - ftstream->base = NULL; - ftstream->size = filesize; - ftstream->pos = 0; - ftstream->read = (FT_Stream_IoFunc) ReadTTFontFileFunc; - ftstream->close = (FT_Stream_CloseFunc) CloseTTFontFileFunc; - ftstream->pathname.pointer = (void *) scalerInfo; + if (scalerInfo->fontData != NULL) { + FT_Stream ftstream = (FT_Stream) calloc(1, sizeof(FT_StreamRec)); + if (ftstream != NULL) { + scalerInfo->directBuffer = (*env)->NewDirectByteBuffer(env, + scalerInfo->fontData, + FILEDATACACHESIZE); + if (scalerInfo->directBuffer != NULL) { + scalerInfo->directBuffer = (*env)->NewGlobalRef(env, + scalerInfo->directBuffer); + ftstream->base = NULL; + ftstream->size = filesize; + ftstream->pos = 0; + ftstream->read = (FT_Stream_IoFunc) ReadTTFontFileFunc; + ftstream->close = (FT_Stream_CloseFunc) CloseTTFontFileFunc; + ftstream->pathname.pointer = (void *) scalerInfo; - memset(&ft_open_args, 0, sizeof(FT_Open_Args)); - ft_open_args.flags = FT_OPEN_STREAM; - ft_open_args.stream = ftstream; + memset(&ft_open_args, 0, sizeof(FT_Open_Args)); + ft_open_args.flags = FT_OPEN_STREAM; + ft_open_args.stream = ftstream; - error = FT_Open_Face(scalerInfo->library, - &ft_open_args, - indexInCollection, - &scalerInfo->face); - } - if (error || scalerInfo->directBuffer == NULL) { - free(ftstream); - } + error = FT_Open_Face(scalerInfo->library, + &ft_open_args, + indexInCollection, + &scalerInfo->face); + } + if (error || scalerInfo->directBuffer == NULL) { + free(ftstream); + } + } } } From 7b490635eab23904992fd4bd7faf86e49bb769f6 Mon Sep 17 00:00:00 2001 From: Johnny Chen Date: Thu, 3 Oct 2013 13:49:52 -0700 Subject: [PATCH 084/131] 8025294: [parfait] JNI-related warnings from b107 for jdk.src.solaris.native.sun.java2d.x11 Reviewed-by: prr, jgodinez --- .../solaris/native/sun/java2d/x11/X11Renderer.c | 17 ++++++----------- .../native/sun/java2d/x11/X11SurfaceData.c | 8 ++++++-- .../native/sun/java2d/x11/XRBackendNative.c | 10 ++++++++++ .../native/sun/java2d/x11/XRSurfaceData.c | 6 ++++++ 4 files changed, 28 insertions(+), 13 deletions(-) diff --git a/jdk/src/solaris/native/sun/java2d/x11/X11Renderer.c b/jdk/src/solaris/native/sun/java2d/x11/X11Renderer.c index cfae03c92dd..bbe32a07ba2 100644 --- a/jdk/src/solaris/native/sun/java2d/x11/X11Renderer.c +++ b/jdk/src/solaris/native/sun/java2d/x11/X11Renderer.c @@ -465,9 +465,7 @@ JNIEXPORT void JNICALL Java_sun_java2d_x11_X11Renderer_XDrawPoly points = transformPoints(env, xcoordsArray, ycoordsArray, transx, transy, pTmp, (int *)&npoints, isclosed); - if (points == 0) { - JNU_ThrowOutOfMemoryError(env, "translated coordinate array"); - } else { + if (points != 0) { if (npoints == 2) { /* * Some X11 implementations fail to draw anything for @@ -588,6 +586,7 @@ Java_sun_java2d_x11_X11Renderer_XDoPath NULL }; PHStroke stroke; + jboolean ok = JNI_TRUE; if (xsdo == NULL) { return; @@ -625,8 +624,6 @@ Java_sun_java2d_x11_X11Renderer_XDoPath types = (jbyte*) (*env)->GetPrimitiveArrayCritical(env, typesArray, NULL); if (types != NULL) { - jboolean ok; - if (isFill) { drawHandler.pDrawScanline = &drawScanline; ok = doFillPath(&drawHandler, @@ -643,14 +640,14 @@ Java_sun_java2d_x11_X11Renderer_XDoPath types, numTypes, stroke); } - if (!ok) { - JNU_ThrowArrayIndexOutOfBoundsException(env, "coords array"); - } (*env)->ReleasePrimitiveArrayCritical(env, typesArray, types, JNI_ABORT); } (*env)->ReleasePrimitiveArrayCritical(env, coordsArray, coords, JNI_ABORT); + if (!ok) { + JNU_ThrowArrayIndexOutOfBoundsException(env, "coords array"); + } } XDHD_FREE_POINTS(&dHData); @@ -893,9 +890,7 @@ JNIEXPORT void JNICALL Java_sun_java2d_x11_X11Renderer_XFillPoly points = transformPoints(env, xcoordsArray, ycoordsArray, transx, transy, pTmp, (int *)&npoints, JNI_FALSE); - if (points == 0) { - JNU_ThrowOutOfMemoryError(env, "translated coordinate array"); - } else { + if (points != 0) { if (npoints > 2) { XFillPolygon(awt_display, xsdo->drawable, (GC) xgc, points, npoints, Complex, CoordModeOrigin); diff --git a/jdk/src/solaris/native/sun/java2d/x11/X11SurfaceData.c b/jdk/src/solaris/native/sun/java2d/x11/X11SurfaceData.c index f944cff7ee9..a35d6fd3065 100644 --- a/jdk/src/solaris/native/sun/java2d/x11/X11SurfaceData.c +++ b/jdk/src/solaris/native/sun/java2d/x11/X11SurfaceData.c @@ -227,7 +227,7 @@ Java_sun_java2d_x11_X11SurfaceData_isShmPMAvailable(JNIEnv *env, jobject this) #if defined(HEADLESS) || !defined(MITSHM) return JNI_FALSE; #else - return useMitShmPixmaps; + return (jboolean)useMitShmPixmaps; #endif /* HEADLESS, MITSHM */ } @@ -258,6 +258,7 @@ Java_sun_java2d_x11_XSurfaceData_initOps(JNIEnv *env, jobject xsd, { #ifndef HEADLESS X11SDOps *xsdo = (X11SDOps*)SurfaceData_InitOps(env, xsd, sizeof(X11SDOps)); + jboolean hasException; if (xsdo == NULL) { JNU_ThrowOutOfMemoryError(env, "Initialization of SurfaceData failed."); return; @@ -270,7 +271,10 @@ Java_sun_java2d_x11_XSurfaceData_initOps(JNIEnv *env, jobject xsd, xsdo->ReleasePixmapWithBg = X11SD_ReleasePixmapWithBg; xsdo->widget = NULL; if (peer != NULL) { - xsdo->drawable = JNU_CallMethodByName(env, NULL, peer, "getWindow", "()J").j; + xsdo->drawable = JNU_CallMethodByName(env, &hasException, peer, "getWindow", "()J").j; + if (hasException) { + return; + } } else { xsdo->drawable = 0; } diff --git a/jdk/src/solaris/native/sun/java2d/x11/XRBackendNative.c b/jdk/src/solaris/native/sun/java2d/x11/XRBackendNative.c index 1705c28f4fb..3a5c9caca80 100644 --- a/jdk/src/solaris/native/sun/java2d/x11/XRBackendNative.c +++ b/jdk/src/solaris/native/sun/java2d/x11/XRBackendNative.c @@ -326,7 +326,13 @@ Java_sun_java2d_xr_XRBackendNative_initIDs(JNIEnv *env, jclass cls) { jlong fmt32; jfieldID a8ID = (*env)->GetStaticFieldID(env, cls, "FMTPTR_A8", "J"); + if (a8ID == NULL) { + return; + } jfieldID argb32ID = (*env)->GetStaticFieldID(env, cls, "FMTPTR_ARGB32", "J"); + if (argb32ID == NULL) { + return; + } if (awt_display == (Display *)NULL) { return; @@ -346,6 +352,10 @@ Java_sun_java2d_xr_XRBackendNative_initIDs(JNIEnv *env, jclass cls) { defaultImg = XCreateImage(awt_display, NULL, 8, ZPixmap, 0, maskData, 32, 32, 8, 0); defaultImg->data = maskData; //required? maskImgID = (*env)->GetStaticFieldID(env, cls, "MASK_XIMG", "J"); + if (maskImgID == NULL) { + return; + } + (*env)->SetStaticLongField(env, cls, maskImgID, ptr_to_jlong(defaultImg)); } diff --git a/jdk/src/solaris/native/sun/java2d/x11/XRSurfaceData.c b/jdk/src/solaris/native/sun/java2d/x11/XRSurfaceData.c index b598a22ab95..a9c762f87c1 100644 --- a/jdk/src/solaris/native/sun/java2d/x11/XRSurfaceData.c +++ b/jdk/src/solaris/native/sun/java2d/x11/XRSurfaceData.c @@ -88,7 +88,13 @@ Java_sun_java2d_xr_XRSurfaceData_initIDs(JNIEnv *env, jclass xsd) J2dTraceLn(J2D_TRACE_INFO, "in XRSurfaceData_initIDs"); pictID = (*env)->GetFieldID(env, xsd, "picture", "I"); + if (pictID == NULL) { + return; + } xidID = (*env)->GetFieldID(env, xsd, "xid", "I"); + if (xidID == NULL) { + return; + } XShared_initIDs(env, JNI_FALSE); #endif /* !HEADLESS */ From 798b7d235620a37d97c46382d40dab6c44fe4854 Mon Sep 17 00:00:00 2001 From: Mikhail Cherkasov Date: Fri, 4 Oct 2013 20:13:32 +0400 Subject: [PATCH 085/131] 8020688: Broken links in documentation at http://docs.oracle.com/javase/6/docs/api/index Reviewed-by: anthony, alexsch --- .../apple/applescript/AppleScriptEngine.java | 2 +- .../keys/content/x509/XMLX509SKI.java | 2 +- .../implementations/ResolverDirectHTTP.java | 2 +- jdk/src/share/classes/java/applet/Applet.java | 4 +- .../share/classes/java/applet/AppletStub.java | 4 +- jdk/src/share/classes/java/awt/Component.java | 16 +++---- jdk/src/share/classes/java/awt/Container.java | 2 +- .../java/awt/DefaultFocusTraversalPolicy.java | 2 +- .../java/awt/DefaultKeyboardFocusManager.java | 2 +- .../share/classes/java/awt/DisplayMode.java | 2 +- .../java/awt/FocusTraversalPolicy.java | 2 +- jdk/src/share/classes/java/awt/Font.java | 2 +- .../classes/java/awt/GraphicsDevice.java | 2 +- .../java/awt/KeyboardFocusManager.java | 2 +- jdk/src/share/classes/java/awt/Toolkit.java | 2 +- .../java/awt/datatransfer/DataFlavor.java | 2 +- .../java/awt/datatransfer/Transferable.java | 2 +- .../classes/java/awt/event/ActionEvent.java | 2 +- .../java/awt/event/ActionListener.java | 2 +- .../java/awt/event/ComponentAdapter.java | 2 +- .../java/awt/event/ComponentEvent.java | 2 +- .../java/awt/event/ComponentListener.java | 2 +- .../java/awt/event/ContainerAdapter.java | 2 +- .../java/awt/event/ContainerEvent.java | 2 +- .../java/awt/event/ContainerListener.java | 2 +- .../classes/java/awt/event/FocusAdapter.java | 2 +- .../classes/java/awt/event/FocusEvent.java | 2 +- .../classes/java/awt/event/FocusListener.java | 2 +- .../classes/java/awt/event/ItemEvent.java | 2 +- .../classes/java/awt/event/ItemListener.java | 2 +- .../classes/java/awt/event/KeyAdapter.java | 2 +- .../classes/java/awt/event/KeyEvent.java | 2 +- .../classes/java/awt/event/MouseAdapter.java | 2 +- .../classes/java/awt/event/MouseEvent.java | 4 +- .../classes/java/awt/event/MouseListener.java | 2 +- .../java/awt/event/MouseMotionAdapter.java | 2 +- .../java/awt/event/MouseMotionListener.java | 2 +- .../classes/java/awt/event/WindowAdapter.java | 2 +- .../classes/java/awt/event/WindowEvent.java | 2 +- .../java/awt/event/WindowFocusListener.java | 2 +- .../java/awt/event/WindowListener.java | 2 +- .../share/classes/java/awt/geom/Line2D.java | 2 +- .../classes/java/beans/Introspector.java | 2 +- jdk/src/share/classes/java/net/URI.java | 4 +- .../classes/java/text/DecimalFormat.java | 2 +- .../classes/java/text/SimpleDateFormat.java | 2 +- .../classes/javax/management/Descriptor.java | 2 +- .../classes/javax/swing/AbstractButton.java | 4 +- .../classes/javax/swing/BorderFactory.java | 2 +- .../javax/swing/BoundedRangeModel.java | 4 +- jdk/src/share/classes/javax/swing/Box.java | 2 +- .../share/classes/javax/swing/BoxLayout.java | 2 +- .../classes/javax/swing/ButtonGroup.java | 2 +- .../javax/swing/DefaultFocusManager.java | 2 +- .../classes/javax/swing/FocusManager.java | 2 +- .../share/classes/javax/swing/ImageIcon.java | 2 +- .../share/classes/javax/swing/JApplet.java | 4 +- .../share/classes/javax/swing/JButton.java | 4 +- .../share/classes/javax/swing/JCheckBox.java | 4 +- .../javax/swing/JCheckBoxMenuItem.java | 4 +- .../classes/javax/swing/JColorChooser.java | 2 +- .../share/classes/javax/swing/JComboBox.java | 8 ++-- .../share/classes/javax/swing/JComponent.java | 43 +++++++++---------- .../classes/javax/swing/JDesktopPane.java | 2 +- .../share/classes/javax/swing/JDialog.java | 4 +- .../classes/javax/swing/JEditorPane.java | 2 +- .../classes/javax/swing/JFileChooser.java | 2 +- jdk/src/share/classes/javax/swing/JFrame.java | 6 +-- .../classes/javax/swing/JInternalFrame.java | 2 +- jdk/src/share/classes/javax/swing/JLabel.java | 2 +- .../classes/javax/swing/JLayeredPane.java | 2 +- jdk/src/share/classes/javax/swing/JList.java | 6 +-- jdk/src/share/classes/javax/swing/JMenu.java | 4 +- .../share/classes/javax/swing/JMenuBar.java | 2 +- .../share/classes/javax/swing/JMenuItem.java | 4 +- .../classes/javax/swing/JOptionPane.java | 2 +- jdk/src/share/classes/javax/swing/JPanel.java | 2 +- .../classes/javax/swing/JPasswordField.java | 2 +- .../share/classes/javax/swing/JPopupMenu.java | 2 +- .../classes/javax/swing/JProgressBar.java | 4 +- .../classes/javax/swing/JRadioButton.java | 4 +- .../javax/swing/JRadioButtonMenuItem.java | 4 +- .../share/classes/javax/swing/JRootPane.java | 2 +- .../classes/javax/swing/JScrollPane.java | 2 +- .../share/classes/javax/swing/JSeparator.java | 2 +- .../share/classes/javax/swing/JSlider.java | 2 +- .../share/classes/javax/swing/JSpinner.java | 2 +- .../share/classes/javax/swing/JSplitPane.java | 2 +- .../classes/javax/swing/JTabbedPane.java | 2 +- jdk/src/share/classes/javax/swing/JTable.java | 6 +-- .../share/classes/javax/swing/JTextArea.java | 2 +- .../share/classes/javax/swing/JTextField.java | 2 +- .../share/classes/javax/swing/JTextPane.java | 2 +- .../classes/javax/swing/JToggleButton.java | 4 +- .../share/classes/javax/swing/JToolBar.java | 2 +- .../share/classes/javax/swing/JToolTip.java | 2 +- jdk/src/share/classes/javax/swing/JTree.java | 2 +- .../share/classes/javax/swing/JWindow.java | 2 +- .../classes/javax/swing/ProgressMonitor.java | 2 +- .../swing/ProgressMonitorInputStream.java | 2 +- jdk/src/share/classes/javax/swing/Spring.java | 2 +- .../classes/javax/swing/SpringLayout.java | 2 +- .../classes/javax/swing/SwingUtilities.java | 4 +- .../classes/javax/swing/SwingWorker.java | 2 +- jdk/src/share/classes/javax/swing/Timer.java | 2 +- .../classes/javax/swing/TransferHandler.java | 2 +- .../classes/javax/swing/WindowConstants.java | 2 +- .../classes/javax/swing/border/Border.java | 2 +- .../swing/event/InternalFrameAdapter.java | 2 +- .../javax/swing/event/InternalFrameEvent.java | 2 +- .../swing/event/InternalFrameListener.java | 2 +- .../javax/swing/event/TreeExpansionEvent.java | 4 +- .../swing/event/TreeExpansionListener.java | 2 +- .../javax/swing/event/TreeModelEvent.java | 2 +- .../javax/swing/event/TreeModelListener.java | 2 +- .../swing/event/TreeSelectionListener.java | 2 +- .../swing/event/TreeWillExpandListener.java | 2 +- .../javax/swing/filechooser/FileFilter.java | 2 +- .../javax/swing/filechooser/FileView.java | 2 +- .../swing/plaf/basic/BasicComboBoxUI.java | 3 +- .../swing/plaf/metal/MetalLookAndFeel.java | 2 +- .../classes/javax/swing/table/TableModel.java | 2 +- .../javax/swing/text/AbstractDocument.java | 8 ++-- .../javax/swing/text/DefaultCaret.java | 2 +- .../swing/text/DefaultStyledDocument.java | 8 ++-- .../javax/swing/text/JTextComponent.java | 6 +-- .../javax/swing/text/PlainDocument.java | 2 +- .../javax/swing/text/StyleContext.java | 12 +++--- .../javax/swing/text/html/HTMLDocument.java | 2 +- .../swing/tree/DefaultMutableTreeNode.java | 2 +- .../swing/tree/DefaultTreeCellRenderer.java | 2 +- .../javax/swing/tree/DefaultTreeModel.java | 2 +- .../javax/swing/tree/ExpandVetoException.java | 2 +- .../javax/swing/tree/TreeCellRenderer.java | 2 +- .../classes/javax/swing/tree/TreeModel.java | 2 +- .../classes/javax/swing/tree/TreeNode.java | 2 +- .../classes/javax/swing/tree/TreePath.java | 2 +- .../javax/swing/tree/TreeSelectionModel.java | 2 +- .../classes/sun/swing/PrintingStatus.java | 2 +- .../sun/text/normalizer/UCharacter.java | 2 +- .../jfc/FileChooserDemo/FileChooserDemo.java | 2 +- 141 files changed, 207 insertions(+), 213 deletions(-) diff --git a/jdk/src/macosx/classes/apple/applescript/AppleScriptEngine.java b/jdk/src/macosx/classes/apple/applescript/AppleScriptEngine.java index 917037b7998..e50f218ef7f 100644 --- a/jdk/src/macosx/classes/apple/applescript/AppleScriptEngine.java +++ b/jdk/src/macosx/classes/apple/applescript/AppleScriptEngine.java @@ -155,7 +155,7 @@ public class AppleScriptEngine implements ScriptEngine { TRACE("init()"); // set up our context /* TODO -- name of current executable? bad java documentation at: - * http://java.sun.com/javase/6/docs/api/javax/script/ScriptEngine.html#FILENAME */ + * http://docs.oracle.com/javase/6/docs/api/javax/script/ScriptEngine.html#FILENAME */ put(ScriptEngine.FILENAME, ""); put(ScriptEngine.ENGINE, getEngine()); put(ScriptEngine.ENGINE_VERSION, getEngineVersion()); diff --git a/jdk/src/share/classes/com/sun/org/apache/xml/internal/security/keys/content/x509/XMLX509SKI.java b/jdk/src/share/classes/com/sun/org/apache/xml/internal/security/keys/content/x509/XMLX509SKI.java index e4617daead9..6030c966373 100644 --- a/jdk/src/share/classes/com/sun/org/apache/xml/internal/security/keys/content/x509/XMLX509SKI.java +++ b/jdk/src/share/classes/com/sun/org/apache/xml/internal/security/keys/content/x509/XMLX509SKI.java @@ -35,7 +35,7 @@ import org.w3c.dom.Element; /** * Handles SubjectKeyIdentifier (SKI) for X.509v3. * - * @see + * @see * Interface X509Extension */ public class XMLX509SKI extends SignatureElementProxy implements XMLX509DataContent { diff --git a/jdk/src/share/classes/com/sun/org/apache/xml/internal/security/utils/resolver/implementations/ResolverDirectHTTP.java b/jdk/src/share/classes/com/sun/org/apache/xml/internal/security/utils/resolver/implementations/ResolverDirectHTTP.java index cd0967215a7..a3359bdc675 100644 --- a/jdk/src/share/classes/com/sun/org/apache/xml/internal/security/utils/resolver/implementations/ResolverDirectHTTP.java +++ b/jdk/src/share/classes/com/sun/org/apache/xml/internal/security/utils/resolver/implementations/ResolverDirectHTTP.java @@ -56,7 +56,7 @@ import com.sun.org.apache.xml.internal.security.utils.resolver.ResourceResolverS * * * @see Java Tip 42: Write Java apps that work with proxy-based firewalls - * @see SUN J2SE docs for network properties + * @see SUN J2SE docs for network properties * @see The JAVA FAQ Question 9.5: How do I make Java work with a proxy server? */ public class ResolverDirectHTTP extends ResourceResolverSpi { diff --git a/jdk/src/share/classes/java/applet/Applet.java b/jdk/src/share/classes/java/applet/Applet.java index ff9389f36f3..2e8e39a19ff 100644 --- a/jdk/src/share/classes/java/applet/Applet.java +++ b/jdk/src/share/classes/java/applet/Applet.java @@ -143,11 +143,11 @@ public class Applet extends Panel { * For example, suppose an applet is contained * within the document: *
          -     *    http://java.sun.com/products/jdk/1.2/index.html
          +     *    http://www.oracle.com/technetwork/java/index.html
                * 
          * The document base is: *
          -     *    http://java.sun.com/products/jdk/1.2/index.html
          +     *    http://www.oracle.com/technetwork/java/index.html
                * 
          * * @return the {@link java.net.URL} of the document that contains this diff --git a/jdk/src/share/classes/java/applet/AppletStub.java b/jdk/src/share/classes/java/applet/AppletStub.java index 0887a586bdc..a1a31ad3cd8 100644 --- a/jdk/src/share/classes/java/applet/AppletStub.java +++ b/jdk/src/share/classes/java/applet/AppletStub.java @@ -54,11 +54,11 @@ public interface AppletStub { * For example, suppose an applet is contained * within the document: *
          -     *    http://java.sun.com/products/jdk/1.2/index.html
          +     *    http://www.oracle.com/technetwork/java/index.html
                * 
          * The document base is: *
          -     *    http://java.sun.com/products/jdk/1.2/index.html
          +     *    http://www.oracle.com/technetwork/java/index.html
                * 
          * * @return the {@link java.net.URL} of the document that contains the diff --git a/jdk/src/share/classes/java/awt/Component.java b/jdk/src/share/classes/java/awt/Component.java index 64a753844d7..040f848437f 100644 --- a/jdk/src/share/classes/java/awt/Component.java +++ b/jdk/src/share/classes/java/awt/Component.java @@ -173,10 +173,10 @@ import sun.util.logging.PlatformLogger; * Note: For more information on the paint mechanisms utilitized * by AWT and Swing, including information on how to write the most * efficient painting code, see - * Painting in AWT and Swing. + * Painting in AWT and Swing. *

          * For details on the focus subsystem, see - * + * * How to Use the Focus Subsystem, * a section in The Java Tutorial, and the * Focus Specification @@ -3205,7 +3205,7 @@ public abstract class Component implements ImageObserver, MenuContainer, * Note: For more information on the paint mechanisms utilitized * by AWT and Swing, including information on how to write the most * efficient painting code, see - * Painting in AWT and Swing. + * Painting in AWT and Swing. * * @param g the graphics context to use for painting * @see #update @@ -3240,7 +3240,7 @@ public abstract class Component implements ImageObserver, MenuContainer, * Note: For more information on the paint mechanisms utilitized * by AWT and Swing, including information on how to write the most * efficient painting code, see - * Painting in AWT and Swing. + * Painting in AWT and Swing. * * @param g the specified context to use for updating * @see #paint @@ -3301,7 +3301,7 @@ public abstract class Component implements ImageObserver, MenuContainer, * Note: For more information on the paint mechanisms utilitized * by AWT and Swing, including information on how to write the most * efficient painting code, see - * Painting in AWT and Swing. + * Painting in AWT and Swing. * * @see #update(Graphics) @@ -3319,7 +3319,7 @@ public abstract class Component implements ImageObserver, MenuContainer, * Note: For more information on the paint mechanisms utilitized * by AWT and Swing, including information on how to write the most * efficient painting code, see - * Painting in AWT and Swing. + * Painting in AWT and Swing. * * @param tm maximum time in milliseconds before update * @see #paint @@ -3341,7 +3341,7 @@ public abstract class Component implements ImageObserver, MenuContainer, * Note: For more information on the paint mechanisms utilitized * by AWT and Swing, including information on how to write the most * efficient painting code, see - * Painting in AWT and Swing. + * Painting in AWT and Swing. * * @param x the x coordinate * @param y the y coordinate @@ -3366,7 +3366,7 @@ public abstract class Component implements ImageObserver, MenuContainer, * Note: For more information on the paint mechanisms utilitized * by AWT and Swing, including information on how to write the most * efficient painting code, see - * Painting in AWT and Swing. + * Painting in AWT and Swing. * * @param tm maximum time in milliseconds before update * @param x the x coordinate diff --git a/jdk/src/share/classes/java/awt/Container.java b/jdk/src/share/classes/java/awt/Container.java index 14bd55dae5c..82b682db78e 100644 --- a/jdk/src/share/classes/java/awt/Container.java +++ b/jdk/src/share/classes/java/awt/Container.java @@ -75,7 +75,7 @@ import sun.security.action.GetBooleanAction; * (and hence to the bottom of the stacking order). *

          * Note: For details on the focus subsystem, see - * + * * How to Use the Focus Subsystem, * a section in The Java Tutorial, and the * Focus Specification diff --git a/jdk/src/share/classes/java/awt/DefaultFocusTraversalPolicy.java b/jdk/src/share/classes/java/awt/DefaultFocusTraversalPolicy.java index 0c30fe9b138..ae9dd910ee7 100644 --- a/jdk/src/share/classes/java/awt/DefaultFocusTraversalPolicy.java +++ b/jdk/src/share/classes/java/awt/DefaultFocusTraversalPolicy.java @@ -54,7 +54,7 @@ import java.awt.peer.ComponentPeer; * impact, the focusability of the Component itself. *

          * Please see - * + * * How to Use the Focus Subsystem, * a section in The Java Tutorial, and the * Focus Specification diff --git a/jdk/src/share/classes/java/awt/DefaultKeyboardFocusManager.java b/jdk/src/share/classes/java/awt/DefaultKeyboardFocusManager.java index 4e07f16fa13..040e659289a 100644 --- a/jdk/src/share/classes/java/awt/DefaultKeyboardFocusManager.java +++ b/jdk/src/share/classes/java/awt/DefaultKeyboardFocusManager.java @@ -49,7 +49,7 @@ import sun.awt.TimedWindowEvent; * Container's FocusTraversalPolicy. *

          * Please see - * + * * How to Use the Focus Subsystem, * a section in The Java Tutorial, and the * Focus Specification diff --git a/jdk/src/share/classes/java/awt/DisplayMode.java b/jdk/src/share/classes/java/awt/DisplayMode.java index c4bd09530e0..71a5d7e8122 100644 --- a/jdk/src/share/classes/java/awt/DisplayMode.java +++ b/jdk/src/share/classes/java/awt/DisplayMode.java @@ -35,7 +35,7 @@ import java.lang.annotation.Native; * (see {@link GraphicsDevice#isDisplayChangeSupported}). *

          * For more information on full-screen exclusive mode API, see the - * + * * Full-Screen Exclusive Mode API Tutorial. * * @see GraphicsDevice diff --git a/jdk/src/share/classes/java/awt/FocusTraversalPolicy.java b/jdk/src/share/classes/java/awt/FocusTraversalPolicy.java index 6b7f4e97e9d..0d8323bc16e 100644 --- a/jdk/src/share/classes/java/awt/FocusTraversalPolicy.java +++ b/jdk/src/share/classes/java/awt/FocusTraversalPolicy.java @@ -49,7 +49,7 @@ package java.awt; * policy is used to perform the search operation. *

          * Please see - * + * * How to Use the Focus Subsystem, * a section in The Java Tutorial, and the * Focus Specification diff --git a/jdk/src/share/classes/java/awt/Font.java b/jdk/src/share/classes/java/awt/Font.java index 67b09fa2868..3908b075c15 100644 --- a/jdk/src/share/classes/java/awt/Font.java +++ b/jdk/src/share/classes/java/awt/Font.java @@ -127,7 +127,7 @@ import static sun.font.EAttribute.*; *

          * For a discussion of the relative advantages and disadvantages of using * physical or logical fonts, see the - * Internationalization FAQ + * Internationalization FAQ * document. * *

          Font Faces and Names

          diff --git a/jdk/src/share/classes/java/awt/GraphicsDevice.java b/jdk/src/share/classes/java/awt/GraphicsDevice.java index c619a2aee19..cebac4abc6b 100644 --- a/jdk/src/share/classes/java/awt/GraphicsDevice.java +++ b/jdk/src/share/classes/java/awt/GraphicsDevice.java @@ -69,7 +69,7 @@ import sun.awt.SunToolkit; * *

          * For more information on full-screen exclusive mode API, see the - * + * * Full-Screen Exclusive Mode API Tutorial. * * @see GraphicsEnvironment diff --git a/jdk/src/share/classes/java/awt/KeyboardFocusManager.java b/jdk/src/share/classes/java/awt/KeyboardFocusManager.java index 72c3fdb4956..83e5933fefa 100644 --- a/jdk/src/share/classes/java/awt/KeyboardFocusManager.java +++ b/jdk/src/share/classes/java/awt/KeyboardFocusManager.java @@ -88,7 +88,7 @@ import sun.awt.AWTAccessor; * ClassLoader. *

          * Please see - * + * * How to Use the Focus Subsystem, * a section in The Java Tutorial, and the * Focus Specification diff --git a/jdk/src/share/classes/java/awt/Toolkit.java b/jdk/src/share/classes/java/awt/Toolkit.java index de14eef1fea..606df3ed154 100644 --- a/jdk/src/share/classes/java/awt/Toolkit.java +++ b/jdk/src/share/classes/java/awt/Toolkit.java @@ -83,7 +83,7 @@ import sun.util.CoreResourceBundleControl; *

          *

        • Moving the focus from one component to another. *
          For more information, see - * Timing + * Timing * Focus Transfers, a section in * The Swing * Tutorial. diff --git a/jdk/src/share/classes/java/awt/datatransfer/DataFlavor.java b/jdk/src/share/classes/java/awt/datatransfer/DataFlavor.java index 7f1b388d377..ac1403348d7 100644 --- a/jdk/src/share/classes/java/awt/datatransfer/DataFlavor.java +++ b/jdk/src/share/classes/java/awt/datatransfer/DataFlavor.java @@ -90,7 +90,7 @@ import sun.awt.datatransfer.DataTransferer; * the same results. *

          * For more information on the using data transfer with Swing see - * the + * the * How to Use Drag and Drop and Data Transfer, * section in Java Tutorial. * diff --git a/jdk/src/share/classes/java/awt/datatransfer/Transferable.java b/jdk/src/share/classes/java/awt/datatransfer/Transferable.java index 56377da82a9..3c5219ddb1d 100644 --- a/jdk/src/share/classes/java/awt/datatransfer/Transferable.java +++ b/jdk/src/share/classes/java/awt/datatransfer/Transferable.java @@ -32,7 +32,7 @@ import java.io.IOException; * for a transfer operation. *

          * For information on using data transfer with Swing, see - * + * * How to Use Drag and Drop and Data Transfer, * a section in The Java Tutorial, for more information. * diff --git a/jdk/src/share/classes/java/awt/event/ActionEvent.java b/jdk/src/share/classes/java/awt/event/ActionEvent.java index 08bd8db95b0..d549db020ca 100644 --- a/jdk/src/share/classes/java/awt/event/ActionEvent.java +++ b/jdk/src/share/classes/java/awt/event/ActionEvent.java @@ -52,7 +52,7 @@ import java.lang.annotation.Native; * in the range from {@code ACTION_FIRST} to {@code ACTION_LAST}. * * @see ActionListener - * @see Tutorial: How to Write an Action Listener + * @see Tutorial: How to Write an Action Listener * * @author Carl Quinn * @since 1.1 diff --git a/jdk/src/share/classes/java/awt/event/ActionListener.java b/jdk/src/share/classes/java/awt/event/ActionListener.java index 78574c22b49..cb766d3134f 100644 --- a/jdk/src/share/classes/java/awt/event/ActionListener.java +++ b/jdk/src/share/classes/java/awt/event/ActionListener.java @@ -37,7 +37,7 @@ import java.util.EventListener; * invoked. * * @see ActionEvent - * @see Tutorial: Java 1.1 Event Model + * @see How to Write an Action Listener * * @author Carl Quinn * @since 1.1 diff --git a/jdk/src/share/classes/java/awt/event/ComponentAdapter.java b/jdk/src/share/classes/java/awt/event/ComponentAdapter.java index 46597dac97b..028b8d3140a 100644 --- a/jdk/src/share/classes/java/awt/event/ComponentAdapter.java +++ b/jdk/src/share/classes/java/awt/event/ComponentAdapter.java @@ -44,7 +44,7 @@ package java.awt.event; * * @see ComponentEvent * @see ComponentListener - * @see Tutorial: Writing a Component Listener + * @see Tutorial: Writing a Component Listener * * @author Carl Quinn * @since 1.1 diff --git a/jdk/src/share/classes/java/awt/event/ComponentEvent.java b/jdk/src/share/classes/java/awt/event/ComponentEvent.java index 67149a7a3af..d168f6c1763 100644 --- a/jdk/src/share/classes/java/awt/event/ComponentEvent.java +++ b/jdk/src/share/classes/java/awt/event/ComponentEvent.java @@ -60,7 +60,7 @@ import java.lang.annotation.Native; * * @see ComponentAdapter * @see ComponentListener - * @see Tutorial: Writing a Component Listener + * @see Tutorial: Writing a Component Listener * * @author Carl Quinn * @since 1.1 diff --git a/jdk/src/share/classes/java/awt/event/ComponentListener.java b/jdk/src/share/classes/java/awt/event/ComponentListener.java index a64a1aac493..8f0aad14875 100644 --- a/jdk/src/share/classes/java/awt/event/ComponentListener.java +++ b/jdk/src/share/classes/java/awt/event/ComponentListener.java @@ -46,7 +46,7 @@ import java.util.EventListener; * * @see ComponentAdapter * @see ComponentEvent - * @see Tutorial: Writing a Component Listener + * @see Tutorial: Writing a Component Listener * * @author Carl Quinn * @since 1.1 diff --git a/jdk/src/share/classes/java/awt/event/ContainerAdapter.java b/jdk/src/share/classes/java/awt/event/ContainerAdapter.java index 3ce3b4defb7..61f6c301744 100644 --- a/jdk/src/share/classes/java/awt/event/ContainerAdapter.java +++ b/jdk/src/share/classes/java/awt/event/ContainerAdapter.java @@ -44,7 +44,7 @@ package java.awt.event; * * @see ContainerEvent * @see ContainerListener - * @see Tutorial: Writing a Container Listener + * @see Tutorial: Writing a Container Listener * * @author Amy Fowler * @since 1.1 diff --git a/jdk/src/share/classes/java/awt/event/ContainerEvent.java b/jdk/src/share/classes/java/awt/event/ContainerEvent.java index 655acadb13c..2d07046f45e 100644 --- a/jdk/src/share/classes/java/awt/event/ContainerEvent.java +++ b/jdk/src/share/classes/java/awt/event/ContainerEvent.java @@ -52,7 +52,7 @@ import java.awt.Component; * * @see ContainerAdapter * @see ContainerListener - * @see Tutorial: Writing a Container Listener + * @see Tutorial: Writing a Container Listener * * @author Tim Prinzing * @author Amy Fowler diff --git a/jdk/src/share/classes/java/awt/event/ContainerListener.java b/jdk/src/share/classes/java/awt/event/ContainerListener.java index 6fb8321589b..3692e40513a 100644 --- a/jdk/src/share/classes/java/awt/event/ContainerListener.java +++ b/jdk/src/share/classes/java/awt/event/ContainerListener.java @@ -46,7 +46,7 @@ import java.util.EventListener; * * @see ContainerAdapter * @see ContainerEvent - * @see Tutorial: Writing a Container Listener + * @see Tutorial: Writing a Container Listener * * @author Tim Prinzing * @author Amy Fowler diff --git a/jdk/src/share/classes/java/awt/event/FocusAdapter.java b/jdk/src/share/classes/java/awt/event/FocusAdapter.java index 00d9b4fa95d..7511da7799f 100644 --- a/jdk/src/share/classes/java/awt/event/FocusAdapter.java +++ b/jdk/src/share/classes/java/awt/event/FocusAdapter.java @@ -44,7 +44,7 @@ package java.awt.event; * * @see FocusEvent * @see FocusListener - * @see Tutorial: Writing a Focus Listener + * @see Tutorial: Writing a Focus Listener * * @author Carl Quinn * @since 1.1 diff --git a/jdk/src/share/classes/java/awt/event/FocusEvent.java b/jdk/src/share/classes/java/awt/event/FocusEvent.java index e70b9684bdc..2f9e1911c99 100644 --- a/jdk/src/share/classes/java/awt/event/FocusEvent.java +++ b/jdk/src/share/classes/java/awt/event/FocusEvent.java @@ -57,7 +57,7 @@ import sun.awt.SunToolkit; * * @see FocusAdapter * @see FocusListener - * @see Tutorial: Writing a Focus Listener + * @see Tutorial: Writing a Focus Listener * * @author Carl Quinn * @author Amy Fowler diff --git a/jdk/src/share/classes/java/awt/event/FocusListener.java b/jdk/src/share/classes/java/awt/event/FocusListener.java index 5f71d501dcc..9183425d3ef 100644 --- a/jdk/src/share/classes/java/awt/event/FocusListener.java +++ b/jdk/src/share/classes/java/awt/event/FocusListener.java @@ -42,7 +42,7 @@ import java.util.EventListener; * * @see FocusAdapter * @see FocusEvent - * @see Tutorial: Writing a Focus Listener + * @see Tutorial: Writing a Focus Listener * * @author Carl Quinn * @since 1.1 diff --git a/jdk/src/share/classes/java/awt/event/ItemEvent.java b/jdk/src/share/classes/java/awt/event/ItemEvent.java index b7c7e5e2165..2caee9e79a5 100644 --- a/jdk/src/share/classes/java/awt/event/ItemEvent.java +++ b/jdk/src/share/classes/java/awt/event/ItemEvent.java @@ -58,7 +58,7 @@ import java.awt.ItemSelectable; * * @see java.awt.ItemSelectable * @see ItemListener - * @see Tutorial: Writing an Item Listener + * @see Tutorial: Writing an Item Listener * * @since 1.1 */ diff --git a/jdk/src/share/classes/java/awt/event/ItemListener.java b/jdk/src/share/classes/java/awt/event/ItemListener.java index 8a8d3cb4f78..3cc7fa88671 100644 --- a/jdk/src/share/classes/java/awt/event/ItemListener.java +++ b/jdk/src/share/classes/java/awt/event/ItemListener.java @@ -40,7 +40,7 @@ import java.util.EventListener; * * @see java.awt.ItemSelectable * @see ItemEvent - * @see Tutorial: Writing an Item Listener + * @see Tutorial: Writing an Item Listener * * @since 1.1 */ diff --git a/jdk/src/share/classes/java/awt/event/KeyAdapter.java b/jdk/src/share/classes/java/awt/event/KeyAdapter.java index c888101b3d0..3c0d61ca983 100644 --- a/jdk/src/share/classes/java/awt/event/KeyAdapter.java +++ b/jdk/src/share/classes/java/awt/event/KeyAdapter.java @@ -46,7 +46,7 @@ package java.awt.event; * * @see KeyEvent * @see KeyListener - * @see Tutorial: Writing a Key Listener + * @see Tutorial: Writing a Key Listener * * @since 1.1 */ diff --git a/jdk/src/share/classes/java/awt/event/KeyEvent.java b/jdk/src/share/classes/java/awt/event/KeyEvent.java index bef1037d7bb..5f88e3a9165 100644 --- a/jdk/src/share/classes/java/awt/event/KeyEvent.java +++ b/jdk/src/share/classes/java/awt/event/KeyEvent.java @@ -145,7 +145,7 @@ import sun.awt.AWTAccessor; * * @see KeyAdapter * @see KeyListener - * @see Tutorial: Writing a Key Listener + * @see Tutorial: Writing a Key Listener * * @since 1.1 */ diff --git a/jdk/src/share/classes/java/awt/event/MouseAdapter.java b/jdk/src/share/classes/java/awt/event/MouseAdapter.java index e4de8dbc276..b908a6626df 100644 --- a/jdk/src/share/classes/java/awt/event/MouseAdapter.java +++ b/jdk/src/share/classes/java/awt/event/MouseAdapter.java @@ -63,7 +63,7 @@ package java.awt.event; * @see MouseListener * @see MouseMotionListener * @see MouseWheelListener - * @see Tutorial: Writing a Mouse Listener + * @see Tutorial: Writing a Mouse Listener * * @since 1.1 */ diff --git a/jdk/src/share/classes/java/awt/event/MouseEvent.java b/jdk/src/share/classes/java/awt/event/MouseEvent.java index 15cb6ee0309..5ad1d1753a3 100644 --- a/jdk/src/share/classes/java/awt/event/MouseEvent.java +++ b/jdk/src/share/classes/java/awt/event/MouseEvent.java @@ -182,8 +182,8 @@ import sun.awt.SunToolkit; * @see MouseMotionAdapter * @see MouseMotionListener * @see MouseWheelListener - * @see Tutorial: Writing a Mouse Listener - * @see Tutorial: Writing a Mouse Motion Listener + * @see Tutorial: Writing a Mouse Listener + * @see Tutorial: Writing a Mouse Motion Listener * * @since 1.1 */ diff --git a/jdk/src/share/classes/java/awt/event/MouseListener.java b/jdk/src/share/classes/java/awt/event/MouseListener.java index a9605fc9ab6..534ed392aa8 100644 --- a/jdk/src/share/classes/java/awt/event/MouseListener.java +++ b/jdk/src/share/classes/java/awt/event/MouseListener.java @@ -50,7 +50,7 @@ import java.util.EventListener; * * @see MouseAdapter * @see MouseEvent - * @see Tutorial: Writing a Mouse Listener + * @see Tutorial: Writing a Mouse Listener * * @since 1.1 */ diff --git a/jdk/src/share/classes/java/awt/event/MouseMotionAdapter.java b/jdk/src/share/classes/java/awt/event/MouseMotionAdapter.java index d19bced786c..e349c9d2d26 100644 --- a/jdk/src/share/classes/java/awt/event/MouseMotionAdapter.java +++ b/jdk/src/share/classes/java/awt/event/MouseMotionAdapter.java @@ -49,7 +49,7 @@ package java.awt.event; * * @see MouseEvent * @see MouseMotionListener - * @see Tutorial: Writing a Mouse Motion Listener + * @see Tutorial: Writing a Mouse Motion Listener * * @since 1.1 */ diff --git a/jdk/src/share/classes/java/awt/event/MouseMotionListener.java b/jdk/src/share/classes/java/awt/event/MouseMotionListener.java index 4b8ff0899cb..8bfb15234cb 100644 --- a/jdk/src/share/classes/java/awt/event/MouseMotionListener.java +++ b/jdk/src/share/classes/java/awt/event/MouseMotionListener.java @@ -47,7 +47,7 @@ import java.util.EventListener; * * @see MouseMotionAdapter * @see MouseEvent - * @see Tutorial: Writing a Mouse Motion Listener + * @see Tutorial: Writing a Mouse Motion Listener * * @since 1.1 */ diff --git a/jdk/src/share/classes/java/awt/event/WindowAdapter.java b/jdk/src/share/classes/java/awt/event/WindowAdapter.java index 38c56363d20..131431df477 100644 --- a/jdk/src/share/classes/java/awt/event/WindowAdapter.java +++ b/jdk/src/share/classes/java/awt/event/WindowAdapter.java @@ -45,7 +45,7 @@ package java.awt.event; * * @see WindowEvent * @see WindowListener - * @see Tutorial: Writing a Window Listener + * @see Tutorial: Writing a Window Listener * * @author Carl Quinn * @author Amy Fowler diff --git a/jdk/src/share/classes/java/awt/event/WindowEvent.java b/jdk/src/share/classes/java/awt/event/WindowEvent.java index 49e45f3991b..ef5082937f2 100644 --- a/jdk/src/share/classes/java/awt/event/WindowEvent.java +++ b/jdk/src/share/classes/java/awt/event/WindowEvent.java @@ -52,7 +52,7 @@ import sun.awt.SunToolkit; * * @see WindowAdapter * @see WindowListener - * @see Tutorial: Writing a Window Listener + * @see Tutorial: Writing a Window Listener * * @since JDK1.1 */ diff --git a/jdk/src/share/classes/java/awt/event/WindowFocusListener.java b/jdk/src/share/classes/java/awt/event/WindowFocusListener.java index 9835a6bf234..22bba010eb4 100644 --- a/jdk/src/share/classes/java/awt/event/WindowFocusListener.java +++ b/jdk/src/share/classes/java/awt/event/WindowFocusListener.java @@ -47,7 +47,7 @@ import java.util.EventListener; * * @see WindowAdapter * @see WindowEvent - * @see Tutorial: Writing a Window Listener + * @see Tutorial: Writing a Window Listener * * @since 1.4 */ diff --git a/jdk/src/share/classes/java/awt/event/WindowListener.java b/jdk/src/share/classes/java/awt/event/WindowListener.java index 4b3ff7c1a6c..9f752a394f4 100644 --- a/jdk/src/share/classes/java/awt/event/WindowListener.java +++ b/jdk/src/share/classes/java/awt/event/WindowListener.java @@ -44,7 +44,7 @@ import java.util.EventListener; * * @see WindowAdapter * @see WindowEvent - * @see Tutorial: How to Write Window Listeners + * @see Tutorial: How to Write Window Listeners * * @since 1.1 */ diff --git a/jdk/src/share/classes/java/awt/geom/Line2D.java b/jdk/src/share/classes/java/awt/geom/Line2D.java index 35f70ad5d4d..a34e7941479 100644 --- a/jdk/src/share/classes/java/awt/geom/Line2D.java +++ b/jdk/src/share/classes/java/awt/geom/Line2D.java @@ -35,7 +35,7 @@ import java.io.Serializable; * default coordinate system called user space in which the y-axis * values increase downward and x-axis values increase to the right. For * more information on the user space coordinate system, see the - * + * * Coordinate Systems section of the Java 2D Programmer's Guide. *

          * This class is only the abstract superclass for all objects that diff --git a/jdk/src/share/classes/java/beans/Introspector.java b/jdk/src/share/classes/java/beans/Introspector.java index acc0f77f389..fc8b21856d6 100644 --- a/jdk/src/share/classes/java/beans/Introspector.java +++ b/jdk/src/share/classes/java/beans/Introspector.java @@ -87,7 +87,7 @@ import sun.reflect.misc.ReflectUtil; *

          * For more information about introspection and design patterns, please * consult the - * JavaBeans™ specification. + * JavaBeans™ specification. */ public class Introspector { diff --git a/jdk/src/share/classes/java/net/URI.java b/jdk/src/share/classes/java/net/URI.java index 77c2f7a178f..71c4f6dc5de 100644 --- a/jdk/src/share/classes/java/net/URI.java +++ b/jdk/src/share/classes/java/net/URI.java @@ -188,7 +188,7 @@ import java.lang.NullPointerException; // for javadoc * URI * *

          - * {@code http://java.sun.com/j2se/1.3/docs/guide/collections/designfaq.html#28} + * {@code http://docs.oracle.com/javase/1.3/docs/guide/collections/designfaq.html#28} *
          * * Resolving the relative URI @@ -227,7 +227,7 @@ import java.lang.NullPointerException; // for javadoc * possible. For example, relativizing the URI * *
          - * {@code http://java.sun.com/j2se/1.3/docs/guide/index.html} + * {@code http://docs.oracle.com/javase/1.3/docs/guide/index.html} *
          * * against the base URI diff --git a/jdk/src/share/classes/java/text/DecimalFormat.java b/jdk/src/share/classes/java/text/DecimalFormat.java index c22e47212bb..f89fd151749 100644 --- a/jdk/src/share/classes/java/text/DecimalFormat.java +++ b/jdk/src/share/classes/java/text/DecimalFormat.java @@ -371,7 +371,7 @@ import sun.util.locale.provider.ResourceBundleBasedAdapter; * } * } * - * @see Java Tutorial + * @see Java Tutorial * @see NumberFormat * @see DecimalFormatSymbols * @see ParsePosition diff --git a/jdk/src/share/classes/java/text/SimpleDateFormat.java b/jdk/src/share/classes/java/text/SimpleDateFormat.java index 5472b0a70d3..fa9f673b8b8 100644 --- a/jdk/src/share/classes/java/text/SimpleDateFormat.java +++ b/jdk/src/share/classes/java/text/SimpleDateFormat.java @@ -412,7 +412,7 @@ import sun.util.locale.provider.LocaleProviderAdapter; * If multiple threads access a format concurrently, it must be synchronized * externally. * - * @see Java Tutorial + * @see Java Tutorial * @see java.util.Calendar * @see java.util.TimeZone * @see DateFormat diff --git a/jdk/src/share/classes/javax/management/Descriptor.java b/jdk/src/share/classes/javax/management/Descriptor.java index 2337e2eb166..b07447ad590 100644 --- a/jdk/src/share/classes/javax/management/Descriptor.java +++ b/jdk/src/share/classes/javax/management/Descriptor.java @@ -319,7 +319,7 @@ import javax.management.openmbean.OpenType; * {@code ModelMBeanOperationInfo}, as * well as the chapter "Model MBeans" of the JMX + * href="http://www.oracle.com/technetwork/java/javase/tech/javamanagement-140525.html">JMX * Specification. The following table summarizes these fields. Note * that when the Type in this table is Number, a String that is the decimal * representation of a Long can also be used.

          diff --git a/jdk/src/share/classes/javax/swing/AbstractButton.java b/jdk/src/share/classes/javax/swing/AbstractButton.java index b8612f1280a..9678148e394 100644 --- a/jdk/src/share/classes/javax/swing/AbstractButton.java +++ b/jdk/src/share/classes/javax/swing/AbstractButton.java @@ -53,12 +53,12 @@ import java.util.*; * configuring a button. Refer to * Swing Components Supporting Action for more * details, and you can find more information in How + * href="http://docs.oracle.com/javase/tutorial/uiswing/misc/action.html">How * to Use Actions, a section in The Java Tutorial. *

          * For further information see * How to Use Buttons, Check Boxes, and Radio Buttons, + href="http://docs.oracle.com/javase/tutorial/uiswing/components/button.html">How to Use Buttons, Check Boxes, and Radio Buttons, * a section in The Java Tutorial. *

          * Warning: diff --git a/jdk/src/share/classes/javax/swing/BorderFactory.java b/jdk/src/share/classes/javax/swing/BorderFactory.java index 33b1b0024d9..1a1e4ab3b0e 100644 --- a/jdk/src/share/classes/javax/swing/BorderFactory.java +++ b/jdk/src/share/classes/javax/swing/BorderFactory.java @@ -35,7 +35,7 @@ import javax.swing.border.*; * possible, this factory will hand out references to shared * Border instances. * For further information and examples see - * How + * How to Use Borders, * a section in The Java Tutorial. * diff --git a/jdk/src/share/classes/javax/swing/BoundedRangeModel.java b/jdk/src/share/classes/javax/swing/BoundedRangeModel.java index 3d077fcd1f7..c8348b9ca26 100644 --- a/jdk/src/share/classes/javax/swing/BoundedRangeModel.java +++ b/jdk/src/share/classes/javax/swing/BoundedRangeModel.java @@ -71,8 +71,8 @@ import javax.swing.event.*; * * For an example of specifying custom bounded range models used by sliders, * see The Anatomy of a Swing-Based Program - * in The Java Tutorial. + href="http://www.oracle.com/technetwork/java/architecture-142923.html#separable">Separable model architecture + * in A Swing Architecture Overview. * * @author Hans Muller * @see DefaultBoundedRangeModel diff --git a/jdk/src/share/classes/javax/swing/Box.java b/jdk/src/share/classes/javax/swing/Box.java index d1c132364b6..812582a378e 100644 --- a/jdk/src/share/classes/javax/swing/Box.java +++ b/jdk/src/share/classes/javax/swing/Box.java @@ -60,7 +60,7 @@ import javax.accessibility.*; * If you are implementing a BoxLayout you * can find further information and examples in * How to Use BoxLayout, + href="http://docs.oracle.com/javase/tutorial/uiswing/layout/box.html">How to Use BoxLayout, * a section in The Java Tutorial. *

          * Warning: diff --git a/jdk/src/share/classes/javax/swing/BoxLayout.java b/jdk/src/share/classes/javax/swing/BoxLayout.java index de1703d5b76..9d7fbf7000e 100644 --- a/jdk/src/share/classes/javax/swing/BoxLayout.java +++ b/jdk/src/share/classes/javax/swing/BoxLayout.java @@ -116,7 +116,7 @@ import java.io.PrintStream; *

          * For further information and examples see * How to Use BoxLayout, + href="http://docs.oracle.com/javase/tutorial/uiswing/layout/box.html">How to Use BoxLayout, * a section in The Java Tutorial. *

          * Warning: diff --git a/jdk/src/share/classes/javax/swing/ButtonGroup.java b/jdk/src/share/classes/javax/swing/ButtonGroup.java index c2971f722e4..2dce82e9889 100644 --- a/jdk/src/share/classes/javax/swing/ButtonGroup.java +++ b/jdk/src/share/classes/javax/swing/ButtonGroup.java @@ -51,7 +51,7 @@ import java.io.Serializable; * Initially, all buttons in the group are unselected. *

          * For examples and further information on using button groups see - * How to Use Radio Buttons, + * How to Use Radio Buttons, * a section in The Java Tutorial. *

          * Warning: diff --git a/jdk/src/share/classes/javax/swing/DefaultFocusManager.java b/jdk/src/share/classes/javax/swing/DefaultFocusManager.java index 91304aafbd8..4ebc54a9090 100644 --- a/jdk/src/share/classes/javax/swing/DefaultFocusManager.java +++ b/jdk/src/share/classes/javax/swing/DefaultFocusManager.java @@ -37,7 +37,7 @@ import java.util.Comparator; * java.awt.DefaultKeyboardFocusManager instead. *

          * Please see - * + * * How to Use the Focus Subsystem, * a section in The Java Tutorial, and the * Focus Specification diff --git a/jdk/src/share/classes/javax/swing/FocusManager.java b/jdk/src/share/classes/javax/swing/FocusManager.java index 6afb84f61eb..554a1553190 100644 --- a/jdk/src/share/classes/javax/swing/FocusManager.java +++ b/jdk/src/share/classes/javax/swing/FocusManager.java @@ -34,7 +34,7 @@ import java.awt.*; * java.awt.DefaultKeyboardFocusManager instead. *

          * Please see - * + * * How to Use the Focus Subsystem, * a section in The Java Tutorial, and the * Focus Specification diff --git a/jdk/src/share/classes/javax/swing/ImageIcon.java b/jdk/src/share/classes/javax/swing/ImageIcon.java index b16a62fe6b3..690ae19c414 100644 --- a/jdk/src/share/classes/javax/swing/ImageIcon.java +++ b/jdk/src/share/classes/javax/swing/ImageIcon.java @@ -50,7 +50,7 @@ import java.security.*; * *

          * For further information and examples of using image icons, see - * How to Use Icons + * How to Use Icons * in The Java Tutorial. * *

          diff --git a/jdk/src/share/classes/javax/swing/JApplet.java b/jdk/src/share/classes/javax/swing/JApplet.java index 0da6c3e532a..5f4c060614c 100644 --- a/jdk/src/share/classes/javax/swing/JApplet.java +++ b/jdk/src/share/classes/javax/swing/JApplet.java @@ -40,7 +40,7 @@ import javax.accessibility.*; * in The Java Tutorial, * in the section * How to Make Applets. + href="http://docs.oracle.com/javase/tutorial/uiswing/components/applet.html">How to Make Applets. *

          * The JApplet class is slightly incompatible with * java.applet.Applet. JApplet contains a @@ -183,7 +183,7 @@ public class JApplet extends Applet implements Accessible, * are currently typed to {@code JComponent}. *

          * Please see - * + * * How to Use Drag and Drop and Data Transfer, a section in * The Java Tutorial, for more information. * diff --git a/jdk/src/share/classes/javax/swing/JButton.java b/jdk/src/share/classes/javax/swing/JButton.java index 45e8757315c..e63977afef6 100644 --- a/jdk/src/share/classes/javax/swing/JButton.java +++ b/jdk/src/share/classes/javax/swing/JButton.java @@ -48,10 +48,10 @@ import java.io.IOException; * configuring a button. Refer to * Swing Components Supporting Action for more * details, and you can find more information in How + * href="http://docs.oracle.com/javase/tutorial/uiswing/misc/action.html">How * to Use Actions, a section in The Java Tutorial. *

          - * See How to Use Buttons, Check Boxes, and Radio Buttons + * See How to Use Buttons, Check Boxes, and Radio Buttons * in The Java Tutorial * for information and examples of using buttons. *

          diff --git a/jdk/src/share/classes/javax/swing/JCheckBox.java b/jdk/src/share/classes/javax/swing/JCheckBox.java index 4d80e9549c6..52930f902a0 100644 --- a/jdk/src/share/classes/javax/swing/JCheckBox.java +++ b/jdk/src/share/classes/javax/swing/JCheckBox.java @@ -40,7 +40,7 @@ import java.io.IOException; * An implementation of a check box -- an item that can be selected or * deselected, and which displays its state to the user. * By convention, any number of check boxes in a group can be selected. - * See How to Use Buttons, Check Boxes, and Radio Buttons + * See How to Use Buttons, Check Boxes, and Radio Buttons * in The Java Tutorial * for examples and information on using check boxes. *

          @@ -50,7 +50,7 @@ import java.io.IOException; * configuring a button. Refer to * Swing Components Supporting Action for more * details, and you can find more information in How + * href="http://docs.oracle.com/javase/tutorial/uiswing/misc/action.html">How * to Use Actions, a section in The Java Tutorial. *

          * Warning: Swing is not thread safe. For more diff --git a/jdk/src/share/classes/javax/swing/JCheckBoxMenuItem.java b/jdk/src/share/classes/javax/swing/JCheckBoxMenuItem.java index 8b42b729f14..2810ee66a12 100644 --- a/jdk/src/share/classes/javax/swing/JCheckBoxMenuItem.java +++ b/jdk/src/share/classes/javax/swing/JCheckBoxMenuItem.java @@ -59,12 +59,12 @@ import javax.accessibility.*; * configuring a menu item. Refer to * Swing Components Supporting Action for more * details, and you can find more information in How + * href="http://docs.oracle.com/javase/tutorial/uiswing/misc/action.html">How * to Use Actions, a section in The Java Tutorial. *

          * For further information and examples of using check box menu items, * see How to Use Menus, + href="http://docs.oracle.com/javase/tutorial/uiswing/components/menu.html">How to Use Menus, * a section in The Java Tutorial. *

          * Warning: Swing is not thread safe. For more diff --git a/jdk/src/share/classes/javax/swing/JColorChooser.java b/jdk/src/share/classes/javax/swing/JColorChooser.java index eb3aff69a5c..06da95e89b9 100644 --- a/jdk/src/share/classes/javax/swing/JColorChooser.java +++ b/jdk/src/share/classes/javax/swing/JColorChooser.java @@ -42,7 +42,7 @@ import sun.swing.SwingUtilities2; * a user to manipulate and select a color. * For information about using color choosers, see * How to Use Color Choosers, + href="http://docs.oracle.com/javase/tutorial/uiswing/components/colorchooser.html">How to Use Color Choosers, * a section in The Java Tutorial. * *

          diff --git a/jdk/src/share/classes/javax/swing/JComboBox.java b/jdk/src/share/classes/javax/swing/JComboBox.java index ba3bb8abb1d..daab76de3f5 100644 --- a/jdk/src/share/classes/javax/swing/JComboBox.java +++ b/jdk/src/share/classes/javax/swing/JComboBox.java @@ -62,8 +62,8 @@ import javax.accessibility.*; * Please see {@link java.beans.XMLEncoder}. * *

          - * See How to Use Combo Boxes - * in The Java Tutorial + * See How to Use Combo Boxes + * in The Java Tutorial * for further information. *

          * @see ComboBoxModel @@ -350,9 +350,7 @@ implements ItemSelectable,ListDataListener,ActionListener, Accessible { * by the look and feel. Some look and feels always use * heavyweight popups, no matter what the value of this property. *

          - * See the article Mixing Heavy and Light Components - * on - * The Swing Connection + * See the article Mixing Heavy and Light Components * This method fires a property changed event. * * @param aFlag if true, lightweight popups are desired diff --git a/jdk/src/share/classes/javax/swing/JComponent.java b/jdk/src/share/classes/javax/swing/JComponent.java index 13576590a39..5d512ee9934 100644 --- a/jdk/src/share/classes/javax/swing/JComponent.java +++ b/jdk/src/share/classes/javax/swing/JComponent.java @@ -78,7 +78,7 @@ import sun.swing.UIClientPropertyKey; * that provide a place for other Swing components to paint themselves. * For an explanation of containment hierarchies, see * Swing Components and the Containment Hierarchy, + href="http://docs.oracle.com/javase/tutorial/uiswing/components/toplevel.html">Swing Components and the Containment Hierarchy, * a section in The Java Tutorial. * *

          @@ -92,21 +92,20 @@ import sun.swing.UIClientPropertyKey; * UI delegate -- an object that descends from * {@link javax.swing.plaf.ComponentUI}. * See How + * href="http://docs.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html">How * to Set the Look and Feel * in The Java Tutorial * for more information. *

        • Comprehensive keystroke handling. * See the document Keyboard - * Bindings in Swing, - * an article in The Swing Connection, + * href="http://docs.oracle.com/javase/tutorial/uiswing/misc/keybinding.html">How to Use Key Bindings, + * an article in The Java Tutorial, * for more information. *
        • Support for tool tips -- * short descriptions that pop up when the cursor lingers * over a component. * See How + * href="http://docs.oracle.com/javase/tutorial/uiswing/components/tooltip.html">How * to Use Tool Tips * in The Java Tutorial * for more information. @@ -124,15 +123,15 @@ import sun.swing.UIClientPropertyKey; *
        • An infrastructure for painting * that includes double buffering and support for borders. * For more information see Painting and - * How + * href="http://www.oracle.com/technetwork/java/painting-140037.html#swing">Painting and + * How * to Use Borders, * both of which are sections in The Java Tutorial. * * For more information on these subjects, see the * Swing package description * and The Java Tutorial section - * The JComponent Class. + * The JComponent Class. *

          * JComponent and its subclasses document default values * for certain properties. For example, JTable documents the @@ -150,7 +149,7 @@ import sun.swing.UIClientPropertyKey; *

          * In release 1.4, the focus subsystem was rearchitected. * For more information, see - * + * * How to Use the Focus Subsystem, * a section in The Java Tutorial. *

          @@ -1291,7 +1290,7 @@ public abstract class JComponent extends Container implements Serializable, /** * In release 1.4, the focus subsystem was rearchitected. * For more information, see - * + * * How to Use the Focus Subsystem, * a section in The Java Tutorial. *

          @@ -1353,7 +1352,7 @@ public abstract class JComponent extends Container implements Serializable, /** * In release 1.4, the focus subsystem was rearchitected. * For more information, see - * + * * How to Use the Focus Subsystem, * a section in The Java Tutorial. *

          @@ -1386,7 +1385,7 @@ public abstract class JComponent extends Container implements Serializable, /** * In release 1.4, the focus subsystem was rearchitected. * For more information, see - * + * * How to Use the Focus Subsystem, * a section in The Java Tutorial. *

          @@ -1419,7 +1418,7 @@ public abstract class JComponent extends Container implements Serializable, * all, use the setFocusable method instead. *

          * Please see - * + * * How to Use the Focus Subsystem, * a section in The Java Tutorial, * for more information. @@ -1438,7 +1437,7 @@ public abstract class JComponent extends Container implements Serializable, * get focus; otherwise returns false. *

          * Please see - * + * * How to Use the Focus Subsystem, * a section in The Java Tutorial, * for more information. @@ -1464,7 +1463,7 @@ public abstract class JComponent extends Container implements Serializable, * its behavior is platform dependent. Instead we recommend the * use of {@link #requestFocusInWindow() requestFocusInWindow()}. * If you would like more information on focus, see - * + * * How to Use the Focus Subsystem, * a section in The Java Tutorial. * @@ -1487,7 +1486,7 @@ public abstract class JComponent extends Container implements Serializable, * use of {@link #requestFocusInWindow(boolean) * requestFocusInWindow(boolean)}. * If you would like more information on focus, see - * + * * How to Use the Focus Subsystem, * a section in The Java Tutorial. * @@ -1509,7 +1508,7 @@ public abstract class JComponent extends Container implements Serializable, * this method. *

          * If you would like more information on focus, see - * + * * How to Use the Focus Subsystem, * a section in The Java Tutorial. * @@ -1530,7 +1529,7 @@ public abstract class JComponent extends Container implements Serializable, * this method. *

          * If you would like more information on focus, see - * + * * How to Use the Focus Subsystem, * a section in The Java Tutorial. * @@ -2595,7 +2594,7 @@ public abstract class JComponent extends Container implements Serializable, /** * In release 1.4, the focus subsystem was rearchitected. * For more information, see - * + * * How to Use the Focus Subsystem, * a section in The Java Tutorial. *

          @@ -2986,7 +2985,7 @@ public abstract class JComponent extends Container implements Serializable, * Registers the text to display in a tool tip. * The text displays when the cursor lingers over the component. *

          - * See How to Use Tool Tips + * See How to Use Tool Tips * in The Java Tutorial * for further documentation. * @@ -3206,7 +3205,7 @@ public abstract class JComponent extends Container implements Serializable, * default value for the system property is {@code false}. *

          * Please see - * + * * How to Use Drag and Drop and Data Transfer, * a section in The Java Tutorial, for more information. * diff --git a/jdk/src/share/classes/javax/swing/JDesktopPane.java b/jdk/src/share/classes/javax/swing/JDesktopPane.java index 8d5342f47cb..74c45d6a8d7 100644 --- a/jdk/src/share/classes/javax/swing/JDesktopPane.java +++ b/jdk/src/share/classes/javax/swing/JDesktopPane.java @@ -63,7 +63,7 @@ import java.util.TreeSet; * (closing, resizing, etc). *

          * For further documentation and examples see - * How to Use Internal Frames, + * How to Use Internal Frames, * a section in The Java Tutorial. *

          * Warning: Swing is not thread safe. For more diff --git a/jdk/src/share/classes/javax/swing/JDialog.java b/jdk/src/share/classes/javax/swing/JDialog.java index a53c4abe50c..036c647483e 100644 --- a/jdk/src/share/classes/javax/swing/JDialog.java +++ b/jdk/src/share/classes/javax/swing/JDialog.java @@ -35,7 +35,7 @@ import javax.accessibility.*; * For information about creating dialogs, see * The Java Tutorial section * How + href="http://docs.oracle.com/javase/tutorial/uiswing/components/dialog.html">How * to Make Dialogs. * *

          @@ -786,7 +786,7 @@ public class JDialog extends Dialog implements WindowConstants, * are currently typed to {@code JComponent}. *

          * Please see - * + * * How to Use Drag and Drop and Data Transfer, a section in * The Java Tutorial, for more information. * diff --git a/jdk/src/share/classes/javax/swing/JEditorPane.java b/jdk/src/share/classes/javax/swing/JEditorPane.java index fa9aeb0aa20..9979286148e 100644 --- a/jdk/src/share/classes/javax/swing/JEditorPane.java +++ b/jdk/src/share/classes/javax/swing/JEditorPane.java @@ -43,7 +43,7 @@ import javax.accessibility.*; /** * A text component to edit various kinds of content. * You can find how-to information and examples of using editor panes in - * Using Text Components, + * Using Text Components, * a section in The Java Tutorial. * *

          diff --git a/jdk/src/share/classes/javax/swing/JFileChooser.java b/jdk/src/share/classes/javax/swing/JFileChooser.java index 61806b439b8..5f897e3ed9a 100644 --- a/jdk/src/share/classes/javax/swing/JFileChooser.java +++ b/jdk/src/share/classes/javax/swing/JFileChooser.java @@ -57,7 +57,7 @@ import java.lang.ref.WeakReference; * choose a file. * For information about using JFileChooser, see * How to Use File Choosers, + href="http://docs.oracle.com/javase/tutorial/uiswing/components/filechooser.html">How to Use File Choosers, * a section in The Java Tutorial. * *

          diff --git a/jdk/src/share/classes/javax/swing/JFrame.java b/jdk/src/share/classes/javax/swing/JFrame.java index aee994eecf9..c8efb87085f 100644 --- a/jdk/src/share/classes/javax/swing/JFrame.java +++ b/jdk/src/share/classes/javax/swing/JFrame.java @@ -40,7 +40,7 @@ import javax.accessibility.*; * You can find task-oriented documentation about using JFrame * in The Java Tutorial, in the section * How to Make Frames. + href="http://docs.oracle.com/javase/tutorial/uiswing/components/frame.html">How to Make Frames. * *

          * The JFrame class is slightly incompatible with Frame. @@ -77,7 +77,7 @@ import javax.accessibility.*; * For more information on content panes * and other features that root panes provide, * see Using Top-Level Containers in The Java Tutorial. + href="http://docs.oracle.com/javase/tutorial/uiswing/components/toplevel.html">Using Top-Level Containers in The Java Tutorial. *

          * In a multi-screen environment, you can create a JFrame * on a different screen device. See {@link java.awt.Frame} for more @@ -430,7 +430,7 @@ public class JFrame extends Frame implements WindowConstants, * are currently typed to {@code JComponent}. *

          * Please see - * + * * How to Use Drag and Drop and Data Transfer, a section in * The Java Tutorial, for more information. * diff --git a/jdk/src/share/classes/javax/swing/JInternalFrame.java b/jdk/src/share/classes/javax/swing/JInternalFrame.java index a0ba3a18084..2d2b53202fe 100644 --- a/jdk/src/share/classes/javax/swing/JInternalFrame.java +++ b/jdk/src/share/classes/javax/swing/JInternalFrame.java @@ -50,7 +50,7 @@ import sun.swing.SwingUtilities2; * resizing, title display, and support for a menu bar. * For task-oriented documentation and examples of using internal frames, * see How to Use Internal Frames, + href="http://docs.oracle.com/javase/tutorial/uiswing/components/internalframe.html" target="_top">How to Use Internal Frames, * a section in The Java Tutorial. * *

          diff --git a/jdk/src/share/classes/javax/swing/JLabel.java b/jdk/src/share/classes/javax/swing/JLabel.java index 82235093f97..661ef911fb6 100644 --- a/jdk/src/share/classes/javax/swing/JLabel.java +++ b/jdk/src/share/classes/javax/swing/JLabel.java @@ -80,7 +80,7 @@ import java.util.*; * should appear between the text and the image. * The default is 4 pixels. *

          - * See How to Use Labels + * See How to Use Labels * in The Java Tutorial * for further documentation. *

          diff --git a/jdk/src/share/classes/javax/swing/JLayeredPane.java b/jdk/src/share/classes/javax/swing/JLayeredPane.java index bf5bc695cd3..f0d083a84e5 100644 --- a/jdk/src/share/classes/javax/swing/JLayeredPane.java +++ b/jdk/src/share/classes/javax/swing/JLayeredPane.java @@ -41,7 +41,7 @@ import javax.accessibility.*; * container, where higher-numbered components sit "on top" of other * components. * For task-oriented documentation and examples of using layered panes see - * How to Use a Layered Pane, + * How to Use a Layered Pane, * a section in The Java Tutorial. *

          * diff --git a/jdk/src/share/classes/javax/swing/JList.java b/jdk/src/share/classes/javax/swing/JList.java index ad22fc38e52..53872e5098f 100644 --- a/jdk/src/share/classes/javax/swing/JList.java +++ b/jdk/src/share/classes/javax/swing/JList.java @@ -257,11 +257,9 @@ import static sun.swing.SwingUtilities2.Section.*; * has been added to the java.beans package. * Please see {@link java.beans.XMLEncoder}. *

          - * See How to Use Lists - * in The Java Tutorial + * See How to Use Lists + * in The Java Tutorial * for further documentation. - * Also see the article Advanced JList Programming - * in The Swing Connection. *

          * @see ListModel * @see AbstractListModel diff --git a/jdk/src/share/classes/javax/swing/JMenu.java b/jdk/src/share/classes/javax/swing/JMenu.java index 62b6f41e2fe..c0ab0e39cc5 100644 --- a/jdk/src/share/classes/javax/swing/JMenu.java +++ b/jdk/src/share/classes/javax/swing/JMenu.java @@ -76,11 +76,11 @@ import java.lang.ref.WeakReference; * configuring a menu. Refer to * Swing Components Supporting Action for more * details, and you can find more information in How + * href="http://docs.oracle.com/javase/tutorial/uiswing/misc/action.html">How * to Use Actions, a section in The Java Tutorial. *

          * For information and examples of using menus see - * How to Use Menus, + * How to Use Menus, * a section in The Java Tutorial. *

          * Warning: Swing is not thread safe. For more diff --git a/jdk/src/share/classes/javax/swing/JMenuBar.java b/jdk/src/share/classes/javax/swing/JMenuBar.java index 22dbe6274fe..8c7b2a84346 100644 --- a/jdk/src/share/classes/javax/swing/JMenuBar.java +++ b/jdk/src/share/classes/javax/swing/JMenuBar.java @@ -54,7 +54,7 @@ import javax.accessibility.*; *

          * For information and examples of using menu bars see * How to Use Menus, + href="http://docs.oracle.com/javase/tutorial/uiswing/components/menu.html">How to Use Menus, * a section in The Java Tutorial. *

          * Warning: Swing is not thread safe. For more diff --git a/jdk/src/share/classes/javax/swing/JMenuItem.java b/jdk/src/share/classes/javax/swing/JMenuItem.java index e13dc8b5b9d..1f1a14a92e4 100644 --- a/jdk/src/share/classes/javax/swing/JMenuItem.java +++ b/jdk/src/share/classes/javax/swing/JMenuItem.java @@ -54,12 +54,12 @@ import javax.accessibility.*; * configuring a menu item. Refer to * Swing Components Supporting Action for more * details, and you can find more information in How + * href="http://docs.oracle.com/javase/tutorial/uiswing/misc/action.html">How * to Use Actions, a section in The Java Tutorial. *

          * For further documentation and for examples, see * How to Use Menus + href="http://docs.oracle.com/javase/tutorial/uiswing/components/menu.html">How to Use Menus * in The Java Tutorial. *

          * Warning: Swing is not thread safe. For more diff --git a/jdk/src/share/classes/javax/swing/JOptionPane.java b/jdk/src/share/classes/javax/swing/JOptionPane.java index 23ed02f6bb8..0cd52101a84 100644 --- a/jdk/src/share/classes/javax/swing/JOptionPane.java +++ b/jdk/src/share/classes/javax/swing/JOptionPane.java @@ -62,7 +62,7 @@ import static javax.swing.ClientPropertyKey.PopupFactory_FORCE_HEAVYWEIGHT_POPUP * prompts users for a value or informs them of something. * For information about using JOptionPane, see * How to Make Dialogs, + href="http://docs.oracle.com/javase/tutorial/uiswing/components/dialog.html">How to Make Dialogs, * a section in The Java Tutorial. * *

          diff --git a/jdk/src/share/classes/javax/swing/JPanel.java b/jdk/src/share/classes/javax/swing/JPanel.java index 7287a53ba27..2ac9c700e46 100644 --- a/jdk/src/share/classes/javax/swing/JPanel.java +++ b/jdk/src/share/classes/javax/swing/JPanel.java @@ -39,7 +39,7 @@ import java.io.IOException; * JPanel is a generic lightweight container. * For examples and task-oriented documentation for JPanel, see * How to Use Panels, + href="http://docs.oracle.com/javase/tutorial/uiswing/components/panel.html">How to Use Panels, * a section in The Java Tutorial. *

          * Warning: Swing is not thread safe. For more diff --git a/jdk/src/share/classes/javax/swing/JPasswordField.java b/jdk/src/share/classes/javax/swing/JPasswordField.java index 1da370921da..71dc3aa75d3 100644 --- a/jdk/src/share/classes/javax/swing/JPasswordField.java +++ b/jdk/src/share/classes/javax/swing/JPasswordField.java @@ -39,7 +39,7 @@ import java.util.Arrays; * the editing of a single line of text where the view indicates * something was typed, but does not show the original characters. * You can find further information and examples in - * How to Use Text Fields, + * How to Use Text Fields, * a section in The Java Tutorial. *

          * JPasswordField is intended diff --git a/jdk/src/share/classes/javax/swing/JPopupMenu.java b/jdk/src/share/classes/javax/swing/JPopupMenu.java index 03532d12fde..992878fa6c9 100644 --- a/jdk/src/share/classes/javax/swing/JPopupMenu.java +++ b/jdk/src/share/classes/javax/swing/JPopupMenu.java @@ -58,7 +58,7 @@ import java.applet.Applet; *

          * For information and examples of using popup menus, see * How to Use Menus + href="http://docs.oracle.com/javase/tutorial/uiswing/components/menu.html">How to Use Menus * in The Java Tutorial. *

          * Warning: Swing is not thread safe. For more diff --git a/jdk/src/share/classes/javax/swing/JProgressBar.java b/jdk/src/share/classes/javax/swing/JProgressBar.java index 2be3a57c396..f21ad0ffe5e 100644 --- a/jdk/src/share/classes/javax/swing/JProgressBar.java +++ b/jdk/src/share/classes/javax/swing/JProgressBar.java @@ -100,7 +100,7 @@ import javax.swing.plaf.ProgressBarUI; *

          * * For complete examples and further documentation see - * How to Monitor Progress, + * How to Monitor Progress, * a section in The Java Tutorial. * *

          @@ -910,7 +910,7 @@ public class JProgressBar extends JComponent implements SwingConstants, Accessib *

          * * See - * How to Monitor Progress + * How to Monitor Progress * for examples of using indeterminate progress bars. * * @param newValue true if the progress bar diff --git a/jdk/src/share/classes/javax/swing/JRadioButton.java b/jdk/src/share/classes/javax/swing/JRadioButton.java index 5d594ceac65..d752a8ac0f0 100644 --- a/jdk/src/share/classes/javax/swing/JRadioButton.java +++ b/jdk/src/share/classes/javax/swing/JRadioButton.java @@ -57,10 +57,10 @@ import java.io.IOException; * configuring a button. Refer to * Swing Components Supporting Action for more * details, and you can find more information in How + * href="http://docs.oracle.com/javase/tutorial/uiswing/misc/action.html">How * to Use Actions, a section in The Java Tutorial. *

          - * See How to Use Buttons, Check Boxes, and Radio Buttons + * See How to Use Buttons, Check Boxes, and Radio Buttons * in The Java Tutorial * for further documentation. *

          diff --git a/jdk/src/share/classes/javax/swing/JRadioButtonMenuItem.java b/jdk/src/share/classes/javax/swing/JRadioButtonMenuItem.java index 1c4dd4c81f0..b8c525a655b 100644 --- a/jdk/src/share/classes/javax/swing/JRadioButtonMenuItem.java +++ b/jdk/src/share/classes/javax/swing/JRadioButtonMenuItem.java @@ -53,12 +53,12 @@ import javax.accessibility.*; * configuring a menu item. Refer to * Swing Components Supporting Action for more * details, and you can find more information in How + * href="http://docs.oracle.com/javase/tutorial/uiswing/misc/action.html">How * to Use Actions, a section in The Java Tutorial. *

          * For further documentation and examples see * How to Use Menus, + href="http://docs.oracle.com/javase/tutorial/uiswing/components/menu.html">How to Use Menus, * a section in The Java Tutorial. *

          * Warning: Swing is not thread safe. For more diff --git a/jdk/src/share/classes/javax/swing/JRootPane.java b/jdk/src/share/classes/javax/swing/JRootPane.java index 1f41ccbfd8d..d12af458902 100644 --- a/jdk/src/share/classes/javax/swing/JRootPane.java +++ b/jdk/src/share/classes/javax/swing/JRootPane.java @@ -43,7 +43,7 @@ import sun.security.action.GetBooleanAction; * JFrame, JDialog, JWindow, * JApplet, and JInternalFrame. * For task-oriented information on functionality provided by root panes - * see How to Use Root Panes, + * see How to Use Root Panes, * a section in The Java Tutorial. * *

          diff --git a/jdk/src/share/classes/javax/swing/JScrollPane.java b/jdk/src/share/classes/javax/swing/JScrollPane.java index 7d30b7dffcc..f76a1fe6489 100644 --- a/jdk/src/share/classes/javax/swing/JScrollPane.java +++ b/jdk/src/share/classes/javax/swing/JScrollPane.java @@ -50,7 +50,7 @@ import java.beans.Transient; * vertical and horizontal scroll bars, and optional row and * column heading viewports. * You can find task-oriented documentation of JScrollPane in - * How to Use Scroll Panes, + * How to Use Scroll Panes, * a section in The Java Tutorial. Note that * JScrollPane does not support heavyweight components. *

          diff --git a/jdk/src/share/classes/javax/swing/JSeparator.java b/jdk/src/share/classes/javax/swing/JSeparator.java index 8c5e14f6134..1d994fb6d59 100644 --- a/jdk/src/share/classes/javax/swing/JSeparator.java +++ b/jdk/src/share/classes/javax/swing/JSeparator.java @@ -47,7 +47,7 @@ import java.io.IOException; * * For more information and examples see * How to Use Menus, + href="http://docs.oracle.com/javase/tutorial/uiswing/components/menu.html">How to Use Menus, * a section in The Java Tutorial. *

          * Warning: Swing is not thread safe. For more diff --git a/jdk/src/share/classes/javax/swing/JSlider.java b/jdk/src/share/classes/javax/swing/JSlider.java index 7a948d91b54..eb15c69c3d7 100644 --- a/jdk/src/share/classes/javax/swing/JSlider.java +++ b/jdk/src/share/classes/javax/swing/JSlider.java @@ -55,7 +55,7 @@ import java.beans.*; *

          * For further information and examples see * How to Use Sliders, + href="http://docs.oracle.com/javase/tutorial/uiswing/components/slider.html">How to Use Sliders, * a section in The Java Tutorial. *

          * Warning: Swing is not thread safe. For more diff --git a/jdk/src/share/classes/javax/swing/JSpinner.java b/jdk/src/share/classes/javax/swing/JSpinner.java index d60f67cfd5e..d0fb75a395e 100644 --- a/jdk/src/share/classes/javax/swing/JSpinner.java +++ b/jdk/src/share/classes/javax/swing/JSpinner.java @@ -93,7 +93,7 @@ import sun.util.locale.provider.LocaleServiceProviderPool; * *

          * For information and examples of using spinner see - * How to Use Spinners, + * How to Use Spinners, * a section in The Java Tutorial. *

          * Warning: Swing is not thread safe. For more diff --git a/jdk/src/share/classes/javax/swing/JSplitPane.java b/jdk/src/share/classes/javax/swing/JSplitPane.java index 622c70f270b..f2b533766c4 100644 --- a/jdk/src/share/classes/javax/swing/JSplitPane.java +++ b/jdk/src/share/classes/javax/swing/JSplitPane.java @@ -49,7 +49,7 @@ import java.io.IOException; * interactively resized by the user. * Information on using JSplitPane is in * How to Use Split Panes in + href="http://docs.oracle.com/javase/tutorial/uiswing/components/splitpane.html">How to Use Split Panes in * The Java Tutorial. *

          * The two Components in a split pane can be aligned diff --git a/jdk/src/share/classes/javax/swing/JTabbedPane.java b/jdk/src/share/classes/javax/swing/JTabbedPane.java index f36615a74a9..603ea31c010 100644 --- a/jdk/src/share/classes/javax/swing/JTabbedPane.java +++ b/jdk/src/share/classes/javax/swing/JTabbedPane.java @@ -43,7 +43,7 @@ import java.io.IOException; * A component that lets the user switch between a group of components by * clicking on a tab with a given title and/or icon. * For examples and information on using tabbed panes see - * How to Use Tabbed Panes, + * How to Use Tabbed Panes, * a section in The Java Tutorial. *

          * Tabs/components are added to a TabbedPane object by using the diff --git a/jdk/src/share/classes/javax/swing/JTable.java b/jdk/src/share/classes/javax/swing/JTable.java index cf477533c29..c7bf52f4f26 100644 --- a/jdk/src/share/classes/javax/swing/JTable.java +++ b/jdk/src/share/classes/javax/swing/JTable.java @@ -62,7 +62,7 @@ import sun.swing.SwingLazyValue; /** * The JTable is used to display and edit regular two-dimensional tables * of cells. - * See How to Use Tables + * See How to Use Tables * in The Java Tutorial * for task-oriented documentation and examples of using JTable. * @@ -2489,7 +2489,7 @@ public class JTable extends JComponent implements TableModelListener, Scrollable * The default value of this property is defined by the look * and feel implementation. *

          - * This is a JavaBeans bound property. + * This is a JavaBeans bound property. * * @param selectionForeground the Color to use in the foreground * for selected list items @@ -2527,7 +2527,7 @@ public class JTable extends JComponent implements TableModelListener, Scrollable * The default value of this property is defined by the look * and feel implementation. *

          - * This is a JavaBeans bound property. + * This is a JavaBeans bound property. * * @param selectionBackground the Color to use for the background * of selected cells diff --git a/jdk/src/share/classes/javax/swing/JTextArea.java b/jdk/src/share/classes/javax/swing/JTextArea.java index 0af83fa9b83..5e4c4baebfd 100644 --- a/jdk/src/share/classes/javax/swing/JTextArea.java +++ b/jdk/src/share/classes/javax/swing/JTextArea.java @@ -44,7 +44,7 @@ import java.io.IOException; * compatibility with the java.awt.TextArea class where it can * reasonably do so. * You can find information and examples of using all the text components in - * Using Text Components, + * Using Text Components, * a section in The Java Tutorial. * *

          diff --git a/jdk/src/share/classes/javax/swing/JTextField.java b/jdk/src/share/classes/javax/swing/JTextField.java index 2fd75f0832d..a5744ee0b95 100644 --- a/jdk/src/share/classes/javax/swing/JTextField.java +++ b/jdk/src/share/classes/javax/swing/JTextField.java @@ -44,7 +44,7 @@ import java.io.Serializable; * of a single line of text. * For information on and examples of using text fields, * see - * How to Use Text Fields + * How to Use Text Fields * in The Java Tutorial. * *

          diff --git a/jdk/src/share/classes/javax/swing/JTextPane.java b/jdk/src/share/classes/javax/swing/JTextPane.java index b129bd8e37d..82512dfd045 100644 --- a/jdk/src/share/classes/javax/swing/JTextPane.java +++ b/jdk/src/share/classes/javax/swing/JTextPane.java @@ -39,7 +39,7 @@ import javax.swing.plaf.*; * A text component that can be marked up with attributes that are * represented graphically. * You can find how-to information and examples of using text panes in - * Using Text Components, + * Using Text Components, * a section in The Java Tutorial. * *

          diff --git a/jdk/src/share/classes/javax/swing/JToggleButton.java b/jdk/src/share/classes/javax/swing/JToggleButton.java index bda38db5e8f..6aa7fe00ff2 100644 --- a/jdk/src/share/classes/javax/swing/JToggleButton.java +++ b/jdk/src/share/classes/javax/swing/JToggleButton.java @@ -42,7 +42,7 @@ import java.io.IOException; * are subclasses of this class. * For information on using them see * How to Use Buttons, Check Boxes, and Radio Buttons, + href="http://docs.oracle.com/javase/tutorial/uiswing/components/button.html">How to Use Buttons, Check Boxes, and Radio Buttons, * a section in The Java Tutorial. *

          * Buttons can be configured, and to some degree controlled, by @@ -51,7 +51,7 @@ import java.io.IOException; * configuring a button. Refer to * Swing Components Supporting Action for more * details, and you can find more information in How + * href="http://docs.oracle.com/javase/tutorial/uiswing/misc/action.html">How * to Use Actions, a section in The Java Tutorial. *

          * Warning: Swing is not thread safe. For more diff --git a/jdk/src/share/classes/javax/swing/JToolBar.java b/jdk/src/share/classes/javax/swing/JToolBar.java index b1a8c87c609..b19ae272d4e 100644 --- a/jdk/src/share/classes/javax/swing/JToolBar.java +++ b/jdk/src/share/classes/javax/swing/JToolBar.java @@ -52,7 +52,7 @@ import java.util.Hashtable; * JToolBar provides a component that is useful for * displaying commonly used Actions or controls. * For examples and information on using tool bars see - * How to Use Tool Bars, + * How to Use Tool Bars, * a section in The Java Tutorial. * *

          diff --git a/jdk/src/share/classes/javax/swing/JToolTip.java b/jdk/src/share/classes/javax/swing/JToolTip.java index 77b29eaed21..5373a57de5f 100644 --- a/jdk/src/share/classes/javax/swing/JToolTip.java +++ b/jdk/src/share/classes/javax/swing/JToolTip.java @@ -44,7 +44,7 @@ import java.util.Objects; * display can override JComponent's createToolTip * method and use a subclass of this class. *

          - * See How to Use Tool Tips + * See How to Use Tool Tips * in The Java Tutorial * for further documentation. *

          diff --git a/jdk/src/share/classes/javax/swing/JTree.java b/jdk/src/share/classes/javax/swing/JTree.java index 56aaca10d8e..25e201279d1 100644 --- a/jdk/src/share/classes/javax/swing/JTree.java +++ b/jdk/src/share/classes/javax/swing/JTree.java @@ -44,7 +44,7 @@ import static sun.swing.SwingUtilities2.Section.*; * * A control that displays a set of hierarchical data as an outline. * You can find task-oriented documentation and examples of using trees in - * How to Use Trees, + * How to Use Trees, * a section in The Java Tutorial. *

          * A specific node in a tree can be identified either by a diff --git a/jdk/src/share/classes/javax/swing/JWindow.java b/jdk/src/share/classes/javax/swing/JWindow.java index f5d7b08a4bd..e211b8d5ca3 100644 --- a/jdk/src/share/classes/javax/swing/JWindow.java +++ b/jdk/src/share/classes/javax/swing/JWindow.java @@ -314,7 +314,7 @@ public class JWindow extends Window implements Accessible, * are currently typed to {@code JComponent}. *

          * Please see - * + * * How to Use Drag and Drop and Data Transfer, a section in * The Java Tutorial, for more information. * diff --git a/jdk/src/share/classes/javax/swing/ProgressMonitor.java b/jdk/src/share/classes/javax/swing/ProgressMonitor.java index ebfa7389018..72f5f57cbbd 100644 --- a/jdk/src/share/classes/javax/swing/ProgressMonitor.java +++ b/jdk/src/share/classes/javax/swing/ProgressMonitor.java @@ -71,7 +71,7 @@ import javax.swing.text.*; * * For further documentation and examples see * How to Monitor Progress, + href="http://docs.oracle.com/javase/tutorial/uiswing/components/progress.html">How to Monitor Progress, * a section in The Java Tutorial. * * @see ProgressMonitorInputStream diff --git a/jdk/src/share/classes/javax/swing/ProgressMonitorInputStream.java b/jdk/src/share/classes/javax/swing/ProgressMonitorInputStream.java index 38f653b94ab..43213c7629a 100644 --- a/jdk/src/share/classes/javax/swing/ProgressMonitorInputStream.java +++ b/jdk/src/share/classes/javax/swing/ProgressMonitorInputStream.java @@ -54,7 +54,7 @@ import java.awt.Component; *

          * * For further documentation and examples see - * How to Monitor Progress, + * How to Monitor Progress, * a section in The Java Tutorial. * * @see ProgressMonitor diff --git a/jdk/src/share/classes/javax/swing/Spring.java b/jdk/src/share/classes/javax/swing/Spring.java index 8da77ff8d4e..6d49eb40ca7 100644 --- a/jdk/src/share/classes/javax/swing/Spring.java +++ b/jdk/src/share/classes/javax/swing/Spring.java @@ -109,7 +109,7 @@ import java.awt.Component; * If you are implementing a SpringLayout you * can find further information and examples in * How to Use SpringLayout, + href="http://docs.oracle.com/javase/tutorial/uiswing/layout/spring.html">How to Use SpringLayout, * a section in The Java Tutorial. *

          * Warning: diff --git a/jdk/src/share/classes/javax/swing/SpringLayout.java b/jdk/src/share/classes/javax/swing/SpringLayout.java index 72de45661a0..f3ca54d15cd 100644 --- a/jdk/src/share/classes/javax/swing/SpringLayout.java +++ b/jdk/src/share/classes/javax/swing/SpringLayout.java @@ -36,7 +36,7 @@ import java.util.*; /** * A SpringLayout lays out the children of its associated container * according to a set of constraints. - * See How to Use SpringLayout + * See How to Use SpringLayout * in The Java Tutorial for examples of using * SpringLayout. * diff --git a/jdk/src/share/classes/javax/swing/SwingUtilities.java b/jdk/src/share/classes/javax/swing/SwingUtilities.java index 6bb308d2f1e..28d1f198cd9 100644 --- a/jdk/src/share/classes/javax/swing/SwingUtilities.java +++ b/jdk/src/share/classes/javax/swing/SwingUtilities.java @@ -1280,7 +1280,7 @@ public class SwingUtilities implements SwingConstants *

          * Additional documentation and examples for this method can be * found in - * Concurrency in Swing. + * Concurrency in Swing. *

          * As of 1.3 this method is just a cover for java.awt.EventQueue.invokeLater(). *

          @@ -1331,7 +1331,7 @@ public class SwingUtilities implements SwingConstants *

          * Additional documentation and examples for this method can be * found in - * Concurrency in Swing. + * Concurrency in Swing. *

          * As of 1.3 this method is just a cover for * java.awt.EventQueue.invokeAndWait(). diff --git a/jdk/src/share/classes/javax/swing/SwingWorker.java b/jdk/src/share/classes/javax/swing/SwingWorker.java index f7b343d8e44..5775bcb4ea9 100644 --- a/jdk/src/share/classes/javax/swing/SwingWorker.java +++ b/jdk/src/share/classes/javax/swing/SwingWorker.java @@ -50,7 +50,7 @@ import sun.swing.AccumulativeRunnable; * When writing a multi-threaded application using Swing, there are * two constraints to keep in mind: * (refer to - * + * * Concurrency in Swing * for more details): *

            diff --git a/jdk/src/share/classes/javax/swing/Timer.java b/jdk/src/share/classes/javax/swing/Timer.java index e938a9d5b15..d52e3bacdbe 100644 --- a/jdk/src/share/classes/javax/swing/Timer.java +++ b/jdk/src/share/classes/javax/swing/Timer.java @@ -121,7 +121,7 @@ import javax.swing.event.EventListenerList; *

            * You can find further documentation * and several examples of using timers by visiting - * How to Use Timers, * a section in The Java Tutorial. * For more examples and help in choosing between diff --git a/jdk/src/share/classes/javax/swing/TransferHandler.java b/jdk/src/share/classes/javax/swing/TransferHandler.java index b169a8edcc7..016dd987bee 100644 --- a/jdk/src/share/classes/javax/swing/TransferHandler.java +++ b/jdk/src/share/classes/javax/swing/TransferHandler.java @@ -75,7 +75,7 @@ import sun.awt.AWTAccessor; * of the transfer, and setForeground for the target of a transfer. *

            * Please see - * + * * How to Use Drag and Drop and Data Transfer, * a section in The Java Tutorial, for more information. * diff --git a/jdk/src/share/classes/javax/swing/WindowConstants.java b/jdk/src/share/classes/javax/swing/WindowConstants.java index c82fc416344..05237583f49 100644 --- a/jdk/src/share/classes/javax/swing/WindowConstants.java +++ b/jdk/src/share/classes/javax/swing/WindowConstants.java @@ -36,7 +36,7 @@ package javax.swing; * use these constants. * For examples of setting the default window-closing operation, see * Responding to Window-Closing Events, + href="http://docs.oracle.com/javase/tutorial/uiswing/components/frame.html#windowevents">Responding to Window-Closing Events, * a section in The Java Tutorial. * @see JFrame#setDefaultCloseOperation(int) * @see JDialog#setDefaultCloseOperation(int) diff --git a/jdk/src/share/classes/javax/swing/border/Border.java b/jdk/src/share/classes/javax/swing/border/Border.java index ea73b4a56c0..2e1d6c74ea1 100644 --- a/jdk/src/share/classes/javax/swing/border/Border.java +++ b/jdk/src/share/classes/javax/swing/border/Border.java @@ -33,7 +33,7 @@ import java.awt.Component; * Interface describing an object capable of rendering a border * around the edges of a swing component. * For examples of using borders see - * How to Use Borders, + * How to Use Borders, * a section in The Java Tutorial. *

            * In the Swing component set, borders supercede Insets as the diff --git a/jdk/src/share/classes/javax/swing/event/InternalFrameAdapter.java b/jdk/src/share/classes/javax/swing/event/InternalFrameAdapter.java index 986d4c2aabd..6ab90470e19 100644 --- a/jdk/src/share/classes/javax/swing/event/InternalFrameAdapter.java +++ b/jdk/src/share/classes/javax/swing/event/InternalFrameAdapter.java @@ -31,7 +31,7 @@ package javax.swing.event; * convenience for creating listener objects, and is functionally * equivalent to the WindowAdapter class in the AWT. *

            - * See How to Write an Internal Frame Listener + * See How to Write an Internal Frame Listener * in The Java Tutorial * * @see InternalFrameEvent diff --git a/jdk/src/share/classes/javax/swing/event/InternalFrameEvent.java b/jdk/src/share/classes/javax/swing/event/InternalFrameEvent.java index 9c2341d7329..5f825bea5e9 100644 --- a/jdk/src/share/classes/javax/swing/event/InternalFrameEvent.java +++ b/jdk/src/share/classes/javax/swing/event/InternalFrameEvent.java @@ -34,7 +34,7 @@ import javax.swing.JInternalFrame; * although different IDs are used. * Help on handling internal frame events * is in - * How to Write an Internal Frame Listener, + * How to Write an Internal Frame Listener, * a section in The Java Tutorial. *

            * Warning: diff --git a/jdk/src/share/classes/javax/swing/event/InternalFrameListener.java b/jdk/src/share/classes/javax/swing/event/InternalFrameListener.java index 823cad7fa7d..bf04ee219f5 100644 --- a/jdk/src/share/classes/javax/swing/event/InternalFrameListener.java +++ b/jdk/src/share/classes/javax/swing/event/InternalFrameListener.java @@ -32,7 +32,7 @@ import java.util.EventListener; * This class is functionally equivalent to the WindowListener class * in the AWT. *

            - * See How to Write an Internal Frame Listener + * See How to Write an Internal Frame Listener * in The Java Tutorial for further documentation. * * @see java.awt.event.WindowListener diff --git a/jdk/src/share/classes/javax/swing/event/TreeExpansionEvent.java b/jdk/src/share/classes/javax/swing/event/TreeExpansionEvent.java index 62b85d6f51f..d7dff7b0871 100644 --- a/jdk/src/share/classes/javax/swing/event/TreeExpansionEvent.java +++ b/jdk/src/share/classes/javax/swing/event/TreeExpansionEvent.java @@ -34,8 +34,8 @@ import javax.swing.tree.TreePath; *

            * For further documentation and examples see * the following sections in The Java Tutorial: - * How to Write a Tree Expansion Listener and - * How to Write a Tree-Will-Expand Listener. + * How to Write a Tree Expansion Listener and + * How to Write a Tree-Will-Expand Listener. *

            * Warning: * Serialized objects of this class will not be compatible with diff --git a/jdk/src/share/classes/javax/swing/event/TreeExpansionListener.java b/jdk/src/share/classes/javax/swing/event/TreeExpansionListener.java index 977fda173a4..7a2867bf513 100644 --- a/jdk/src/share/classes/javax/swing/event/TreeExpansionListener.java +++ b/jdk/src/share/classes/javax/swing/event/TreeExpansionListener.java @@ -32,7 +32,7 @@ import java.util.EventListener; * a node. * For further documentation and examples see * How to Write a Tree Expansion Listener, + href="http://docs.oracle.com/javase/tutorial/uiswing/events/treeexpansionlistener.html">How to Write a Tree Expansion Listener, * a section in The Java Tutorial. * * @author Scott Violet diff --git a/jdk/src/share/classes/javax/swing/event/TreeModelEvent.java b/jdk/src/share/classes/javax/swing/event/TreeModelEvent.java index 6c6d7cef4cd..0fc036fce69 100644 --- a/jdk/src/share/classes/javax/swing/event/TreeModelEvent.java +++ b/jdk/src/share/classes/javax/swing/event/TreeModelEvent.java @@ -34,7 +34,7 @@ import javax.swing.tree.TreePath; * used to notify tree model listeners of the change. * For more information and examples see * How to Write a Tree Model Listener, + href="http://docs.oracle.com/javase/tutorial/uiswing/events/treemodellistener.html">How to Write a Tree Model Listener, * a section in The Java Tutorial. *

            * Warning: diff --git a/jdk/src/share/classes/javax/swing/event/TreeModelListener.java b/jdk/src/share/classes/javax/swing/event/TreeModelListener.java index 309c9b7d8a7..b48fdfb2548 100644 --- a/jdk/src/share/classes/javax/swing/event/TreeModelListener.java +++ b/jdk/src/share/classes/javax/swing/event/TreeModelListener.java @@ -32,7 +32,7 @@ import java.util.EventListener; * to changes in a TreeModel. * For further information and examples see * How to Write a Tree Model Listener, + href="http://docs.oracle.com/javase/tutorial/uiswing/events/treemodellistener.html">How to Write a Tree Model Listener, * a section in The Java Tutorial. * * @author Rob Davis diff --git a/jdk/src/share/classes/javax/swing/event/TreeSelectionListener.java b/jdk/src/share/classes/javax/swing/event/TreeSelectionListener.java index 7e2d0e84fae..6a344e35145 100644 --- a/jdk/src/share/classes/javax/swing/event/TreeSelectionListener.java +++ b/jdk/src/share/classes/javax/swing/event/TreeSelectionListener.java @@ -32,7 +32,7 @@ import java.util.EventListener; * changes. * For more information and examples see * How to Write a Tree Selection Listener, + href="http://docs.oracle.com/javase/tutorial/uiswing/events/treeselectionlistener.html">How to Write a Tree Selection Listener, * a section in The Java Tutorial. * * @see javax.swing.tree.TreeSelectionModel diff --git a/jdk/src/share/classes/javax/swing/event/TreeWillExpandListener.java b/jdk/src/share/classes/javax/swing/event/TreeWillExpandListener.java index c78ce6979dc..3afb1f1e58f 100644 --- a/jdk/src/share/classes/javax/swing/event/TreeWillExpandListener.java +++ b/jdk/src/share/classes/javax/swing/event/TreeWillExpandListener.java @@ -32,7 +32,7 @@ import javax.swing.tree.ExpandVetoException; * The listener that's notified when a tree expands or collapses * a node. * For further information and examples see - * How to Write a Tree-Will-Expand Listener, + * How to Write a Tree-Will-Expand Listener, * a section in The Java Tutorial. * * @author Scott Violet diff --git a/jdk/src/share/classes/javax/swing/filechooser/FileFilter.java b/jdk/src/share/classes/javax/swing/filechooser/FileFilter.java index 50584c351f2..8cc1586bacc 100644 --- a/jdk/src/share/classes/javax/swing/filechooser/FileFilter.java +++ b/jdk/src/share/classes/javax/swing/filechooser/FileFilter.java @@ -39,7 +39,7 @@ import java.io.File; * For an example implementation of a simple file filter, see * yourJDK/demo/jfc/FileChooserDemo/ExampleFileFilter.java. * For more information and examples see - * How to Use File Choosers, + * How to Use File Choosers, * a section in The Java Tutorial. * * @see FileNameExtensionFilter diff --git a/jdk/src/share/classes/javax/swing/filechooser/FileView.java b/jdk/src/share/classes/javax/swing/filechooser/FileView.java index 7e208b09c9c..30dffc1cbee 100644 --- a/jdk/src/share/classes/javax/swing/filechooser/FileView.java +++ b/jdk/src/share/classes/javax/swing/filechooser/FileView.java @@ -57,7 +57,7 @@ import javax.swing.*; * yourJDK/demo/jfc/FileChooserDemo/ExampleFileView.java. * For more information and examples see * How to Use File Choosers, + href="http://docs.oracle.com/javase/tutorial/uiswing/components/filechooser.html">How to Use File Choosers, * a section in The Java Tutorial. * * @see javax.swing.JFileChooser diff --git a/jdk/src/share/classes/javax/swing/plaf/basic/BasicComboBoxUI.java b/jdk/src/share/classes/javax/swing/plaf/basic/BasicComboBoxUI.java index eec48001160..37764cce509 100644 --- a/jdk/src/share/classes/javax/swing/plaf/basic/BasicComboBoxUI.java +++ b/jdk/src/share/classes/javax/swing/plaf/basic/BasicComboBoxUI.java @@ -54,8 +54,7 @@ import sun.swing.UIAction; *

            * For adding specific actions, * overide installKeyboardActions to add actions in response to - * KeyStroke bindings. See the article Keyboard Bindings in Swing - * at The Swing Connection. + * KeyStroke bindings. See the article How to Use Key Bindings * * @author Arnaud Weber * @author Tom Santos diff --git a/jdk/src/share/classes/javax/swing/plaf/metal/MetalLookAndFeel.java b/jdk/src/share/classes/javax/swing/plaf/metal/MetalLookAndFeel.java index b6208df57c7..8df43e2fa6b 100644 --- a/jdk/src/share/classes/javax/swing/plaf/metal/MetalLookAndFeel.java +++ b/jdk/src/share/classes/javax/swing/plaf/metal/MetalLookAndFeel.java @@ -2361,7 +2361,7 @@ public class MetalLookAndFeel extends BasicLookAndFeel } // From the JLF Design Guidelines: - // http://java.sun.com/products/jlf/ed2/book/HIG.Visual2.html + // http://www.oracle.com/technetwork/java/jlf-135985.html private static class MetalLayoutStyle extends DefaultLayoutStyle { private static MetalLayoutStyle INSTANCE = new MetalLayoutStyle(); diff --git a/jdk/src/share/classes/javax/swing/table/TableModel.java b/jdk/src/share/classes/javax/swing/table/TableModel.java index 43544ee4c7c..2c4794bc980 100644 --- a/jdk/src/share/classes/javax/swing/table/TableModel.java +++ b/jdk/src/share/classes/javax/swing/table/TableModel.java @@ -40,7 +40,7 @@ import javax.swing.event.*; * JTable table = new JTable(myData); *

            * - * For further documentation, see Creating a Table Model + * For further documentation, see Creating a Table Model * in The Java Tutorial. *

            * @author Philip Milne diff --git a/jdk/src/share/classes/javax/swing/text/AbstractDocument.java b/jdk/src/share/classes/javax/swing/text/AbstractDocument.java index a4dad8eed3a..7d98b7ad95b 100644 --- a/jdk/src/share/classes/javax/swing/text/AbstractDocument.java +++ b/jdk/src/share/classes/javax/swing/text/AbstractDocument.java @@ -408,7 +408,7 @@ public abstract class AbstractDocument implements Document, Serializable { *

            * This method is thread safe, although most Swing methods * are not. Please see - * Concurrency + * Concurrency * in Swing for more information. * * @param r the renderer to execute @@ -569,7 +569,7 @@ public abstract class AbstractDocument implements Document, Serializable { *

            * This method is thread safe, although most Swing methods * are not. Please see - * Concurrency + * Concurrency * in Swing for more information. * * @param offs the starting offset >= 0 @@ -682,7 +682,7 @@ public abstract class AbstractDocument implements Document, Serializable { *

            * This method is thread safe, although most Swing methods * are not. Please see - * Concurrency + * Concurrency * in Swing for more information. * * @param offs the starting offset >= 0 @@ -837,7 +837,7 @@ public abstract class AbstractDocument implements Document, Serializable { *

            * This method is thread safe, although most Swing methods * are not. Please see - * Concurrency + * Concurrency * in Swing for more information. * * @param offs the position in the model >= 0 diff --git a/jdk/src/share/classes/javax/swing/text/DefaultCaret.java b/jdk/src/share/classes/javax/swing/text/DefaultCaret.java index 0d2031cff1b..0ba5eddda30 100644 --- a/jdk/src/share/classes/javax/swing/text/DefaultCaret.java +++ b/jdk/src/share/classes/javax/swing/text/DefaultCaret.java @@ -237,7 +237,7 @@ public class DefaultCaret extends Rectangle implements Caret, FocusListener, Mou *

            * This method is thread safe, although most Swing methods * are not. Please see - * Concurrency + * Concurrency * in Swing for more information. */ protected final synchronized void repaint() { diff --git a/jdk/src/share/classes/javax/swing/text/DefaultStyledDocument.java b/jdk/src/share/classes/javax/swing/text/DefaultStyledDocument.java index 4a6419e77d6..cfa9a578fbc 100644 --- a/jdk/src/share/classes/javax/swing/text/DefaultStyledDocument.java +++ b/jdk/src/share/classes/javax/swing/text/DefaultStyledDocument.java @@ -173,7 +173,7 @@ public class DefaultStyledDocument extends AbstractDocument implements StyledDoc *

            * This method is thread safe, although most Swing methods * are not. Please see - * Concurrency + * Concurrency * in Swing for more information. * * @param offset the starting offset >= 0 @@ -426,7 +426,7 @@ public class DefaultStyledDocument extends AbstractDocument implements StyledDoc *

            * This method is thread safe, although most Swing methods * are not. Please see - * Concurrency + * Concurrency * in Swing for more information. * * @param pos the offset from the start of the document >= 0 @@ -483,7 +483,7 @@ public class DefaultStyledDocument extends AbstractDocument implements StyledDoc *

            * This method is thread safe, although most Swing methods * are not. Please see - * Concurrency + * Concurrency * in Swing for more information. * * @param offset the offset in the document >= 0 @@ -536,7 +536,7 @@ public class DefaultStyledDocument extends AbstractDocument implements StyledDoc *

            * This method is thread safe, although most Swing methods * are not. Please see - * Concurrency + * Concurrency * in Swing for more information. * * @param offset the offset into the paragraph >= 0 diff --git a/jdk/src/share/classes/javax/swing/text/JTextComponent.java b/jdk/src/share/classes/javax/swing/text/JTextComponent.java index c88b1165615..2f3ab8114f1 100644 --- a/jdk/src/share/classes/javax/swing/text/JTextComponent.java +++ b/jdk/src/share/classes/javax/swing/text/JTextComponent.java @@ -84,7 +84,7 @@ import sun.swing.SwingAccessor; * support). * You can find information on how to use the functionality * this class provides in - * General Rules for Using Text Components, + * General Rules for Using Text Components, * a section in The Java Tutorial. * *

            @@ -2215,7 +2215,7 @@ public abstract class JTextComponent extends JComponent implements Scrollable, A *

            * This method is thread-safe, although most Swing methods are not. Please * see + * HREF="http://docs.oracle.com/javase/tutorial/uiswing/concurrency/index.html"> * Concurrency in Swing for more information. * *

            @@ -2473,7 +2473,7 @@ public abstract class JTextComponent extends JComponent implements Scrollable, A *

            * This method is thread-safe, although most Swing methods are not. Please * see + * HREF="http://docs.oracle.com/javase/tutorial/uiswing/concurrency/index.html"> * Concurrency in Swing for more information. * *

            diff --git a/jdk/src/share/classes/javax/swing/text/PlainDocument.java b/jdk/src/share/classes/javax/swing/text/PlainDocument.java index 8424faf092c..783a5d68ea7 100644 --- a/jdk/src/share/classes/javax/swing/text/PlainDocument.java +++ b/jdk/src/share/classes/javax/swing/text/PlainDocument.java @@ -100,7 +100,7 @@ public class PlainDocument extends AbstractDocument { *

            * This method is thread safe, although most Swing methods * are not. Please see - * Concurrency + * Concurrency * in Swing for more information. * * @param offs the starting offset >= 0 diff --git a/jdk/src/share/classes/javax/swing/text/StyleContext.java b/jdk/src/share/classes/javax/swing/text/StyleContext.java index ac11b1f82f4..6aa1952db80 100644 --- a/jdk/src/share/classes/javax/swing/text/StyleContext.java +++ b/jdk/src/share/classes/javax/swing/text/StyleContext.java @@ -292,7 +292,7 @@ public class StyleContext implements Serializable, AbstractDocument.AttributeCon *

            * This method is thread safe, although most Swing methods * are not. Please see - * Concurrency + * Concurrency * in Swing for more information. * * @param old the old attribute set @@ -321,7 +321,7 @@ public class StyleContext implements Serializable, AbstractDocument.AttributeCon *

            * This method is thread safe, although most Swing methods * are not. Please see - * Concurrency + * Concurrency * in Swing for more information. * * @param old the old attribute set @@ -349,7 +349,7 @@ public class StyleContext implements Serializable, AbstractDocument.AttributeCon *

            * This method is thread safe, although most Swing methods * are not. Please see - * Concurrency + * Concurrency * in Swing for more information. * * @param old the old set of attributes @@ -377,7 +377,7 @@ public class StyleContext implements Serializable, AbstractDocument.AttributeCon *

            * This method is thread safe, although most Swing methods * are not. Please see - * Concurrency + * Concurrency * in Swing for more information. * * @param old the old attribute set @@ -405,7 +405,7 @@ public class StyleContext implements Serializable, AbstractDocument.AttributeCon *

            * This method is thread safe, although most Swing methods * are not. Please see - * Concurrency + * Concurrency * in Swing for more information. * * @param old the old attribute set @@ -445,7 +445,7 @@ public class StyleContext implements Serializable, AbstractDocument.AttributeCon *

            * This method is thread safe, although most Swing methods * are not. Please see - * Concurrency + * Concurrency * in Swing for more information. * * @param a the set to reclaim diff --git a/jdk/src/share/classes/javax/swing/text/html/HTMLDocument.java b/jdk/src/share/classes/javax/swing/text/html/HTMLDocument.java index 7f11b299939..abbee8037fb 100644 --- a/jdk/src/share/classes/javax/swing/text/html/HTMLDocument.java +++ b/jdk/src/share/classes/javax/swing/text/html/HTMLDocument.java @@ -475,7 +475,7 @@ public class HTMLDocument extends DefaultStyledDocument { *

            * This method is thread safe, although most Swing methods * are not. Please see - * Concurrency + * Concurrency * in Swing for more information. * * @param offset the offset into the paragraph (must be at least 0) diff --git a/jdk/src/share/classes/javax/swing/tree/DefaultMutableTreeNode.java b/jdk/src/share/classes/javax/swing/tree/DefaultMutableTreeNode.java index e5b01a4fc57..874515e6c04 100644 --- a/jdk/src/share/classes/javax/swing/tree/DefaultMutableTreeNode.java +++ b/jdk/src/share/classes/javax/swing/tree/DefaultMutableTreeNode.java @@ -35,7 +35,7 @@ import java.util.*; * structure. * For examples of using default mutable tree nodes, see * How to Use Trees + href="http://docs.oracle.com/javase/tutorial/uiswing/components/tree.html">How to Use Trees * in The Java Tutorial. * *

            diff --git a/jdk/src/share/classes/javax/swing/tree/DefaultTreeCellRenderer.java b/jdk/src/share/classes/javax/swing/tree/DefaultTreeCellRenderer.java index d4b58260849..213bf06f569 100644 --- a/jdk/src/share/classes/javax/swing/tree/DefaultTreeCellRenderer.java +++ b/jdk/src/share/classes/javax/swing/tree/DefaultTreeCellRenderer.java @@ -49,7 +49,7 @@ import sun.swing.DefaultLookup; * DefaultTreeCellRenderer is not opaque and * unless you subclass paint you should not change this. * See How to Use Trees + href="http://docs.oracle.com/javase/tutorial/uiswing/components/tree.html">How to Use Trees * in The Java Tutorial * for examples of customizing node display using this class. *

            diff --git a/jdk/src/share/classes/javax/swing/tree/DefaultTreeModel.java b/jdk/src/share/classes/javax/swing/tree/DefaultTreeModel.java index 794f11baaa5..034d9256096 100644 --- a/jdk/src/share/classes/javax/swing/tree/DefaultTreeModel.java +++ b/jdk/src/share/classes/javax/swing/tree/DefaultTreeModel.java @@ -33,7 +33,7 @@ import javax.swing.event.*; /** * A simple tree data model that uses TreeNodes. * For further information and examples that use DefaultTreeModel, - * see How to Use Trees + * see How to Use Trees * in The Java Tutorial. *

            * Warning: diff --git a/jdk/src/share/classes/javax/swing/tree/ExpandVetoException.java b/jdk/src/share/classes/javax/swing/tree/ExpandVetoException.java index 3295b56e635..b13f50e8d80 100644 --- a/jdk/src/share/classes/javax/swing/tree/ExpandVetoException.java +++ b/jdk/src/share/classes/javax/swing/tree/ExpandVetoException.java @@ -30,7 +30,7 @@ import javax.swing.event.TreeExpansionEvent; /** * Exception used to stop and expand/collapse from happening. * See How to Write a Tree-Will-Expand Listener + href="http://docs.oracle.com/javase/tutorial/uiswing/events/treewillexpandlistener.html">How to Write a Tree-Will-Expand Listener * in The Java Tutorial * for further information and examples. * diff --git a/jdk/src/share/classes/javax/swing/tree/TreeCellRenderer.java b/jdk/src/share/classes/javax/swing/tree/TreeCellRenderer.java index 8c352cb1fbe..533e5e47dbb 100644 --- a/jdk/src/share/classes/javax/swing/tree/TreeCellRenderer.java +++ b/jdk/src/share/classes/javax/swing/tree/TreeCellRenderer.java @@ -30,7 +30,7 @@ import javax.swing.JTree; /** * Defines the requirements for an object that displays a tree node. * See How to Use Trees + href="http://docs.oracle.com/javase/tutorial/uiswing/components/tree.html">How to Use Trees * in The Java Tutorial * for an example of implementing a tree cell renderer * that displays custom icons. diff --git a/jdk/src/share/classes/javax/swing/tree/TreeModel.java b/jdk/src/share/classes/javax/swing/tree/TreeModel.java index b5a998c55a0..49f1d9f5139 100644 --- a/jdk/src/share/classes/javax/swing/tree/TreeModel.java +++ b/jdk/src/share/classes/javax/swing/tree/TreeModel.java @@ -50,7 +50,7 @@ import javax.swing.event.*; * For further information on tree models, * including an example of a custom implementation, * see How to Use Trees + href="http://docs.oracle.com/javase/tutorial/uiswing/components/tree.html">How to Use Trees * in The Java Tutorial. * * @see TreePath diff --git a/jdk/src/share/classes/javax/swing/tree/TreeNode.java b/jdk/src/share/classes/javax/swing/tree/TreeNode.java index 7db0f971475..5931cc635e6 100644 --- a/jdk/src/share/classes/javax/swing/tree/TreeNode.java +++ b/jdk/src/share/classes/javax/swing/tree/TreeNode.java @@ -37,7 +37,7 @@ import java.util.Enumeration; * * For further information and examples of using tree nodes, * see How to Use Tree Nodes + href="http://docs.oracle.com/javase/tutorial/uiswing/components/tree.html">How to Use Tree Nodes * in The Java Tutorial. * * @author Rob Davis diff --git a/jdk/src/share/classes/javax/swing/tree/TreePath.java b/jdk/src/share/classes/javax/swing/tree/TreePath.java index 33c42a7bb67..df7818d5bcf 100644 --- a/jdk/src/share/classes/javax/swing/tree/TreePath.java +++ b/jdk/src/share/classes/javax/swing/tree/TreePath.java @@ -66,7 +66,7 @@ import java.beans.ConstructorProperties; *

            * For further information and examples of using tree paths, * see How to Use Trees + href="http://docs.oracle.com/javase/tutorial/uiswing/components/tree.html">How to Use Trees * in The Java Tutorial. *

            * Warning: diff --git a/jdk/src/share/classes/javax/swing/tree/TreeSelectionModel.java b/jdk/src/share/classes/javax/swing/tree/TreeSelectionModel.java index 4c491277e36..bc08aef6580 100644 --- a/jdk/src/share/classes/javax/swing/tree/TreeSelectionModel.java +++ b/jdk/src/share/classes/javax/swing/tree/TreeSelectionModel.java @@ -32,7 +32,7 @@ import java.beans.PropertyChangeListener; * This interface represents the current state of the selection for * the tree component. * For information and examples of using tree selection models, - * see How to Use Trees + * see How to Use Trees * in The Java Tutorial. * *

            diff --git a/jdk/src/share/classes/sun/swing/PrintingStatus.java b/jdk/src/share/classes/sun/swing/PrintingStatus.java index af3658bddef..d5b7aee900c 100644 --- a/jdk/src/share/classes/sun/swing/PrintingStatus.java +++ b/jdk/src/share/classes/sun/swing/PrintingStatus.java @@ -43,7 +43,7 @@ import java.lang.reflect.InvocationTargetException; *

            * Methods of these class are thread safe, although most Swing methods * are not. Please see - * Concurrency + * Concurrency * in Swing for more information. * * @author Alexander Potochkin diff --git a/jdk/src/share/classes/sun/text/normalizer/UCharacter.java b/jdk/src/share/classes/sun/text/normalizer/UCharacter.java index 728b903aa84..015bd913037 100644 --- a/jdk/src/share/classes/sun/text/normalizer/UCharacter.java +++ b/jdk/src/share/classes/sun/text/normalizer/UCharacter.java @@ -42,7 +42,7 @@ import java.util.MissingResourceException; /** *

            * The UCharacter class provides extensions to the - * + * * java.lang.Character class. These extensions provide support for * more Unicode properties and together with the UTF16 * class, provide support for supplementary characters (those with code diff --git a/jdk/src/share/demo/jfc/FileChooserDemo/FileChooserDemo.java b/jdk/src/share/demo/jfc/FileChooserDemo/FileChooserDemo.java index bfb74b43308..e492e09e032 100644 --- a/jdk/src/share/demo/jfc/FileChooserDemo/FileChooserDemo.java +++ b/jdk/src/share/demo/jfc/FileChooserDemo/FileChooserDemo.java @@ -800,7 +800,7 @@ public class FileChooserDemo extends JPanel implements ActionListener { * NOTE: By default, the look and feel will be set to the * Cross Platform Look and Feel (which is currently Metal). * The following code tries to set the Look and Feel to Nimbus. - * http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/nimbus.html + * http://docs.oracle.com/javase/tutorial/uiswing/lookandfeel/nimbus.html */ try { for (LookAndFeelInfo info : UIManager. From c1c21c0ff1d4934931f72f31799c65d1703f2d99 Mon Sep 17 00:00:00 2001 From: Johnny Chen Date: Fri, 4 Oct 2013 16:17:59 -0700 Subject: [PATCH 086/131] 8025940: Windows build fails after the fix for 8025280 Reviewed-by: prr, jgodinez --- jdk/src/share/native/sun/java2d/loops/MaskBlit.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/jdk/src/share/native/sun/java2d/loops/MaskBlit.c b/jdk/src/share/native/sun/java2d/loops/MaskBlit.c index 3463315bcf6..83f9493d74b 100644 --- a/jdk/src/share/native/sun/java2d/loops/MaskBlit.c +++ b/jdk/src/share/native/sun/java2d/loops/MaskBlit.c @@ -99,6 +99,8 @@ Java_sun_java2d_loops_MaskBlit_MaskBlit (maskArray ? (*env)->GetPrimitiveArrayCritical(env, maskArray, 0) : 0); + jint savesx = srcInfo.bounds.x1; + jint savedx = dstInfo.bounds.x1; if (maskArray != NULL && pMask == NULL) { SurfaceData_InvokeRelease(env, dstOps, &dstInfo); SurfaceData_InvokeRelease(env, srcOps, &srcInfo); @@ -106,8 +108,6 @@ Java_sun_java2d_loops_MaskBlit_MaskBlit SurfaceData_InvokeUnlock(env, srcOps, &srcInfo); return; } - jint savesx = srcInfo.bounds.x1; - jint savedx = dstInfo.bounds.x1; Region_StartIteration(env, &clipInfo); while (Region_NextIteration(&clipInfo, &span)) { void *pSrc = PtrCoord(srcInfo.rasBase, From d3158f2d7676656c784c952d060ad77cdd04dab7 Mon Sep 17 00:00:00 2001 From: Chris Hegarty Date: Mon, 7 Oct 2013 11:31:37 +0100 Subject: [PATCH 087/131] 8025991: tools/launcher/RunpathTest.java fails Reviewed-by: erikj --- jdk/test/tools/launcher/RunpathTest.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/jdk/test/tools/launcher/RunpathTest.java b/jdk/test/tools/launcher/RunpathTest.java index a04609934a5..26233b28561 100644 --- a/jdk/test/tools/launcher/RunpathTest.java +++ b/jdk/test/tools/launcher/RunpathTest.java @@ -64,8 +64,8 @@ public class RunpathTest extends TestHelper { } void testRpath() { - String expectedRpath = ".*RPATH.*\\$ORIGIN/../../lib/" + getJreArch() + ".*"; - elfCheck(java64Cmd, expectedRpath); + String expectedRpath = ".*RPATH.*\\$ORIGIN/../lib/" + getJreArch() + ".*"; + elfCheck(javaCmd, expectedRpath); } public static void main(String... args) throws Exception { From 254c852564782a413dbb94afafbe3523025f2ce2 Mon Sep 17 00:00:00 2001 From: Alexander Scherbatiy Date: Mon, 7 Oct 2013 16:13:48 +0400 Subject: [PATCH 088/131] 8025438: [macosx] right JNFCall* method should be used in JDK-8008728 fix Reviewed-by: serb, anthony --- jdk/src/macosx/native/sun/awt/AWTWindow.m | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/jdk/src/macosx/native/sun/awt/AWTWindow.m b/jdk/src/macosx/native/sun/awt/AWTWindow.m index c933379f141..2231f10d1bf 100644 --- a/jdk/src/macosx/native/sun/awt/AWTWindow.m +++ b/jdk/src/macosx/native/sun/awt/AWTWindow.m @@ -366,7 +366,7 @@ AWT_ASSERT_APPKIT_THREAD; - (BOOL) canBecomeMainWindow { AWT_ASSERT_APPKIT_THREAD; - if(!self.isEnabled){ + if (!self.isEnabled) { // Native system can bring up the NSWindow to // the top even if the window is not main. // We should bring up the modal dialog manually @@ -377,7 +377,7 @@ AWT_ASSERT_APPKIT_THREAD; if (platformWindow != NULL) { static JNF_MEMBER_CACHE(jm_checkBlockingAndOrder, jc_CPlatformWindow, "checkBlockingAndOrder", "()Z"); - JNFCallVoidMethod(env, platformWindow, jm_checkBlockingAndOrder); + JNFCallBooleanMethod(env, platformWindow, jm_checkBlockingAndOrder); (*env)->DeleteLocalRef(env, platformWindow); } } From 3b9db3b7b2f8c3bfe24a495d766fe47ff2c50e56 Mon Sep 17 00:00:00 2001 From: Alexander Scherbatiy Date: Mon, 7 Oct 2013 16:42:29 +0400 Subject: [PATCH 089/131] 8007219: [macosx] Frame size reverts meaning of maximized attribute if frame size close to display Reviewed-by: serb, anthony --- .../classes/sun/lwawt/LWWindowPeer.java | 23 ++++-- .../sun/lwawt/macosx/CPlatformWindow.java | 10 +-- .../classes/sun/lwawt/macosx/CWrapper.java | 1 + jdk/src/macosx/native/sun/awt/CWrapper.m | 23 ++++++ .../MaximizedToMaximized.java | 76 +++++++++++++++++++ 5 files changed, 122 insertions(+), 11 deletions(-) create mode 100644 jdk/test/java/awt/Frame/MaximizedToMaximized/MaximizedToMaximized.java diff --git a/jdk/src/macosx/classes/sun/lwawt/LWWindowPeer.java b/jdk/src/macosx/classes/sun/lwawt/LWWindowPeer.java index 105899034fc..44aafc59d11 100644 --- a/jdk/src/macosx/classes/sun/lwawt/LWWindowPeer.java +++ b/jdk/src/macosx/classes/sun/lwawt/LWWindowPeer.java @@ -317,9 +317,25 @@ public class LWWindowPeer op |= SET_SIZE; } + // Don't post ComponentMoved/Resized and Paint events + // until we've got a notification from the delegate + Rectangle cb = constrainBounds(x, y, w, h); + setBounds(cb.x, cb.y, cb.width, cb.height, op, false, false); + // Get updated bounds, so we don't have to handle 'op' here manually + Rectangle r = getBounds(); + platformWindow.setBounds(r.x, r.y, r.width, r.height); + } + + public Rectangle constrainBounds(Rectangle bounds) { + return constrainBounds(bounds.x, bounds.y, bounds.width, bounds.height); + } + + public Rectangle constrainBounds(int x, int y, int w, int h) { + if (w < MINIMUM_WIDTH) { w = MINIMUM_WIDTH; } + if (h < MINIMUM_HEIGHT) { h = MINIMUM_HEIGHT; } @@ -334,12 +350,7 @@ public class LWWindowPeer h = maxH; } - // Don't post ComponentMoved/Resized and Paint events - // until we've got a notification from the delegate - setBounds(x, y, w, h, op, false, false); - // Get updated bounds, so we don't have to handle 'op' here manually - Rectangle r = getBounds(); - platformWindow.setBounds(r.x, r.y, r.width, r.height); + return new Rectangle(x, y, w, h); } @Override diff --git a/jdk/src/macosx/classes/sun/lwawt/macosx/CPlatformWindow.java b/jdk/src/macosx/classes/sun/lwawt/macosx/CPlatformWindow.java index b85942002fb..8fca7df691d 100644 --- a/jdk/src/macosx/classes/sun/lwawt/macosx/CPlatformWindow.java +++ b/jdk/src/macosx/classes/sun/lwawt/macosx/CPlatformWindow.java @@ -210,7 +210,6 @@ public class CPlatformWindow extends CFRetainedResource implements PlatformWindo private boolean undecorated; // initialized in getInitialStyleBits() private Rectangle normalBounds = null; // not-null only for undecorated maximized windows private CPlatformResponder responder; - private volatile boolean zoomed = false; // from native perspective public CPlatformWindow() { super(0, true); @@ -231,7 +230,9 @@ public class CPlatformWindow extends CFRetainedResource implements PlatformWindo contentView.initialize(peer, responder); final long ownerPtr = owner != null ? owner.getNSWindowPtr() : 0L; - final long nativeWindowPtr = nativeCreateNSWindow(contentView.getAWTView(), ownerPtr, styleBits, 0, 0, 0, 0); + Rectangle bounds = _peer.constrainBounds(_target.getBounds()); + final long nativeWindowPtr = nativeCreateNSWindow(contentView.getAWTView(), + ownerPtr, styleBits, bounds.x, bounds.y, bounds.width, bounds.height); setPtr(nativeWindowPtr); if (target instanceof javax.swing.RootPaneContainer) { @@ -466,7 +467,8 @@ public class CPlatformWindow extends CFRetainedResource implements PlatformWindo } private boolean isMaximized() { - return undecorated ? this.normalBounds != null : zoomed; + return undecorated ? this.normalBounds != null + : CWrapper.NSWindow.isZoomed(getNSWindowPtr()); } private void maximize() { @@ -474,7 +476,6 @@ public class CPlatformWindow extends CFRetainedResource implements PlatformWindo return; } if (!undecorated) { - zoomed = true; CWrapper.NSWindow.zoom(getNSWindowPtr()); } else { deliverZoom(true); @@ -496,7 +497,6 @@ public class CPlatformWindow extends CFRetainedResource implements PlatformWindo return; } if (!undecorated) { - zoomed = false; CWrapper.NSWindow.zoom(getNSWindowPtr()); } else { deliverZoom(false); diff --git a/jdk/src/macosx/classes/sun/lwawt/macosx/CWrapper.java b/jdk/src/macosx/classes/sun/lwawt/macosx/CWrapper.java index 7dc421e26b1..879118cf2e1 100644 --- a/jdk/src/macosx/classes/sun/lwawt/macosx/CWrapper.java +++ b/jdk/src/macosx/classes/sun/lwawt/macosx/CWrapper.java @@ -68,6 +68,7 @@ public final class CWrapper { public static native void miniaturize(long window); public static native void deminiaturize(long window); + public static native boolean isZoomed(long window); public static native void zoom(long window); public static native void makeFirstResponder(long window, long responder); diff --git a/jdk/src/macosx/native/sun/awt/CWrapper.m b/jdk/src/macosx/native/sun/awt/CWrapper.m index ccc688e802d..a658a5df64a 100644 --- a/jdk/src/macosx/native/sun/awt/CWrapper.m +++ b/jdk/src/macosx/native/sun/awt/CWrapper.m @@ -435,6 +435,29 @@ JNF_COCOA_ENTER(env); JNF_COCOA_EXIT(env); } +/* + * Class: sun_lwawt_macosx_CWrapper$NSWindow + * Method: isZoomed + * Signature: (J)Z + */ +JNIEXPORT jboolean JNICALL +Java_sun_lwawt_macosx_CWrapper_00024NSWindow_isZoomed +(JNIEnv *env, jclass cls, jlong windowPtr) +{ + __block jboolean isZoomed = JNI_FALSE; + +JNF_COCOA_ENTER(env); + + NSWindow *window = (NSWindow *)jlong_to_ptr(windowPtr); + [ThreadUtilities performOnMainThreadWaiting:YES block:^(){ + isZoomed = [window isZoomed]; + }]; + +JNF_COCOA_EXIT(env); + + return isZoomed; +} + /* * Class: sun_lwawt_macosx_CWrapper$NSWindow * Method: zoom diff --git a/jdk/test/java/awt/Frame/MaximizedToMaximized/MaximizedToMaximized.java b/jdk/test/java/awt/Frame/MaximizedToMaximized/MaximizedToMaximized.java new file mode 100644 index 00000000000..83fcfa1701d --- /dev/null +++ b/jdk/test/java/awt/Frame/MaximizedToMaximized/MaximizedToMaximized.java @@ -0,0 +1,76 @@ +/* + * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +import java.awt.Dimension; +import java.awt.Frame; +import java.awt.GraphicsDevice; +import java.awt.GraphicsEnvironment; +import java.awt.Insets; +import java.awt.Rectangle; +import java.awt.Toolkit; +import sun.awt.SunToolkit; + +/** + * @test + * @bug 8007219 + * @author Alexander Scherbatiy + * @summary Frame size reverts meaning of maximized attribute + * @run main MaximizedToMaximized + */ +public class MaximizedToMaximized { + + public static void main(String[] args) throws Exception { + + Frame frame = new Frame(); + final Toolkit toolkit = Toolkit.getDefaultToolkit(); + final GraphicsEnvironment graphicsEnvironment = + GraphicsEnvironment.getLocalGraphicsEnvironment(); + final GraphicsDevice graphicsDevice = + graphicsEnvironment.getDefaultScreenDevice(); + + final Dimension screenSize = toolkit.getScreenSize(); + final Insets screenInsets = toolkit.getScreenInsets( + graphicsDevice.getDefaultConfiguration()); + + final Rectangle availableScreenBounds = new Rectangle(screenSize); + + availableScreenBounds.x += screenInsets.left; + availableScreenBounds.y += screenInsets.top; + availableScreenBounds.width -= (screenInsets.left + screenInsets.right); + availableScreenBounds.height -= (screenInsets.top + screenInsets.bottom); + + frame.setBounds(availableScreenBounds.x, availableScreenBounds.y, + availableScreenBounds.width, availableScreenBounds.height); + frame.setVisible(true); + + Rectangle frameBounds = frame.getBounds(); + frame.setExtendedState(Frame.MAXIMIZED_BOTH); + ((SunToolkit) toolkit).realSync(); + + Rectangle maximizedFrameBounds = frame.getBounds(); + if (maximizedFrameBounds.width < frameBounds.width + || maximizedFrameBounds.height < frameBounds.height) { + throw new RuntimeException("Maximized frame is smaller than non maximized"); + } + } +} From f00b2dd7ad998706183526e323cd3a57dc9af62a Mon Sep 17 00:00:00 2001 From: Christine Lu Date: Mon, 7 Oct 2013 11:34:44 -0700 Subject: [PATCH 090/131] 8025840: Fix all the doclint warnings about trademark Reviewed-by: art --- .../classes/javax/swing/AbstractAction.java | 2 +- .../classes/javax/swing/AbstractButton.java | 6 +++--- .../classes/javax/swing/AbstractCellEditor.java | 2 +- .../classes/javax/swing/AbstractListModel.java | 2 +- jdk/src/share/classes/javax/swing/Box.java | 4 ++-- jdk/src/share/classes/javax/swing/BoxLayout.java | 8 ++++---- .../share/classes/javax/swing/ButtonGroup.java | 2 +- .../classes/javax/swing/CellRendererPane.java | 2 +- .../javax/swing/DefaultBoundedRangeModel.java | 2 +- .../classes/javax/swing/DefaultButtonModel.java | 2 +- .../classes/javax/swing/DefaultCellEditor.java | 2 +- .../javax/swing/DefaultListCellRenderer.java | 4 ++-- .../classes/javax/swing/DefaultListModel.java | 2 +- .../javax/swing/DefaultListSelectionModel.java | 2 +- .../javax/swing/DefaultSingleSelectionModel.java | 2 +- jdk/src/share/classes/javax/swing/ImageIcon.java | 4 ++-- jdk/src/share/classes/javax/swing/JApplet.java | 2 +- jdk/src/share/classes/javax/swing/JButton.java | 4 ++-- jdk/src/share/classes/javax/swing/JCheckBox.java | 4 ++-- .../classes/javax/swing/JCheckBoxMenuItem.java | 4 ++-- .../share/classes/javax/swing/JColorChooser.java | 2 +- jdk/src/share/classes/javax/swing/JComboBox.java | 4 ++-- .../share/classes/javax/swing/JComponent.java | 4 ++-- .../share/classes/javax/swing/JDesktopPane.java | 4 ++-- jdk/src/share/classes/javax/swing/JDialog.java | 2 +- .../share/classes/javax/swing/JEditorPane.java | 6 +++--- .../classes/javax/swing/JFormattedTextField.java | 4 ++-- jdk/src/share/classes/javax/swing/JFrame.java | 2 +- .../classes/javax/swing/JInternalFrame.java | 8 ++++---- jdk/src/share/classes/javax/swing/JLabel.java | 4 ++-- .../share/classes/javax/swing/JLayeredPane.java | 4 ++-- jdk/src/share/classes/javax/swing/JList.java | 6 +++--- jdk/src/share/classes/javax/swing/JMenu.java | 6 +++--- jdk/src/share/classes/javax/swing/JMenuBar.java | 4 ++-- jdk/src/share/classes/javax/swing/JMenuItem.java | 4 ++-- .../share/classes/javax/swing/JOptionPane.java | 4 ++-- jdk/src/share/classes/javax/swing/JPanel.java | 4 ++-- .../classes/javax/swing/JPasswordField.java | 4 ++-- .../share/classes/javax/swing/JPopupMenu.java | 2 +- .../share/classes/javax/swing/JProgressBar.java | 6 +++--- .../share/classes/javax/swing/JRadioButton.java | 4 ++-- .../javax/swing/JRadioButtonMenuItem.java | 4 ++-- jdk/src/share/classes/javax/swing/JRootPane.java | 10 +++++----- .../share/classes/javax/swing/JScrollBar.java | 4 ++-- .../share/classes/javax/swing/JScrollPane.java | 6 +++--- .../share/classes/javax/swing/JSeparator.java | 4 ++-- jdk/src/share/classes/javax/swing/JSlider.java | 4 ++-- jdk/src/share/classes/javax/swing/JSpinner.java | 2 +- .../share/classes/javax/swing/JSplitPane.java | 4 ++-- .../share/classes/javax/swing/JTabbedPane.java | 4 ++-- jdk/src/share/classes/javax/swing/JTable.java | 4 ++-- jdk/src/share/classes/javax/swing/JTextArea.java | 4 ++-- .../share/classes/javax/swing/JTextField.java | 4 ++-- jdk/src/share/classes/javax/swing/JTextPane.java | 2 +- .../share/classes/javax/swing/JToggleButton.java | 6 +++--- jdk/src/share/classes/javax/swing/JToolBar.java | 2 +- jdk/src/share/classes/javax/swing/JToolTip.java | 4 ++-- jdk/src/share/classes/javax/swing/JTree.java | 10 +++++----- jdk/src/share/classes/javax/swing/JViewport.java | 6 +++--- jdk/src/share/classes/javax/swing/JWindow.java | 2 +- jdk/src/share/classes/javax/swing/KeyStroke.java | 2 +- .../share/classes/javax/swing/OverlayLayout.java | 2 +- .../classes/javax/swing/ScrollPaneLayout.java | 2 +- .../classes/javax/swing/SizeRequirements.java | 2 +- jdk/src/share/classes/javax/swing/Spring.java | 2 +- .../share/classes/javax/swing/SpringLayout.java | 2 +- jdk/src/share/classes/javax/swing/Timer.java | 2 +- .../share/classes/javax/swing/UIDefaults.java | 2 +- jdk/src/share/classes/javax/swing/UIManager.java | 2 +- .../swing/UnsupportedLookAndFeelException.java | 2 +- .../classes/javax/swing/ViewportLayout.java | 2 +- .../javax/swing/border/AbstractBorder.java | 2 +- .../classes/javax/swing/border/BevelBorder.java | 2 +- .../javax/swing/border/CompoundBorder.java | 2 +- .../classes/javax/swing/border/EmptyBorder.java | 2 +- .../classes/javax/swing/border/EtchedBorder.java | 2 +- .../classes/javax/swing/border/LineBorder.java | 2 +- .../classes/javax/swing/border/MatteBorder.java | 2 +- .../javax/swing/border/SoftBevelBorder.java | 2 +- .../classes/javax/swing/border/TitledBorder.java | 2 +- .../colorchooser/AbstractColorChooserPanel.java | 2 +- .../ColorChooserComponentFactory.java | 2 +- .../swing/colorchooser/DefaultPreviewPanel.java | 2 +- .../colorchooser/DefaultSwatchChooserPanel.java | 2 +- .../classes/javax/swing/event/AncestorEvent.java | 2 +- .../classes/javax/swing/event/CaretEvent.java | 2 +- .../classes/javax/swing/event/ChangeEvent.java | 2 +- .../javax/swing/event/EventListenerList.java | 2 +- .../javax/swing/event/HyperlinkEvent.java | 2 +- .../javax/swing/event/InternalFrameEvent.java | 2 +- .../classes/javax/swing/event/ListDataEvent.java | 2 +- .../javax/swing/event/ListSelectionEvent.java | 2 +- .../javax/swing/event/MenuDragMouseEvent.java | 2 +- .../classes/javax/swing/event/MenuEvent.java | 2 +- .../classes/javax/swing/event/MenuKeyEvent.java | 2 +- .../javax/swing/event/PopupMenuEvent.java | 2 +- .../javax/swing/event/TableColumnModelEvent.java | 2 +- .../javax/swing/event/TableModelEvent.java | 2 +- .../javax/swing/event/TreeExpansionEvent.java | 2 +- .../javax/swing/event/TreeModelEvent.java | 2 +- .../javax/swing/event/TreeSelectionEvent.java | 2 +- .../javax/swing/event/UndoableEditEvent.java | 2 +- .../javax/swing/plaf/BorderUIResource.java | 2 +- .../javax/swing/plaf/ColorUIResource.java | 2 +- .../javax/swing/plaf/DimensionUIResource.java | 2 +- .../classes/javax/swing/plaf/FontUIResource.java | 2 +- .../classes/javax/swing/plaf/IconUIResource.java | 2 +- .../javax/swing/plaf/InsetsUIResource.java | 2 +- .../javax/swing/plaf/basic/BasicArrowButton.java | 2 +- .../javax/swing/plaf/basic/BasicCheckBoxUI.java | 2 +- .../swing/plaf/basic/BasicComboBoxEditor.java | 2 +- .../swing/plaf/basic/BasicComboBoxRenderer.java | 4 ++-- .../javax/swing/plaf/basic/BasicComboPopup.java | 2 +- .../swing/plaf/basic/BasicEditorPaneUI.java | 2 +- .../javax/swing/plaf/basic/BasicIconFactory.java | 2 +- .../plaf/basic/BasicInternalFrameTitlePane.java | 2 +- .../javax/swing/plaf/basic/BasicListUI.java | 8 ++++---- .../javax/swing/plaf/basic/BasicLookAndFeel.java | 2 +- .../swing/plaf/basic/BasicSplitPaneDivider.java | 4 ++-- .../javax/swing/plaf/basic/BasicTextAreaUI.java | 2 +- .../javax/swing/plaf/basic/BasicTextFieldUI.java | 2 +- .../javax/swing/plaf/basic/BasicTextPaneUI.java | 2 +- .../javax/swing/plaf/basic/BasicTextUI.java | 2 +- .../javax/swing/plaf/basic/ComboPopup.java | 2 +- .../swing/plaf/metal/DefaultMetalTheme.java | 2 +- .../javax/swing/plaf/metal/MetalButtonUI.java | 2 +- .../swing/plaf/metal/MetalCheckBoxIcon.java | 2 +- .../javax/swing/plaf/metal/MetalCheckBoxUI.java | 2 +- .../swing/plaf/metal/MetalComboBoxButton.java | 2 +- .../swing/plaf/metal/MetalComboBoxEditor.java | 4 ++-- .../javax/swing/plaf/metal/MetalComboBoxUI.java | 2 +- .../javax/swing/plaf/metal/MetalIconFactory.java | 12 ++++++------ .../javax/swing/plaf/metal/MetalLookAndFeel.java | 2 +- .../swing/plaf/metal/MetalProgressBarUI.java | 2 +- .../swing/plaf/metal/MetalRadioButtonUI.java | 2 +- .../javax/swing/plaf/metal/MetalRootPaneUI.java | 2 +- .../swing/plaf/metal/MetalScrollButton.java | 2 +- .../swing/plaf/metal/MetalScrollPaneUI.java | 2 +- .../javax/swing/plaf/metal/MetalSeparatorUI.java | 2 +- .../javax/swing/plaf/metal/MetalSliderUI.java | 2 +- .../swing/plaf/metal/MetalSplitPaneDivider.java | 2 +- .../javax/swing/plaf/metal/MetalSplitPaneUI.java | 2 +- .../swing/plaf/metal/MetalTabbedPaneUI.java | 2 +- .../javax/swing/plaf/metal/MetalTextFieldUI.java | 2 +- .../swing/plaf/metal/MetalToggleButtonUI.java | 2 +- .../javax/swing/plaf/metal/MetalToolTipUI.java | 2 +- .../javax/swing/plaf/multi/MultiLookAndFeel.java | 2 +- .../javax/swing/plaf/synth/SynthTextAreaUI.java | 2 +- .../javax/swing/plaf/synth/SynthTextFieldUI.java | 2 +- .../javax/swing/plaf/synth/SynthTextPaneUI.java | 2 +- .../javax/swing/table/AbstractTableModel.java | 2 +- .../swing/table/DefaultTableCellRenderer.java | 4 ++-- .../swing/table/DefaultTableColumnModel.java | 2 +- .../javax/swing/table/DefaultTableModel.java | 2 +- .../classes/javax/swing/table/JTableHeader.java | 4 ++-- .../classes/javax/swing/table/TableColumn.java | 2 +- .../javax/swing/text/AbstractDocument.java | 8 ++++---- .../javax/swing/text/BadLocationException.java | 2 +- .../classes/javax/swing/text/DateFormatter.java | 2 +- .../classes/javax/swing/text/DefaultCaret.java | 2 +- .../javax/swing/text/DefaultEditorKit.java | 16 ++++++++-------- .../javax/swing/text/DefaultFormatter.java | 2 +- .../swing/text/DefaultFormatterFactory.java | 2 +- .../javax/swing/text/DefaultStyledDocument.java | 8 ++++---- .../javax/swing/text/InternationalFormatter.java | 2 +- .../classes/javax/swing/text/JTextComponent.java | 6 +++--- .../classes/javax/swing/text/MaskFormatter.java | 2 +- .../javax/swing/text/NumberFormatter.java | 2 +- .../classes/javax/swing/text/PlainDocument.java | 2 +- .../javax/swing/text/SimpleAttributeSet.java | 2 +- .../classes/javax/swing/text/StringContent.java | 2 +- .../classes/javax/swing/text/StyleContext.java | 4 ++-- .../javax/swing/text/StyledEditorKit.java | 16 ++++++++-------- .../share/classes/javax/swing/text/TabSet.java | 2 +- .../share/classes/javax/swing/text/TabStop.java | 2 +- .../classes/javax/swing/text/TextAction.java | 2 +- .../classes/javax/swing/text/html/Option.java | 2 +- .../javax/swing/tree/AbstractLayoutCache.java | 2 +- .../javax/swing/tree/DefaultMutableTreeNode.java | 2 +- .../javax/swing/tree/DefaultTreeCellEditor.java | 2 +- .../swing/tree/DefaultTreeCellRenderer.java | 2 +- .../javax/swing/tree/DefaultTreeModel.java | 2 +- .../swing/tree/DefaultTreeSelectionModel.java | 2 +- .../javax/swing/tree/FixedHeightLayoutCache.java | 2 +- .../share/classes/javax/swing/tree/TreePath.java | 2 +- .../swing/tree/VariableHeightLayoutCache.java | 2 +- .../javax/swing/undo/CannotRedoException.java | 2 +- .../javax/swing/undo/CannotUndoException.java | 2 +- .../classes/javax/swing/undo/UndoManager.java | 2 +- 189 files changed, 283 insertions(+), 283 deletions(-) diff --git a/jdk/src/share/classes/javax/swing/AbstractAction.java b/jdk/src/share/classes/javax/swing/AbstractAction.java index 1d55a949e72..5b49dd92c91 100644 --- a/jdk/src/share/classes/javax/swing/AbstractAction.java +++ b/jdk/src/share/classes/javax/swing/AbstractAction.java @@ -49,7 +49,7 @@ import sun.security.action.GetPropertyAction; * future Swing releases. The current serialization support is * appropriate for short term storage or RMI between applications running * the same version of Swing. As of 1.4, support for long term storage - * of all JavaBeansTM + * of all JavaBeans™ * has been added to the java.beans package. * Please see {@link java.beans.XMLEncoder}. * diff --git a/jdk/src/share/classes/javax/swing/AbstractButton.java b/jdk/src/share/classes/javax/swing/AbstractButton.java index 9678148e394..193317c99ac 100644 --- a/jdk/src/share/classes/javax/swing/AbstractButton.java +++ b/jdk/src/share/classes/javax/swing/AbstractButton.java @@ -66,7 +66,7 @@ import java.util.*; * future Swing releases. The current serialization support is * appropriate for short term storage or RMI between applications running * the same version of Swing. As of 1.4, support for long term storage - * of all JavaBeansTM + * of all JavaBeans™ * has been added to the java.beans package. * Please see {@link java.beans.XMLEncoder}. * @@ -1973,7 +1973,7 @@ public abstract class AbstractButton extends JComponent implements ItemSelectabl * future Swing releases. The current serialization support is * appropriate for short term storage or RMI between applications running * the same version of Swing. As of 1.4, support for long term storage - * of all JavaBeansTM + * of all JavaBeans™ * has been added to the java.beans package. * Please see {@link java.beans.XMLEncoder}. */ @@ -2379,7 +2379,7 @@ public abstract class AbstractButton extends JComponent implements ItemSelectabl * future Swing releases. The current serialization support is * appropriate for short term storage or RMI between applications running * the same version of Swing. As of 1.4, support for long term storage - * of all JavaBeansTM + * of all JavaBeans™ * has been added to the java.beans package. * Please see {@link java.beans.XMLEncoder}. * @since 1.4 diff --git a/jdk/src/share/classes/javax/swing/AbstractCellEditor.java b/jdk/src/share/classes/javax/swing/AbstractCellEditor.java index 17ce6d26e01..f9efea555dc 100644 --- a/jdk/src/share/classes/javax/swing/AbstractCellEditor.java +++ b/jdk/src/share/classes/javax/swing/AbstractCellEditor.java @@ -43,7 +43,7 @@ import java.io.Serializable; * future Swing releases. The current serialization support is * appropriate for short term storage or RMI between applications running * the same version of Swing. As of 1.4, support for long term storage - * of all JavaBeansTM + * of all JavaBeans™ * has been added to the java.beans package. * Please see {@link java.beans.XMLEncoder}. * diff --git a/jdk/src/share/classes/javax/swing/AbstractListModel.java b/jdk/src/share/classes/javax/swing/AbstractListModel.java index 9200102bc34..7270c8f222c 100644 --- a/jdk/src/share/classes/javax/swing/AbstractListModel.java +++ b/jdk/src/share/classes/javax/swing/AbstractListModel.java @@ -38,7 +38,7 @@ import java.util.EventListener; * future Swing releases. The current serialization support is * appropriate for short term storage or RMI between applications running * the same version of Swing. As of 1.4, support for long term storage - * of all JavaBeansTM + * of all JavaBeans™ * has been added to the java.beans package. * Please see {@link java.beans.XMLEncoder}. * diff --git a/jdk/src/share/classes/javax/swing/Box.java b/jdk/src/share/classes/javax/swing/Box.java index 812582a378e..2f4c6e4c76f 100644 --- a/jdk/src/share/classes/javax/swing/Box.java +++ b/jdk/src/share/classes/javax/swing/Box.java @@ -68,7 +68,7 @@ import javax.accessibility.*; * future Swing releases. The current serialization support is * appropriate for short term storage or RMI between applications running * the same version of Swing. As of 1.4, support for long term storage - * of all JavaBeansTM + * of all JavaBeans™ * has been added to the java.beans package. * Please see {@link java.beans.XMLEncoder}. * @@ -298,7 +298,7 @@ public class Box extends JComponent implements Accessible { * future Swing releases. The current serialization support is * appropriate for short term storage or RMI between applications running * the same version of Swing. As of 1.4, support for long term storage - * of all JavaBeansTM + * of all JavaBeans™ * has been added to the java.beans package. * Please see {@link java.beans.XMLEncoder}. */ diff --git a/jdk/src/share/classes/javax/swing/BoxLayout.java b/jdk/src/share/classes/javax/swing/BoxLayout.java index 9d7fbf7000e..abe4b73201f 100644 --- a/jdk/src/share/classes/javax/swing/BoxLayout.java +++ b/jdk/src/share/classes/javax/swing/BoxLayout.java @@ -36,12 +36,12 @@ import java.io.PrintStream; * vertically or horizontally. The components will not wrap so, for * example, a vertical arrangement of components will stay vertically * arranged when the frame is resized. - *

          + *
          * * * *
          - *

          The following text describes this graphic. + * WIDTH="191" HEIGHT="201" STYLE="FLOAT:BOTTOM; BORDER:0"> *

          @@ -124,7 +124,7 @@ import java.io.PrintStream; * future Swing releases. The current serialization support is * appropriate for short term storage or RMI between applications running * the same version of Swing. As of 1.4, support for long term storage - * of all JavaBeansTM + * of all JavaBeans™ * has been added to the java.beans package. * Please see {@link java.beans.XMLEncoder}. * diff --git a/jdk/src/share/classes/javax/swing/ButtonGroup.java b/jdk/src/share/classes/javax/swing/ButtonGroup.java index 2dce82e9889..7f6229d485e 100644 --- a/jdk/src/share/classes/javax/swing/ButtonGroup.java +++ b/jdk/src/share/classes/javax/swing/ButtonGroup.java @@ -59,7 +59,7 @@ import java.io.Serializable; * future Swing releases. The current serialization support is * appropriate for short term storage or RMI between applications running * the same version of Swing. As of 1.4, support for long term storage - * of all JavaBeansTM + * of all JavaBeans™ * has been added to the java.beans package. * Please see {@link java.beans.XMLEncoder}. * diff --git a/jdk/src/share/classes/javax/swing/CellRendererPane.java b/jdk/src/share/classes/javax/swing/CellRendererPane.java index 7523ef0698b..6a9f17b058a 100644 --- a/jdk/src/share/classes/javax/swing/CellRendererPane.java +++ b/jdk/src/share/classes/javax/swing/CellRendererPane.java @@ -57,7 +57,7 @@ import javax.accessibility.*; * future Swing releases. The current serialization support is * appropriate for short term storage or RMI between applications running * the same version of Swing. As of 1.4, support for long term storage - * of all JavaBeansTM + * of all JavaBeans™ * has been added to the java.beans package. * Please see {@link java.beans.XMLEncoder}. * diff --git a/jdk/src/share/classes/javax/swing/DefaultBoundedRangeModel.java b/jdk/src/share/classes/javax/swing/DefaultBoundedRangeModel.java index 418adf48c03..fb250acbcda 100644 --- a/jdk/src/share/classes/javax/swing/DefaultBoundedRangeModel.java +++ b/jdk/src/share/classes/javax/swing/DefaultBoundedRangeModel.java @@ -37,7 +37,7 @@ import java.util.EventListener; * future Swing releases. The current serialization support is * appropriate for short term storage or RMI between applications running * the same version of Swing. As of 1.4, support for long term storage - * of all JavaBeansTM + * of all JavaBeans™ * has been added to the java.beans package. * Please see {@link java.beans.XMLEncoder}. * diff --git a/jdk/src/share/classes/javax/swing/DefaultButtonModel.java b/jdk/src/share/classes/javax/swing/DefaultButtonModel.java index 5eaec14f9e9..7c0fa3d2181 100644 --- a/jdk/src/share/classes/javax/swing/DefaultButtonModel.java +++ b/jdk/src/share/classes/javax/swing/DefaultButtonModel.java @@ -39,7 +39,7 @@ import javax.swing.event.*; * future Swing releases. The current serialization support is * appropriate for short term storage or RMI between applications running * the same version of Swing. As of 1.4, support for long term storage - * of all JavaBeansTM + * of all JavaBeans™ * has been added to the java.beans package. * Please see {@link java.beans.XMLEncoder}. * diff --git a/jdk/src/share/classes/javax/swing/DefaultCellEditor.java b/jdk/src/share/classes/javax/swing/DefaultCellEditor.java index 1738e0e69b7..60042a378ef 100644 --- a/jdk/src/share/classes/javax/swing/DefaultCellEditor.java +++ b/jdk/src/share/classes/javax/swing/DefaultCellEditor.java @@ -43,7 +43,7 @@ import java.io.Serializable; * future Swing releases. The current serialization support is * appropriate for short term storage or RMI between applications running * the same version of Swing. As of 1.4, support for long term storage - * of all JavaBeansTM + * of all JavaBeans™ * has been added to the java.beans package. * Please see {@link java.beans.XMLEncoder}. * diff --git a/jdk/src/share/classes/javax/swing/DefaultListCellRenderer.java b/jdk/src/share/classes/javax/swing/DefaultListCellRenderer.java index 85a10e28f14..4d7a64909e1 100644 --- a/jdk/src/share/classes/javax/swing/DefaultListCellRenderer.java +++ b/jdk/src/share/classes/javax/swing/DefaultListCellRenderer.java @@ -63,7 +63,7 @@ import sun.swing.DefaultLookup; * future Swing releases. The current serialization support is * appropriate for short term storage or RMI between applications running * the same version of Swing. As of 1.4, support for long term storage - * of all JavaBeansTM + * of all JavaBeans™ * has been added to the java.beans package. * Please see {@link java.beans.XMLEncoder}. * @@ -337,7 +337,7 @@ public class DefaultListCellRenderer extends JLabel * future Swing releases. The current serialization support is * appropriate for short term storage or RMI between applications running * the same version of Swing. As of 1.4, support for long term storage - * of all JavaBeansTM + * of all JavaBeans™ * has been added to the java.beans package. * Please see {@link java.beans.XMLEncoder}. */ diff --git a/jdk/src/share/classes/javax/swing/DefaultListModel.java b/jdk/src/share/classes/javax/swing/DefaultListModel.java index 5fc23eaf0cd..33efc4abe32 100644 --- a/jdk/src/share/classes/javax/swing/DefaultListModel.java +++ b/jdk/src/share/classes/javax/swing/DefaultListModel.java @@ -44,7 +44,7 @@ import javax.swing.event.*; * future Swing releases. The current serialization support is * appropriate for short term storage or RMI between applications running * the same version of Swing. As of 1.4, support for long term storage - * of all JavaBeansTM + * of all JavaBeans™ * has been added to the java.beans package. * Please see {@link java.beans.XMLEncoder}. * diff --git a/jdk/src/share/classes/javax/swing/DefaultListSelectionModel.java b/jdk/src/share/classes/javax/swing/DefaultListSelectionModel.java index 57fb5d776db..8da0b4254a8 100644 --- a/jdk/src/share/classes/javax/swing/DefaultListSelectionModel.java +++ b/jdk/src/share/classes/javax/swing/DefaultListSelectionModel.java @@ -41,7 +41,7 @@ import javax.swing.event.*; * future Swing releases. The current serialization support is * appropriate for short term storage or RMI between applications running * the same version of Swing. As of 1.4, support for long term storage - * of all JavaBeansTM + * of all JavaBeans™ * has been added to the java.beans package. * Please see {@link java.beans.XMLEncoder}. * diff --git a/jdk/src/share/classes/javax/swing/DefaultSingleSelectionModel.java b/jdk/src/share/classes/javax/swing/DefaultSingleSelectionModel.java index 65b33204207..1d5ad7ccac0 100644 --- a/jdk/src/share/classes/javax/swing/DefaultSingleSelectionModel.java +++ b/jdk/src/share/classes/javax/swing/DefaultSingleSelectionModel.java @@ -37,7 +37,7 @@ import java.util.EventListener; * future Swing releases. The current serialization support is * appropriate for short term storage or RMI between applications running * the same version of Swing. As of 1.4, support for long term storage - * of all JavaBeansTM + * of all JavaBeans™ * has been added to the java.beans package. * Please see {@link java.beans.XMLEncoder}. * diff --git a/jdk/src/share/classes/javax/swing/ImageIcon.java b/jdk/src/share/classes/javax/swing/ImageIcon.java index 690ae19c414..236d682d9a8 100644 --- a/jdk/src/share/classes/javax/swing/ImageIcon.java +++ b/jdk/src/share/classes/javax/swing/ImageIcon.java @@ -59,7 +59,7 @@ import java.security.*; * future Swing releases. The current serialization support is * appropriate for short term storage or RMI between applications running * the same version of Swing. As of 1.4, support for long term storage - * of all JavaBeansTM + * of all JavaBeans™ * has been added to the java.beans package. * Please see {@link java.beans.XMLEncoder}. * @@ -555,7 +555,7 @@ public class ImageIcon implements Icon, Serializable, Accessible { * future Swing releases. The current serialization support is * appropriate for short term storage or RMI between applications running * the same version of Swing. As of 1.4, support for long term storage - * of all JavaBeansTM + * of all JavaBeans™ * has been added to the java.beans package. * Please see {@link java.beans.XMLEncoder}. * @since 1.3 diff --git a/jdk/src/share/classes/javax/swing/JApplet.java b/jdk/src/share/classes/javax/swing/JApplet.java index 5f4c060614c..acb02035420 100644 --- a/jdk/src/share/classes/javax/swing/JApplet.java +++ b/jdk/src/share/classes/javax/swing/JApplet.java @@ -77,7 +77,7 @@ import javax.accessibility.*; * future Swing releases. The current serialization support is * appropriate for short term storage or RMI between applications running * the same version of Swing. As of 1.4, support for long term storage - * of all JavaBeansTM + * of all JavaBeans™ * has been added to the java.beans package. * Please see {@link java.beans.XMLEncoder}. * diff --git a/jdk/src/share/classes/javax/swing/JButton.java b/jdk/src/share/classes/javax/swing/JButton.java index e63977afef6..0e97ba8dd44 100644 --- a/jdk/src/share/classes/javax/swing/JButton.java +++ b/jdk/src/share/classes/javax/swing/JButton.java @@ -65,7 +65,7 @@ import java.io.IOException; * future Swing releases. The current serialization support is * appropriate for short term storage or RMI between applications running * the same version of Swing. As of 1.4, support for long term storage - * of all JavaBeansTM + * of all JavaBeans™ * has been added to the java.beans package. * Please see {@link java.beans.XMLEncoder}. * @@ -304,7 +304,7 @@ public class JButton extends AbstractButton implements Accessible { * future Swing releases. The current serialization support is * appropriate for short term storage or RMI between applications running * the same version of Swing. As of 1.4, support for long term storage - * of all JavaBeansTM + * of all JavaBeans™ * has been added to the java.beans package. * Please see {@link java.beans.XMLEncoder}. */ diff --git a/jdk/src/share/classes/javax/swing/JCheckBox.java b/jdk/src/share/classes/javax/swing/JCheckBox.java index 52930f902a0..8fdbd17fa04 100644 --- a/jdk/src/share/classes/javax/swing/JCheckBox.java +++ b/jdk/src/share/classes/javax/swing/JCheckBox.java @@ -63,7 +63,7 @@ import java.io.IOException; * future Swing releases. The current serialization support is * appropriate for short term storage or RMI between applications running * the same version of Swing. As of 1.4, support for long term storage - * of all JavaBeansTM + * of all JavaBeans™ * has been added to the java.beans package. * Please see {@link java.beans.XMLEncoder}. * @@ -330,7 +330,7 @@ public class JCheckBox extends JToggleButton implements Accessible { * future Swing releases. The current serialization support is * appropriate for short term storage or RMI between applications running * the same version of Swing. As of 1.4, support for long term storage - * of all JavaBeansTM + * of all JavaBeans™ * has been added to the java.beans package. * Please see {@link java.beans.XMLEncoder}. */ diff --git a/jdk/src/share/classes/javax/swing/JCheckBoxMenuItem.java b/jdk/src/share/classes/javax/swing/JCheckBoxMenuItem.java index 2810ee66a12..3d924d38536 100644 --- a/jdk/src/share/classes/javax/swing/JCheckBoxMenuItem.java +++ b/jdk/src/share/classes/javax/swing/JCheckBoxMenuItem.java @@ -77,7 +77,7 @@ import javax.accessibility.*; * future Swing releases. The current serialization support is * appropriate for short term storage or RMI between applications running * the same version of Swing. As of 1.4, support for long term storage - * of all JavaBeansTM + * of all JavaBeans™ * has been added to the java.beans package. * Please see {@link java.beans.XMLEncoder}. * @@ -289,7 +289,7 @@ public class JCheckBoxMenuItem extends JMenuItem implements SwingConstants, * future Swing releases. The current serialization support is * appropriate for short term storage or RMI between applications running * the same version of Swing. As of 1.4, support for long term storage - * of all JavaBeansTM + * of all JavaBeans™ * has been added to the java.beans package. * Please see {@link java.beans.XMLEncoder}. */ diff --git a/jdk/src/share/classes/javax/swing/JColorChooser.java b/jdk/src/share/classes/javax/swing/JColorChooser.java index 06da95e89b9..9fb2a35a778 100644 --- a/jdk/src/share/classes/javax/swing/JColorChooser.java +++ b/jdk/src/share/classes/javax/swing/JColorChooser.java @@ -69,7 +69,7 @@ import sun.swing.SwingUtilities2; * future Swing releases. The current serialization support is * appropriate for short term storage or RMI between applications running * the same version of Swing. As of 1.4, support for long term storage - * of all JavaBeansTM + * of all JavaBeans™ * has been added to the java.beans package. * Please see {@link java.beans.XMLEncoder}. * diff --git a/jdk/src/share/classes/javax/swing/JComboBox.java b/jdk/src/share/classes/javax/swing/JComboBox.java index daab76de3f5..2d81a18a1d0 100644 --- a/jdk/src/share/classes/javax/swing/JComboBox.java +++ b/jdk/src/share/classes/javax/swing/JComboBox.java @@ -57,7 +57,7 @@ import javax.accessibility.*; * future Swing releases. The current serialization support is * appropriate for short term storage or RMI between applications running * the same version of Swing. As of 1.4, support for long term storage - * of all JavaBeansTM + * of all JavaBeans™ * has been added to the java.beans package. * Please see {@link java.beans.XMLEncoder}. * @@ -1608,7 +1608,7 @@ implements ItemSelectable,ListDataListener,ActionListener, Accessible { * future Swing releases. The current serialization support is * appropriate for short term storage or RMI between applications running * the same version of Swing. As of 1.4, support for long term storage - * of all JavaBeansTM + * of all JavaBeans™ * has been added to the java.beans package. * Please see {@link java.beans.XMLEncoder}. */ diff --git a/jdk/src/share/classes/javax/swing/JComponent.java b/jdk/src/share/classes/javax/swing/JComponent.java index 5d512ee9934..a15ec705655 100644 --- a/jdk/src/share/classes/javax/swing/JComponent.java +++ b/jdk/src/share/classes/javax/swing/JComponent.java @@ -163,7 +163,7 @@ import sun.swing.UIClientPropertyKey; * future Swing releases. The current serialization support is * appropriate for short term storage or RMI between applications running * the same version of Swing. As of 1.4, support for long term storage - * of all JavaBeansTM + * of all JavaBeans™ * has been added to the java.beans package. * Please see {@link java.beans.XMLEncoder}. * @@ -3653,7 +3653,7 @@ public abstract class JComponent extends Container implements Serializable, * future Swing releases. The current serialization support is * appropriate for short term storage or RMI between applications running * the same version of Swing. As of 1.4, support for long term storage - * of all JavaBeansTM + * of all JavaBeans™ * has been added to the java.beans package. * Please see {@link java.beans.XMLEncoder}. */ diff --git a/jdk/src/share/classes/javax/swing/JDesktopPane.java b/jdk/src/share/classes/javax/swing/JDesktopPane.java index 74c45d6a8d7..6ba0bc82bf2 100644 --- a/jdk/src/share/classes/javax/swing/JDesktopPane.java +++ b/jdk/src/share/classes/javax/swing/JDesktopPane.java @@ -76,7 +76,7 @@ import java.util.TreeSet; * future Swing releases. The current serialization support is * appropriate for short term storage or RMI between applications running * the same version of Swing. As of 1.4, support for long term storage - * of all JavaBeansTM + * of all JavaBeans™ * has been added to the java.beans package. * Please see {@link java.beans.XMLEncoder}. * @@ -612,7 +612,7 @@ public class JDesktopPane extends JLayeredPane implements Accessible * future Swing releases. The current serialization support is * appropriate for short term storage or RMI between applications running * the same version of Swing. As of 1.4, support for long term storage - * of all JavaBeansTM + * of all JavaBeans™ * has been added to the java.beans package. * Please see {@link java.beans.XMLEncoder}. */ diff --git a/jdk/src/share/classes/javax/swing/JDialog.java b/jdk/src/share/classes/javax/swing/JDialog.java index 036c647483e..2e4b2b72efd 100644 --- a/jdk/src/share/classes/javax/swing/JDialog.java +++ b/jdk/src/share/classes/javax/swing/JDialog.java @@ -77,7 +77,7 @@ import javax.accessibility.*; * future Swing releases. The current serialization support is * appropriate for short term storage or RMI between applications running * the same version of Swing. As of 1.4, support for long term storage - * of all JavaBeansTM + * of all JavaBeans™ * has been added to the {@code java.beans} package. * Please see {@link java.beans.XMLEncoder}. * diff --git a/jdk/src/share/classes/javax/swing/JEditorPane.java b/jdk/src/share/classes/javax/swing/JEditorPane.java index 9979286148e..f4c5893068c 100644 --- a/jdk/src/share/classes/javax/swing/JEditorPane.java +++ b/jdk/src/share/classes/javax/swing/JEditorPane.java @@ -179,7 +179,7 @@ import javax.accessibility.*; * future Swing releases. The current serialization support is * appropriate for short term storage or RMI between applications running * the same version of Swing. As of 1.4, support for long term storage - * of all JavaBeansTM + * of all JavaBeans™ * has been added to the java.beans package. * Please see {@link java.beans.XMLEncoder}. * @@ -1636,7 +1636,7 @@ public class JEditorPane extends JTextComponent { * future Swing releases. The current serialization support is * appropriate for short term storage or RMI between applications running * the same version of Swing. As of 1.4, support for long term storage - * of all JavaBeansTM + * of all JavaBeans™ * has been added to the java.beans package. * Please see {@link java.beans.XMLEncoder}. */ @@ -1690,7 +1690,7 @@ public class JEditorPane extends JTextComponent { * future Swing releases. The current serialization support is * appropriate for short term storage or RMI between applications running * the same version of Swing. As of 1.4, support for long term storage - * of all JavaBeansTM + * of all JavaBeans™ * has been added to the java.beans package. * Please see {@link java.beans.XMLEncoder}. */ diff --git a/jdk/src/share/classes/javax/swing/JFormattedTextField.java b/jdk/src/share/classes/javax/swing/JFormattedTextField.java index 31f4017d026..e682c571e51 100644 --- a/jdk/src/share/classes/javax/swing/JFormattedTextField.java +++ b/jdk/src/share/classes/javax/swing/JFormattedTextField.java @@ -54,7 +54,7 @@ import javax.swing.text.*; * configuring what action should be taken when focus is lost. The possible * configurations are: * - * + * *

          Value

          Description

          Value

          Description

          JFormattedTextField.REVERT * Revert the display to match that of getValue, * possibly losing the current edit. @@ -171,7 +171,7 @@ import javax.swing.text.*; * future Swing releases. The current serialization support is * appropriate for short term storage or RMI between applications running * the same version of Swing. As of 1.4, support for long term storage - * of all JavaBeansTM + * of all JavaBeans™ * has been added to the java.beans package. * Please see {@link java.beans.XMLEncoder}. * diff --git a/jdk/src/share/classes/javax/swing/JFrame.java b/jdk/src/share/classes/javax/swing/JFrame.java index c8efb87085f..038c63b122a 100644 --- a/jdk/src/share/classes/javax/swing/JFrame.java +++ b/jdk/src/share/classes/javax/swing/JFrame.java @@ -93,7 +93,7 @@ import javax.accessibility.*; * future Swing releases. The current serialization support is * appropriate for short term storage or RMI between applications running * the same version of Swing. As of 1.4, support for long term storage - * of all JavaBeansTM + * of all JavaBeans™ * has been added to the java.beans package. * Please see {@link java.beans.XMLEncoder}. * diff --git a/jdk/src/share/classes/javax/swing/JInternalFrame.java b/jdk/src/share/classes/javax/swing/JInternalFrame.java index 2d2b53202fe..ad78df11c01 100644 --- a/jdk/src/share/classes/javax/swing/JInternalFrame.java +++ b/jdk/src/share/classes/javax/swing/JInternalFrame.java @@ -90,7 +90,7 @@ import sun.swing.SwingUtilities2; * future Swing releases. The current serialization support is * appropriate for short term storage or RMI between applications running * the same version of Swing. As of 1.4, support for long term storage - * of all JavaBeansTM + * of all JavaBeans™ * has been added to the java.beans package. * Please see {@link java.beans.XMLEncoder}. * @@ -2029,7 +2029,7 @@ public class JInternalFrame extends JComponent implements * future Swing releases. The current serialization support is * appropriate for short term storage or RMI between applications running * the same version of Swing. As of 1.4, support for long term storage - * of all JavaBeansTM + * of all JavaBeans™ * has been added to the java.beans package. * Please see {@link java.beans.XMLEncoder}. */ @@ -2144,7 +2144,7 @@ public class JInternalFrame extends JComponent implements * future Swing releases. The current serialization support is * appropriate for short term storage or RMI between applications running * the same version of Swing. As of 1.4, support for long term storage - * of all JavaBeansTM + * of all JavaBeans™ * has been added to the java.beans package. * Please see {@link java.beans.XMLEncoder}. * @@ -2318,7 +2318,7 @@ public class JInternalFrame extends JComponent implements * future Swing releases. The current serialization support is * appropriate for short term storage or RMI between applications running * the same version of Swing. As of 1.4, support for long term storage - * of all JavaBeansTM + * of all JavaBeans™ * has been added to the java.beans package. * Please see {@link java.beans.XMLEncoder}. */ diff --git a/jdk/src/share/classes/javax/swing/JLabel.java b/jdk/src/share/classes/javax/swing/JLabel.java index 661ef911fb6..cf4ae3921f0 100644 --- a/jdk/src/share/classes/javax/swing/JLabel.java +++ b/jdk/src/share/classes/javax/swing/JLabel.java @@ -94,7 +94,7 @@ import java.util.*; * future Swing releases. The current serialization support is * appropriate for short term storage or RMI between applications running * the same version of Swing. As of 1.4, support for long term storage - * of all JavaBeansTM + * of all JavaBeans™ * has been added to the java.beans package. * Please see {@link java.beans.XMLEncoder}. * @@ -1064,7 +1064,7 @@ public class JLabel extends JComponent implements SwingConstants, Accessible * future Swing releases. The current serialization support is * appropriate for short term storage or RMI between applications running * the same version of Swing. As of 1.4, support for long term storage - * of all JavaBeansTM + * of all JavaBeans™ * has been added to the java.beans package. * Please see {@link java.beans.XMLEncoder}. */ diff --git a/jdk/src/share/classes/javax/swing/JLayeredPane.java b/jdk/src/share/classes/javax/swing/JLayeredPane.java index f0d083a84e5..075e535309b 100644 --- a/jdk/src/share/classes/javax/swing/JLayeredPane.java +++ b/jdk/src/share/classes/javax/swing/JLayeredPane.java @@ -148,7 +148,7 @@ import javax.accessibility.*; * future Swing releases. The current serialization support is * appropriate for short term storage or RMI between applications running * the same version of Swing. As of 1.4, support for long term storage - * of all JavaBeansTM + * of all JavaBeans™ * has been added to the java.beans package. * Please see {@link java.beans.XMLEncoder}. * @@ -765,7 +765,7 @@ public class JLayeredPane extends JComponent implements Accessible { * future Swing releases. The current serialization support is * appropriate for short term storage or RMI between applications running * the same version of Swing. As of 1.4, support for long term storage - * of all JavaBeansTM + * of all JavaBeans™ * has been added to the java.beans package. * Please see {@link java.beans.XMLEncoder}. */ diff --git a/jdk/src/share/classes/javax/swing/JList.java b/jdk/src/share/classes/javax/swing/JList.java index 53872e5098f..9b016251a7e 100644 --- a/jdk/src/share/classes/javax/swing/JList.java +++ b/jdk/src/share/classes/javax/swing/JList.java @@ -253,7 +253,7 @@ import static sun.swing.SwingUtilities2.Section.*; * future Swing releases. The current serialization support is * appropriate for short term storage or RMI between applications running * the same version of Swing. As of 1.4, support for long term storage - * of all JavaBeansTM + * of all JavaBeans™ * has been added to the java.beans package. * Please see {@link java.beans.XMLEncoder}. *

          @@ -970,7 +970,7 @@ public class JList extends JComponent implements Scrollable, Accessible * * - * + * *

          Value

          Description

          Value

          Description

          VERTICAL * Cells are layed out vertically in a single column. *
          HORIZONTAL_WRAP @@ -2877,7 +2877,7 @@ public class JList extends JComponent implements Scrollable, Accessible * future Swing releases. The current serialization support is * appropriate for short term storage or RMI between applications running * the same version of Swing. As of 1.4, support for long term storage - * of all JavaBeansTM + * of all JavaBeans™ * has been added to the java.beans package. * Please see {@link java.beans.XMLEncoder}. */ diff --git a/jdk/src/share/classes/javax/swing/JMenu.java b/jdk/src/share/classes/javax/swing/JMenu.java index c0ab0e39cc5..ad5f6fef68e 100644 --- a/jdk/src/share/classes/javax/swing/JMenu.java +++ b/jdk/src/share/classes/javax/swing/JMenu.java @@ -93,7 +93,7 @@ import java.lang.ref.WeakReference; * future Swing releases. The current serialization support is * appropriate for short term storage or RMI between applications running * the same version of Swing. As of 1.4, support for long term storage - * of all JavaBeansTM + * of all JavaBeans™ * has been added to the java.beans package. * Please see {@link java.beans.XMLEncoder}. * @@ -1149,7 +1149,7 @@ public class JMenu extends JMenuItem implements Accessible,MenuElement * future Swing releases. The current serialization support is * appropriate for short term storage or RMI between applications running * the same version of Swing. As of 1.4, support for long term storage - * of all JavaBeansTM + * of all JavaBeans™ * has been added to the java.beans package. * Please see {@link java.beans.XMLEncoder}. */ @@ -1386,7 +1386,7 @@ public class JMenu extends JMenuItem implements Accessible,MenuElement * future Swing releases. The current serialization support is * appropriate for short term storage or RMI between applications running * the same version of Swing. As of 1.4, support for long term storage - * of all JavaBeansTM + * of all JavaBeans™ * has been added to the java.beans package. * Please see {@link java.beans.XMLEncoder}. */ diff --git a/jdk/src/share/classes/javax/swing/JMenuBar.java b/jdk/src/share/classes/javax/swing/JMenuBar.java index 8c7b2a84346..8e6683d6f17 100644 --- a/jdk/src/share/classes/javax/swing/JMenuBar.java +++ b/jdk/src/share/classes/javax/swing/JMenuBar.java @@ -67,7 +67,7 @@ import javax.accessibility.*; * future Swing releases. The current serialization support is * appropriate for short term storage or RMI between applications running * the same version of Swing. As of 1.4, support for long term storage - * of all JavaBeansTM + * of all JavaBeans™ * has been added to the java.beans package. * Please see {@link java.beans.XMLEncoder}. *

          @@ -502,7 +502,7 @@ public class JMenuBar extends JComponent implements Accessible,MenuElement * future Swing releases. The current serialization support is * appropriate for short term storage or RMI between applications running * the same version of Swing. As of 1.4, support for long term storage - * of all JavaBeansTM + * of all JavaBeans™ * has been added to the java.beans package. * Please see {@link java.beans.XMLEncoder}. */ diff --git a/jdk/src/share/classes/javax/swing/JMenuItem.java b/jdk/src/share/classes/javax/swing/JMenuItem.java index 1f1a14a92e4..10b59bbce3f 100644 --- a/jdk/src/share/classes/javax/swing/JMenuItem.java +++ b/jdk/src/share/classes/javax/swing/JMenuItem.java @@ -72,7 +72,7 @@ import javax.accessibility.*; * future Swing releases. The current serialization support is * appropriate for short term storage or RMI between applications running * the same version of Swing. As of 1.4, support for long term storage - * of all JavaBeansTM + * of all JavaBeans™ * has been added to the java.beans package. * Please see {@link java.beans.XMLEncoder}. * @@ -826,7 +826,7 @@ public class JMenuItem extends AbstractButton implements Accessible,MenuElement * future Swing releases. The current serialization support is * appropriate for short term storage or RMI between applications running * the same version of Swing. As of 1.4, support for long term storage - * of all JavaBeansTM + * of all JavaBeans™ * has been added to the java.beans package. * Please see {@link java.beans.XMLEncoder}. */ diff --git a/jdk/src/share/classes/javax/swing/JOptionPane.java b/jdk/src/share/classes/javax/swing/JOptionPane.java index 0cd52101a84..8bbd49db63a 100644 --- a/jdk/src/share/classes/javax/swing/JOptionPane.java +++ b/jdk/src/share/classes/javax/swing/JOptionPane.java @@ -298,7 +298,7 @@ import static javax.swing.ClientPropertyKey.PopupFactory_FORCE_HEAVYWEIGHT_POPUP * future Swing releases. The current serialization support is * appropriate for short term storage or RMI between applications running * the same version of Swing. As of 1.4, support for long term storage - * of all JavaBeansTM + * of all JavaBeans™ * has been added to the java.beans package. * Please see {@link java.beans.XMLEncoder}. * @@ -2573,7 +2573,7 @@ public class JOptionPane extends JComponent implements Accessible * future Swing releases. The current serialization support is * appropriate for short term storage or RMI between applications running * the same version of Swing. As of 1.4, support for long term storage - * of all JavaBeansTM + * of all JavaBeans™ * has been added to the java.beans package. * Please see {@link java.beans.XMLEncoder}. */ diff --git a/jdk/src/share/classes/javax/swing/JPanel.java b/jdk/src/share/classes/javax/swing/JPanel.java index 2ac9c700e46..8ebfcb1cbfb 100644 --- a/jdk/src/share/classes/javax/swing/JPanel.java +++ b/jdk/src/share/classes/javax/swing/JPanel.java @@ -52,7 +52,7 @@ import java.io.IOException; * future Swing releases. The current serialization support is * appropriate for short term storage or RMI between applications running * the same version of Swing. As of 1.4, support for long term storage - * of all JavaBeansTM + * of all JavaBeans™ * has been added to the java.beans package. * Please see {@link java.beans.XMLEncoder}. * @@ -229,7 +229,7 @@ public class JPanel extends JComponent implements Accessible * future Swing releases. The current serialization support is * appropriate for short term storage or RMI between applications running * the same version of Swing. As of 1.4, support for long term storage - * of all JavaBeansTM + * of all JavaBeans™ * has been added to the java.beans package. * Please see {@link java.beans.XMLEncoder}. */ diff --git a/jdk/src/share/classes/javax/swing/JPasswordField.java b/jdk/src/share/classes/javax/swing/JPasswordField.java index 71dc3aa75d3..8a646944ada 100644 --- a/jdk/src/share/classes/javax/swing/JPasswordField.java +++ b/jdk/src/share/classes/javax/swing/JPasswordField.java @@ -64,7 +64,7 @@ import java.util.Arrays; * future Swing releases. The current serialization support is * appropriate for short term storage or RMI between applications running * the same version of Swing. As of 1.4, support for long term storage - * of all JavaBeansTM + * of all JavaBeans™ * has been added to the java.beans package. * Please see {@link java.beans.XMLEncoder}. * @@ -399,7 +399,7 @@ public class JPasswordField extends JTextField { * future Swing releases. The current serialization support is * appropriate for short term storage or RMI between applications running * the same version of Swing. As of 1.4, support for long term storage - * of all JavaBeansTM + * of all JavaBeans™ * has been added to the java.beans package. * Please see {@link java.beans.XMLEncoder}. */ diff --git a/jdk/src/share/classes/javax/swing/JPopupMenu.java b/jdk/src/share/classes/javax/swing/JPopupMenu.java index 992878fa6c9..3b9bbfc7237 100644 --- a/jdk/src/share/classes/javax/swing/JPopupMenu.java +++ b/jdk/src/share/classes/javax/swing/JPopupMenu.java @@ -71,7 +71,7 @@ import java.applet.Applet; * future Swing releases. The current serialization support is * appropriate for short term storage or RMI between applications running * the same version of Swing. As of 1.4, support for long term storage - * of all JavaBeansTM + * of all JavaBeans™ * has been added to the java.beans package. * Please see {@link java.beans.XMLEncoder}. * diff --git a/jdk/src/share/classes/javax/swing/JProgressBar.java b/jdk/src/share/classes/javax/swing/JProgressBar.java index f21ad0ffe5e..606ff13c2ca 100644 --- a/jdk/src/share/classes/javax/swing/JProgressBar.java +++ b/jdk/src/share/classes/javax/swing/JProgressBar.java @@ -114,7 +114,7 @@ import javax.swing.plaf.ProgressBarUI; * future Swing releases. The current serialization support is * appropriate for short term storage or RMI between applications running * the same version of Swing. As of 1.4, support for long term storage - * of all JavaBeansTM + * of all JavaBeans™ * has been added to the java.beans package. * Please see {@link java.beans.XMLEncoder}. * @@ -643,7 +643,7 @@ public class JProgressBar extends JComponent implements SwingConstants, Accessib * future Swing releases. The current serialization support is * appropriate for short term storage or RMI between applications running * the same version of Swing. As of 1.4, support for long term storage - * of all JavaBeansTM + * of all JavaBeans™ * has been added to the java.beans package. * Please see {@link java.beans.XMLEncoder}. */ @@ -1031,7 +1031,7 @@ public class JProgressBar extends JComponent implements SwingConstants, Accessib * future Swing releases. The current serialization support is * appropriate for short term storage or RMI between applications running * the same version of Swing. As of 1.4, support for long term storage - * of all JavaBeansTM + * of all JavaBeans™ * has been added to the java.beans package. * Please see {@link java.beans.XMLEncoder}. */ diff --git a/jdk/src/share/classes/javax/swing/JRadioButton.java b/jdk/src/share/classes/javax/swing/JRadioButton.java index d752a8ac0f0..ad7a3abf8b9 100644 --- a/jdk/src/share/classes/javax/swing/JRadioButton.java +++ b/jdk/src/share/classes/javax/swing/JRadioButton.java @@ -74,7 +74,7 @@ import java.io.IOException; * future Swing releases. The current serialization support is * appropriate for short term storage or RMI between applications running * the same version of Swing. As of 1.4, support for long term storage - * of all JavaBeansTM + * of all JavaBeans™ * has been added to the java.beans package. * Please see {@link java.beans.XMLEncoder}. * @@ -280,7 +280,7 @@ public class JRadioButton extends JToggleButton implements Accessible { * future Swing releases. The current serialization support is * appropriate for short term storage or RMI between applications running * the same version of Swing. As of 1.4, support for long term storage - * of all JavaBeansTM + * of all JavaBeans™ * has been added to the java.beans package. * Please see {@link java.beans.XMLEncoder}. */ diff --git a/jdk/src/share/classes/javax/swing/JRadioButtonMenuItem.java b/jdk/src/share/classes/javax/swing/JRadioButtonMenuItem.java index b8c525a655b..897ba97c760 100644 --- a/jdk/src/share/classes/javax/swing/JRadioButtonMenuItem.java +++ b/jdk/src/share/classes/javax/swing/JRadioButtonMenuItem.java @@ -71,7 +71,7 @@ import javax.accessibility.*; * future Swing releases. The current serialization support is * appropriate for short term storage or RMI between applications running * the same version of Swing. As of 1.4, support for long term storage - * of all JavaBeansTM + * of all JavaBeans™ * has been added to the java.beans package. * Please see {@link java.beans.XMLEncoder}. * @@ -262,7 +262,7 @@ public class JRadioButtonMenuItem extends JMenuItem implements Accessible { * future Swing releases. The current serialization support is * appropriate for short term storage or RMI between applications running * the same version of Swing. As of 1.4, support for long term storage - * of all JavaBeansTM + * of all JavaBeans™ * has been added to the java.beans package. * Please see {@link java.beans.XMLEncoder}. */ diff --git a/jdk/src/share/classes/javax/swing/JRootPane.java b/jdk/src/share/classes/javax/swing/JRootPane.java index d12af458902..480af1b5ca3 100644 --- a/jdk/src/share/classes/javax/swing/JRootPane.java +++ b/jdk/src/share/classes/javax/swing/JRootPane.java @@ -49,7 +49,7 @@ import sun.security.action.GetBooleanAction; *

          * The following image shows the relationships between * the classes that use root panes. - *

          The following text describes this graphic.

          * The "heavyweight" components (those that delegate to a peer, or native @@ -69,7 +69,7 @@ import sun.security.action.GetBooleanAction; * can be used to obtain the JRootPane that contains * a given component. * - * + *
          * *
          * TM + * of all JavaBeans™ * has been added to the java.beans package. * Please see {@link java.beans.XMLEncoder}. * @@ -898,7 +898,7 @@ public class JRootPane extends JComponent implements Accessible { * future Swing releases. The current serialization support is * appropriate for short term storage or RMI between applications running * the same version of Swing. As of 1.4, support for long term storage - * of all JavaBeansTM + * of all JavaBeans™ * has been added to the java.beans package. * Please see {@link java.beans.XMLEncoder}. */ @@ -1064,7 +1064,7 @@ public class JRootPane extends JComponent implements Accessible { * future Swing releases. The current serialization support is * appropriate for short term storage or RMI between applications running * the same version of Swing. As of 1.4, support for long term storage - * of all JavaBeansTM + * of all JavaBeans™ * has been added to the java.beans package. * Please see {@link java.beans.XMLEncoder}. */ diff --git a/jdk/src/share/classes/javax/swing/JScrollBar.java b/jdk/src/share/classes/javax/swing/JScrollBar.java index 8cbbbc8551b..efcac811546 100644 --- a/jdk/src/share/classes/javax/swing/JScrollBar.java +++ b/jdk/src/share/classes/javax/swing/JScrollBar.java @@ -67,7 +67,7 @@ import java.io.IOException; * future Swing releases. The current serialization support is * appropriate for short term storage or RMI between applications running * the same version of Swing. As of 1.4, support for long term storage - * of all JavaBeansTM + * of all JavaBeans™ * has been added to the java.beans package. * Please see {@link java.beans.XMLEncoder}. * @@ -838,7 +838,7 @@ public class JScrollBar extends JComponent implements Adjustable, Accessible * future Swing releases. The current serialization support is * appropriate for short term storage or RMI between applications running * the same version of Swing. As of 1.4, support for long term storage - * of all JavaBeansTM + * of all JavaBeans™ * has been added to the java.beans package. * Please see {@link java.beans.XMLEncoder}. */ diff --git a/jdk/src/share/classes/javax/swing/JScrollPane.java b/jdk/src/share/classes/javax/swing/JScrollPane.java index f76a1fe6489..4c5f1e88823 100644 --- a/jdk/src/share/classes/javax/swing/JScrollPane.java +++ b/jdk/src/share/classes/javax/swing/JScrollPane.java @@ -146,7 +146,7 @@ import java.beans.Transient; * future Swing releases. The current serialization support is * appropriate for short term storage or RMI between applications running * the same version of Swing. As of 1.4, support for long term storage - * of all JavaBeansTM + * of all JavaBeans™ * has been added to the java.beans package. * Please see {@link java.beans.XMLEncoder}. * @@ -677,7 +677,7 @@ public class JScrollPane extends JComponent implements ScrollPaneConstants, Acce * future Swing releases. The current serialization support is * appropriate for short term storage or RMI between applications running * the same version of Swing. As of 1.4, support for long term storage - * of all JavaBeansTM + * of all JavaBeans™ * has been added to the java.beans package. * Please see {@link java.beans.XMLEncoder}. * @@ -1437,7 +1437,7 @@ public class JScrollPane extends JComponent implements ScrollPaneConstants, Acce * future Swing releases. The current serialization support is * appropriate for short term storage or RMI between applications running * the same version of Swing. As of 1.4, support for long term storage - * of all JavaBeansTM + * of all JavaBeans™ * has been added to the java.beans package. * Please see {@link java.beans.XMLEncoder}. */ diff --git a/jdk/src/share/classes/javax/swing/JSeparator.java b/jdk/src/share/classes/javax/swing/JSeparator.java index 1d994fb6d59..5f56ae3077c 100644 --- a/jdk/src/share/classes/javax/swing/JSeparator.java +++ b/jdk/src/share/classes/javax/swing/JSeparator.java @@ -60,7 +60,7 @@ import java.io.IOException; * future Swing releases. The current serialization support is * appropriate for short term storage or RMI between applications running * the same version of Swing. As of 1.4, support for long term storage - * of all JavaBeansTM + * of all JavaBeans™ * has been added to the java.beans package. * Please see {@link java.beans.XMLEncoder}. * @@ -276,7 +276,7 @@ public class JSeparator extends JComponent implements SwingConstants, Accessible * future Swing releases. The current serialization support is * appropriate for short term storage or RMI between applications running * the same version of Swing. As of 1.4, support for long term storage - * of all JavaBeansTM + * of all JavaBeans™ * has been added to the java.beans package. * Please see {@link java.beans.XMLEncoder}. */ diff --git a/jdk/src/share/classes/javax/swing/JSlider.java b/jdk/src/share/classes/javax/swing/JSlider.java index eb15c69c3d7..207ce7d0535 100644 --- a/jdk/src/share/classes/javax/swing/JSlider.java +++ b/jdk/src/share/classes/javax/swing/JSlider.java @@ -68,7 +68,7 @@ import java.beans.*; * future Swing releases. The current serialization support is * appropriate for short term storage or RMI between applications running * the same version of Swing. As of 1.4, support for long term storage - * of all JavaBeansTM + * of all JavaBeans™ * has been added to the java.beans package. * Please see {@link java.beans.XMLEncoder}. * @@ -1425,7 +1425,7 @@ public class JSlider extends JComponent implements SwingConstants, Accessible { * future Swing releases. The current serialization support is * appropriate for short term storage or RMI between applications running * the same version of Swing. As of 1.4, support for long term storage - * of all JavaBeansTM + * of all JavaBeans™ * has been added to the java.beans package. * Please see {@link java.beans.XMLEncoder}. */ diff --git a/jdk/src/share/classes/javax/swing/JSpinner.java b/jdk/src/share/classes/javax/swing/JSpinner.java index d0fb75a395e..d15bde3ad6e 100644 --- a/jdk/src/share/classes/javax/swing/JSpinner.java +++ b/jdk/src/share/classes/javax/swing/JSpinner.java @@ -106,7 +106,7 @@ import sun.util.locale.provider.LocaleServiceProviderPool; * future Swing releases. The current serialization support is * appropriate for short term storage or RMI between applications running * the same version of Swing. As of 1.4, support for long term storage - * of all JavaBeansTM + * of all JavaBeans™ * has been added to the java.beans package. * Please see {@link java.beans.XMLEncoder}. * diff --git a/jdk/src/share/classes/javax/swing/JSplitPane.java b/jdk/src/share/classes/javax/swing/JSplitPane.java index f2b533766c4..111a3e0285a 100644 --- a/jdk/src/share/classes/javax/swing/JSplitPane.java +++ b/jdk/src/share/classes/javax/swing/JSplitPane.java @@ -89,7 +89,7 @@ import java.io.IOException; * future Swing releases. The current serialization support is * appropriate for short term storage or RMI between applications running * the same version of Swing. As of 1.4, support for long term storage - * of all JavaBeansTM + * of all JavaBeans™ * has been added to the java.beans package. * Please see {@link java.beans.XMLEncoder}. * @@ -1152,7 +1152,7 @@ public class JSplitPane extends JComponent implements Accessible * future Swing releases. The current serialization support is * appropriate for short term storage or RMI between applications running * the same version of Swing. As of 1.4, support for long term storage - * of all JavaBeansTM + * of all JavaBeans™ * has been added to the java.beans package. * Please see {@link java.beans.XMLEncoder}. */ diff --git a/jdk/src/share/classes/javax/swing/JTabbedPane.java b/jdk/src/share/classes/javax/swing/JTabbedPane.java index 603ea31c010..e6c0951bdae 100644 --- a/jdk/src/share/classes/javax/swing/JTabbedPane.java +++ b/jdk/src/share/classes/javax/swing/JTabbedPane.java @@ -91,7 +91,7 @@ import java.io.IOException; * future Swing releases. The current serialization support is * appropriate for short term storage or RMI between applications running * the same version of Swing. As of 1.4, support for long term storage - * of all JavaBeansTM + * of all JavaBeans™ * has been added to the java.beans package. * Please see {@link java.beans.XMLEncoder}. * @@ -1885,7 +1885,7 @@ public class JTabbedPane extends JComponent * future Swing releases. The current serialization support is * appropriate for short term storage or RMI between applications running * the same version of Swing. As of 1.4, support for long term storage - * of all JavaBeansTM + * of all JavaBeans™ * has been added to the java.beans package. * Please see {@link java.beans.XMLEncoder}. */ diff --git a/jdk/src/share/classes/javax/swing/JTable.java b/jdk/src/share/classes/javax/swing/JTable.java index c7bf52f4f26..c366c6bbe8f 100644 --- a/jdk/src/share/classes/javax/swing/JTable.java +++ b/jdk/src/share/classes/javax/swing/JTable.java @@ -200,7 +200,7 @@ import sun.swing.SwingLazyValue; * future Swing releases. The current serialization support is * appropriate for short term storage or RMI between applications running * the same version of Swing. As of 1.4, support for long term storage - * of all JavaBeansTM + * of all JavaBeans™ * has been added to the java.beans package. * Please see {@link java.beans.XMLEncoder}. * @@ -6575,7 +6575,7 @@ public class JTable extends JComponent implements TableModelListener, Scrollable * future Swing releases. The current serialization support is * appropriate for short term storage or RMI between applications running * the same version of Swing. As of 1.4, support for long term storage - * of all JavaBeansTM + * of all JavaBeans™ * has been added to the java.beans package. * Please see {@link java.beans.XMLEncoder}. */ diff --git a/jdk/src/share/classes/javax/swing/JTextArea.java b/jdk/src/share/classes/javax/swing/JTextArea.java index 5e4c4baebfd..80b2bb729e3 100644 --- a/jdk/src/share/classes/javax/swing/JTextArea.java +++ b/jdk/src/share/classes/javax/swing/JTextArea.java @@ -112,7 +112,7 @@ import java.io.IOException; * future Swing releases. The current serialization support is * appropriate for short term storage or RMI between applications running * the same version of Swing. As of 1.4, support for long term storage - * of all JavaBeansTM + * of all JavaBeans™ * has been added to the java.beans package. * Please see {@link java.beans.XMLEncoder}. * @@ -783,7 +783,7 @@ public class JTextArea extends JTextComponent { * future Swing releases. The current serialization support is * appropriate for short term storage or RMI between applications running * the same version of Swing. As of 1.4, support for long term storage - * of all JavaBeansTM + * of all JavaBeans™ * has been added to the java.beans package. * Please see {@link java.beans.XMLEncoder}. */ diff --git a/jdk/src/share/classes/javax/swing/JTextField.java b/jdk/src/share/classes/javax/swing/JTextField.java index a5744ee0b95..0e5e9aa4915 100644 --- a/jdk/src/share/classes/javax/swing/JTextField.java +++ b/jdk/src/share/classes/javax/swing/JTextField.java @@ -148,7 +148,7 @@ import java.io.Serializable; * future Swing releases. The current serialization support is * appropriate for short term storage or RMI between applications running * the same version of Swing. As of 1.4, support for long term storage - * of all JavaBeansTM + * of all JavaBeans™ * has been added to the java.beans package. * Please see {@link java.beans.XMLEncoder}. * @@ -939,7 +939,7 @@ public class JTextField extends JTextComponent implements SwingConstants { * future Swing releases. The current serialization support is * appropriate for short term storage or RMI between applications running * the same version of Swing. As of 1.4, support for long term storage - * of all JavaBeansTM + * of all JavaBeans™ * has been added to the java.beans package. * Please see {@link java.beans.XMLEncoder}. */ diff --git a/jdk/src/share/classes/javax/swing/JTextPane.java b/jdk/src/share/classes/javax/swing/JTextPane.java index 82512dfd045..a6a76edcf32 100644 --- a/jdk/src/share/classes/javax/swing/JTextPane.java +++ b/jdk/src/share/classes/javax/swing/JTextPane.java @@ -68,7 +68,7 @@ import javax.swing.plaf.*; * future Swing releases. The current serialization support is * appropriate for short term storage or RMI between applications running * the same version of Swing. As of 1.4, support for long term storage - * of all JavaBeansTM + * of all JavaBeans™ * has been added to the java.beans package. * Please see {@link java.beans.XMLEncoder}. * diff --git a/jdk/src/share/classes/javax/swing/JToggleButton.java b/jdk/src/share/classes/javax/swing/JToggleButton.java index 6aa7fe00ff2..3489a07e803 100644 --- a/jdk/src/share/classes/javax/swing/JToggleButton.java +++ b/jdk/src/share/classes/javax/swing/JToggleButton.java @@ -64,7 +64,7 @@ import java.io.IOException; * future Swing releases. The current serialization support is * appropriate for short term storage or RMI between applications running * the same version of Swing. As of 1.4, support for long term storage - * of all JavaBeansTM + * of all JavaBeans™ * has been added to the java.beans package. * Please see {@link java.beans.XMLEncoder}. * @@ -218,7 +218,7 @@ public class JToggleButton extends AbstractButton implements Accessible { * future Swing releases. The current serialization support is * appropriate for short term storage or RMI between applications running * the same version of Swing. As of 1.4, support for long term storage - * of all JavaBeansTM + * of all JavaBeans™ * has been added to the java.beans package. * Please see {@link java.beans.XMLEncoder}. */ @@ -380,7 +380,7 @@ public class JToggleButton extends AbstractButton implements Accessible { * future Swing releases. The current serialization support is * appropriate for short term storage or RMI between applications running * the same version of Swing. As of 1.4, support for long term storage - * of all JavaBeansTM + * of all JavaBeans™ * has been added to the java.beans package. * Please see {@link java.beans.XMLEncoder}. */ diff --git a/jdk/src/share/classes/javax/swing/JToolBar.java b/jdk/src/share/classes/javax/swing/JToolBar.java index b19ae272d4e..a47e86127c0 100644 --- a/jdk/src/share/classes/javax/swing/JToolBar.java +++ b/jdk/src/share/classes/javax/swing/JToolBar.java @@ -74,7 +74,7 @@ import java.util.Hashtable; * future Swing releases. The current serialization support is * appropriate for short term storage or RMI between applications running * the same version of Swing. As of 1.4, support for long term storage - * of all JavaBeansTM + * of all JavaBeans™ * has been added to the java.beans package. * Please see {@link java.beans.XMLEncoder}. * diff --git a/jdk/src/share/classes/javax/swing/JToolTip.java b/jdk/src/share/classes/javax/swing/JToolTip.java index 5373a57de5f..6373feecb03 100644 --- a/jdk/src/share/classes/javax/swing/JToolTip.java +++ b/jdk/src/share/classes/javax/swing/JToolTip.java @@ -58,7 +58,7 @@ import java.util.Objects; * future Swing releases. The current serialization support is * appropriate for short term storage or RMI between applications running * the same version of Swing. As of 1.4, support for long term storage - * of all JavaBeansTM + * of all JavaBeans™ * has been added to the java.beans package. * Please see {@link java.beans.XMLEncoder}. * @@ -254,7 +254,7 @@ public class JToolTip extends JComponent implements Accessible { * future Swing releases. The current serialization support is * appropriate for short term storage or RMI between applications running * the same version of Swing. As of 1.4, support for long term storage - * of all JavaBeansTM + * of all JavaBeans™ * has been added to the java.beans package. * Please see {@link java.beans.XMLEncoder}. */ diff --git a/jdk/src/share/classes/javax/swing/JTree.java b/jdk/src/share/classes/javax/swing/JTree.java index 25e201279d1..fdacb72aa3c 100644 --- a/jdk/src/share/classes/javax/swing/JTree.java +++ b/jdk/src/share/classes/javax/swing/JTree.java @@ -130,7 +130,7 @@ import static sun.swing.SwingUtilities2.Section.*; * future Swing releases. The current serialization support is * appropriate for short term storage or RMI between applications running * the same version of Swing. As of 1.4, support for long term storage - * of all JavaBeansTM + * of all JavaBeans™ * has been added to the java.beans package. * Please see {@link java.beans.XMLEncoder}. *

          @@ -3238,7 +3238,7 @@ public class JTree extends JComponent implements Scrollable, Accessible * future Swing releases. The current serialization support is * appropriate for short term storage or RMI between applications running * the same version of Swing. As of 1.4, support for long term storage - * of all JavaBeansTM + * of all JavaBeans™ * has been added to the java.beans package. * Please see {@link java.beans.XMLEncoder}. */ @@ -3360,7 +3360,7 @@ public class JTree extends JComponent implements Scrollable, Accessible * future Swing releases. The current serialization support is * appropriate for short term storage or RMI between applications running * the same version of Swing. As of 1.4, support for long term storage - * of all JavaBeansTM + * of all JavaBeans™ * has been added to the java.beans package. * Please see {@link java.beans.XMLEncoder}. */ @@ -3861,7 +3861,7 @@ public class JTree extends JComponent implements Scrollable, Accessible * future Swing releases. The current serialization support is * appropriate for short term storage or RMI between applications running * the same version of Swing. As of 1.4, support for long term storage - * of all JavaBeansTM + * of all JavaBeans™ * has been added to the java.beans package. * Please see {@link java.beans.XMLEncoder}. */ @@ -4093,7 +4093,7 @@ public class JTree extends JComponent implements Scrollable, Accessible * future Swing releases. The current serialization support is * appropriate for short term storage or RMI between applications running * the same version of Swing. As of 1.4, support for long term storage - * of all JavaBeansTM + * of all JavaBeans™ * has been added to the java.beans package. * Please see {@link java.beans.XMLEncoder}. */ diff --git a/jdk/src/share/classes/javax/swing/JViewport.java b/jdk/src/share/classes/javax/swing/JViewport.java index 7d546a88d9c..7f3346de550 100644 --- a/jdk/src/share/classes/javax/swing/JViewport.java +++ b/jdk/src/share/classes/javax/swing/JViewport.java @@ -94,7 +94,7 @@ import java.io.Serializable; * future Swing releases. The current serialization support is * appropriate for short term storage or RMI between applications running * the same version of Swing. As of 1.4, support for long term storage - * of all JavaBeansTM + * of all JavaBeans™ * has been added to the java.beans package. * Please see {@link java.beans.XMLEncoder}. * @@ -1292,7 +1292,7 @@ public class JViewport extends JComponent implements Accessible * future Swing releases. The current serialization support is * appropriate for short term storage or RMI between applications running * the same version of Swing. As of 1.4, support for long term storage - * of all JavaBeansTM + * of all JavaBeans™ * has been added to the java.beans package. * Please see {@link java.beans.XMLEncoder}. */ @@ -1761,7 +1761,7 @@ public class JViewport extends JComponent implements Accessible * future Swing releases. The current serialization support is * appropriate for short term storage or RMI between applications running * the same version of Swing. As of 1.4, support for long term storage - * of all JavaBeansTM + * of all JavaBeans™ * has been added to the java.beans package. * Please see {@link java.beans.XMLEncoder}. */ diff --git a/jdk/src/share/classes/javax/swing/JWindow.java b/jdk/src/share/classes/javax/swing/JWindow.java index e211b8d5ca3..c49e942b9aa 100644 --- a/jdk/src/share/classes/javax/swing/JWindow.java +++ b/jdk/src/share/classes/javax/swing/JWindow.java @@ -76,7 +76,7 @@ import javax.accessibility.*; * future Swing releases. The current serialization support is * appropriate for short term storage or RMI between applications running * the same version of Swing. As of 1.4, support for long term storage - * of all JavaBeansTM + * of all JavaBeans™ * has been added to the java.beans package. * Please see {@link java.beans.XMLEncoder}. * diff --git a/jdk/src/share/classes/javax/swing/KeyStroke.java b/jdk/src/share/classes/javax/swing/KeyStroke.java index 9aaa15d21c6..774eeb692f1 100644 --- a/jdk/src/share/classes/javax/swing/KeyStroke.java +++ b/jdk/src/share/classes/javax/swing/KeyStroke.java @@ -51,7 +51,7 @@ import java.awt.event.KeyEvent; * future Swing releases. The current serialization support is * appropriate for short term storage or RMI between applications running * the same version of Swing. As of 1.4, support for long term storage - * of all JavaBeansTM + * of all JavaBeans™ * has been added to the java.beans package. * Please see {@link java.beans.XMLEncoder}. * diff --git a/jdk/src/share/classes/javax/swing/OverlayLayout.java b/jdk/src/share/classes/javax/swing/OverlayLayout.java index 89c47c02a40..6ea88c2e386 100644 --- a/jdk/src/share/classes/javax/swing/OverlayLayout.java +++ b/jdk/src/share/classes/javax/swing/OverlayLayout.java @@ -45,7 +45,7 @@ import java.io.Serializable; * future Swing releases. The current serialization support is * appropriate for short term storage or RMI between applications running * the same version of Swing. As of 1.4, support for long term storage - * of all JavaBeansTM + * of all JavaBeans™ * has been added to the java.beans package. * Please see {@link java.beans.XMLEncoder}. * diff --git a/jdk/src/share/classes/javax/swing/ScrollPaneLayout.java b/jdk/src/share/classes/javax/swing/ScrollPaneLayout.java index 8d0ebd0da95..9aa581af867 100644 --- a/jdk/src/share/classes/javax/swing/ScrollPaneLayout.java +++ b/jdk/src/share/classes/javax/swing/ScrollPaneLayout.java @@ -48,7 +48,7 @@ import java.io.Serializable; * future Swing releases. The current serialization support is * appropriate for short term storage or RMI between applications running * the same version of Swing. As of 1.4, support for long term storage - * of all JavaBeansTM + * of all JavaBeans™ * has been added to the java.beans package. * Please see {@link java.beans.XMLEncoder}. * diff --git a/jdk/src/share/classes/javax/swing/SizeRequirements.java b/jdk/src/share/classes/javax/swing/SizeRequirements.java index a1def55cd37..aa03f551423 100644 --- a/jdk/src/share/classes/javax/swing/SizeRequirements.java +++ b/jdk/src/share/classes/javax/swing/SizeRequirements.java @@ -81,7 +81,7 @@ import java.io.Serializable; * future Swing releases. The current serialization support is * appropriate for short term storage or RMI between applications running * the same version of Swing. As of 1.4, support for long term storage - * of all JavaBeansTM + * of all JavaBeans™ * has been added to the java.beans package. * Please see {@link java.beans.XMLEncoder}. * diff --git a/jdk/src/share/classes/javax/swing/Spring.java b/jdk/src/share/classes/javax/swing/Spring.java index 6d49eb40ca7..2b18313e7c6 100644 --- a/jdk/src/share/classes/javax/swing/Spring.java +++ b/jdk/src/share/classes/javax/swing/Spring.java @@ -117,7 +117,7 @@ import java.awt.Component; * future Swing releases. The current serialization support is * appropriate for short term storage or RMI between applications running * the same version of Swing. As of 1.4, support for long term storage - * of all JavaBeansTM + * of all JavaBeans™ * has been added to the java.beans package. * Please see {@link java.beans.XMLEncoder}. * diff --git a/jdk/src/share/classes/javax/swing/SpringLayout.java b/jdk/src/share/classes/javax/swing/SpringLayout.java index f3ca54d15cd..699a9ce5a5d 100644 --- a/jdk/src/share/classes/javax/swing/SpringLayout.java +++ b/jdk/src/share/classes/javax/swing/SpringLayout.java @@ -172,7 +172,7 @@ import java.util.*; * future Swing releases. The current serialization support is * appropriate for short term storage or RMI between applications running * the same version of Swing. As of 1.4, support for long term storage - * of all JavaBeansTM + * of all JavaBeans™ * has been added to the java.beans package. * Please see {@link java.beans.XMLEncoder}. * diff --git a/jdk/src/share/classes/javax/swing/Timer.java b/jdk/src/share/classes/javax/swing/Timer.java index d52e3bacdbe..e6e04307519 100644 --- a/jdk/src/share/classes/javax/swing/Timer.java +++ b/jdk/src/share/classes/javax/swing/Timer.java @@ -137,7 +137,7 @@ import javax.swing.event.EventListenerList; * future Swing releases. The current serialization support is * appropriate for short term storage or RMI between applications running * the same version of Swing. As of 1.4, support for long term storage - * of all JavaBeansTM + * of all JavaBeans™ * has been added to the java.beans package. * Please see {@link java.beans.XMLEncoder}. * diff --git a/jdk/src/share/classes/javax/swing/UIDefaults.java b/jdk/src/share/classes/javax/swing/UIDefaults.java index 51cbd9cb57f..4812caa04f3 100644 --- a/jdk/src/share/classes/javax/swing/UIDefaults.java +++ b/jdk/src/share/classes/javax/swing/UIDefaults.java @@ -64,7 +64,7 @@ import sun.util.CoreResourceBundleControl; * future Swing releases. The current serialization support is * appropriate for short term storage or RMI between applications running * the same version of Swing. As of 1.4, support for long term storage - * of all JavaBeansTM + * of all JavaBeans™ * has been added to the java.beans package. * Please see {@link java.beans.XMLEncoder}. * diff --git a/jdk/src/share/classes/javax/swing/UIManager.java b/jdk/src/share/classes/javax/swing/UIManager.java index 17a7b9e81dc..2ea4bdce8f8 100644 --- a/jdk/src/share/classes/javax/swing/UIManager.java +++ b/jdk/src/share/classes/javax/swing/UIManager.java @@ -167,7 +167,7 @@ import sun.awt.AWTAccessor; * future Swing releases. The current serialization support is * appropriate for short term storage or RMI between applications running * the same version of Swing. As of 1.4, support for long term storage - * of all JavaBeansTM + * of all JavaBeans™ * has been added to the java.beans package. * Please see {@link java.beans.XMLEncoder}. * diff --git a/jdk/src/share/classes/javax/swing/UnsupportedLookAndFeelException.java b/jdk/src/share/classes/javax/swing/UnsupportedLookAndFeelException.java index 3ebf757512e..0ff32966131 100644 --- a/jdk/src/share/classes/javax/swing/UnsupportedLookAndFeelException.java +++ b/jdk/src/share/classes/javax/swing/UnsupportedLookAndFeelException.java @@ -33,7 +33,7 @@ package javax.swing; * future Swing releases. The current serialization support is * appropriate for short term storage or RMI between applications running * the same version of Swing. As of 1.4, support for long term storage - * of all JavaBeansTM + * of all JavaBeans™ * has been added to the java.beans package. * Please see {@link java.beans.XMLEncoder}. * diff --git a/jdk/src/share/classes/javax/swing/ViewportLayout.java b/jdk/src/share/classes/javax/swing/ViewportLayout.java index b72c37d3982..aeac64276d6 100644 --- a/jdk/src/share/classes/javax/swing/ViewportLayout.java +++ b/jdk/src/share/classes/javax/swing/ViewportLayout.java @@ -50,7 +50,7 @@ import java.io.Serializable; * future Swing releases. The current serialization support is * appropriate for short term storage or RMI between applications running * the same version of Swing. As of 1.4, support for long term storage - * of all JavaBeansTM + * of all JavaBeans™ * has been added to the java.beans package. * Please see {@link java.beans.XMLEncoder}. * diff --git a/jdk/src/share/classes/javax/swing/border/AbstractBorder.java b/jdk/src/share/classes/javax/swing/border/AbstractBorder.java index e1d19fe3ce1..ee7ee28c17f 100644 --- a/jdk/src/share/classes/javax/swing/border/AbstractBorder.java +++ b/jdk/src/share/classes/javax/swing/border/AbstractBorder.java @@ -40,7 +40,7 @@ import java.io.Serializable; * future Swing releases. The current serialization support is * appropriate for short term storage or RMI between applications running * the same version of Swing. As of 1.4, support for long term storage - * of all JavaBeansTM + * of all JavaBeans™ * has been added to the java.beans package. * Please see {@link java.beans.XMLEncoder}. * diff --git a/jdk/src/share/classes/javax/swing/border/BevelBorder.java b/jdk/src/share/classes/javax/swing/border/BevelBorder.java index cb056eb75d8..659bd7f6966 100644 --- a/jdk/src/share/classes/javax/swing/border/BevelBorder.java +++ b/jdk/src/share/classes/javax/swing/border/BevelBorder.java @@ -38,7 +38,7 @@ import java.beans.ConstructorProperties; * future Swing releases. The current serialization support is * appropriate for short term storage or RMI between applications running * the same version of Swing. As of 1.4, support for long term storage - * of all JavaBeansTM + * of all JavaBeans™ * has been added to the java.beans package. * Please see {@link java.beans.XMLEncoder}. * diff --git a/jdk/src/share/classes/javax/swing/border/CompoundBorder.java b/jdk/src/share/classes/javax/swing/border/CompoundBorder.java index a0143670ec2..f1a6d8538e6 100644 --- a/jdk/src/share/classes/javax/swing/border/CompoundBorder.java +++ b/jdk/src/share/classes/javax/swing/border/CompoundBorder.java @@ -48,7 +48,7 @@ import java.beans.ConstructorProperties; * future Swing releases. The current serialization support is * appropriate for short term storage or RMI between applications running * the same version of Swing. As of 1.4, support for long term storage - * of all JavaBeansTM + * of all JavaBeans™ * has been added to the java.beans package. * Please see {@link java.beans.XMLEncoder}. * diff --git a/jdk/src/share/classes/javax/swing/border/EmptyBorder.java b/jdk/src/share/classes/javax/swing/border/EmptyBorder.java index a1b74c3b3f2..cc8da3a2287 100644 --- a/jdk/src/share/classes/javax/swing/border/EmptyBorder.java +++ b/jdk/src/share/classes/javax/swing/border/EmptyBorder.java @@ -40,7 +40,7 @@ import java.beans.ConstructorProperties; * future Swing releases. The current serialization support is * appropriate for short term storage or RMI between applications running * the same version of Swing. As of 1.4, support for long term storage - * of all JavaBeansTM + * of all JavaBeans™ * has been added to the java.beans package. * Please see {@link java.beans.XMLEncoder}. * diff --git a/jdk/src/share/classes/javax/swing/border/EtchedBorder.java b/jdk/src/share/classes/javax/swing/border/EtchedBorder.java index b7d72c9548a..3bb5c7e0686 100644 --- a/jdk/src/share/classes/javax/swing/border/EtchedBorder.java +++ b/jdk/src/share/classes/javax/swing/border/EtchedBorder.java @@ -44,7 +44,7 @@ import java.beans.ConstructorProperties; * future Swing releases. The current serialization support is * appropriate for short term storage or RMI between applications running * the same version of Swing. As of 1.4, support for long term storage - * of all JavaBeansTM + * of all JavaBeans™ * has been added to the java.beans package. * Please see {@link java.beans.XMLEncoder}. * diff --git a/jdk/src/share/classes/javax/swing/border/LineBorder.java b/jdk/src/share/classes/javax/swing/border/LineBorder.java index 980b0da1a97..8d7abb99ac9 100644 --- a/jdk/src/share/classes/javax/swing/border/LineBorder.java +++ b/jdk/src/share/classes/javax/swing/border/LineBorder.java @@ -44,7 +44,7 @@ import java.beans.ConstructorProperties; * future Swing releases. The current serialization support is * appropriate for short term storage or RMI between applications running * the same version of Swing. As of 1.4, support for long term storage - * of all JavaBeansTM + * of all JavaBeans™ * has been added to the java.beans package. * Please see {@link java.beans.XMLEncoder}. * diff --git a/jdk/src/share/classes/javax/swing/border/MatteBorder.java b/jdk/src/share/classes/javax/swing/border/MatteBorder.java index 80d49a7ed87..53eaefaa6df 100644 --- a/jdk/src/share/classes/javax/swing/border/MatteBorder.java +++ b/jdk/src/share/classes/javax/swing/border/MatteBorder.java @@ -40,7 +40,7 @@ import javax.swing.Icon; * future Swing releases. The current serialization support is * appropriate for short term storage or RMI between applications running * the same version of Swing. As of 1.4, support for long term storage - * of all JavaBeansTM + * of all JavaBeans™ * has been added to the java.beans package. * Please see {@link java.beans.XMLEncoder}. * diff --git a/jdk/src/share/classes/javax/swing/border/SoftBevelBorder.java b/jdk/src/share/classes/javax/swing/border/SoftBevelBorder.java index b23c13cb741..d11b4202af8 100644 --- a/jdk/src/share/classes/javax/swing/border/SoftBevelBorder.java +++ b/jdk/src/share/classes/javax/swing/border/SoftBevelBorder.java @@ -40,7 +40,7 @@ import java.beans.ConstructorProperties; * future Swing releases. The current serialization support is * appropriate for short term storage or RMI between applications running * the same version of Swing. As of 1.4, support for long term storage - * of all JavaBeansTM + * of all JavaBeans™ * has been added to the java.beans package. * Please see {@link java.beans.XMLEncoder}. * diff --git a/jdk/src/share/classes/javax/swing/border/TitledBorder.java b/jdk/src/share/classes/javax/swing/border/TitledBorder.java index 244a45bc8de..0eec042c7ec 100644 --- a/jdk/src/share/classes/javax/swing/border/TitledBorder.java +++ b/jdk/src/share/classes/javax/swing/border/TitledBorder.java @@ -60,7 +60,7 @@ import javax.swing.plaf.basic.BasicHTML; * future Swing releases. The current serialization support is * appropriate for short term storage or RMI between applications running * the same version of Swing. As of 1.4, support for long term storage - * of all JavaBeansTM + * of all JavaBeans™ * has been added to the java.beans package. * Please see {@link java.beans.XMLEncoder}. * diff --git a/jdk/src/share/classes/javax/swing/colorchooser/AbstractColorChooserPanel.java b/jdk/src/share/classes/javax/swing/colorchooser/AbstractColorChooserPanel.java index 2a3b0c0c4c1..58b5946aaaa 100644 --- a/jdk/src/share/classes/javax/swing/colorchooser/AbstractColorChooserPanel.java +++ b/jdk/src/share/classes/javax/swing/colorchooser/AbstractColorChooserPanel.java @@ -40,7 +40,7 @@ import javax.swing.*; * future Swing releases. The current serialization support is * appropriate for short term storage or RMI between applications running * the same version of Swing. As of 1.4, support for long term storage - * of all JavaBeansTM + * of all JavaBeans™ * has been added to the java.beans package. * Please see {@link java.beans.XMLEncoder}. * diff --git a/jdk/src/share/classes/javax/swing/colorchooser/ColorChooserComponentFactory.java b/jdk/src/share/classes/javax/swing/colorchooser/ColorChooserComponentFactory.java index 67eac203c71..ef3f4012984 100644 --- a/jdk/src/share/classes/javax/swing/colorchooser/ColorChooserComponentFactory.java +++ b/jdk/src/share/classes/javax/swing/colorchooser/ColorChooserComponentFactory.java @@ -37,7 +37,7 @@ import javax.swing.JComponent; * future Swing releases. The current serialization support is * appropriate for short term storage or RMI between applications running * the same version of Swing. As of 1.4, support for long term storage - * of all JavaBeansTM + * of all JavaBeans™ * has been added to the java.beans package. * Please see {@link java.beans.XMLEncoder}. * diff --git a/jdk/src/share/classes/javax/swing/colorchooser/DefaultPreviewPanel.java b/jdk/src/share/classes/javax/swing/colorchooser/DefaultPreviewPanel.java index fa1a670d47d..55bdf41ee4a 100644 --- a/jdk/src/share/classes/javax/swing/colorchooser/DefaultPreviewPanel.java +++ b/jdk/src/share/classes/javax/swing/colorchooser/DefaultPreviewPanel.java @@ -46,7 +46,7 @@ import sun.swing.SwingUtilities2; * future Swing releases. The current serialization support is * appropriate for short term storage or RMI between applications running * the same version of Swing. As of 1.4, support for long term storage - * of all JavaBeansTM + * of all JavaBeans™ * has been added to the java.beans package. * Please see {@link java.beans.XMLEncoder}. * diff --git a/jdk/src/share/classes/javax/swing/colorchooser/DefaultSwatchChooserPanel.java b/jdk/src/share/classes/javax/swing/colorchooser/DefaultSwatchChooserPanel.java index 564a085ea98..6fdcf42c827 100644 --- a/jdk/src/share/classes/javax/swing/colorchooser/DefaultSwatchChooserPanel.java +++ b/jdk/src/share/classes/javax/swing/colorchooser/DefaultSwatchChooserPanel.java @@ -45,7 +45,7 @@ import javax.accessibility.*; * future Swing releases. The current serialization support is * appropriate for short term storage or RMI between applications running * the same version of Swing. As of 1.4, support for long term storage - * of all JavaBeansTM + * of all JavaBeans™ * has been added to the java.beans package. * Please see {@link java.beans.XMLEncoder}. * diff --git a/jdk/src/share/classes/javax/swing/event/AncestorEvent.java b/jdk/src/share/classes/javax/swing/event/AncestorEvent.java index c166c19cecd..0234d3e0b16 100644 --- a/jdk/src/share/classes/javax/swing/event/AncestorEvent.java +++ b/jdk/src/share/classes/javax/swing/event/AncestorEvent.java @@ -37,7 +37,7 @@ import javax.swing.*; * future Swing releases. The current serialization support is * appropriate for short term storage or RMI between applications running * the same version of Swing. As of 1.4, support for long term storage - * of all JavaBeansTM + * of all JavaBeans™ * has been added to the java.beans package. * Please see {@link java.beans.XMLEncoder}. * diff --git a/jdk/src/share/classes/javax/swing/event/CaretEvent.java b/jdk/src/share/classes/javax/swing/event/CaretEvent.java index 6cb3164b6b0..049ec5be649 100644 --- a/jdk/src/share/classes/javax/swing/event/CaretEvent.java +++ b/jdk/src/share/classes/javax/swing/event/CaretEvent.java @@ -36,7 +36,7 @@ import java.util.EventObject; * future Swing releases. The current serialization support is * appropriate for short term storage or RMI between applications running * the same version of Swing. As of 1.4, support for long term storage - * of all JavaBeansTM + * of all JavaBeans™ * has been added to the java.beans package. * Please see {@link java.beans.XMLEncoder}. * diff --git a/jdk/src/share/classes/javax/swing/event/ChangeEvent.java b/jdk/src/share/classes/javax/swing/event/ChangeEvent.java index 7c351c4145b..4e93c295c04 100644 --- a/jdk/src/share/classes/javax/swing/event/ChangeEvent.java +++ b/jdk/src/share/classes/javax/swing/event/ChangeEvent.java @@ -36,7 +36,7 @@ import java.util.EventObject; * future Swing releases. The current serialization support is * appropriate for short term storage or RMI between applications running * the same version of Swing. As of 1.4, support for long term storage - * of all JavaBeansTM + * of all JavaBeans™ * has been added to the java.beans package. * Please see {@link java.beans.XMLEncoder}. * diff --git a/jdk/src/share/classes/javax/swing/event/EventListenerList.java b/jdk/src/share/classes/javax/swing/event/EventListenerList.java index 004659ad24e..2d1e9ab2895 100644 --- a/jdk/src/share/classes/javax/swing/event/EventListenerList.java +++ b/jdk/src/share/classes/javax/swing/event/EventListenerList.java @@ -88,7 +88,7 @@ import java.lang.reflect.Array; * future Swing releases. The current serialization support is * appropriate for short term storage or RMI between applications running * the same version of Swing. As of 1.4, support for long term storage - * of all JavaBeansTM + * of all JavaBeans™ * has been added to the java.beans package. * Please see {@link java.beans.XMLEncoder}. * diff --git a/jdk/src/share/classes/javax/swing/event/HyperlinkEvent.java b/jdk/src/share/classes/javax/swing/event/HyperlinkEvent.java index f0e53d7b641..004038af785 100644 --- a/jdk/src/share/classes/javax/swing/event/HyperlinkEvent.java +++ b/jdk/src/share/classes/javax/swing/event/HyperlinkEvent.java @@ -39,7 +39,7 @@ import javax.swing.text.Element; * future Swing releases. The current serialization support is * appropriate for short term storage or RMI between applications running * the same version of Swing. As of 1.4, support for long term storage - * of all JavaBeansTM + * of all JavaBeans™ * has been added to the java.beans package. * Please see {@link java.beans.XMLEncoder}. * diff --git a/jdk/src/share/classes/javax/swing/event/InternalFrameEvent.java b/jdk/src/share/classes/javax/swing/event/InternalFrameEvent.java index 5f825bea5e9..f061581cbb9 100644 --- a/jdk/src/share/classes/javax/swing/event/InternalFrameEvent.java +++ b/jdk/src/share/classes/javax/swing/event/InternalFrameEvent.java @@ -42,7 +42,7 @@ import javax.swing.JInternalFrame; * future Swing releases. The current serialization support is * appropriate for short term storage or RMI between applications running * the same version of Swing. As of 1.4, support for long term storage - * of all JavaBeansTM + * of all JavaBeans™ * has been added to the java.beans package. * Please see {@link java.beans.XMLEncoder}. * diff --git a/jdk/src/share/classes/javax/swing/event/ListDataEvent.java b/jdk/src/share/classes/javax/swing/event/ListDataEvent.java index 8862e724eac..05f0ccd67f6 100644 --- a/jdk/src/share/classes/javax/swing/event/ListDataEvent.java +++ b/jdk/src/share/classes/javax/swing/event/ListDataEvent.java @@ -36,7 +36,7 @@ import java.util.EventObject; * future Swing releases. The current serialization support is * appropriate for short term storage or RMI between applications running * the same version of Swing. As of 1.4, support for long term storage - * of all JavaBeansTM + * of all JavaBeans™ * has been added to the java.beans package. * Please see {@link java.beans.XMLEncoder}. * diff --git a/jdk/src/share/classes/javax/swing/event/ListSelectionEvent.java b/jdk/src/share/classes/javax/swing/event/ListSelectionEvent.java index 41f2f3c8d3a..adbb2c87ed7 100644 --- a/jdk/src/share/classes/javax/swing/event/ListSelectionEvent.java +++ b/jdk/src/share/classes/javax/swing/event/ListSelectionEvent.java @@ -42,7 +42,7 @@ import javax.swing.*; * future Swing releases. The current serialization support is * appropriate for short term storage or RMI between applications running * the same version of Swing. As of 1.4, support for long term storage - * of all JavaBeansTM + * of all JavaBeans™ * has been added to the java.beans package. * Please see {@link java.beans.XMLEncoder}. * diff --git a/jdk/src/share/classes/javax/swing/event/MenuDragMouseEvent.java b/jdk/src/share/classes/javax/swing/event/MenuDragMouseEvent.java index 905e76d4215..d2fcea6f506 100644 --- a/jdk/src/share/classes/javax/swing/event/MenuDragMouseEvent.java +++ b/jdk/src/share/classes/javax/swing/event/MenuDragMouseEvent.java @@ -41,7 +41,7 @@ import java.awt.Component; * future Swing releases. The current serialization support is * appropriate for short term storage or RMI between applications running * the same version of Swing. As of 1.4, support for long term storage - * of all JavaBeansTM + * of all JavaBeans™ * has been added to the java.beans package. * Please see {@link java.beans.XMLEncoder}. * diff --git a/jdk/src/share/classes/javax/swing/event/MenuEvent.java b/jdk/src/share/classes/javax/swing/event/MenuEvent.java index a506199fdd4..a88c6b16e58 100644 --- a/jdk/src/share/classes/javax/swing/event/MenuEvent.java +++ b/jdk/src/share/classes/javax/swing/event/MenuEvent.java @@ -37,7 +37,7 @@ import java.util.EventObject; * future Swing releases. The current serialization support is * appropriate for short term storage or RMI between applications running * the same version of Swing. As of 1.4, support for long term storage - * of all JavaBeansTM + * of all JavaBeans™ * has been added to the java.beans package. * Please see {@link java.beans.XMLEncoder}. * diff --git a/jdk/src/share/classes/javax/swing/event/MenuKeyEvent.java b/jdk/src/share/classes/javax/swing/event/MenuKeyEvent.java index c932873bd47..3575352939e 100644 --- a/jdk/src/share/classes/javax/swing/event/MenuKeyEvent.java +++ b/jdk/src/share/classes/javax/swing/event/MenuKeyEvent.java @@ -41,7 +41,7 @@ import java.awt.Component; * future Swing releases. The current serialization support is * appropriate for short term storage or RMI between applications running * the same version of Swing. As of 1.4, support for long term storage - * of all JavaBeansTM + * of all JavaBeans™ * has been added to the java.beans package. * Please see {@link java.beans.XMLEncoder}. * diff --git a/jdk/src/share/classes/javax/swing/event/PopupMenuEvent.java b/jdk/src/share/classes/javax/swing/event/PopupMenuEvent.java index ee1b28ebdda..695f858002c 100644 --- a/jdk/src/share/classes/javax/swing/event/PopupMenuEvent.java +++ b/jdk/src/share/classes/javax/swing/event/PopupMenuEvent.java @@ -35,7 +35,7 @@ import java.util.EventObject; * future Swing releases. The current serialization support is * appropriate for short term storage or RMI between applications running * the same version of Swing. As of 1.4, support for long term storage - * of all JavaBeansTM + * of all JavaBeans™ * has been added to the java.beans package. * Please see {@link java.beans.XMLEncoder}. * diff --git a/jdk/src/share/classes/javax/swing/event/TableColumnModelEvent.java b/jdk/src/share/classes/javax/swing/event/TableColumnModelEvent.java index 1f895c36617..18f72a0839d 100644 --- a/jdk/src/share/classes/javax/swing/event/TableColumnModelEvent.java +++ b/jdk/src/share/classes/javax/swing/event/TableColumnModelEvent.java @@ -38,7 +38,7 @@ import javax.swing.table.*; * future Swing releases. The current serialization support is * appropriate for short term storage or RMI between applications running * the same version of Swing. As of 1.4, support for long term storage - * of all JavaBeansTM + * of all JavaBeans™ * has been added to the java.beans package. * Please see {@link java.beans.XMLEncoder}. * diff --git a/jdk/src/share/classes/javax/swing/event/TableModelEvent.java b/jdk/src/share/classes/javax/swing/event/TableModelEvent.java index 90ffa771765..038ccb36bb0 100644 --- a/jdk/src/share/classes/javax/swing/event/TableModelEvent.java +++ b/jdk/src/share/classes/javax/swing/event/TableModelEvent.java @@ -57,7 +57,7 @@ import javax.swing.table.*; * future Swing releases. The current serialization support is * appropriate for short term storage or RMI between applications running * the same version of Swing. As of 1.4, support for long term storage - * of all JavaBeansTM + * of all JavaBeans™ * has been added to the java.beans package. * Please see {@link java.beans.XMLEncoder}. * diff --git a/jdk/src/share/classes/javax/swing/event/TreeExpansionEvent.java b/jdk/src/share/classes/javax/swing/event/TreeExpansionEvent.java index d7dff7b0871..c91d7cdb106 100644 --- a/jdk/src/share/classes/javax/swing/event/TreeExpansionEvent.java +++ b/jdk/src/share/classes/javax/swing/event/TreeExpansionEvent.java @@ -42,7 +42,7 @@ import javax.swing.tree.TreePath; * future Swing releases. The current serialization support is * appropriate for short term storage or RMI between applications running * the same version of Swing. As of 1.4, support for long term storage - * of all JavaBeansTM + * of all JavaBeans™ * has been added to the java.beans package. * Please see {@link java.beans.XMLEncoder}. * diff --git a/jdk/src/share/classes/javax/swing/event/TreeModelEvent.java b/jdk/src/share/classes/javax/swing/event/TreeModelEvent.java index 0fc036fce69..e67552df9c5 100644 --- a/jdk/src/share/classes/javax/swing/event/TreeModelEvent.java +++ b/jdk/src/share/classes/javax/swing/event/TreeModelEvent.java @@ -42,7 +42,7 @@ import javax.swing.tree.TreePath; * future Swing releases. The current serialization support is * appropriate for short term storage or RMI between applications running * the same version of Swing. As of 1.4, support for long term storage - * of all JavaBeansTM + * of all JavaBeans™ * has been added to the java.beans package. * Please see {@link java.beans.XMLEncoder}. * diff --git a/jdk/src/share/classes/javax/swing/event/TreeSelectionEvent.java b/jdk/src/share/classes/javax/swing/event/TreeSelectionEvent.java index 8924875d899..40deb719c38 100644 --- a/jdk/src/share/classes/javax/swing/event/TreeSelectionEvent.java +++ b/jdk/src/share/classes/javax/swing/event/TreeSelectionEvent.java @@ -40,7 +40,7 @@ import javax.swing.tree.TreePath; * future Swing releases. The current serialization support is * appropriate for short term storage or RMI between applications running * the same version of Swing. As of 1.4, support for long term storage - * of all JavaBeansTM + * of all JavaBeans™ * has been added to the java.beans package. * Please see {@link java.beans.XMLEncoder}. * diff --git a/jdk/src/share/classes/javax/swing/event/UndoableEditEvent.java b/jdk/src/share/classes/javax/swing/event/UndoableEditEvent.java index 546d41db52e..85d4c28c40c 100644 --- a/jdk/src/share/classes/javax/swing/event/UndoableEditEvent.java +++ b/jdk/src/share/classes/javax/swing/event/UndoableEditEvent.java @@ -35,7 +35,7 @@ import javax.swing.undo.*; * future Swing releases. The current serialization support is * appropriate for short term storage or RMI between applications running * the same version of Swing. As of 1.4, support for long term storage - * of all JavaBeansTM + * of all JavaBeans™ * has been added to the java.beans package. * Please see {@link java.beans.XMLEncoder}. * diff --git a/jdk/src/share/classes/javax/swing/plaf/BorderUIResource.java b/jdk/src/share/classes/javax/swing/plaf/BorderUIResource.java index 69eea59e87c..0e549348ef9 100644 --- a/jdk/src/share/classes/javax/swing/plaf/BorderUIResource.java +++ b/jdk/src/share/classes/javax/swing/plaf/BorderUIResource.java @@ -51,7 +51,7 @@ import javax.swing.plaf.UIResource; * future Swing releases. The current serialization support is * appropriate for short term storage or RMI between applications running * the same version of Swing. As of 1.4, support for long term storage - * of all JavaBeansTM + * of all JavaBeans™ * has been added to the java.beans package. * Please see {@link java.beans.XMLEncoder}. * diff --git a/jdk/src/share/classes/javax/swing/plaf/ColorUIResource.java b/jdk/src/share/classes/javax/swing/plaf/ColorUIResource.java index 97d957a52c3..79eba0477a5 100644 --- a/jdk/src/share/classes/javax/swing/plaf/ColorUIResource.java +++ b/jdk/src/share/classes/javax/swing/plaf/ColorUIResource.java @@ -37,7 +37,7 @@ import java.beans.ConstructorProperties; * future Swing releases. The current serialization support is * appropriate for short term storage or RMI between applications running * the same version of Swing. As of 1.4, support for long term storage - * of all JavaBeansTM + * of all JavaBeans™ * has been added to the java.beans package. * Please see {@link java.beans.XMLEncoder}. * diff --git a/jdk/src/share/classes/javax/swing/plaf/DimensionUIResource.java b/jdk/src/share/classes/javax/swing/plaf/DimensionUIResource.java index 4bb839de967..49828dc3550 100644 --- a/jdk/src/share/classes/javax/swing/plaf/DimensionUIResource.java +++ b/jdk/src/share/classes/javax/swing/plaf/DimensionUIResource.java @@ -40,7 +40,7 @@ import javax.swing.plaf.UIResource; * future Swing releases. The current serialization support is * appropriate for short term storage or RMI between applications running * the same version of Swing. As of 1.4, support for long term storage - * of all JavaBeansTM + * of all JavaBeans™ * has been added to the java.beans package. * Please see {@link java.beans.XMLEncoder}. * diff --git a/jdk/src/share/classes/javax/swing/plaf/FontUIResource.java b/jdk/src/share/classes/javax/swing/plaf/FontUIResource.java index 327e82dd067..f8966e8719a 100644 --- a/jdk/src/share/classes/javax/swing/plaf/FontUIResource.java +++ b/jdk/src/share/classes/javax/swing/plaf/FontUIResource.java @@ -39,7 +39,7 @@ import javax.swing.plaf.UIResource; * future Swing releases. The current serialization support is * appropriate for short term storage or RMI between applications running * the same version of Swing. As of 1.4, support for long term storage - * of all JavaBeansTM + * of all JavaBeans™ * has been added to the java.beans package. * Please see {@link java.beans.XMLEncoder}. * diff --git a/jdk/src/share/classes/javax/swing/plaf/IconUIResource.java b/jdk/src/share/classes/javax/swing/plaf/IconUIResource.java index c88da155c88..2fd10327a3f 100644 --- a/jdk/src/share/classes/javax/swing/plaf/IconUIResource.java +++ b/jdk/src/share/classes/javax/swing/plaf/IconUIResource.java @@ -44,7 +44,7 @@ import javax.swing.plaf.UIResource; * future Swing releases. The current serialization support is * appropriate for short term storage or RMI between applications running * the same version of Swing. As of 1.4, support for long term storage - * of all JavaBeansTM + * of all JavaBeans™ * has been added to the java.beans package. * Please see {@link java.beans.XMLEncoder}. * diff --git a/jdk/src/share/classes/javax/swing/plaf/InsetsUIResource.java b/jdk/src/share/classes/javax/swing/plaf/InsetsUIResource.java index e608f1ca474..5da2498b4f5 100644 --- a/jdk/src/share/classes/javax/swing/plaf/InsetsUIResource.java +++ b/jdk/src/share/classes/javax/swing/plaf/InsetsUIResource.java @@ -39,7 +39,7 @@ import javax.swing.plaf.UIResource; * future Swing releases. The current serialization support is * appropriate for short term storage or RMI between applications running * the same version of Swing. As of 1.4, support for long term storage - * of all JavaBeansTM + * of all JavaBeans™ * has been added to the java.beans package. * Please see {@link java.beans.XMLEncoder}. * diff --git a/jdk/src/share/classes/javax/swing/plaf/basic/BasicArrowButton.java b/jdk/src/share/classes/javax/swing/plaf/basic/BasicArrowButton.java index ca20f852b3a..73b79263129 100644 --- a/jdk/src/share/classes/javax/swing/plaf/basic/BasicArrowButton.java +++ b/jdk/src/share/classes/javax/swing/plaf/basic/BasicArrowButton.java @@ -39,7 +39,7 @@ import javax.swing.plaf.UIResource; * future Swing releases. The current serialization support is * appropriate for short term storage or RMI between applications running * the same version of Swing. As of 1.4, support for long term storage - * of all JavaBeansTM + * of all JavaBeans™ * has been added to the java.beans package. * Please see {@link java.beans.XMLEncoder}. * diff --git a/jdk/src/share/classes/javax/swing/plaf/basic/BasicCheckBoxUI.java b/jdk/src/share/classes/javax/swing/plaf/basic/BasicCheckBoxUI.java index 792bd82500b..4c1d5c399d8 100644 --- a/jdk/src/share/classes/javax/swing/plaf/basic/BasicCheckBoxUI.java +++ b/jdk/src/share/classes/javax/swing/plaf/basic/BasicCheckBoxUI.java @@ -43,7 +43,7 @@ import java.io.Serializable; * future Swing releases. The current serialization support is * appropriate for short term storage or RMI between applications running * the same version of Swing. As of 1.4, support for long term storage - * of all JavaBeansTM + * of all JavaBeans™ * has been added to the java.beans package. * Please see {@link java.beans.XMLEncoder}. * diff --git a/jdk/src/share/classes/javax/swing/plaf/basic/BasicComboBoxEditor.java b/jdk/src/share/classes/javax/swing/plaf/basic/BasicComboBoxEditor.java index c902252f4dc..07e0a0f56e8 100644 --- a/jdk/src/share/classes/javax/swing/plaf/basic/BasicComboBoxEditor.java +++ b/jdk/src/share/classes/javax/swing/plaf/basic/BasicComboBoxEditor.java @@ -160,7 +160,7 @@ public class BasicComboBoxEditor implements ComboBoxEditor,FocusListener { * future Swing releases. The current serialization support is * appropriate for short term storage or RMI between applications running * the same version of Swing. As of 1.4, support for long term storage - * of all JavaBeansTM + * of all JavaBeans™ * has been added to the java.beans package. * Please see {@link java.beans.XMLEncoder}. */ diff --git a/jdk/src/share/classes/javax/swing/plaf/basic/BasicComboBoxRenderer.java b/jdk/src/share/classes/javax/swing/plaf/basic/BasicComboBoxRenderer.java index f2b5ddf4735..f98be00b12c 100644 --- a/jdk/src/share/classes/javax/swing/plaf/basic/BasicComboBoxRenderer.java +++ b/jdk/src/share/classes/javax/swing/plaf/basic/BasicComboBoxRenderer.java @@ -41,7 +41,7 @@ import java.io.Serializable; * future Swing releases. The current serialization support is * appropriate for short term storage or RMI between applications running * the same version of Swing. As of 1.4, support for long term storage - * of all JavaBeansTM + * of all JavaBeans™ * has been added to the java.beans package. * Please see {@link java.beans.XMLEncoder}. * @@ -135,7 +135,7 @@ implements ListCellRenderer, Serializable { * future Swing releases. The current serialization support is * appropriate for short term storage or RMI between applications running * the same version of Swing. As of 1.4, support for long term storage - * of all JavaBeansTM + * of all JavaBeans™ * has been added to the java.beans package. * Please see {@link java.beans.XMLEncoder}. */ diff --git a/jdk/src/share/classes/javax/swing/plaf/basic/BasicComboPopup.java b/jdk/src/share/classes/javax/swing/plaf/basic/BasicComboPopup.java index 38f591b1ffc..e3ed947d732 100644 --- a/jdk/src/share/classes/javax/swing/plaf/basic/BasicComboPopup.java +++ b/jdk/src/share/classes/javax/swing/plaf/basic/BasicComboPopup.java @@ -53,7 +53,7 @@ import java.io.Serializable; * future Swing releases. The current serialization support is * appropriate for short term storage or RMI between applications running * the same version of Swing. As of 1.4, support for long term storage - * of all JavaBeansTM + * of all JavaBeans™ * has been added to the java.beans package. * Please see {@link java.beans.XMLEncoder}. * diff --git a/jdk/src/share/classes/javax/swing/plaf/basic/BasicEditorPaneUI.java b/jdk/src/share/classes/javax/swing/plaf/basic/BasicEditorPaneUI.java index 190519b070b..32bace0cc43 100644 --- a/jdk/src/share/classes/javax/swing/plaf/basic/BasicEditorPaneUI.java +++ b/jdk/src/share/classes/javax/swing/plaf/basic/BasicEditorPaneUI.java @@ -44,7 +44,7 @@ import javax.swing.border.*; * future Swing releases. The current serialization support is * appropriate for short term storage or RMI between applications running * the same version of Swing. As of 1.4, support for long term storage - * of all JavaBeansTM + * of all JavaBeans™ * has been added to the java.beans package. * Please see {@link java.beans.XMLEncoder}. * diff --git a/jdk/src/share/classes/javax/swing/plaf/basic/BasicIconFactory.java b/jdk/src/share/classes/javax/swing/plaf/basic/BasicIconFactory.java index ddf9aec9950..6ea1cbcccf4 100644 --- a/jdk/src/share/classes/javax/swing/plaf/basic/BasicIconFactory.java +++ b/jdk/src/share/classes/javax/swing/plaf/basic/BasicIconFactory.java @@ -42,7 +42,7 @@ import java.io.Serializable; * future Swing releases. The current serialization support is * appropriate for short term storage or RMI between applications running * the same version of Swing. As of 1.4, support for long term storage - * of all JavaBeansTM + * of all JavaBeans™ * has been added to the java.beans package. * Please see {@link java.beans.XMLEncoder}. * diff --git a/jdk/src/share/classes/javax/swing/plaf/basic/BasicInternalFrameTitlePane.java b/jdk/src/share/classes/javax/swing/plaf/basic/BasicInternalFrameTitlePane.java index c6600b4837f..283ced62287 100644 --- a/jdk/src/share/classes/javax/swing/plaf/basic/BasicInternalFrameTitlePane.java +++ b/jdk/src/share/classes/javax/swing/plaf/basic/BasicInternalFrameTitlePane.java @@ -50,7 +50,7 @@ import sun.swing.UIAction; * future Swing releases. The current serialization support is * appropriate for short term storage or RMI between applications running * the same version of Swing. As of 1.4, support for long term storage - * of all JavaBeansTM + * of all JavaBeans™ * has been added to the java.beans package. * Please see {@link java.beans.XMLEncoder}. * diff --git a/jdk/src/share/classes/javax/swing/plaf/basic/BasicListUI.java b/jdk/src/share/classes/javax/swing/plaf/basic/BasicListUI.java index 28066de61cb..eb8df7bb774 100644 --- a/jdk/src/share/classes/javax/swing/plaf/basic/BasicListUI.java +++ b/jdk/src/share/classes/javax/swing/plaf/basic/BasicListUI.java @@ -1488,7 +1488,7 @@ public class BasicListUI extends ListUI * future Swing releases. The current serialization support is * appropriate for short term storage or RMI between applications running * the same version of Swing. As of 1.4, support for long term storage - * of all JavaBeansTM + * of all JavaBeans™ * has been added to the java.beans package. * Please see {@link java.beans.XMLEncoder}. * @@ -1592,7 +1592,7 @@ public class BasicListUI extends ListUI * future Swing releases. The current serialization support is * appropriate for short term storage or RMI between applications running * the same version of Swing. As of 1.4, support for long term storage - * of all JavaBeansTM + * of all JavaBeans™ * has been added to the java.beans package. * Please see {@link java.beans.XMLEncoder}. * @@ -1650,7 +1650,7 @@ public class BasicListUI extends ListUI * future Swing releases. The current serialization support is * appropriate for short term storage or RMI between applications running * the same version of Swing. As of 1.4, support for long term storage - * of all JavaBeansTM + * of all JavaBeans™ * has been added to the java.beans package. * Please see {@link java.beans.XMLEncoder}. * @@ -1717,7 +1717,7 @@ public class BasicListUI extends ListUI * future Swing releases. The current serialization support is * appropriate for short term storage or RMI between applications running * the same version of Swing. As of 1.4, support for long term storage - * of all JavaBeansTM + * of all JavaBeans™ * has been added to the java.beans package. * Please see {@link java.beans.XMLEncoder}. * diff --git a/jdk/src/share/classes/javax/swing/plaf/basic/BasicLookAndFeel.java b/jdk/src/share/classes/javax/swing/plaf/basic/BasicLookAndFeel.java index 2e808c4b566..b8aff8a255a 100644 --- a/jdk/src/share/classes/javax/swing/plaf/basic/BasicLookAndFeel.java +++ b/jdk/src/share/classes/javax/swing/plaf/basic/BasicLookAndFeel.java @@ -96,7 +96,7 @@ import java.beans.PropertyChangeEvent; * future Swing releases. The current serialization support is * appropriate for short term storage or RMI between applications running * the same version of Swing. As of 1.4, support for long term storage - * of all JavaBeansTM + * of all JavaBeans™ * has been added to the java.beans package. * Please see {@link java.beans.XMLEncoder}. * diff --git a/jdk/src/share/classes/javax/swing/plaf/basic/BasicSplitPaneDivider.java b/jdk/src/share/classes/javax/swing/plaf/basic/BasicSplitPaneDivider.java index 70b0bffaac7..9a56bd7b3b8 100644 --- a/jdk/src/share/classes/javax/swing/plaf/basic/BasicSplitPaneDivider.java +++ b/jdk/src/share/classes/javax/swing/plaf/basic/BasicSplitPaneDivider.java @@ -53,7 +53,7 @@ import sun.swing.DefaultLookup; * future Swing releases. The current serialization support is * appropriate for short term storage or RMI between applications running * the same version of Swing. As of 1.4, support for long term storage - * of all JavaBeansTM + * of all JavaBeans™ * has been added to the java.beans package. * Please see {@link java.beans.XMLEncoder}. * @@ -671,7 +671,7 @@ public class BasicSplitPaneDivider extends Container * future Swing releases. The current serialization support is * appropriate for short term storage or RMI between applications running * the same version of Swing. As of 1.4, support for long term storage - * of all JavaBeansTM + * of all JavaBeans™ * has been added to the java.beans package. * Please see {@link java.beans.XMLEncoder}. */ diff --git a/jdk/src/share/classes/javax/swing/plaf/basic/BasicTextAreaUI.java b/jdk/src/share/classes/javax/swing/plaf/basic/BasicTextAreaUI.java index 0c57e4ac76b..4a34184bdb1 100644 --- a/jdk/src/share/classes/javax/swing/plaf/basic/BasicTextAreaUI.java +++ b/jdk/src/share/classes/javax/swing/plaf/basic/BasicTextAreaUI.java @@ -43,7 +43,7 @@ import javax.swing.plaf.*; * future Swing releases. The current serialization support is * appropriate for short term storage or RMI between applications running * the same version of Swing. As of 1.4, support for long term storage - * of all JavaBeansTM + * of all JavaBeans™ * has been added to the java.beans package. * Please see {@link java.beans.XMLEncoder}. * diff --git a/jdk/src/share/classes/javax/swing/plaf/basic/BasicTextFieldUI.java b/jdk/src/share/classes/javax/swing/plaf/basic/BasicTextFieldUI.java index cc45d215406..0083c34b74f 100644 --- a/jdk/src/share/classes/javax/swing/plaf/basic/BasicTextFieldUI.java +++ b/jdk/src/share/classes/javax/swing/plaf/basic/BasicTextFieldUI.java @@ -45,7 +45,7 @@ import sun.swing.DefaultLookup; * future Swing releases. The current serialization support is * appropriate for short term storage or RMI between applications running * the same version of Swing. As of 1.4, support for long term storage - * of all JavaBeansTM + * of all JavaBeans™ * has been added to the java.beans package. * Please see {@link java.beans.XMLEncoder}. * diff --git a/jdk/src/share/classes/javax/swing/plaf/basic/BasicTextPaneUI.java b/jdk/src/share/classes/javax/swing/plaf/basic/BasicTextPaneUI.java index 5f3070d0acd..1e460c41584 100644 --- a/jdk/src/share/classes/javax/swing/plaf/basic/BasicTextPaneUI.java +++ b/jdk/src/share/classes/javax/swing/plaf/basic/BasicTextPaneUI.java @@ -41,7 +41,7 @@ import javax.swing.border.*; * future Swing releases. The current serialization support is * appropriate for short term storage or RMI between applications running * the same version of Swing. As of 1.4, support for long term storage - * of all JavaBeansTM + * of all JavaBeans™ * has been added to the java.beans package. * Please see {@link java.beans.XMLEncoder}. * diff --git a/jdk/src/share/classes/javax/swing/plaf/basic/BasicTextUI.java b/jdk/src/share/classes/javax/swing/plaf/basic/BasicTextUI.java index b00bcda30be..bec3faacbfd 100644 --- a/jdk/src/share/classes/javax/swing/plaf/basic/BasicTextUI.java +++ b/jdk/src/share/classes/javax/swing/plaf/basic/BasicTextUI.java @@ -93,7 +93,7 @@ import javax.swing.plaf.basic.DragRecognitionSupport.BeforeDrag; * future Swing releases. The current serialization support is * appropriate for short term storage or RMI between applications running * the same version of Swing. As of 1.4, support for long term storage - * of all JavaBeansTM + * of all JavaBeans™ * has been added to the java.beans package. * Please see {@link java.beans.XMLEncoder}. * diff --git a/jdk/src/share/classes/javax/swing/plaf/basic/ComboPopup.java b/jdk/src/share/classes/javax/swing/plaf/basic/ComboPopup.java index b6950edc06f..c2a4fa25006 100644 --- a/jdk/src/share/classes/javax/swing/plaf/basic/ComboPopup.java +++ b/jdk/src/share/classes/javax/swing/plaf/basic/ComboPopup.java @@ -40,7 +40,7 @@ import javax.swing.JList; * future Swing releases. The current serialization support is * appropriate for short term storage or RMI between applications running * the same version of Swing. As of 1.4, support for long term storage - * of all JavaBeansTM + * of all JavaBeans™ * has been added to the java.beans package. * Please see {@link java.beans.XMLEncoder}. * diff --git a/jdk/src/share/classes/javax/swing/plaf/metal/DefaultMetalTheme.java b/jdk/src/share/classes/javax/swing/plaf/metal/DefaultMetalTheme.java index 4ff115b20a1..b0b42cfcf55 100644 --- a/jdk/src/share/classes/javax/swing/plaf/metal/DefaultMetalTheme.java +++ b/jdk/src/share/classes/javax/swing/plaf/metal/DefaultMetalTheme.java @@ -79,7 +79,7 @@ import sun.swing.SwingUtilities2; * future Swing releases. The current serialization support is * appropriate for short term storage or RMI between applications running * the same version of Swing. As of 1.4, support for long term storage - * of all JavaBeansTM + * of all JavaBeans™ * has been added to the java.beans package. * Please see {@link java.beans.XMLEncoder}. * diff --git a/jdk/src/share/classes/javax/swing/plaf/metal/MetalButtonUI.java b/jdk/src/share/classes/javax/swing/plaf/metal/MetalButtonUI.java index 65dc2c297bd..3d02f9c5138 100644 --- a/jdk/src/share/classes/javax/swing/plaf/metal/MetalButtonUI.java +++ b/jdk/src/share/classes/javax/swing/plaf/metal/MetalButtonUI.java @@ -44,7 +44,7 @@ import javax.swing.plaf.*; * future Swing releases. The current serialization support is * appropriate for short term storage or RMI between applications running * the same version of Swing. As of 1.4, support for long term storage - * of all JavaBeansTM + * of all JavaBeans™ * has been added to the java.beans package. * Please see {@link java.beans.XMLEncoder}. * diff --git a/jdk/src/share/classes/javax/swing/plaf/metal/MetalCheckBoxIcon.java b/jdk/src/share/classes/javax/swing/plaf/metal/MetalCheckBoxIcon.java index c88ac8cfe9c..b32157144ef 100644 --- a/jdk/src/share/classes/javax/swing/plaf/metal/MetalCheckBoxIcon.java +++ b/jdk/src/share/classes/javax/swing/plaf/metal/MetalCheckBoxIcon.java @@ -40,7 +40,7 @@ import javax.swing.plaf.*; * future Swing releases. The current serialization support is * appropriate for short term storage or RMI between applications running * the same version of Swing. As of 1.4, support for long term storage - * of all JavaBeansTM + * of all JavaBeans™ * has been added to the java.beans package. * Please see {@link java.beans.XMLEncoder}. * diff --git a/jdk/src/share/classes/javax/swing/plaf/metal/MetalCheckBoxUI.java b/jdk/src/share/classes/javax/swing/plaf/metal/MetalCheckBoxUI.java index 1ee684357fb..95ef177105c 100644 --- a/jdk/src/share/classes/javax/swing/plaf/metal/MetalCheckBoxUI.java +++ b/jdk/src/share/classes/javax/swing/plaf/metal/MetalCheckBoxUI.java @@ -44,7 +44,7 @@ import java.io.Serializable; * future Swing releases. The current serialization support is * appropriate for short term storage or RMI between applications running * the same version of Swing. As of 1.4, support for long term storage - * of all JavaBeansTM + * of all JavaBeans™ * has been added to the java.beans package. * Please see {@link java.beans.XMLEncoder}. * diff --git a/jdk/src/share/classes/javax/swing/plaf/metal/MetalComboBoxButton.java b/jdk/src/share/classes/javax/swing/plaf/metal/MetalComboBoxButton.java index 5f76492f404..63a53bf1a6a 100644 --- a/jdk/src/share/classes/javax/swing/plaf/metal/MetalComboBoxButton.java +++ b/jdk/src/share/classes/javax/swing/plaf/metal/MetalComboBoxButton.java @@ -41,7 +41,7 @@ import java.io.Serializable; * future Swing releases. The current serialization support is * appropriate for short term storage or RMI between applications running * the same version of Swing. As of 1.4, support for long term storage - * of all JavaBeansTM + * of all JavaBeans™ * has been added to the java.beans package. * Please see {@link java.beans.XMLEncoder}. * diff --git a/jdk/src/share/classes/javax/swing/plaf/metal/MetalComboBoxEditor.java b/jdk/src/share/classes/javax/swing/plaf/metal/MetalComboBoxEditor.java index a85458c1244..aa375fbb6be 100644 --- a/jdk/src/share/classes/javax/swing/plaf/metal/MetalComboBoxEditor.java +++ b/jdk/src/share/classes/javax/swing/plaf/metal/MetalComboBoxEditor.java @@ -41,7 +41,7 @@ import javax.swing.plaf.basic.BasicComboBoxEditor; * future Swing releases. The current serialization support is * appropriate for short term storage or RMI between applications running * the same version of Swing. As of 1.4, support for long term storage - * of all JavaBeansTM + * of all JavaBeans™ * has been added to the java.beans package. * Please see {@link java.beans.XMLEncoder}. * @@ -129,7 +129,7 @@ public class MetalComboBoxEditor extends BasicComboBoxEditor { * future Swing releases. The current serialization support is * appropriate for short term storage or RMI between applications running * the same version of Swing. As of 1.4, support for long term storage - * of all JavaBeansTM + * of all JavaBeans™ * has been added to the java.beans package. * Please see {@link java.beans.XMLEncoder}. */ diff --git a/jdk/src/share/classes/javax/swing/plaf/metal/MetalComboBoxUI.java b/jdk/src/share/classes/javax/swing/plaf/metal/MetalComboBoxUI.java index e97416eca1e..74f8830f30c 100644 --- a/jdk/src/share/classes/javax/swing/plaf/metal/MetalComboBoxUI.java +++ b/jdk/src/share/classes/javax/swing/plaf/metal/MetalComboBoxUI.java @@ -43,7 +43,7 @@ import java.beans.*; * future Swing releases. The current serialization support is * appropriate for short term storage or RMI between applications running * the same version of Swing. As of 1.4, support for long term storage - * of all JavaBeansTM + * of all JavaBeans™ * has been added to the java.beans package. * Please see {@link java.beans.XMLEncoder}. * diff --git a/jdk/src/share/classes/javax/swing/plaf/metal/MetalIconFactory.java b/jdk/src/share/classes/javax/swing/plaf/metal/MetalIconFactory.java index 63c1491e6e1..5b81f17624f 100644 --- a/jdk/src/share/classes/javax/swing/plaf/metal/MetalIconFactory.java +++ b/jdk/src/share/classes/javax/swing/plaf/metal/MetalIconFactory.java @@ -36,7 +36,7 @@ import sun.swing.CachedPainter; /** * Factory object that vends Icons for - * the JavaTM look and feel (Metal). + * the Java™ look and feel (Metal). * These icons are used extensively in Metal via the defaults mechanism. * While other look and feels often use GIFs for icons, creating icons * in code facilitates switching to other themes. @@ -52,7 +52,7 @@ import sun.swing.CachedPainter; * future Swing releases. The current serialization support is * appropriate for short term storage or RMI between applications running * the same version of Swing. As of 1.4, support for long term storage - * of all JavaBeansTM + * of all JavaBeans™ * has been added to the java.beans package. * Please see {@link java.beans.XMLEncoder}. * @@ -1550,7 +1550,7 @@ public class MetalIconFactory implements Serializable { * future Swing releases. The current serialization support is * appropriate for short term storage or RMI between applications running * the same version of Swing. As of 1.4, support for long term storage - * of all JavaBeansTM + * of all JavaBeans™ * has been added to the java.beans package. * Please see {@link java.beans.XMLEncoder}. */ @@ -1632,7 +1632,7 @@ public class MetalIconFactory implements Serializable { * future Swing releases. The current serialization support is * appropriate for short term storage or RMI between applications running * the same version of Swing. As of 1.4, support for long term storage - * of all JavaBeansTM + * of all JavaBeans™ * has been added to the java.beans package. * Please see {@link java.beans.XMLEncoder}. */ @@ -1651,7 +1651,7 @@ public class MetalIconFactory implements Serializable { * future Swing releases. The current serialization support is * appropriate for short term storage or RMI between applications running * the same version of Swing. As of 1.4, support for long term storage - * of all JavaBeansTM + * of all JavaBeans™ * has been added to the java.beans package. * Please see {@link java.beans.XMLEncoder}. */ @@ -1736,7 +1736,7 @@ public class MetalIconFactory implements Serializable { * future Swing releases. The current serialization support is * appropriate for short term storage or RMI between applications running * the same version of Swing. As of 1.4, support for long term storage - * of all JavaBeansTM + * of all JavaBeans™ * has been added to the java.beans package. * Please see {@link java.beans.XMLEncoder}. */ diff --git a/jdk/src/share/classes/javax/swing/plaf/metal/MetalLookAndFeel.java b/jdk/src/share/classes/javax/swing/plaf/metal/MetalLookAndFeel.java index 8df43e2fa6b..76ece662b2f 100644 --- a/jdk/src/share/classes/javax/swing/plaf/metal/MetalLookAndFeel.java +++ b/jdk/src/share/classes/javax/swing/plaf/metal/MetalLookAndFeel.java @@ -72,7 +72,7 @@ import sun.swing.SwingUtilities2; * future Swing releases. The current serialization support is * appropriate for short term storage or RMI between applications running * the same version of Swing. As of 1.4, support for long term storage - * of all JavaBeansTM + * of all JavaBeans™ * has been added to the java.beans package. * Please see {@link java.beans.XMLEncoder}. * diff --git a/jdk/src/share/classes/javax/swing/plaf/metal/MetalProgressBarUI.java b/jdk/src/share/classes/javax/swing/plaf/metal/MetalProgressBarUI.java index 44288ea5f68..a2918b0e9b1 100644 --- a/jdk/src/share/classes/javax/swing/plaf/metal/MetalProgressBarUI.java +++ b/jdk/src/share/classes/javax/swing/plaf/metal/MetalProgressBarUI.java @@ -38,7 +38,7 @@ import java.awt.*; * future Swing releases. The current serialization support is * appropriate for short term storage or RMI between applications running * the same version of Swing. As of 1.4, support for long term storage - * of all JavaBeansTM + * of all JavaBeans™ * has been added to the java.beans package. * Please see {@link java.beans.XMLEncoder}. * diff --git a/jdk/src/share/classes/javax/swing/plaf/metal/MetalRadioButtonUI.java b/jdk/src/share/classes/javax/swing/plaf/metal/MetalRadioButtonUI.java index 0dcadef6f35..274335580c6 100644 --- a/jdk/src/share/classes/javax/swing/plaf/metal/MetalRadioButtonUI.java +++ b/jdk/src/share/classes/javax/swing/plaf/metal/MetalRadioButtonUI.java @@ -46,7 +46,7 @@ import javax.swing.text.View; * future Swing releases. The current serialization support is * appropriate for short term storage or RMI between applications running * the same version of Swing. As of 1.4, support for long term storage - * of all JavaBeansTM + * of all JavaBeans™ * has been added to the java.beans package. * Please see {@link java.beans.XMLEncoder}. * diff --git a/jdk/src/share/classes/javax/swing/plaf/metal/MetalRootPaneUI.java b/jdk/src/share/classes/javax/swing/plaf/metal/MetalRootPaneUI.java index d3b6e5128df..e2c6d519c53 100644 --- a/jdk/src/share/classes/javax/swing/plaf/metal/MetalRootPaneUI.java +++ b/jdk/src/share/classes/javax/swing/plaf/metal/MetalRootPaneUI.java @@ -56,7 +56,7 @@ import java.security.*; * future Swing releases. The current serialization support is * appropriate for short term storage or RMI between applications running * the same version of Swing. As of 1.4, support for long term storage - * of all JavaBeansTM + * of all JavaBeans™ * has been added to the java.beans package. * Please see {@link java.beans.XMLEncoder}. * diff --git a/jdk/src/share/classes/javax/swing/plaf/metal/MetalScrollButton.java b/jdk/src/share/classes/javax/swing/plaf/metal/MetalScrollButton.java index f6f0d6f8c17..61616d47041 100644 --- a/jdk/src/share/classes/javax/swing/plaf/metal/MetalScrollButton.java +++ b/jdk/src/share/classes/javax/swing/plaf/metal/MetalScrollButton.java @@ -43,7 +43,7 @@ import javax.swing.plaf.basic.BasicArrowButton; * future Swing releases. The current serialization support is * appropriate for short term storage or RMI between applications running * the same version of Swing. As of 1.4, support for long term storage - * of all JavaBeansTM + * of all JavaBeans™ * has been added to the java.beans package. * Please see {@link java.beans.XMLEncoder}. * diff --git a/jdk/src/share/classes/javax/swing/plaf/metal/MetalScrollPaneUI.java b/jdk/src/share/classes/javax/swing/plaf/metal/MetalScrollPaneUI.java index b4eadab6e1d..d1f5b7abb19 100644 --- a/jdk/src/share/classes/javax/swing/plaf/metal/MetalScrollPaneUI.java +++ b/jdk/src/share/classes/javax/swing/plaf/metal/MetalScrollPaneUI.java @@ -44,7 +44,7 @@ import java.awt.event.*; * future Swing releases. The current serialization support is * appropriate for short term storage or RMI between applications running * the same version of Swing. As of 1.4, support for long term storage - * of all JavaBeansTM + * of all JavaBeans™ * has been added to the java.beans package. * Please see {@link java.beans.XMLEncoder}. * diff --git a/jdk/src/share/classes/javax/swing/plaf/metal/MetalSeparatorUI.java b/jdk/src/share/classes/javax/swing/plaf/metal/MetalSeparatorUI.java index 07d723eb5ab..17ac847c703 100644 --- a/jdk/src/share/classes/javax/swing/plaf/metal/MetalSeparatorUI.java +++ b/jdk/src/share/classes/javax/swing/plaf/metal/MetalSeparatorUI.java @@ -44,7 +44,7 @@ import javax.swing.plaf.basic.BasicSeparatorUI; * future Swing releases. The current serialization support is * appropriate for short term storage or RMI between applications running * the same version of Swing. As of 1.4, support for long term storage - * of all JavaBeansTM + * of all JavaBeans™ * has been added to the java.beans package. * Please see {@link java.beans.XMLEncoder}. * diff --git a/jdk/src/share/classes/javax/swing/plaf/metal/MetalSliderUI.java b/jdk/src/share/classes/javax/swing/plaf/metal/MetalSliderUI.java index 99d078c4d16..8b50bb76961 100644 --- a/jdk/src/share/classes/javax/swing/plaf/metal/MetalSliderUI.java +++ b/jdk/src/share/classes/javax/swing/plaf/metal/MetalSliderUI.java @@ -44,7 +44,7 @@ import javax.swing.plaf.*; * future Swing releases. The current serialization support is * appropriate for short term storage or RMI between applications running * the same version of Swing. As of 1.4, support for long term storage - * of all JavaBeansTM + * of all JavaBeans™ * has been added to the java.beans package. * Please see {@link java.beans.XMLEncoder}. * diff --git a/jdk/src/share/classes/javax/swing/plaf/metal/MetalSplitPaneDivider.java b/jdk/src/share/classes/javax/swing/plaf/metal/MetalSplitPaneDivider.java index 86b37b4f9fd..33ef49d6ad5 100644 --- a/jdk/src/share/classes/javax/swing/plaf/metal/MetalSplitPaneDivider.java +++ b/jdk/src/share/classes/javax/swing/plaf/metal/MetalSplitPaneDivider.java @@ -39,7 +39,7 @@ import javax.swing.plaf.basic.*; * future Swing releases. The current serialization support is * appropriate for short term storage or RMI between applications running * the same version of Swing. As of 1.4, support for long term storage - * of all JavaBeansTM + * of all JavaBeans™ * has been added to the java.beans package. * Please see {@link java.beans.XMLEncoder}. * diff --git a/jdk/src/share/classes/javax/swing/plaf/metal/MetalSplitPaneUI.java b/jdk/src/share/classes/javax/swing/plaf/metal/MetalSplitPaneUI.java index f2b2ebc9a55..8aaa40942a0 100644 --- a/jdk/src/share/classes/javax/swing/plaf/metal/MetalSplitPaneUI.java +++ b/jdk/src/share/classes/javax/swing/plaf/metal/MetalSplitPaneUI.java @@ -37,7 +37,7 @@ import javax.swing.plaf.basic.*; * future Swing releases. The current serialization support is * appropriate for short term storage or RMI between applications running * the same version of Swing. As of 1.4, support for long term storage - * of all JavaBeansTM + * of all JavaBeans™ * has been added to the java.beans package. * Please see {@link java.beans.XMLEncoder}. * diff --git a/jdk/src/share/classes/javax/swing/plaf/metal/MetalTabbedPaneUI.java b/jdk/src/share/classes/javax/swing/plaf/metal/MetalTabbedPaneUI.java index 667ccc5c334..23ead51d4d9 100644 --- a/jdk/src/share/classes/javax/swing/plaf/metal/MetalTabbedPaneUI.java +++ b/jdk/src/share/classes/javax/swing/plaf/metal/MetalTabbedPaneUI.java @@ -41,7 +41,7 @@ import javax.swing.plaf.basic.BasicTabbedPaneUI; * future Swing releases. The current serialization support is * appropriate for short term storage or RMI between applications running * the same version of Swing. As of 1.4, support for long term storage - * of all JavaBeansTM + * of all JavaBeans™ * has been added to the java.beans package. * Please see {@link java.beans.XMLEncoder}. * diff --git a/jdk/src/share/classes/javax/swing/plaf/metal/MetalTextFieldUI.java b/jdk/src/share/classes/javax/swing/plaf/metal/MetalTextFieldUI.java index 02ab7e75f51..8fe89f3fd33 100644 --- a/jdk/src/share/classes/javax/swing/plaf/metal/MetalTextFieldUI.java +++ b/jdk/src/share/classes/javax/swing/plaf/metal/MetalTextFieldUI.java @@ -41,7 +41,7 @@ import javax.swing.plaf.basic.*; * future Swing releases. The current serialization support is * appropriate for short term storage or RMI between applications running * the same version of Swing. As of 1.4, support for long term storage - * of all JavaBeansTM + * of all JavaBeans™ * has been added to the java.beans package. * Please see {@link java.beans.XMLEncoder}. * diff --git a/jdk/src/share/classes/javax/swing/plaf/metal/MetalToggleButtonUI.java b/jdk/src/share/classes/javax/swing/plaf/metal/MetalToggleButtonUI.java index 707ca928473..d207cbbb1d5 100644 --- a/jdk/src/share/classes/javax/swing/plaf/metal/MetalToggleButtonUI.java +++ b/jdk/src/share/classes/javax/swing/plaf/metal/MetalToggleButtonUI.java @@ -49,7 +49,7 @@ import java.io.Serializable; * future Swing releases. The current serialization support is * appropriate for short term storage or RMI between applications running * the same version of Swing. As of 1.4, support for long term storage - * of all JavaBeansTM + * of all JavaBeans™ * has been added to the java.beans package. * Please see {@link java.beans.XMLEncoder}. * diff --git a/jdk/src/share/classes/javax/swing/plaf/metal/MetalToolTipUI.java b/jdk/src/share/classes/javax/swing/plaf/metal/MetalToolTipUI.java index 914502e322f..38a39a06746 100644 --- a/jdk/src/share/classes/javax/swing/plaf/metal/MetalToolTipUI.java +++ b/jdk/src/share/classes/javax/swing/plaf/metal/MetalToolTipUI.java @@ -45,7 +45,7 @@ import javax.swing.text.View; * future Swing releases. The current serialization support is * appropriate for short term storage or RMI between applications running * the same version of Swing. As of 1.4, support for long term storage - * of all JavaBeansTM + * of all JavaBeans™ * has been added to the java.beans package. * Please see {@link java.beans.XMLEncoder}. * diff --git a/jdk/src/share/classes/javax/swing/plaf/multi/MultiLookAndFeel.java b/jdk/src/share/classes/javax/swing/plaf/multi/MultiLookAndFeel.java index 1007299e2c2..0e6c8e8de96 100644 --- a/jdk/src/share/classes/javax/swing/plaf/multi/MultiLookAndFeel.java +++ b/jdk/src/share/classes/javax/swing/plaf/multi/MultiLookAndFeel.java @@ -47,7 +47,7 @@ import javax.swing.plaf.*; * future Swing releases. The current serialization support is * appropriate for short term storage or RMI between applications running * the same version of Swing. As of 1.4, support for long term storage - * of all JavaBeansTM + * of all JavaBeans™ * has been added to the java.beans package. * Please see {@link java.beans.XMLEncoder}. * diff --git a/jdk/src/share/classes/javax/swing/plaf/synth/SynthTextAreaUI.java b/jdk/src/share/classes/javax/swing/plaf/synth/SynthTextAreaUI.java index f6b77bfd51e..09b33ec95e7 100644 --- a/jdk/src/share/classes/javax/swing/plaf/synth/SynthTextAreaUI.java +++ b/jdk/src/share/classes/javax/swing/plaf/synth/SynthTextAreaUI.java @@ -44,7 +44,7 @@ import java.beans.PropertyChangeEvent; * future Swing releases. The current serialization support is * appropriate for short term storage or RMI between applications running * the same version of Swing. As of 1.4, support for long term storage - * of all JavaBeansTM + * of all JavaBeans™ * has been added to the java.beans package. * Please see {@link java.beans.XMLEncoder}. * diff --git a/jdk/src/share/classes/javax/swing/plaf/synth/SynthTextFieldUI.java b/jdk/src/share/classes/javax/swing/plaf/synth/SynthTextFieldUI.java index d420d2d7264..9a1ae3ef6d9 100644 --- a/jdk/src/share/classes/javax/swing/plaf/synth/SynthTextFieldUI.java +++ b/jdk/src/share/classes/javax/swing/plaf/synth/SynthTextFieldUI.java @@ -43,7 +43,7 @@ import java.beans.PropertyChangeEvent; * future Swing releases. The current serialization support is * appropriate for short term storage or RMI between applications running * the same version of Swing. As of 1.4, support for long term storage - * of all JavaBeansTM + * of all JavaBeans™ * has been added to the java.beans package. * Please see {@link java.beans.XMLEncoder}. * diff --git a/jdk/src/share/classes/javax/swing/plaf/synth/SynthTextPaneUI.java b/jdk/src/share/classes/javax/swing/plaf/synth/SynthTextPaneUI.java index 3c5b4c2146b..8b21b4ba7c6 100644 --- a/jdk/src/share/classes/javax/swing/plaf/synth/SynthTextPaneUI.java +++ b/jdk/src/share/classes/javax/swing/plaf/synth/SynthTextPaneUI.java @@ -40,7 +40,7 @@ import java.awt.*; * future Swing releases. The current serialization support is * appropriate for short term storage or RMI between applications running * the same version of Swing. As of 1.4, support for long term storage - * of all JavaBeansTM + * of all JavaBeans™ * has been added to the java.beans package. * Please see {@link java.beans.XMLEncoder}. * diff --git a/jdk/src/share/classes/javax/swing/table/AbstractTableModel.java b/jdk/src/share/classes/javax/swing/table/AbstractTableModel.java index b79290db025..c9ea60271dc 100644 --- a/jdk/src/share/classes/javax/swing/table/AbstractTableModel.java +++ b/jdk/src/share/classes/javax/swing/table/AbstractTableModel.java @@ -50,7 +50,7 @@ import java.util.EventListener; * future Swing releases. The current serialization support is * appropriate for short term storage or RMI between applications running * the same version of Swing. As of 1.4, support for long term storage - * of all JavaBeansTM + * of all JavaBeans™ * has been added to the java.beans package. * Please see {@link java.beans.XMLEncoder}. * diff --git a/jdk/src/share/classes/javax/swing/table/DefaultTableCellRenderer.java b/jdk/src/share/classes/javax/swing/table/DefaultTableCellRenderer.java index e061bff35a2..61c6c9f732e 100644 --- a/jdk/src/share/classes/javax/swing/table/DefaultTableCellRenderer.java +++ b/jdk/src/share/classes/javax/swing/table/DefaultTableCellRenderer.java @@ -75,7 +75,7 @@ import sun.swing.DefaultLookup; * future Swing releases. The current serialization support is * appropriate for short term storage or RMI between applications running * the same version of Swing. As of 1.4, support for long term storage - * of all JavaBeansTM + * of all JavaBeans™ * has been added to the java.beans package. * Please see {@link java.beans.XMLEncoder}. * @@ -387,7 +387,7 @@ public class DefaultTableCellRenderer extends JLabel * future Swing releases. The current serialization support is * appropriate for short term storage or RMI between applications running * the same version of Swing. As of 1.4, support for long term storage - * of all JavaBeansTM + * of all JavaBeans™ * has been added to the java.beans package. * Please see {@link java.beans.XMLEncoder}. */ diff --git a/jdk/src/share/classes/javax/swing/table/DefaultTableColumnModel.java b/jdk/src/share/classes/javax/swing/table/DefaultTableColumnModel.java index c0c30b06d36..49664898876 100644 --- a/jdk/src/share/classes/javax/swing/table/DefaultTableColumnModel.java +++ b/jdk/src/share/classes/javax/swing/table/DefaultTableColumnModel.java @@ -44,7 +44,7 @@ import sun.swing.SwingUtilities2; * future Swing releases. The current serialization support is * appropriate for short term storage or RMI between applications running * the same version of Swing. As of 1.4, support for long term storage - * of all JavaBeansTM + * of all JavaBeans™ * has been added to the java.beans package. * Please see {@link java.beans.XMLEncoder}. * diff --git a/jdk/src/share/classes/javax/swing/table/DefaultTableModel.java b/jdk/src/share/classes/javax/swing/table/DefaultTableModel.java index a018324a6bb..5abf1e82aa1 100644 --- a/jdk/src/share/classes/javax/swing/table/DefaultTableModel.java +++ b/jdk/src/share/classes/javax/swing/table/DefaultTableModel.java @@ -50,7 +50,7 @@ import javax.swing.event.TableModelEvent; * future Swing releases. The current serialization support is * appropriate for short term storage or RMI between applications running * the same version of Swing. As of 1.4, support for long term storage - * of all JavaBeansTM + * of all JavaBeans™ * has been added to the java.beans package. * Please see {@link java.beans.XMLEncoder}. * diff --git a/jdk/src/share/classes/javax/swing/table/JTableHeader.java b/jdk/src/share/classes/javax/swing/table/JTableHeader.java index f4a2901d5ae..65befd14986 100644 --- a/jdk/src/share/classes/javax/swing/table/JTableHeader.java +++ b/jdk/src/share/classes/javax/swing/table/JTableHeader.java @@ -52,7 +52,7 @@ import java.io.IOException; * future Swing releases. The current serialization support is * appropriate for short term storage or RMI between applications running * the same version of Swing. As of 1.4, support for long term storage - * of all JavaBeansTM + * of all JavaBeans™ * has been added to the java.beans package. * Please see {@link java.beans.XMLEncoder}. * @@ -776,7 +776,7 @@ public class JTableHeader extends JComponent implements TableColumnModelListener * future Swing releases. The current serialization support is * appropriate for short term storage or RMI between applications running * the same version of Swing. As of 1.4, support for long term storage - * of all JavaBeansTM + * of all JavaBeans™ * has been added to the java.beans package. * Please see {@link java.beans.XMLEncoder}. */ diff --git a/jdk/src/share/classes/javax/swing/table/TableColumn.java b/jdk/src/share/classes/javax/swing/table/TableColumn.java index af2a1b71373..b7851e60610 100644 --- a/jdk/src/share/classes/javax/swing/table/TableColumn.java +++ b/jdk/src/share/classes/javax/swing/table/TableColumn.java @@ -67,7 +67,7 @@ import java.beans.PropertyChangeListener; * future Swing releases. The current serialization support is * appropriate for short term storage or RMI between applications running * the same version of Swing. As of 1.4, support for long term storage - * of all JavaBeansTM + * of all JavaBeans™ * has been added to the java.beans package. * Please see {@link java.beans.XMLEncoder}. * diff --git a/jdk/src/share/classes/javax/swing/text/AbstractDocument.java b/jdk/src/share/classes/javax/swing/text/AbstractDocument.java index 7d98b7ad95b..e20d10af886 100644 --- a/jdk/src/share/classes/javax/swing/text/AbstractDocument.java +++ b/jdk/src/share/classes/javax/swing/text/AbstractDocument.java @@ -90,7 +90,7 @@ import sun.swing.SwingUtilities2; * future Swing releases. The current serialization support is * appropriate for short term storage or RMI between applications running * the same version of Swing. As of 1.4, support for long term storage - * of all JavaBeansTM + * of all JavaBeans™ * has been added to the java.beans package. * Please see {@link java.beans.XMLEncoder}. * @@ -1778,7 +1778,7 @@ public abstract class AbstractDocument implements Document, Serializable { * future Swing releases. The current serialization support is * appropriate for short term storage or RMI between applications running * the same version of Swing. As of 1.4, support for long term storage - * of all JavaBeansTM + * of all JavaBeans™ * has been added to the java.beans package. * Please see {@link java.beans.XMLEncoder}. */ @@ -2247,7 +2247,7 @@ public abstract class AbstractDocument implements Document, Serializable { * future Swing releases. The current serialization support is * appropriate for short term storage or RMI between applications running * the same version of Swing. As of 1.4, support for long term storage - * of all JavaBeansTM + * of all JavaBeans™ * has been added to the java.beans package. * Please see {@link java.beans.XMLEncoder}. */ @@ -2501,7 +2501,7 @@ public abstract class AbstractDocument implements Document, Serializable { * future Swing releases. The current serialization support is * appropriate for short term storage or RMI between applications running * the same version of Swing. As of 1.4, support for long term storage - * of all JavaBeansTM + * of all JavaBeans™ * has been added to the java.beans package. * Please see {@link java.beans.XMLEncoder}. * diff --git a/jdk/src/share/classes/javax/swing/text/BadLocationException.java b/jdk/src/share/classes/javax/swing/text/BadLocationException.java index c900e61cf7e..62032aeac5c 100644 --- a/jdk/src/share/classes/javax/swing/text/BadLocationException.java +++ b/jdk/src/share/classes/javax/swing/text/BadLocationException.java @@ -33,7 +33,7 @@ package javax.swing.text; * future Swing releases. The current serialization support is * appropriate for short term storage or RMI between applications running * the same version of Swing. As of 1.4, support for long term storage - * of all JavaBeansTM + * of all JavaBeans™ * has been added to the java.beans package. * Please see {@link java.beans.XMLEncoder}. * diff --git a/jdk/src/share/classes/javax/swing/text/DateFormatter.java b/jdk/src/share/classes/javax/swing/text/DateFormatter.java index 68310bc16d2..b301bf97aaa 100644 --- a/jdk/src/share/classes/javax/swing/text/DateFormatter.java +++ b/jdk/src/share/classes/javax/swing/text/DateFormatter.java @@ -39,7 +39,7 @@ import javax.swing.text.*; * future Swing releases. The current serialization support is * appropriate for short term storage or RMI between applications running * the same version of Swing. As of 1.4, support for long term storage - * of all JavaBeansTM + * of all JavaBeans™ * has been added to the java.beans package. * Please see {@link java.beans.XMLEncoder}. * diff --git a/jdk/src/share/classes/javax/swing/text/DefaultCaret.java b/jdk/src/share/classes/javax/swing/text/DefaultCaret.java index 0ba5eddda30..7b06fb3f1c9 100644 --- a/jdk/src/share/classes/javax/swing/text/DefaultCaret.java +++ b/jdk/src/share/classes/javax/swing/text/DefaultCaret.java @@ -98,7 +98,7 @@ import sun.swing.SwingUtilities2; * future Swing releases. The current serialization support is * appropriate for short term storage or RMI between applications running * the same version of Swing. As of 1.4, support for long term storage - * of all JavaBeansTM + * of all JavaBeans™ * has been added to the java.beans package. * Please see {@link java.beans.XMLEncoder}. * diff --git a/jdk/src/share/classes/javax/swing/text/DefaultEditorKit.java b/jdk/src/share/classes/javax/swing/text/DefaultEditorKit.java index cd310104dd3..f47a1c62c62 100644 --- a/jdk/src/share/classes/javax/swing/text/DefaultEditorKit.java +++ b/jdk/src/share/classes/javax/swing/text/DefaultEditorKit.java @@ -840,7 +840,7 @@ public class DefaultEditorKit extends EditorKit { * future Swing releases. The current serialization support is * appropriate for short term storage or RMI between applications running * the same version of Swing. As of 1.4, support for long term storage - * of all JavaBeansTM + * of all JavaBeans™ * has been added to the java.beans package. * Please see {@link java.beans.XMLEncoder}. * @@ -899,7 +899,7 @@ public class DefaultEditorKit extends EditorKit { * future Swing releases. The current serialization support is * appropriate for short term storage or RMI between applications running * the same version of Swing. As of 1.4, support for long term storage - * of all JavaBeansTM + * of all JavaBeans™ * has been added to the java.beans package. * Please see {@link java.beans.XMLEncoder}. * @@ -947,7 +947,7 @@ public class DefaultEditorKit extends EditorKit { * future Swing releases. The current serialization support is * appropriate for short term storage or RMI between applications running * the same version of Swing. As of 1.4, support for long term storage - * of all JavaBeansTM + * of all JavaBeans™ * has been added to the java.beans package. * Please see {@link java.beans.XMLEncoder}. * @@ -989,7 +989,7 @@ public class DefaultEditorKit extends EditorKit { * future Swing releases. The current serialization support is * appropriate for short term storage or RMI between applications running * the same version of Swing. As of 1.4, support for long term storage - * of all JavaBeansTM + * of all JavaBeans™ * has been added to the java.beans package. * Please see {@link java.beans.XMLEncoder}. * @@ -1265,7 +1265,7 @@ public class DefaultEditorKit extends EditorKit { * future Swing releases. The current serialization support is * appropriate for short term storage or RMI between applications running * the same version of Swing. As of 1.4, support for long term storage - * of all JavaBeansTM + * of all JavaBeans™ * has been added to the java.beans package. * Please see {@link java.beans.XMLEncoder}. * @@ -1301,7 +1301,7 @@ public class DefaultEditorKit extends EditorKit { * future Swing releases. The current serialization support is * appropriate for short term storage or RMI between applications running * the same version of Swing. As of 1.4, support for long term storage - * of all JavaBeansTM + * of all JavaBeans™ * has been added to the java.beans package. * Please see {@link java.beans.XMLEncoder}. * @@ -1338,7 +1338,7 @@ public class DefaultEditorKit extends EditorKit { * future Swing releases. The current serialization support is * appropriate for short term storage or RMI between applications running * the same version of Swing. As of 1.4, support for long term storage - * of all JavaBeansTM + * of all JavaBeans™ * has been added to the java.beans package. * Please see {@link java.beans.XMLEncoder}. * @@ -1373,7 +1373,7 @@ public class DefaultEditorKit extends EditorKit { * future Swing releases. The current serialization support is * appropriate for short term storage or RMI between applications running * the same version of Swing. As of 1.4, support for long term storage - * of all JavaBeansTM + * of all JavaBeans™ * has been added to the java.beans package. * Please see {@link java.beans.XMLEncoder}. * diff --git a/jdk/src/share/classes/javax/swing/text/DefaultFormatter.java b/jdk/src/share/classes/javax/swing/text/DefaultFormatter.java index b67966ab70a..1933d38053d 100644 --- a/jdk/src/share/classes/javax/swing/text/DefaultFormatter.java +++ b/jdk/src/share/classes/javax/swing/text/DefaultFormatter.java @@ -50,7 +50,7 @@ import javax.swing.text.*; * future Swing releases. The current serialization support is * appropriate for short term storage or RMI between applications running * the same version of Swing. As of 1.4, support for long term storage - * of all JavaBeansTM + * of all JavaBeans™ * has been added to the java.beans package. * Please see {@link java.beans.XMLEncoder}. * diff --git a/jdk/src/share/classes/javax/swing/text/DefaultFormatterFactory.java b/jdk/src/share/classes/javax/swing/text/DefaultFormatterFactory.java index ad367dff0f3..7474dcbc205 100644 --- a/jdk/src/share/classes/javax/swing/text/DefaultFormatterFactory.java +++ b/jdk/src/share/classes/javax/swing/text/DefaultFormatterFactory.java @@ -64,7 +64,7 @@ import javax.swing.JFormattedTextField; * future Swing releases. The current serialization support is * appropriate for short term storage or RMI between applications running * the same version of Swing. As of 1.4, support for long term storage - * of all JavaBeansTM + * of all JavaBeans™ * has been added to the java.beans package. * Please see {@link java.beans.XMLEncoder}. * diff --git a/jdk/src/share/classes/javax/swing/text/DefaultStyledDocument.java b/jdk/src/share/classes/javax/swing/text/DefaultStyledDocument.java index cfa9a578fbc..ec94ebdddd1 100644 --- a/jdk/src/share/classes/javax/swing/text/DefaultStyledDocument.java +++ b/jdk/src/share/classes/javax/swing/text/DefaultStyledDocument.java @@ -61,7 +61,7 @@ import static sun.swing.SwingUtilities2.IMPLIED_CR; * future Swing releases. The current serialization support is * appropriate for short term storage or RMI between applications running * the same version of Swing. As of 1.4, support for long term storage - * of all JavaBeansTM + * of all JavaBeans™ * has been added to the java.beans package. * Please see {@link java.beans.XMLEncoder}. * @@ -1124,7 +1124,7 @@ public class DefaultStyledDocument extends AbstractDocument implements StyledDoc * future Swing releases. The current serialization support is * appropriate for short term storage or RMI between applications running * the same version of Swing. As of 1.4, support for long term storage - * of all JavaBeansTM + * of all JavaBeans™ * has been added to the java.beans package. * Please see {@link java.beans.XMLEncoder}. */ @@ -1155,7 +1155,7 @@ public class DefaultStyledDocument extends AbstractDocument implements StyledDoc * future Swing releases. The current serialization support is * appropriate for short term storage or RMI between applications running * the same version of Swing. As of 1.4, support for long term storage - * of all JavaBeansTM + * of all JavaBeans™ * has been added to the java.beans package. * Please see {@link java.beans.XMLEncoder}. */ @@ -1390,7 +1390,7 @@ public class DefaultStyledDocument extends AbstractDocument implements StyledDoc * future Swing releases. The current serialization support is * appropriate for short term storage or RMI between applications running * the same version of Swing. As of 1.4, support for long term storage - * of all JavaBeansTM + * of all JavaBeans™ * has been added to the java.beans package. * Please see {@link java.beans.XMLEncoder}. */ diff --git a/jdk/src/share/classes/javax/swing/text/InternationalFormatter.java b/jdk/src/share/classes/javax/swing/text/InternationalFormatter.java index 52331d76103..f7308d47d8d 100644 --- a/jdk/src/share/classes/javax/swing/text/InternationalFormatter.java +++ b/jdk/src/share/classes/javax/swing/text/InternationalFormatter.java @@ -83,7 +83,7 @@ import javax.swing.*; * future Swing releases. The current serialization support is * appropriate for short term storage or RMI between applications running * the same version of Swing. As of 1.4, support for long term storage - * of all JavaBeansTM + * of all JavaBeans™ * has been added to the java.beans package. * Please see {@link java.beans.XMLEncoder}. * diff --git a/jdk/src/share/classes/javax/swing/text/JTextComponent.java b/jdk/src/share/classes/javax/swing/text/JTextComponent.java index 2f3ab8114f1..52052b7a89f 100644 --- a/jdk/src/share/classes/javax/swing/text/JTextComponent.java +++ b/jdk/src/share/classes/javax/swing/text/JTextComponent.java @@ -281,7 +281,7 @@ import sun.swing.SwingAccessor; * future Swing releases. The current serialization support is * appropriate for short term storage or RMI between applications running * the same version of Swing. As of 1.4, support for long term storage - * of all JavaBeansTM + * of all JavaBeans™ * has been added to the java.beans package. * Please see {@link java.beans.XMLEncoder}. * @@ -1122,7 +1122,7 @@ public abstract class JTextComponent extends JComponent implements Scrollable, A * future Swing releases. The current serialization support is * appropriate for short term storage or RMI between applications running * the same version of Swing. As of 1.4, support for long term storage - * of all JavaBeansTM + * of all JavaBeans™ * has been added to the java.beans package. * Please see {@link java.beans.XMLEncoder}. */ @@ -2539,7 +2539,7 @@ public abstract class JTextComponent extends JComponent implements Scrollable, A * future Swing releases. The current serialization support is * appropriate for short term storage or RMI between applications running * the same version of Swing. As of 1.4, support for long term storage - * of all JavaBeansTM + * of all JavaBeans™ * has been added to the java.beans package. * Please see {@link java.beans.XMLEncoder}. */ diff --git a/jdk/src/share/classes/javax/swing/text/MaskFormatter.java b/jdk/src/share/classes/javax/swing/text/MaskFormatter.java index f54a1768a7b..2285e4ef1d1 100644 --- a/jdk/src/share/classes/javax/swing/text/MaskFormatter.java +++ b/jdk/src/share/classes/javax/swing/text/MaskFormatter.java @@ -143,7 +143,7 @@ import javax.swing.*; * future Swing releases. The current serialization support is * appropriate for short term storage or RMI between applications running * the same version of Swing. As of 1.4, support for long term storage - * of all JavaBeansTM + * of all JavaBeans™ * has been added to the java.beans package. * Please see {@link java.beans.XMLEncoder}. * diff --git a/jdk/src/share/classes/javax/swing/text/NumberFormatter.java b/jdk/src/share/classes/javax/swing/text/NumberFormatter.java index 9500dcc03b7..1af2b302d26 100644 --- a/jdk/src/share/classes/javax/swing/text/NumberFormatter.java +++ b/jdk/src/share/classes/javax/swing/text/NumberFormatter.java @@ -83,7 +83,7 @@ import java.util.*; * future Swing releases. The current serialization support is * appropriate for short term storage or RMI between applications running * the same version of Swing. As of 1.4, support for long term storage - * of all JavaBeansTM + * of all JavaBeans™ * has been added to the java.beans package. * Please see {@link java.beans.XMLEncoder}. * diff --git a/jdk/src/share/classes/javax/swing/text/PlainDocument.java b/jdk/src/share/classes/javax/swing/text/PlainDocument.java index 783a5d68ea7..8c731da6f61 100644 --- a/jdk/src/share/classes/javax/swing/text/PlainDocument.java +++ b/jdk/src/share/classes/javax/swing/text/PlainDocument.java @@ -48,7 +48,7 @@ import java.util.Vector; * future Swing releases. The current serialization support is * appropriate for short term storage or RMI between applications running * the same version of Swing. As of 1.4, support for long term storage - * of all JavaBeansTM + * of all JavaBeans™ * has been added to the java.beans package. * Please see {@link java.beans.XMLEncoder}. * diff --git a/jdk/src/share/classes/javax/swing/text/SimpleAttributeSet.java b/jdk/src/share/classes/javax/swing/text/SimpleAttributeSet.java index b0ad80ecb21..8539687b424 100644 --- a/jdk/src/share/classes/javax/swing/text/SimpleAttributeSet.java +++ b/jdk/src/share/classes/javax/swing/text/SimpleAttributeSet.java @@ -41,7 +41,7 @@ import java.io.Serializable; * future Swing releases. The current serialization support is * appropriate for short term storage or RMI between applications running * the same version of Swing. As of 1.4, support for long term storage - * of all JavaBeansTM + * of all JavaBeans™ * has been added to the java.beans package. * Please see {@link java.beans.XMLEncoder}. * diff --git a/jdk/src/share/classes/javax/swing/text/StringContent.java b/jdk/src/share/classes/javax/swing/text/StringContent.java index c834894845c..a62fcc4ba84 100644 --- a/jdk/src/share/classes/javax/swing/text/StringContent.java +++ b/jdk/src/share/classes/javax/swing/text/StringContent.java @@ -44,7 +44,7 @@ import javax.swing.SwingUtilities; * future Swing releases. The current serialization support is * appropriate for short term storage or RMI between applications running * the same version of Swing. As of 1.4, support for long term storage - * of all JavaBeansTM + * of all JavaBeans™ * has been added to the java.beans package. * Please see {@link java.beans.XMLEncoder}. * diff --git a/jdk/src/share/classes/javax/swing/text/StyleContext.java b/jdk/src/share/classes/javax/swing/text/StyleContext.java index 6aa1952db80..dc004c6aea6 100644 --- a/jdk/src/share/classes/javax/swing/text/StyleContext.java +++ b/jdk/src/share/classes/javax/swing/text/StyleContext.java @@ -56,7 +56,7 @@ import sun.font.FontUtilities; * future Swing releases. The current serialization support is * appropriate for short term storage or RMI between applications running * the same version of Swing. As of 1.4, support for long term storage - * of all JavaBeansTM + * of all JavaBeans™ * has been added to the java.beans package. * Please see {@link java.beans.XMLEncoder}. * @@ -1240,7 +1240,7 @@ public class StyleContext implements Serializable, AbstractDocument.AttributeCon * future Swing releases. The current serialization support is * appropriate for short term storage or RMI between applications running * the same version of Swing. As of 1.4, support for long term storage - * of all JavaBeansTM + * of all JavaBeans™ * has been added to the java.beans package. * Please see {@link java.beans.XMLEncoder}. */ diff --git a/jdk/src/share/classes/javax/swing/text/StyledEditorKit.java b/jdk/src/share/classes/javax/swing/text/StyledEditorKit.java index 20832c6c8b8..57b8ac00044 100644 --- a/jdk/src/share/classes/javax/swing/text/StyledEditorKit.java +++ b/jdk/src/share/classes/javax/swing/text/StyledEditorKit.java @@ -371,7 +371,7 @@ public class StyledEditorKit extends DefaultEditorKit { * future Swing releases. The current serialization support is * appropriate for short term storage or RMI between applications running * the same version of Swing. As of 1.4, support for long term storage - * of all JavaBeansTM + * of all JavaBeans™ * has been added to the java.beans package. * Please see {@link java.beans.XMLEncoder}. */ @@ -490,7 +490,7 @@ public class StyledEditorKit extends DefaultEditorKit { * future Swing releases. The current serialization support is * appropriate for short term storage or RMI between applications running * the same version of Swing. As of 1.4, support for long term storage - * of all JavaBeansTM + * of all JavaBeans™ * has been added to the java.beans package. * Please see {@link java.beans.XMLEncoder}. */ @@ -546,7 +546,7 @@ public class StyledEditorKit extends DefaultEditorKit { * future Swing releases. The current serialization support is * appropriate for short term storage or RMI between applications running * the same version of Swing. As of 1.4, support for long term storage - * of all JavaBeansTM + * of all JavaBeans™ * has been added to the java.beans package. * Please see {@link java.beans.XMLEncoder}. */ @@ -613,7 +613,7 @@ public class StyledEditorKit extends DefaultEditorKit { * future Swing releases. The current serialization support is * appropriate for short term storage or RMI between applications running * the same version of Swing. As of 1.4, support for long term storage - * of all JavaBeansTM + * of all JavaBeans™ * has been added to the java.beans package. * Please see {@link java.beans.XMLEncoder}. */ @@ -679,7 +679,7 @@ public class StyledEditorKit extends DefaultEditorKit { * future Swing releases. The current serialization support is * appropriate for short term storage or RMI between applications running * the same version of Swing. As of 1.4, support for long term storage - * of all JavaBeansTM + * of all JavaBeans™ * has been added to the java.beans package. * Please see {@link java.beans.XMLEncoder}. */ @@ -729,7 +729,7 @@ public class StyledEditorKit extends DefaultEditorKit { * future Swing releases. The current serialization support is * appropriate for short term storage or RMI between applications running * the same version of Swing. As of 1.4, support for long term storage - * of all JavaBeansTM + * of all JavaBeans™ * has been added to the java.beans package. * Please see {@link java.beans.XMLEncoder}. */ @@ -768,7 +768,7 @@ public class StyledEditorKit extends DefaultEditorKit { * future Swing releases. The current serialization support is * appropriate for short term storage or RMI between applications running * the same version of Swing. As of 1.4, support for long term storage - * of all JavaBeansTM + * of all JavaBeans™ * has been added to the java.beans package. * Please see {@link java.beans.XMLEncoder}. */ @@ -807,7 +807,7 @@ public class StyledEditorKit extends DefaultEditorKit { * future Swing releases. The current serialization support is * appropriate for short term storage or RMI between applications running * the same version of Swing. As of 1.4, support for long term storage - * of all JavaBeansTM + * of all JavaBeans™ * has been added to the java.beans package. * Please see {@link java.beans.XMLEncoder}. */ diff --git a/jdk/src/share/classes/javax/swing/text/TabSet.java b/jdk/src/share/classes/javax/swing/text/TabSet.java index 690ca5743d5..2a5351607c2 100644 --- a/jdk/src/share/classes/javax/swing/text/TabSet.java +++ b/jdk/src/share/classes/javax/swing/text/TabSet.java @@ -37,7 +37,7 @@ import java.io.Serializable; * future Swing releases. The current serialization support is * appropriate for short term storage or RMI between applications running * the same version of Swing. As of 1.4, support for long term storage - * of all JavaBeansTM + * of all JavaBeans™ * has been added to the java.beans package. * Please see {@link java.beans.XMLEncoder}. * diff --git a/jdk/src/share/classes/javax/swing/text/TabStop.java b/jdk/src/share/classes/javax/swing/text/TabStop.java index 70d5c160835..a78ea24b0c7 100644 --- a/jdk/src/share/classes/javax/swing/text/TabStop.java +++ b/jdk/src/share/classes/javax/swing/text/TabStop.java @@ -37,7 +37,7 @@ import java.io.Serializable; * future Swing releases. The current serialization support is * appropriate for short term storage or RMI between applications running * the same version of Swing. As of 1.4, support for long term storage - * of all JavaBeansTM + * of all JavaBeans™ * has been added to the java.beans package. * Please see {@link java.beans.XMLEncoder}. * diff --git a/jdk/src/share/classes/javax/swing/text/TextAction.java b/jdk/src/share/classes/javax/swing/text/TextAction.java index 9a5c9379adb..bcfa7c39043 100644 --- a/jdk/src/share/classes/javax/swing/text/TextAction.java +++ b/jdk/src/share/classes/javax/swing/text/TextAction.java @@ -52,7 +52,7 @@ import javax.swing.KeyStroke; * future Swing releases. The current serialization support is * appropriate for short term storage or RMI between applications running * the same version of Swing. As of 1.4, support for long term storage - * of all JavaBeansTM + * of all JavaBeans™ * has been added to the java.beans package. * Please see {@link java.beans.XMLEncoder}. * diff --git a/jdk/src/share/classes/javax/swing/text/html/Option.java b/jdk/src/share/classes/javax/swing/text/html/Option.java index 9628fdad8fa..181b87cde5c 100644 --- a/jdk/src/share/classes/javax/swing/text/html/Option.java +++ b/jdk/src/share/classes/javax/swing/text/html/Option.java @@ -38,7 +38,7 @@ import javax.swing.text.*; * future Swing releases. The current serialization support is * appropriate for short term storage or RMI between applications running * the same version of Swing. As of 1.4, support for long term storage - * of all JavaBeansTM + * of all JavaBeans™ * has been added to the java.beans package. * Please see {@link java.beans.XMLEncoder}. * diff --git a/jdk/src/share/classes/javax/swing/tree/AbstractLayoutCache.java b/jdk/src/share/classes/javax/swing/tree/AbstractLayoutCache.java index 8db55e67290..412ae261a7c 100644 --- a/jdk/src/share/classes/javax/swing/tree/AbstractLayoutCache.java +++ b/jdk/src/share/classes/javax/swing/tree/AbstractLayoutCache.java @@ -36,7 +36,7 @@ import java.util.Enumeration; * future Swing releases. The current serialization support is * appropriate for short term storage or RMI between applications running * the same version of Swing. As of 1.4, support for long term storage - * of all JavaBeansTM + * of all JavaBeans™ * has been added to the java.beans package. * Please see {@link java.beans.XMLEncoder}. * diff --git a/jdk/src/share/classes/javax/swing/tree/DefaultMutableTreeNode.java b/jdk/src/share/classes/javax/swing/tree/DefaultMutableTreeNode.java index 874515e6c04..5e776a0cd81 100644 --- a/jdk/src/share/classes/javax/swing/tree/DefaultMutableTreeNode.java +++ b/jdk/src/share/classes/javax/swing/tree/DefaultMutableTreeNode.java @@ -76,7 +76,7 @@ import java.util.*; * future Swing releases. The current serialization support is * appropriate for short term storage or RMI between applications running * the same version of Swing. As of 1.4, support for long term storage - * of all JavaBeansTM + * of all JavaBeans™ * has been added to the java.beans package. * Please see {@link java.beans.XMLEncoder}. * diff --git a/jdk/src/share/classes/javax/swing/tree/DefaultTreeCellEditor.java b/jdk/src/share/classes/javax/swing/tree/DefaultTreeCellEditor.java index 5745a3c3dc7..6e69a1bbf1f 100644 --- a/jdk/src/share/classes/javax/swing/tree/DefaultTreeCellEditor.java +++ b/jdk/src/share/classes/javax/swing/tree/DefaultTreeCellEditor.java @@ -52,7 +52,7 @@ import java.util.Vector; * future Swing releases. The current serialization support is * appropriate for short term storage or RMI between applications running * the same version of Swing. As of 1.4, support for long term storage - * of all JavaBeansTM + * of all JavaBeans™ * has been added to the java.beans package. * Please see {@link java.beans.XMLEncoder}. * diff --git a/jdk/src/share/classes/javax/swing/tree/DefaultTreeCellRenderer.java b/jdk/src/share/classes/javax/swing/tree/DefaultTreeCellRenderer.java index 213bf06f569..942d6d6defd 100644 --- a/jdk/src/share/classes/javax/swing/tree/DefaultTreeCellRenderer.java +++ b/jdk/src/share/classes/javax/swing/tree/DefaultTreeCellRenderer.java @@ -95,7 +95,7 @@ import sun.swing.DefaultLookup; * future Swing releases. The current serialization support is * appropriate for short term storage or RMI between applications running * the same version of Swing. As of 1.4, support for long term storage - * of all JavaBeansTM + * of all JavaBeans™ * has been added to the java.beans package. * Please see {@link java.beans.XMLEncoder}. * diff --git a/jdk/src/share/classes/javax/swing/tree/DefaultTreeModel.java b/jdk/src/share/classes/javax/swing/tree/DefaultTreeModel.java index 034d9256096..d3de67253c2 100644 --- a/jdk/src/share/classes/javax/swing/tree/DefaultTreeModel.java +++ b/jdk/src/share/classes/javax/swing/tree/DefaultTreeModel.java @@ -41,7 +41,7 @@ import javax.swing.event.*; * future Swing releases. The current serialization support is * appropriate for short term storage or RMI between applications running * the same version of Swing. As of 1.4, support for long term storage - * of all JavaBeansTM + * of all JavaBeans™ * has been added to the java.beans package. * Please see {@link java.beans.XMLEncoder}. * diff --git a/jdk/src/share/classes/javax/swing/tree/DefaultTreeSelectionModel.java b/jdk/src/share/classes/javax/swing/tree/DefaultTreeSelectionModel.java index 6420139b067..f9f9839acb2 100644 --- a/jdk/src/share/classes/javax/swing/tree/DefaultTreeSelectionModel.java +++ b/jdk/src/share/classes/javax/swing/tree/DefaultTreeSelectionModel.java @@ -53,7 +53,7 @@ import javax.swing.DefaultListSelectionModel; * future Swing releases. The current serialization support is * appropriate for short term storage or RMI between applications running * the same version of Swing. As of 1.4, support for long term storage - * of all JavaBeansTM + * of all JavaBeans™ * has been added to the java.beans package. * Please see {@link java.beans.XMLEncoder}. * diff --git a/jdk/src/share/classes/javax/swing/tree/FixedHeightLayoutCache.java b/jdk/src/share/classes/javax/swing/tree/FixedHeightLayoutCache.java index 4f61aff7304..c3676dd5288 100644 --- a/jdk/src/share/classes/javax/swing/tree/FixedHeightLayoutCache.java +++ b/jdk/src/share/classes/javax/swing/tree/FixedHeightLayoutCache.java @@ -42,7 +42,7 @@ import sun.swing.SwingUtilities2; * future Swing releases. The current serialization support is * appropriate for short term storage or RMI between applications running * the same version of Swing. As of 1.4, support for long term storage - * of all JavaBeansTM + * of all JavaBeans™ * has been added to the java.beans package. * Please see {@link java.beans.XMLEncoder}. * diff --git a/jdk/src/share/classes/javax/swing/tree/TreePath.java b/jdk/src/share/classes/javax/swing/tree/TreePath.java index df7818d5bcf..53e285e9538 100644 --- a/jdk/src/share/classes/javax/swing/tree/TreePath.java +++ b/jdk/src/share/classes/javax/swing/tree/TreePath.java @@ -74,7 +74,7 @@ import java.beans.ConstructorProperties; * future Swing releases. The current serialization support is * appropriate for short term storage or RMI between applications running * the same version of Swing. As of 1.4, support for long term storage - * of all JavaBeansTM + * of all JavaBeans™ * has been added to the java.beans package. * Please see {@link java.beans.XMLEncoder}. * diff --git a/jdk/src/share/classes/javax/swing/tree/VariableHeightLayoutCache.java b/jdk/src/share/classes/javax/swing/tree/VariableHeightLayoutCache.java index 5185194ed3b..f564724a854 100644 --- a/jdk/src/share/classes/javax/swing/tree/VariableHeightLayoutCache.java +++ b/jdk/src/share/classes/javax/swing/tree/VariableHeightLayoutCache.java @@ -43,7 +43,7 @@ import sun.swing.SwingUtilities2; * future Swing releases. The current serialization support is * appropriate for short term storage or RMI between applications running * the same version of Swing. As of 1.4, support for long term storage - * of all JavaBeansTM + * of all JavaBeans™ * has been added to the java.beans package. * Please see {@link java.beans.XMLEncoder}. * diff --git a/jdk/src/share/classes/javax/swing/undo/CannotRedoException.java b/jdk/src/share/classes/javax/swing/undo/CannotRedoException.java index 59b89ad93a3..e59e3f5eb14 100644 --- a/jdk/src/share/classes/javax/swing/undo/CannotRedoException.java +++ b/jdk/src/share/classes/javax/swing/undo/CannotRedoException.java @@ -32,7 +32,7 @@ package javax.swing.undo; * future Swing releases. The current serialization support is * appropriate for short term storage or RMI between applications running * the same version of Swing. As of 1.4, support for long term storage - * of all JavaBeansTM + * of all JavaBeans™ * has been added to the java.beans package. * Please see {@link java.beans.XMLEncoder}. * diff --git a/jdk/src/share/classes/javax/swing/undo/CannotUndoException.java b/jdk/src/share/classes/javax/swing/undo/CannotUndoException.java index 9974b82de7d..2779eaa8b54 100644 --- a/jdk/src/share/classes/javax/swing/undo/CannotUndoException.java +++ b/jdk/src/share/classes/javax/swing/undo/CannotUndoException.java @@ -33,7 +33,7 @@ package javax.swing.undo; * future Swing releases. The current serialization support is * appropriate for short term storage or RMI between applications running * the same version of Swing. As of 1.4, support for long term storage - * of all JavaBeansTM + * of all JavaBeans™ * has been added to the java.beans package. * Please see {@link java.beans.XMLEncoder}. * diff --git a/jdk/src/share/classes/javax/swing/undo/UndoManager.java b/jdk/src/share/classes/javax/swing/undo/UndoManager.java index 0d9553fd3b7..23dc9b5884e 100644 --- a/jdk/src/share/classes/javax/swing/undo/UndoManager.java +++ b/jdk/src/share/classes/javax/swing/undo/UndoManager.java @@ -126,7 +126,7 @@ import java.util.*; * future Swing releases. The current serialization support is * appropriate for short term storage or RMI between applications running * the same version of Swing. As of 1.4, support for long term storage - * of all JavaBeansTM + * of all JavaBeans™ * has been added to the java.beans package. * Please see {@link java.beans.XMLEncoder}. * From 241991b07e8f9213f5ac38b27076f6794223ffb1 Mon Sep 17 00:00:00 2001 From: Dmitry Ginzburg Date: Tue, 8 Oct 2013 13:57:44 +0400 Subject: [PATCH 091/131] 8025236: [javadoc] fix some errors in AWT Reviewed-by: yan, anthony --- jdk/src/share/classes/java/awt/event/InputEvent.java | 2 +- jdk/src/share/classes/java/awt/event/MouseEvent.java | 12 ++++++------ jdk/src/share/classes/java/awt/im/InputContext.java | 1 - .../classes/java/awt/im/InputMethodHighlight.java | 4 ++-- 4 files changed, 9 insertions(+), 10 deletions(-) diff --git a/jdk/src/share/classes/java/awt/event/InputEvent.java b/jdk/src/share/classes/java/awt/event/InputEvent.java index 24965d20caf..14e926c8dec 100644 --- a/jdk/src/share/classes/java/awt/event/InputEvent.java +++ b/jdk/src/share/classes/java/awt/event/InputEvent.java @@ -445,7 +445,7 @@ public abstract class InputEvent extends ComponentEvent { *
                *    int onmask = SHIFT_DOWN_MASK | BUTTON1_DOWN_MASK;
                *    int offmask = CTRL_DOWN_MASK;
          -     *    if ((event.getModifiersEx() & (onmask | offmask)) == onmask) {
          +     *    if ((event.getModifiersEx() & (onmask | offmask)) == onmask) {
                *        ...
                *    }
                * 
          diff --git a/jdk/src/share/classes/java/awt/event/MouseEvent.java b/jdk/src/share/classes/java/awt/event/MouseEvent.java index 5ad1d1753a3..4532c9f908c 100644 --- a/jdk/src/share/classes/java/awt/event/MouseEvent.java +++ b/jdk/src/share/classes/java/awt/event/MouseEvent.java @@ -146,12 +146,12 @@ import sun.awt.SunToolkit; * {@link InputEvent#getMaskForButton(int) getMaskForButton(button)} method may be used * as button masks. *

          - * MOUSE_DRAGGED events are delivered to the Component + * {@code MOUSE_DRAGGED} events are delivered to the {@code Component} * in which the mouse button was pressed until the mouse button is released * (regardless of whether the mouse position is within the bounds of the - * Component). Due to platform-dependent Drag&Drop implementations, - * MOUSE_DRAGGED events may not be delivered during a native - * Drag&Drop operation. + * {@code Component}). Due to platform-dependent Drag&Drop implementations, + * {@code MOUSE_DRAGGED} events may not be delivered during a native + * Drag&Drop operation. * * In a multi-screen environment mouse drag events are delivered to the * Component even if the mouse position is outside the bounds of the @@ -327,7 +327,7 @@ public class MouseEvent extends InputEvent { * For all other events the count will be 0. * * @serial - * @see #getClickCount(). + * @see #getClickCount() */ int clickCount; @@ -403,7 +403,7 @@ public class MouseEvent extends InputEvent { /** * Initialize JNI field and method IDs for fields that may be - accessed from C. + * accessed from C. */ private static native void initIDs(); diff --git a/jdk/src/share/classes/java/awt/im/InputContext.java b/jdk/src/share/classes/java/awt/im/InputContext.java index d835e6942c9..e2223fcbc50 100644 --- a/jdk/src/share/classes/java/awt/im/InputContext.java +++ b/jdk/src/share/classes/java/awt/im/InputContext.java @@ -118,7 +118,6 @@ public class InputContext { * Otherwise, an input method or keyboard layout that supports the requested * locale is selected in an implementation dependent way. * - *

          * * Before switching away from an input method, any currently uncommitted text * is committed. If no input method or keyboard layout supporting the requested diff --git a/jdk/src/share/classes/java/awt/im/InputMethodHighlight.java b/jdk/src/share/classes/java/awt/im/InputMethodHighlight.java index ffa99dfea67..55905d97708 100644 --- a/jdk/src/share/classes/java/awt/im/InputMethodHighlight.java +++ b/jdk/src/share/classes/java/awt/im/InputMethodHighlight.java @@ -51,8 +51,8 @@ import java.util.Map; * mappings from abstract to concrete styles. Currently defined state values * are raw (unconverted) and converted. * These state values are recommended for use before and after the -* main conversion step of text composition, say, before and after kana->kanji -* or pinyin->hanzi conversion. +* main conversion step of text composition, say, before and after kana->kanji +* or pinyin->hanzi conversion. * The variation field allows input methods to express additional * information about the conversion results. *

          From ee806b07216de008a293528a46a7e10d50f28e37 Mon Sep 17 00:00:00 2001 From: Alexander Zvegintsev Date: Tue, 8 Oct 2013 15:17:22 +0400 Subject: [PATCH 092/131] 7158311: GraphicsDevice.setDisplayMode(...) leads to hang when DISPLAY variable points to Oracle Linux 8001463: Regression : Deadlock between AWT-XAWT thread and AWT-EventQueue-0 Thread when screen resolution changes Reviewed-by: art, serb --- jdk/src/solaris/classes/sun/awt/X11/XToolkit.java | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/jdk/src/solaris/classes/sun/awt/X11/XToolkit.java b/jdk/src/solaris/classes/sun/awt/X11/XToolkit.java index 7fa438f4484..9f9a15ddee2 100644 --- a/jdk/src/solaris/classes/sun/awt/X11/XToolkit.java +++ b/jdk/src/solaris/classes/sun/awt/X11/XToolkit.java @@ -240,9 +240,14 @@ public final class XToolkit extends UNIXToolkit implements Runnable { @Override public void dispatchEvent(XEvent ev) { if (ev.get_type() == XConstants.ConfigureNotify) { - ((X11GraphicsEnvironment)GraphicsEnvironment. - getLocalGraphicsEnvironment()). - displayChanged(); + awtUnlock(); + try { + ((X11GraphicsEnvironment)GraphicsEnvironment. + getLocalGraphicsEnvironment()). + displayChanged(); + } finally { + awtLock(); + } } } }); From 419c7a7c32de29a9dae09d24df123d0f6e247783 Mon Sep 17 00:00:00 2001 From: Petr Pchelko Date: Tue, 8 Oct 2013 15:54:43 +0400 Subject: [PATCH 093/131] 8025585: Win: Popups in JFXPanel do not receive MouseWheel events Reviewed-by: anthony, art --- .../windows/native/sun/windows/awt_Toolkit.cpp | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/jdk/src/windows/native/sun/windows/awt_Toolkit.cpp b/jdk/src/windows/native/sun/windows/awt_Toolkit.cpp index cdb5247d618..ba8d6de2673 100644 --- a/jdk/src/windows/native/sun/windows/awt_Toolkit.cpp +++ b/jdk/src/windows/native/sun/windows/awt_Toolkit.cpp @@ -1516,10 +1516,19 @@ BOOL AwtToolkit::PreProcessMouseMsg(AwtComponent* p, MSG& msg) * the mouse, not the Component with the input focus. */ - if (msg.message == WM_MOUSEWHEEL && - AwtToolkit::MainThread() == ::GetWindowThreadProcessId(hWndForWheel, NULL)) { + if (msg.message == WM_MOUSEWHEEL) { //i.e. mouse is over client area for this window - msg.hwnd = hWndForWheel; + DWORD hWndForWheelProcess; + DWORD hWndForWheelThread = ::GetWindowThreadProcessId(hWndForWheel, &hWndForWheelProcess); + if (::GetCurrentProcessId() == hWndForWheelProcess) { + if (AwtToolkit::MainThread() == hWndForWheelThread) { + msg.hwnd = hWndForWheel; + } else { + // Interop mode, redispatch the event to another toolkit. + ::SendMessage(hWndForWheel, msg.message, mouseWParam, mouseLParam); + return TRUE; + } + } } /* From d8c323d038f9a9e7827613da9f0aece0a49dd0f8 Mon Sep 17 00:00:00 2001 From: Oleg Pekhovskiy Date: Tue, 8 Oct 2013 16:04:12 +0400 Subject: [PATCH 094/131] 8000425: FileDialog documentation should be enhanced Reviewed-by: serb, anthony --- jdk/src/share/classes/java/awt/FileDialog.java | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/jdk/src/share/classes/java/awt/FileDialog.java b/jdk/src/share/classes/java/awt/FileDialog.java index 3739570abb5..0fc63c7fde4 100644 --- a/jdk/src/share/classes/java/awt/FileDialog.java +++ b/jdk/src/share/classes/java/awt/FileDialog.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1995, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1995, 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 @@ -457,9 +457,16 @@ public class FileDialog extends Dialog { * specified file. This file becomes the default file if it is set * before the file dialog window is first shown. *

          + * When the dialog is shown, the specified file is selected. The kind of + * selection depends on the file existence, the dialog type, and the native + * platform. E.g., the file could be highlighted in the file list, or a + * file name editbox could be populated with the file name. + *

          + * This method accepts either a full file path, or a file name with an + * extension if used together with the {@code setDirectory} method. + *

          * Specifying "" as the file is exactly equivalent to specifying - * null - * as the file. + * {@code null} as the file. * * @param file the file being set * @see #getFile From acf636d21cc0a22cc6b96a62320b42185beefe66 Mon Sep 17 00:00:00 2001 From: Oleg Pekhovskiy Date: Tue, 8 Oct 2013 16:56:15 +0400 Subject: [PATCH 095/131] 7068423: Spec for java.awt.GraphicsDevice.getFullScreenWindow() needs clarification Reviewed-by: art, anthony --- jdk/src/share/classes/java/awt/GraphicsDevice.java | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/jdk/src/share/classes/java/awt/GraphicsDevice.java b/jdk/src/share/classes/java/awt/GraphicsDevice.java index cebac4abc6b..5e3901a0dd3 100644 --- a/jdk/src/share/classes/java/awt/GraphicsDevice.java +++ b/jdk/src/share/classes/java/awt/GraphicsDevice.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2009, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 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 @@ -334,11 +334,12 @@ public abstract class GraphicsDevice { } /** - * Returns the Window object representing the + * Returns the {@code Window} object representing the * full-screen window if the device is in full-screen mode. * - * @return the full-screen window, or null if the device is - * not in full-screen mode. + * @return the full-screen window, or {@code null} if the device is + * not in full-screen mode. The {@code Window} object can differ + * from the object previously set by {@code setFullScreenWindow}. * @see #setFullScreenWindow(Window) * @since 1.4 */ From bf733d1947bdec44d8b14f2e0c791760311d983b Mon Sep 17 00:00:00 2001 From: Oleg Pekhovskiy Date: Tue, 8 Oct 2013 17:00:44 +0400 Subject: [PATCH 096/131] 7199196: Incremental transfer is broken because of a typo Reviewed-by: anthony, serb --- jdk/src/solaris/classes/sun/awt/X11/XSelection.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/jdk/src/solaris/classes/sun/awt/X11/XSelection.java b/jdk/src/solaris/classes/sun/awt/X11/XSelection.java index f19ad2ffb67..36ebc8e6dba 100644 --- a/jdk/src/solaris/classes/sun/awt/X11/XSelection.java +++ b/jdk/src/solaris/classes/sun/awt/X11/XSelection.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 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 @@ -375,7 +375,7 @@ public final class XSelection { XToolkit.awtUnlock(); } - validateDataGetter(dataGetter); + validateDataGetter(incrDataGetter); if (incrDataGetter.getActualFormat() != 8) { throw new IOException("Unsupported data format: " + From fdd26c3a51c447d7392a99ddab12f91843317ddf Mon Sep 17 00:00:00 2001 From: Sergey Malenkov Date: Tue, 8 Oct 2013 18:10:13 +0400 Subject: [PATCH 097/131] 7081584: Specification for Window.isAlwaysOnTopSupported needs to be clarified Reviewed-by: art, serb --- .../classes/sun/lwawt/LWComponentPeer.java | 9 ++------- .../classes/sun/lwawt/macosx/CFileDialog.java | 5 ----- jdk/src/share/classes/java/awt/Component.java | 4 ---- jdk/src/share/classes/java/awt/Window.java | 16 ++++++++++------ .../classes/java/awt/peer/ComponentPeer.java | 9 --------- .../share/classes/sun/awt/NullComponentPeer.java | 4 ---- .../classes/sun/awt/X11/XComponentPeer.java | 8 ++------ .../classes/sun/awt/windows/WComponentPeer.java | 7 ++----- 8 files changed, 16 insertions(+), 46 deletions(-) diff --git a/jdk/src/macosx/classes/sun/lwawt/LWComponentPeer.java b/jdk/src/macosx/classes/sun/lwawt/LWComponentPeer.java index f6adcda7fde..0ab1d1e9ad2 100644 --- a/jdk/src/macosx/classes/sun/lwawt/LWComponentPeer.java +++ b/jdk/src/macosx/classes/sun/lwawt/LWComponentPeer.java @@ -385,11 +385,6 @@ public abstract class LWComponentPeer // ---- PEER METHODS ---- // - @Override - public Toolkit getToolkit() { - return LWToolkit.getLWToolkit(); - } - // Just a helper method public LWToolkit getLWToolkit() { return LWToolkit.getLWToolkit(); @@ -1010,13 +1005,13 @@ public abstract class LWComponentPeer @Override public boolean prepareImage(Image img, int w, int h, ImageObserver o) { // TODO: is it a right/complete implementation? - return getToolkit().prepareImage(img, w, h, o); + return Toolkit.getDefaultToolkit().prepareImage(img, w, h, o); } @Override public int checkImage(Image img, int w, int h, ImageObserver o) { // TODO: is it a right/complete implementation? - return getToolkit().checkImage(img, w, h, o); + return Toolkit.getDefaultToolkit().checkImage(img, w, h, o); } @Override diff --git a/jdk/src/macosx/classes/sun/lwawt/macosx/CFileDialog.java b/jdk/src/macosx/classes/sun/lwawt/macosx/CFileDialog.java index 29129394a37..4702cecc5ac 100644 --- a/jdk/src/macosx/classes/sun/lwawt/macosx/CFileDialog.java +++ b/jdk/src/macosx/classes/sun/lwawt/macosx/CFileDialog.java @@ -326,11 +326,6 @@ class CFileDialog implements FileDialogPeer { return getMinimumSize(); } - @Override - public Toolkit getToolkit() { - return Toolkit.getDefaultToolkit(); - } - @Override public void handleEvent(AWTEvent e) { } diff --git a/jdk/src/share/classes/java/awt/Component.java b/jdk/src/share/classes/java/awt/Component.java index 040f848437f..f7e2fbdba05 100644 --- a/jdk/src/share/classes/java/awt/Component.java +++ b/jdk/src/share/classes/java/awt/Component.java @@ -1223,10 +1223,6 @@ public abstract class Component implements ImageObserver, MenuContainer, * be called on the toolkit thread. */ final Toolkit getToolkitImpl() { - ComponentPeer peer = this.peer; - if ((peer != null) && ! (peer instanceof LightweightPeer)){ - return peer.getToolkit(); - } Container parent = this.parent; if (parent != null) { return parent.getToolkitImpl(); diff --git a/jdk/src/share/classes/java/awt/Window.java b/jdk/src/share/classes/java/awt/Window.java index 1575b8b2d66..bc7ef94cfd1 100644 --- a/jdk/src/share/classes/java/awt/Window.java +++ b/jdk/src/share/classes/java/awt/Window.java @@ -2197,8 +2197,8 @@ public class Window extends Container implements Accessible { * windows. To detect if always-on-top windows are supported by the * current platform, use {@link Toolkit#isAlwaysOnTopSupported()} and * {@link Window#isAlwaysOnTopSupported()}. If always-on-top mode - * isn't supported by the toolkit or for this window, calling this - * method has no effect. + * isn't supported for this window or this window's toolkit does not + * support always-on-top windows, calling this method has no effect. *

          * If a SecurityManager is installed, the calling thread must be * granted the AWTPermission "setWindowAlwaysOnTop" in @@ -2211,11 +2211,13 @@ public class Window extends Container implements Accessible { * windows * @throws SecurityException if the calling thread does not have * permission to set the value of always-on-top property + * * @see #isAlwaysOnTop * @see #toFront * @see #toBack * @see AWTPermission * @see #isAlwaysOnTopSupported + * @see #getToolkit * @see Toolkit#isAlwaysOnTopSupported * @since 1.5 */ @@ -2248,11 +2250,13 @@ public class Window extends Container implements Accessible { * window. Some platforms may not support always-on-top windows, some * may support only some kinds of top-level windows; for example, * a platform may not support always-on-top modal dialogs. - * @return {@code true}, if the always-on-top mode is - * supported by the toolkit and for this window, - * {@code false}, if always-on-top mode is not supported - * for this window or toolkit doesn't support always-on-top windows. + * + * @return {@code true}, if the always-on-top mode is supported for + * this window and this window's toolkit supports always-on-top windows, + * {@code false} otherwise + * * @see #setAlwaysOnTop(boolean) + * @see #getToolkit * @see Toolkit#isAlwaysOnTopSupported * @since 1.6 */ diff --git a/jdk/src/share/classes/java/awt/peer/ComponentPeer.java b/jdk/src/share/classes/java/awt/peer/ComponentPeer.java index 40f310d4b1f..8f5942a740e 100644 --- a/jdk/src/share/classes/java/awt/peer/ComponentPeer.java +++ b/jdk/src/share/classes/java/awt/peer/ComponentPeer.java @@ -259,15 +259,6 @@ public interface ComponentPeer { */ ColorModel getColorModel(); - /** - * Returns the toolkit that is responsible for the component. - * - * @return the toolkit that is responsible for the component - * - * @see Component#getToolkit() - */ - Toolkit getToolkit(); - /** * Returns a graphics object to paint on the component. * diff --git a/jdk/src/share/classes/sun/awt/NullComponentPeer.java b/jdk/src/share/classes/sun/awt/NullComponentPeer.java index b32b8a4f9bb..50712dee865 100644 --- a/jdk/src/share/classes/sun/awt/NullComponentPeer.java +++ b/jdk/src/share/classes/sun/awt/NullComponentPeer.java @@ -141,10 +141,6 @@ public class NullComponentPeer implements LightweightPeer, return new Dimension(1,1); } - public java.awt.Toolkit getToolkit() { - return null; - } - public ColorModel getColorModel() { return null; } diff --git a/jdk/src/solaris/classes/sun/awt/X11/XComponentPeer.java b/jdk/src/solaris/classes/sun/awt/X11/XComponentPeer.java index aa74d923e52..d50351af566 100644 --- a/jdk/src/solaris/classes/sun/awt/X11/XComponentPeer.java +++ b/jdk/src/solaris/classes/sun/awt/X11/XComponentPeer.java @@ -607,10 +607,6 @@ public class XComponentPeer extends XWindow implements ComponentPeer, DropTarget public void layout() {} - public java.awt.Toolkit getToolkit() { - return Toolkit.getDefaultToolkit(); - } - void updateMotifColors(Color bg) { int red = bg.getRed(); int green = bg.getGreen(); @@ -745,11 +741,11 @@ public class XComponentPeer extends XWindow implements ComponentPeer, DropTarget } public boolean prepareImage(Image img, int w, int h, ImageObserver o) { - return getToolkit().prepareImage(img, w, h, o); + return Toolkit.getDefaultToolkit().prepareImage(img, w, h, o); } public int checkImage(Image img, int w, int h, ImageObserver o) { - return getToolkit().checkImage(img, w, h, o); + return Toolkit.getDefaultToolkit().checkImage(img, w, h, o); } public Dimension preferredSize() { diff --git a/jdk/src/windows/classes/sun/awt/windows/WComponentPeer.java b/jdk/src/windows/classes/sun/awt/windows/WComponentPeer.java index da4135ec033..658df2c51e1 100644 --- a/jdk/src/windows/classes/sun/awt/windows/WComponentPeer.java +++ b/jdk/src/windows/classes/sun/awt/windows/WComponentPeer.java @@ -546,9 +546,6 @@ public abstract class WComponentPeer extends WObjectPeer return null; } } - public java.awt.Toolkit getToolkit() { - return Toolkit.getDefaultToolkit(); - } // fallback default font object final static Font defaultFont = new Font(Font.DIALOG, Font.PLAIN, 12); @@ -739,11 +736,11 @@ public abstract class WComponentPeer extends WObjectPeer } public boolean prepareImage(Image img, int w, int h, ImageObserver o) { - return getToolkit().prepareImage(img, w, h, o); + return Toolkit.getDefaultToolkit().prepareImage(img, w, h, o); } public int checkImage(Image img, int w, int h, ImageObserver o) { - return getToolkit().checkImage(img, w, h, o); + return Toolkit.getDefaultToolkit().checkImage(img, w, h, o); } // Object overrides From a485f88ad9583f98b522183108b17650fb3442af Mon Sep 17 00:00:00 2001 From: Sergey Malenkov Date: Tue, 8 Oct 2013 18:19:10 +0400 Subject: [PATCH 098/131] 7172597: java.awt.KeyboardFocusManager.clearFocusOwner() missed javadoc tag @since 1.8 Reviewed-by: art, anthony --- jdk/src/share/classes/java/awt/KeyboardFocusManager.java | 1 + 1 file changed, 1 insertion(+) diff --git a/jdk/src/share/classes/java/awt/KeyboardFocusManager.java b/jdk/src/share/classes/java/awt/KeyboardFocusManager.java index 83e5933fefa..8f869fa19c4 100644 --- a/jdk/src/share/classes/java/awt/KeyboardFocusManager.java +++ b/jdk/src/share/classes/java/awt/KeyboardFocusManager.java @@ -590,6 +590,7 @@ public abstract class KeyboardFocusManager * * @see Component#requestFocus() * @see java.awt.event.FocusEvent#FOCUS_LOST + * @since 1.8 */ public void clearFocusOwner() { if (getFocusOwner() != null) { From 9a9e0fd42cca9dd8bdfedd3d9cc5ac9cf2a73323 Mon Sep 17 00:00:00 2001 From: Alexander Scherbatiy Date: Tue, 8 Oct 2013 18:45:38 +0400 Subject: [PATCH 099/131] 7081594: Windows owned by an always-on-top window DO NOT automatically become always-on-top Reviewed-by: art, anthony, serb --- jdk/src/share/classes/java/awt/Window.java | 15 +++ .../AlwaysOnTop/AlwaysOnTopFieldTest.java | 91 +++++++++++++++++++ 2 files changed, 106 insertions(+) create mode 100644 jdk/test/java/awt/Window/AlwaysOnTop/AlwaysOnTopFieldTest.java diff --git a/jdk/src/share/classes/java/awt/Window.java b/jdk/src/share/classes/java/awt/Window.java index bc7ef94cfd1..6f66395169b 100644 --- a/jdk/src/share/classes/java/awt/Window.java +++ b/jdk/src/share/classes/java/awt/Window.java @@ -630,6 +630,12 @@ public class Window extends Container implements Accessible { this.parent = owner; if (owner != null) { owner.addOwnedWindow(weakThis); + if (owner.isAlwaysOnTop()) { + try { + setAlwaysOnTop(true); + } catch (SecurityException ignore) { + } + } } // WindowDisposerRecord requires a proper value of parent field. @@ -2243,6 +2249,15 @@ public class Window extends Container implements Accessible { } firePropertyChange("alwaysOnTop", oldAlwaysOnTop, alwaysOnTop); } + for (WeakReference ref : ownedWindowList) { + Window window = ref.get(); + if (window != null) { + try { + window.setAlwaysOnTop(alwaysOnTop); + } catch (SecurityException ignore) { + } + } + } } /** diff --git a/jdk/test/java/awt/Window/AlwaysOnTop/AlwaysOnTopFieldTest.java b/jdk/test/java/awt/Window/AlwaysOnTop/AlwaysOnTopFieldTest.java new file mode 100644 index 00000000000..965eb7f5b07 --- /dev/null +++ b/jdk/test/java/awt/Window/AlwaysOnTop/AlwaysOnTopFieldTest.java @@ -0,0 +1,91 @@ +/* + * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ +import java.awt.Dialog; +import java.awt.Frame; +import java.awt.Toolkit; +import java.awt.Window; +import sun.awt.SunToolkit; +/** + * @test + * @bug 7081594 + * @author Alexander Scherbatiy + * @summary Windows owned by an always-on-top window DO NOT automatically become always-on-top + * @run main AlwaysOnTopFieldTest + */ +public class AlwaysOnTopFieldTest { + + public static void main(String[] args) { + SunToolkit toolkit = (SunToolkit) Toolkit.getDefaultToolkit(); + + Window window = new Frame("Window 1"); + window.setSize(200, 200); + window.setAlwaysOnTop(true); + window.setVisible(true); + toolkit.realSync(); + + Dialog dialog = new Dialog(window, "Owned dialog 1"); + dialog.setSize(200, 200); + dialog.setLocation(100, 100); + dialog.setVisible(true); + toolkit.realSync(); + + try { + if (!window.isAlwaysOnTop()) { + throw new RuntimeException("Window has wrong isAlwaysOnTop value"); + } + if (!dialog.isAlwaysOnTop()) { + throw new RuntimeException("Dialog has wrong isAlwaysOnTop value"); + } + } finally { + window.dispose(); + dialog.dispose(); + } + + window = new Frame("Window 2"); + window.setSize(200, 200); + window.setVisible(true); + toolkit.realSync(); + + + dialog = new Dialog(window, "Owned dialog 2"); + dialog.setSize(200, 200); + dialog.setLocation(100, 100); + dialog.setVisible(true); + toolkit.realSync(); + + window.setAlwaysOnTop(true); + toolkit.realSync(); + + try { + if (!window.isAlwaysOnTop()) { + throw new RuntimeException("Window has wrong isAlwaysOnTop value"); + } + if (!dialog.isAlwaysOnTop()) { + throw new RuntimeException("Dialog has wrong isAlwaysOnTop value"); + } + } finally { + window.dispose(); + dialog.dispose(); + } + } +} From eacfa0f773292fd33596950984ffabb4712d55f7 Mon Sep 17 00:00:00 2001 From: Sergey Bylokhov Date: Tue, 8 Oct 2013 21:24:49 +0400 Subject: [PATCH 100/131] 8022119: test api/javax_sound/sampled/spi/MixerProvider/indexTGF_MixerProviderTests fails Reviewed-by: art, anthony --- .../com/sun/media/sound/JSSecurityManager.java | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/jdk/src/share/classes/com/sun/media/sound/JSSecurityManager.java b/jdk/src/share/classes/com/sun/media/sound/JSSecurityManager.java index 280e92aec68..ef34bc4adf9 100644 --- a/jdk/src/share/classes/com/sun/media/sound/JSSecurityManager.java +++ b/jdk/src/share/classes/com/sun/media/sound/JSSecurityManager.java @@ -187,9 +187,18 @@ final class JSSecurityManager { static List getProviders(final Class providerClass) { List p = new ArrayList<>(); - // ServiceLoader creates "lazy" iterator instance, so it doesn't, - // require do be called from privileged section - final Iterator ps = ServiceLoader.load(providerClass).iterator(); + // ServiceLoader creates "lazy" iterator instance, but it ensures that + // next/hasNext run with permissions that are restricted by whatever + // creates the ServiceLoader instance, so it requires to be called from + // privileged section + final PrivilegedAction> psAction = + new PrivilegedAction>() { + @Override + public Iterator run() { + return ServiceLoader.load(providerClass).iterator(); + } + }; + final Iterator ps = AccessController.doPrivileged(psAction); // the iterator's hasNext() method looks through classpath for // the provider class names, so it requires read permissions From 5ed7c4d3a2e8440fbab924c567caf8e2c216b3cc Mon Sep 17 00:00:00 2001 From: Sergey Bylokhov Date: Tue, 8 Oct 2013 23:34:20 +0400 Subject: [PATCH 101/131] 8025603: Unused methods in the awt text peers should be removed Reviewed-by: art, anthony --- .../sun/lwawt/LWTextComponentPeer.java | 4 +- .../share/classes/java/awt/TextComponent.java | 35 +--- .../java/awt/peer/TextComponentPeer.java | 4 +- .../classes/sun/awt/X11/XTextAreaPeer.java | 194 +++++++++--------- .../classes/sun/awt/X11/XTextFieldPeer.java | 144 +++++-------- .../classes/sun/awt/windows/WButtonPeer.java | 11 +- .../sun/awt/windows/WCheckboxPeer.java | 12 +- .../classes/sun/awt/windows/WChoicePeer.java | 11 +- .../sun/awt/windows/WComponentPeer.java | 10 +- .../classes/sun/awt/windows/WLabelPeer.java | 12 +- .../classes/sun/awt/windows/WListPeer.java | 9 +- .../sun/awt/windows/WScrollbarPeer.java | 13 +- .../sun/awt/windows/WTextAreaPeer.java | 58 ++---- .../sun/awt/windows/WTextComponentPeer.java | 45 ++-- .../sun/awt/windows/WTextFieldPeer.java | 51 ++--- .../native/sun/windows/awt_TextArea.cpp | 19 +- .../native/sun/windows/awt_TextComponent.cpp | 132 ------------ .../native/sun/windows/awt_TextField.cpp | 6 +- 18 files changed, 212 insertions(+), 558 deletions(-) diff --git a/jdk/src/macosx/classes/sun/lwawt/LWTextComponentPeer.java b/jdk/src/macosx/classes/sun/lwawt/LWTextComponentPeer.java index 8616992e892..d1df8e7abd1 100644 --- a/jdk/src/macosx/classes/sun/lwawt/LWTextComponentPeer.java +++ b/jdk/src/macosx/classes/sun/lwawt/LWTextComponentPeer.java @@ -123,7 +123,7 @@ abstract class LWTextComponentPeer= jtext.getDocument().getLength() && jtext.getDocument().getLength() != 0); @@ -491,6 +496,7 @@ final class XTextAreaPeer extends XComponentPeer implements TextAreaPeer { * replace the text between the position "s" and "e" with "txt" * @see java.awt.peer.TextAreaPeer */ + @Override public void replaceRange(String txt, int s, int e) { if (jtext != null) { // JTextArea.replaceRange() posts two different events. @@ -508,6 +514,7 @@ final class XTextAreaPeer extends XComponentPeer implements TextAreaPeer { * to be implemented. * @see java.awt.peer.TextComponentPeer */ + @Override public void setCaretPosition(int position) { jtext.setCaretPosition(position); } @@ -516,54 +523,19 @@ final class XTextAreaPeer extends XComponentPeer implements TextAreaPeer { * to be implemented. * @see java.awt.peer.TextComponentPeer */ + @Override public int getCaretPosition() { return jtext.getCaretPosition(); } - /** - * DEPRECATED - * @see java.awt.peer.TextAreaPeer - */ - public void insertText(String txt, int pos) { - insert(txt, pos); - } + final class AWTTextAreaUI extends MotifTextAreaUI { - /** - * DEPRECATED - * @see java.awt.peer.TextAreaPeer - */ - public void replaceText(String txt, int start, int end) { - replaceRange(txt, start, end); - } - - /** - * DEPRECATED - * @see java.awt.peer.TextAreaPeer - */ - public Dimension minimumSize(int rows, int cols) { - return getMinimumSize(rows, cols); - } - - /** - * DEPRECATED - * @see java.awt.peer.TextAreaPeer - */ - public Dimension preferredSize(int rows, int cols) { - return getPreferredSize(rows, cols); - } - - - class AWTTextAreaUI extends MotifTextAreaUI { - /** - * Creates a UI for a JTextArea. - * - * @param c the text field - * @return the UI - */ - JTextArea jta; + private JTextArea jta; + @Override protected String getPropertyPrefix() { return "TextArea"; } + @Override public void installUI(JComponent c) { super.installUI(c); @@ -619,6 +591,7 @@ final class XTextAreaPeer extends XComponentPeer implements TextAreaPeer { } } + @Override protected void installKeyboardActions() { super.installKeyboardActions(); @@ -636,13 +609,15 @@ final class XTextAreaPeer extends XComponentPeer implements TextAreaPeer { } } + @Override protected Caret createCaret() { return new XAWTCaret(); } } - static class XAWTCaret extends DefaultCaret { + static final class XAWTCaret extends DefaultCaret { + @Override public void focusGained(FocusEvent e) { super.focusGained(e); if (getComponent().isEnabled()){ @@ -652,6 +627,7 @@ final class XTextAreaPeer extends XComponentPeer implements TextAreaPeer { getComponent().repaint(); } + @Override public void focusLost(FocusEvent e) { super.focusLost(e); getComponent().repaint(); @@ -660,6 +636,7 @@ final class XTextAreaPeer extends XComponentPeer implements TextAreaPeer { // Fix for 5100950: textarea.getSelectedText() returns the de-selected text, on XToolkit // Restoring Motif behaviour // If the text is unhighlighted then we should sets the selection range to zero + @Override public void setSelectionVisible(boolean vis) { if (vis){ super.setSelectionVisible(vis); @@ -670,16 +647,14 @@ final class XTextAreaPeer extends XComponentPeer implements TextAreaPeer { } } + final class XAWTScrollBarButton extends BasicArrowButton { - class XAWTScrollBarButton extends BasicArrowButton - { - UIDefaults uidefaults = XToolkit.getUIDefaults(); + private UIDefaults uidefaults = XToolkit.getUIDefaults(); private Color darkShadow = SystemColor.controlShadow; private Color lightShadow = SystemColor.controlLtHighlight; private Color buttonBack = uidefaults.getColor("ScrollBar.track"); - public XAWTScrollBarButton(int direction) - { + XAWTScrollBarButton(int direction) { super(direction); switch (direction) { @@ -699,6 +674,7 @@ final class XTextAreaPeer extends XComponentPeer implements TextAreaPeer { setForeground(uidefaults.getColor("ScrollBar.foreground")); } + @Override public Dimension getPreferredSize() { switch (direction) { case NORTH: @@ -711,18 +687,22 @@ final class XTextAreaPeer extends XComponentPeer implements TextAreaPeer { } } + @Override public Dimension getMinimumSize() { return getPreferredSize(); } + @Override public Dimension getMaximumSize() { return getPreferredSize(); } + @Override public boolean isFocusTraversable() { return false; } + @Override public void paint(Graphics g) { int w = getWidth(); @@ -838,19 +818,16 @@ final class XTextAreaPeer extends XComponentPeer implements TextAreaPeer { } } + final class XAWTScrollBarUI extends BasicScrollBarUI { - class XAWTScrollBarUI extends BasicScrollBarUI - { - public XAWTScrollBarUI() { - super(); - } - + @Override protected void installDefaults() { super.installDefaults(); scrollbar.setBorder(new BevelBorder(false,SystemColor.controlDkShadow,SystemColor.controlLtHighlight) ); } + @Override protected void configureScrollBarColors() { UIDefaults uidefaults = XToolkit.getUIDefaults(); Color bg = scrollbar.getBackground(); @@ -873,12 +850,14 @@ final class XTextAreaPeer extends XComponentPeer implements TextAreaPeer { } + @Override protected JButton createDecreaseButton(int orientation) { JButton b = new XAWTScrollBarButton(orientation); return b; } + @Override protected JButton createIncreaseButton(int orientation) { JButton b = new XAWTScrollBarButton(orientation); return b; @@ -892,12 +871,14 @@ final class XTextAreaPeer extends XComponentPeer implements TextAreaPeer { return incrButton; } + @Override public void paint(Graphics g, JComponent c) { paintTrack(g, c, getTrackBounds()); Rectangle thumbBounds = getThumbBounds(); paintThumb(g, c, thumbBounds); } + @Override public void paintThumb(Graphics g, JComponent c, Rectangle thumbBounds) { if(!scrollbar.isEnabled()) { @@ -926,17 +907,18 @@ final class XTextAreaPeer extends XComponentPeer implements TextAreaPeer { } } + final class AWTTextArea extends JTextArea implements DocumentListener { - class AWTTextArea extends JTextArea implements DocumentListener { - boolean isFocused = false; - XTextAreaPeer peer; + private boolean isFocused = false; + private final XTextAreaPeer peer; - public AWTTextArea(String text, XTextAreaPeer peer) { + AWTTextArea(String text, XTextAreaPeer peer) { super(text); setFocusable(false); this.peer = peer; } + @Override public void insertUpdate(DocumentEvent e) { if (peer != null) { peer.postEvent(new TextEvent(peer.target, @@ -944,6 +926,7 @@ final class XTextAreaPeer extends XComponentPeer implements TextAreaPeer { } } + @Override public void removeUpdate(DocumentEvent e) { if (peer != null) { peer.postEvent(new TextEvent(peer.target, @@ -951,6 +934,7 @@ final class XTextAreaPeer extends XComponentPeer implements TextAreaPeer { } } + @Override public void changedUpdate(DocumentEvent e) { if (peer != null) { peer.postEvent(new TextEvent(peer.target, @@ -971,6 +955,7 @@ final class XTextAreaPeer extends XComponentPeer implements TextAreaPeer { super.processFocusEvent(fe); } + @Override public boolean hasFocus() { return isFocused; } @@ -991,6 +976,7 @@ final class XTextAreaPeer extends XComponentPeer implements TextAreaPeer { processInputMethodEvent(e); } + @Override public void updateUI() { ComponentUI ui = new AWTTextAreaUI(); setUI(ui); @@ -998,6 +984,7 @@ final class XTextAreaPeer extends XComponentPeer implements TextAreaPeer { // Fix for 4915454 - override the default implementation to avoid // loading SystemFlavorMap and associated classes. + @Override public void setTransferHandler(TransferHandler newHandler) { TransferHandler oldHandler = (TransferHandler) getClientProperty(AWTAccessor.getClientPropertyKeyAccessor() @@ -1010,9 +997,8 @@ final class XTextAreaPeer extends XComponentPeer implements TextAreaPeer { } } + final class XAWTScrollPaneUI extends BasicScrollPaneUI { - class XAWTScrollPaneUI extends BasicScrollPaneUI - { private final Border vsbMarginBorderR = new EmptyBorder(0, 2, 0, 0); private final Border vsbMarginBorderL = new EmptyBorder(0, 0, 0, 2); private final Border hsbMarginBorder = new EmptyBorder(2, 0, 0, 0); @@ -1022,12 +1008,14 @@ final class XTextAreaPeer extends XComponentPeer implements TextAreaPeer { private PropertyChangeListener propertyChangeHandler; + @Override protected void installListeners(JScrollPane scrollPane) { super.installListeners(scrollPane); propertyChangeHandler = createPropertyChangeHandler(); scrollPane.addPropertyChangeListener(propertyChangeHandler); } + @Override public void paint(Graphics g, JComponent c) { Border vpBorder = scrollpane.getViewportBorder(); if (vpBorder != null) { @@ -1043,6 +1031,7 @@ final class XTextAreaPeer extends XComponentPeer implements TextAreaPeer { private PropertyChangeListener createPropertyChangeHandler() { return new PropertyChangeListener() { + @Override public void propertyChange(PropertyChangeEvent e) { String propertyName = e.getPropertyName(); @@ -1067,7 +1056,7 @@ final class XTextAreaPeer extends XComponentPeer implements TextAreaPeer { return c.getComponentOrientation().isLeftToRight(); } - + @Override protected void installDefaults(JScrollPane scrollpane) { Border b = scrollpane.getBorder(); UIDefaults uidefaults = XToolkit.getUIDefaults(); @@ -1094,6 +1083,7 @@ final class XTextAreaPeer extends XComponentPeer implements TextAreaPeer { } } + @Override protected void uninstallDefaults(JScrollPane c) { super.uninstallDefaults(c); @@ -1115,15 +1105,15 @@ final class XTextAreaPeer extends XComponentPeer implements TextAreaPeer { } } - private class AWTTextPane extends JScrollPane implements FocusListener { - JTextArea jtext; - XWindow xwin; - Color control = SystemColor.control; - Color focus = SystemColor.activeCaptionBorder; + private final JTextArea jtext; + private final XWindow xwin; - public AWTTextPane(JTextArea jt, XWindow xwin, Container parent) { + private final Color control = SystemColor.control; + private final Color focus = SystemColor.activeCaptionBorder; + + AWTTextPane(JTextArea jt, XWindow xwin, Container parent) { super(jt); this.xwin = xwin; setDoubleBuffered(true); @@ -1148,6 +1138,7 @@ final class XTextAreaPeer extends XComponentPeer implements TextAreaPeer { } } + @Override public void focusGained(FocusEvent e) { Graphics g = getGraphics(); Rectangle r = getViewportBorderBounds(); @@ -1156,6 +1147,7 @@ final class XTextAreaPeer extends XComponentPeer implements TextAreaPeer { g.dispose(); } + @Override public void focusLost(FocusEvent e) { Graphics g = getGraphics(); Rectangle r = getViewportBorderBounds(); @@ -1168,19 +1160,23 @@ final class XTextAreaPeer extends XComponentPeer implements TextAreaPeer { return (Window) xwin.target; } + @Override public ComponentPeer getPeer() { return (ComponentPeer) (xwin); } + @Override public void updateUI() { ComponentUI ui = new XAWTScrollPaneUI(); setUI(ui); } + @Override public JScrollBar createVerticalScrollBar() { return new XAWTScrollBar(JScrollBar.VERTICAL); } + @Override public JScrollBar createHorizontalScrollBar() { return new XAWTScrollBar(JScrollBar.HORIZONTAL); } @@ -1189,18 +1185,19 @@ final class XTextAreaPeer extends XComponentPeer implements TextAreaPeer { return this.jtext; } + @Override public Graphics getGraphics() { return xwin.getGraphics(); } + final class XAWTScrollBar extends ScrollBar { - class XAWTScrollBar extends ScrollBar { - - public XAWTScrollBar(int i) { + XAWTScrollBar(int i) { super(i); setFocusable(false); } + @Override public void updateUI() { ComponentUI ui = new XAWTScrollBarUI(); setUI(ui); @@ -1214,12 +1211,13 @@ final class XTextAreaPeer extends XComponentPeer implements TextAreaPeer { private Color control = SystemColor.controlShadow; private boolean isRaised; - public BevelBorder(boolean isRaised, Color darkShadow, Color lightShadow) { + BevelBorder(boolean isRaised, Color darkShadow, Color lightShadow) { this.isRaised = isRaised; this.darkShadow = darkShadow; this.lightShadow = lightShadow; } + @Override public void paintBorder(Component c, Graphics g, int x, int y, int w, int h) { g.setColor((isRaised) ? lightShadow : darkShadow); g.drawLine(x, y, x+w-1, y); // top @@ -1238,10 +1236,12 @@ final class XTextAreaPeer extends XComponentPeer implements TextAreaPeer { g.drawLine(x+w-2, y+h-2, x+w-2, y+1); // right } + @Override public Insets getBorderInsets(Component c) { return getBorderInsets(c, new Insets(0,0,0,0)); } + @Override public Insets getBorderInsets(Component c, Insets insets) { insets.top = insets.left = insets.bottom = insets.right = 2; return insets; diff --git a/jdk/src/solaris/classes/sun/awt/X11/XTextFieldPeer.java b/jdk/src/solaris/classes/sun/awt/X11/XTextFieldPeer.java index 8bb74559946..3db7ed4ef9d 100644 --- a/jdk/src/solaris/classes/sun/awt/X11/XTextFieldPeer.java +++ b/jdk/src/solaris/classes/sun/awt/X11/XTextFieldPeer.java @@ -97,6 +97,7 @@ final class XTextFieldPeer extends XComponentPeer implements TextFieldPeer { firstChangeSkipped = true; } + @Override public void dispose() { XToolkit.specialPeerMap.remove(xtext); // visible caret has a timer thread which must be stopped @@ -136,10 +137,10 @@ final class XTextFieldPeer extends XComponentPeer implements TextFieldPeer { setFont(font); } - /** * @see java.awt.peer.TextComponentPeer */ + @Override public void setEditable(boolean editable) { if (xtext != null) { xtext.setEditable(editable); @@ -150,6 +151,7 @@ final class XTextFieldPeer extends XComponentPeer implements TextFieldPeer { /** * @see java.awt.peer.ComponentPeer */ + @Override public void setEnabled(boolean enabled) { super.setEnabled(enabled); if (xtext != null) { @@ -161,22 +163,23 @@ final class XTextFieldPeer extends XComponentPeer implements TextFieldPeer { /** * @see java.awt.peer.TextComponentPeer */ - + @Override public InputMethodRequests getInputMethodRequests() { if (xtext != null) return xtext.getInputMethodRequests(); else return null; } + @Override void handleJavaInputMethodEvent(InputMethodEvent e) { if (xtext != null) xtext.processInputMethodEventImpl(e); } - /** * @see java.awt.peer.TextFieldPeer */ + @Override public void setEchoChar(char c) { if (xtext != null) { xtext.setEchoChar(c); @@ -188,6 +191,7 @@ final class XTextFieldPeer extends XComponentPeer implements TextFieldPeer { /** * @see java.awt.peer.TextComponentPeer */ + @Override public int getSelectionStart() { return xtext.getSelectionStart(); } @@ -195,6 +199,7 @@ final class XTextFieldPeer extends XComponentPeer implements TextFieldPeer { /** * @see java.awt.peer.TextComponentPeer */ + @Override public int getSelectionEnd() { return xtext.getSelectionEnd(); } @@ -202,6 +207,7 @@ final class XTextFieldPeer extends XComponentPeer implements TextFieldPeer { /** * @see java.awt.peer.TextComponentPeer */ + @Override public String getText() { return xtext.getText(); } @@ -209,12 +215,13 @@ final class XTextFieldPeer extends XComponentPeer implements TextFieldPeer { /** * @see java.awt.peer.TextComponentPeer */ - public void setText(String txt) { - setXAWTTextField(txt); + @Override + public void setText(String text) { + setXAWTTextField(text); repaint(); } - private boolean setXAWTTextField(String txt) { + private void setXAWTTextField(String txt) { text = txt; if (xtext != null) { // JTextField.setText() posts two different events (remove & insert). @@ -229,29 +236,22 @@ final class XTextFieldPeer extends XComponentPeer implements TextFieldPeer { xtext.getDocument().addDocumentListener(xtext); xtext.setCaretPosition(0); } - return true; } /** * to be implemented. * @see java.awt.peer.TextComponentPeer */ + @Override public void setCaretPosition(int position) { if (xtext != null) xtext.setCaretPosition(position); } - /** - * DEPRECATED - * @see java.awt.peer.TextFieldPeer - */ - public void setEchoCharacter(char c) { - setEchoChar(c); - } - void repaintText() { xtext.repaintNow(); } + @Override public void setBackground(Color c) { if (log.isLoggable(PlatformLogger.Level.FINE)) { log.fine("target="+ target + ", old=" + background + ", new=" + c); @@ -264,6 +264,7 @@ final class XTextFieldPeer extends XComponentPeer implements TextFieldPeer { repaintText(); } + @Override public void setForeground(Color c) { foreground = c; if (xtext != null) { @@ -274,6 +275,7 @@ final class XTextFieldPeer extends XComponentPeer implements TextFieldPeer { repaintText(); } + @Override public void setFont(Font f) { synchronized (getStateLock()) { font = f; @@ -284,14 +286,6 @@ final class XTextFieldPeer extends XComponentPeer implements TextFieldPeer { xtext.validate(); } - /** - * DEPRECATED - * @see java.awt.peer.TextFieldPeer - */ - public Dimension preferredSize(int cols) { - return getPreferredSize(cols); - } - /** * Deselects the the highlighted text. */ @@ -303,20 +297,19 @@ final class XTextFieldPeer extends XComponentPeer implements TextFieldPeer { } } - /** * to be implemented. * @see java.awt.peer.TextComponentPeer */ + @Override public int getCaretPosition() { return xtext.getCaretPosition(); } - - /** * @see java.awt.peer.TextComponentPeer */ + @Override public void select(int s, int e) { xtext.select(s,e); // Fixed 5100806 @@ -324,29 +317,32 @@ final class XTextFieldPeer extends XComponentPeer implements TextFieldPeer { xtext.repaint(); } - + @Override public Dimension getMinimumSize() { return xtext.getMinimumSize(); } + @Override public Dimension getPreferredSize() { return xtext.getPreferredSize(); } + @Override public Dimension getPreferredSize(int cols) { return getMinimumSize(cols); } private static final int PADDING = 16; + @Override public Dimension getMinimumSize(int cols) { Font f = xtext.getFont(); FontMetrics fm = xtext.getFontMetrics(f); return new Dimension(fm.charWidth('0') * cols + 10, fm.getMaxDescent() + fm.getMaxAscent() + PADDING); - } + @Override public boolean isFocusable() { return true; } @@ -359,11 +355,10 @@ final class XTextFieldPeer extends XComponentPeer implements TextFieldPeer { modifiers)); } - protected void disposeImpl() { } - + @Override public void repaint() { if (xtext != null) xtext.repaint(); } @@ -372,27 +367,32 @@ final class XTextFieldPeer extends XComponentPeer implements TextFieldPeer { if (xtext != null) xtext.paint(g); } + @Override public void print(Graphics g) { if (xtext != null) { xtext.print(g); } } + @Override public void focusLost(FocusEvent e) { super.focusLost(e); xtext.forwardFocusLost(e); } + @Override public void focusGained(FocusEvent e) { super.focusGained(e); xtext.forwardFocusGained(e); } + @Override void handleJavaKeyEvent(KeyEvent e) { AWTAccessor.getComponentAccessor().processEvent(xtext,e); } + @Override public void handleJavaMouseEvent( MouseEvent mouseEvent ) { super.handleJavaMouseEvent(mouseEvent); if (xtext != null) { @@ -405,26 +405,21 @@ final class XTextFieldPeer extends XComponentPeer implements TextFieldPeer { } } - /** * DEPRECATED */ + @Override public Dimension minimumSize() { return getMinimumSize(); } - /** - * DEPRECATED - */ - public Dimension minimumSize(int cols) { - return getMinimumSize(cols); - } - + @Override public void setVisible(boolean b) { super.setVisible(b); if (xtext != null) xtext.setVisible(b); } + @Override public void setBounds(int x, int y, int width, int height, int op) { super.setBounds(x, y, width, height, op); if (xtext != null) { @@ -451,47 +446,11 @@ final class XTextFieldPeer extends XComponentPeer implements TextFieldPeer { } } + final class AWTTextFieldUI extends MotifPasswordFieldUI { - // - // Accessibility support - // - - // stub functions: to be fully implemented in a future release - public int getIndexAtPoint(int x, int y) { return -1; } - public Rectangle getCharacterBounds(int i) { return null; } - public long filterEvents(long mask) { return 0; } - - - /* To be fully implemented in a future release - - int oldSelectionStart; - int oldSelectionEnd; - - public native int getIndexAtPoint(int x, int y); - public native Rectangle getCharacterBounds(int i); - public native long filterEvents(long mask); - - /** - * Handle a change in the text selection endpoints - * (Note: could be simply a change in the caret location) - * - public void selectionValuesChanged(int start, int end) { - return; // Need to write implemetation of this. - } - */ - - - class AWTTextFieldUI extends MotifPasswordFieldUI { - - /** - * Creates a UI for a JTextField. - * - * @param c the text field - * @return the UI - */ - JTextField jtf; - + private JTextField jtf; + @Override protected String getPropertyPrefix() { JTextComponent comp = getComponent(); if (comp instanceof JPasswordField && ((JPasswordField)comp).echoCharIsSet()) { @@ -501,6 +460,7 @@ final class XTextFieldPeer extends XComponentPeer implements TextFieldPeer { } } + @Override public void installUI(JComponent c) { super.installUI(c); @@ -557,6 +517,7 @@ final class XTextFieldPeer extends XComponentPeer implements TextFieldPeer { } } + @Override protected void installKeyboardActions() { super.installKeyboardActions(); @@ -574,21 +535,19 @@ final class XTextFieldPeer extends XComponentPeer implements TextFieldPeer { } } + @Override protected Caret createCaret() { return new XTextAreaPeer.XAWTCaret(); } } - class XAWTTextField extends JPasswordField - implements ActionListener, - DocumentListener - { + final class XAWTTextField extends JPasswordField + implements ActionListener, DocumentListener { - boolean isFocused = false; + private boolean isFocused = false; + private final XComponentPeer peer; - XComponentPeer peer; - - public XAWTTextField(String text, XComponentPeer peer, Container parent) { + XAWTTextField(String text, XComponentPeer peer, Container parent) { super(text); this.peer = peer; setDoubleBuffered(true); @@ -603,6 +562,7 @@ final class XTextFieldPeer extends XComponentPeer implements TextFieldPeer { } + @Override public void actionPerformed( ActionEvent actionEvent ) { peer.postEvent(new ActionEvent(peer.target, ActionEvent.ACTION_PERFORMED, @@ -612,6 +572,7 @@ final class XTextFieldPeer extends XComponentPeer implements TextFieldPeer { } + @Override public void insertUpdate(DocumentEvent e) { if (peer != null) { peer.postEvent(new TextEvent(peer.target, @@ -619,6 +580,7 @@ final class XTextFieldPeer extends XComponentPeer implements TextFieldPeer { } } + @Override public void removeUpdate(DocumentEvent e) { if (peer != null) { peer.postEvent(new TextEvent(peer.target, @@ -626,6 +588,7 @@ final class XTextFieldPeer extends XComponentPeer implements TextFieldPeer { } } + @Override public void changedUpdate(DocumentEvent e) { if (peer != null) { peer.postEvent(new TextEvent(peer.target, @@ -633,33 +596,32 @@ final class XTextFieldPeer extends XComponentPeer implements TextFieldPeer { } } + @Override public ComponentPeer getPeer() { return (ComponentPeer) peer; } - public void repaintNow() { paintImmediately(getBounds()); } + @Override public Graphics getGraphics() { return peer.getGraphics(); } + @Override public void updateUI() { ComponentUI ui = new AWTTextFieldUI(); setUI(ui); } - void forwardFocusGained( FocusEvent e) { isFocused = true; FocusEvent fe = CausedFocusEvent.retarget(e, this); super.processFocusEvent(fe); - } - void forwardFocusLost( FocusEvent e) { isFocused = false; FocusEvent fe = CausedFocusEvent.retarget(e, this); @@ -667,11 +629,11 @@ final class XTextFieldPeer extends XComponentPeer implements TextFieldPeer { } + @Override public boolean hasFocus() { return isFocused; } - public void processInputMethodEventImpl(InputMethodEvent e) { processInputMethodEvent(e); } @@ -686,6 +648,7 @@ final class XTextFieldPeer extends XComponentPeer implements TextFieldPeer { // Fix for 4915454 - override the default implementation to avoid // loading SystemFlavorMap and associated classes. + @Override public void setTransferHandler(TransferHandler newHandler) { TransferHandler oldHandler = (TransferHandler) getClientProperty(AWTAccessor.getClientPropertyKeyAccessor() @@ -697,6 +660,7 @@ final class XTextFieldPeer extends XComponentPeer implements TextFieldPeer { firePropertyChange("transferHandler", oldHandler, newHandler); } + @Override public void setEchoChar(char c) { super.setEchoChar(c); ((AWTTextFieldUI)ui).installKeyboardActions(); diff --git a/jdk/src/windows/classes/sun/awt/windows/WButtonPeer.java b/jdk/src/windows/classes/sun/awt/windows/WButtonPeer.java index f0811acffd0..f006c9a8564 100644 --- a/jdk/src/windows/classes/sun/awt/windows/WButtonPeer.java +++ b/jdk/src/windows/classes/sun/awt/windows/WButtonPeer.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1996, 2006, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1996, 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 @@ -29,7 +29,7 @@ import java.awt.peer.*; import java.awt.event.ActionEvent; import java.awt.event.KeyEvent; -class WButtonPeer extends WComponentPeer implements ButtonPeer { +final class WButtonPeer extends WComponentPeer implements ButtonPeer { static { initIDs(); @@ -83,13 +83,6 @@ class WButtonPeer extends WComponentPeer implements ButtonPeer { return false; } - /** - * DEPRECATED - */ - public Dimension minimumSize() { - return getMinimumSize(); - } - /** * Initialize JNI field and method IDs */ diff --git a/jdk/src/windows/classes/sun/awt/windows/WCheckboxPeer.java b/jdk/src/windows/classes/sun/awt/windows/WCheckboxPeer.java index a0537572cd3..efab5315959 100644 --- a/jdk/src/windows/classes/sun/awt/windows/WCheckboxPeer.java +++ b/jdk/src/windows/classes/sun/awt/windows/WCheckboxPeer.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1996, 2005, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1996, 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 @@ -28,7 +28,7 @@ import java.awt.*; import java.awt.peer.*; import java.awt.event.ItemEvent; -public class WCheckboxPeer extends WComponentPeer implements CheckboxPeer { +final class WCheckboxPeer extends WComponentPeer implements CheckboxPeer { // CheckboxPeer implementation @@ -100,12 +100,4 @@ public class WCheckboxPeer extends WComponentPeer implements CheckboxPeer { } }); } - - /** - * DEPRECATED - */ - public Dimension minimumSize() { - return getMinimumSize(); - } - } diff --git a/jdk/src/windows/classes/sun/awt/windows/WChoicePeer.java b/jdk/src/windows/classes/sun/awt/windows/WChoicePeer.java index 8ecc83ed866..74f9548a63e 100644 --- a/jdk/src/windows/classes/sun/awt/windows/WChoicePeer.java +++ b/jdk/src/windows/classes/sun/awt/windows/WChoicePeer.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1996, 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1996, 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 @@ -32,7 +32,7 @@ import java.awt.event.WindowListener; import java.awt.event.WindowAdapter; import sun.awt.SunToolkit; -class WChoicePeer extends WComponentPeer implements ChoicePeer { +final class WChoicePeer extends WComponentPeer implements ChoicePeer { // WComponentPeer overrides @@ -151,12 +151,5 @@ class WChoicePeer extends WComponentPeer implements ChoicePeer { return fm.getHeight() * maxItems; } - /** - * DEPRECATED - */ - public Dimension minimumSize() { - return getMinimumSize(); - } - native void closeList(); } diff --git a/jdk/src/windows/classes/sun/awt/windows/WComponentPeer.java b/jdk/src/windows/classes/sun/awt/windows/WComponentPeer.java index 658df2c51e1..cb13413fc08 100644 --- a/jdk/src/windows/classes/sun/awt/windows/WComponentPeer.java +++ b/jdk/src/windows/classes/sun/awt/windows/WComponentPeer.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1996, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1996, 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 @@ -50,7 +50,6 @@ import sun.java2d.ScreenUpdateManager; import sun.java2d.d3d.D3DSurfaceData; import sun.java2d.opengl.OGLSurfaceData; import sun.java2d.pipe.Region; -import sun.awt.DisplayChangedListener; import sun.awt.PaintEventDispatcher; import sun.awt.SunToolkit; import sun.awt.event.IgnorePaintEvent; @@ -881,13 +880,6 @@ public abstract class WComponentPeer extends WObjectPeer public native void beginValidate(); public native void endValidate(); - /** - * DEPRECATED - */ - public Dimension minimumSize() { - return getMinimumSize(); - } - /** * DEPRECATED */ diff --git a/jdk/src/windows/classes/sun/awt/windows/WLabelPeer.java b/jdk/src/windows/classes/sun/awt/windows/WLabelPeer.java index f5984c2a9cd..259329d4f6d 100644 --- a/jdk/src/windows/classes/sun/awt/windows/WLabelPeer.java +++ b/jdk/src/windows/classes/sun/awt/windows/WLabelPeer.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1996, 2001, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1996, 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 @@ -27,7 +27,7 @@ package sun.awt.windows; import java.awt.*; import java.awt.peer.*; -class WLabelPeer extends WComponentPeer implements LabelPeer { +final class WLabelPeer extends WComponentPeer implements LabelPeer { // ComponentPeer overrides @@ -82,12 +82,4 @@ class WLabelPeer extends WComponentPeer implements LabelPeer { super.initialize(); } - - /** - * DEPRECATED - */ - public Dimension minimumSize() { - return getMinimumSize(); - } - } diff --git a/jdk/src/windows/classes/sun/awt/windows/WListPeer.java b/jdk/src/windows/classes/sun/awt/windows/WListPeer.java index 2cd4df7a034..0c090b5a46b 100644 --- a/jdk/src/windows/classes/sun/awt/windows/WListPeer.java +++ b/jdk/src/windows/classes/sun/awt/windows/WListPeer.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1996, 2006, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1996, 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 @@ -29,13 +29,8 @@ import java.awt.peer.*; import java.awt.event.ActionEvent; import java.awt.event.ItemEvent; -class WListPeer extends WComponentPeer implements ListPeer { +final class WListPeer extends WComponentPeer implements ListPeer { - // ComponentPeer overrides - - public Dimension minimumSize() { - return minimumSize(4); - } public boolean isFocusable() { return true; } diff --git a/jdk/src/windows/classes/sun/awt/windows/WScrollbarPeer.java b/jdk/src/windows/classes/sun/awt/windows/WScrollbarPeer.java index 655fcd85dd5..65c41a3f7a6 100644 --- a/jdk/src/windows/classes/sun/awt/windows/WScrollbarPeer.java +++ b/jdk/src/windows/classes/sun/awt/windows/WScrollbarPeer.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1996, 2002, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1996, 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 @@ -28,8 +28,7 @@ import java.awt.*; import java.awt.peer.*; import java.awt.event.AdjustmentEvent; -class WScrollbarPeer extends WComponentPeer implements ScrollbarPeer { - +final class WScrollbarPeer extends WComponentPeer implements ScrollbarPeer { // Returns width for vertial scrollbar as SM_CXHSCROLL, // height for horizontal scrollbar as SM_CYVSCROLL @@ -140,12 +139,4 @@ class WScrollbarPeer extends WComponentPeer implements ScrollbarPeer { public boolean shouldClearRectBeforePaint() { return false; } - - /** - * DEPRECATED - */ - public Dimension minimumSize() { - return getMinimumSize(); - } - } diff --git a/jdk/src/windows/classes/sun/awt/windows/WTextAreaPeer.java b/jdk/src/windows/classes/sun/awt/windows/WTextAreaPeer.java index 063cffc9e71..746f27790d7 100644 --- a/jdk/src/windows/classes/sun/awt/windows/WTextAreaPeer.java +++ b/jdk/src/windows/classes/sun/awt/windows/WTextAreaPeer.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1996, 2003, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1996, 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 @@ -30,34 +30,36 @@ import java.awt.peer.*; import java.awt.im.InputMethodRequests; -class WTextAreaPeer extends WTextComponentPeer implements TextAreaPeer { +final class WTextAreaPeer extends WTextComponentPeer implements TextAreaPeer { // WComponentPeer overrides + @Override public Dimension getMinimumSize() { return getMinimumSize(10, 60); } // TextAreaPeer implementation - /* This should eventually be a direct native method. */ - public void insert(String txt, int pos) { - insertText(txt, pos); + @Override + public void insert(String text, int pos) { + replaceRange(text, pos, pos); } - /* This should eventually be a direct native method. */ - public void replaceRange(String txt, int start, int end) { - replaceText(txt, start, end); - } + @Override + public native void replaceRange(String text, int start, int end); + @Override public Dimension getPreferredSize(int rows, int cols) { return getMinimumSize(rows, cols); } + @Override public Dimension getMinimumSize(int rows, int cols) { FontMetrics fm = getFontMetrics(((TextArea)target).getFont()); return new Dimension(fm.charWidth('0') * cols + 20, fm.getHeight() * rows + 20); } + @Override public InputMethodRequests getInputMethodRequests() { return null; } @@ -68,42 +70,6 @@ class WTextAreaPeer extends WTextComponentPeer implements TextAreaPeer { super(target); } + @Override native void create(WComponentPeer parent); - - // native callbacks - - - // deprecated methods - - /** - * DEPRECATED but, for now, still called by insert(String, int). - */ - public native void insertText(String txt, int pos); - - /** - * DEPRECATED but, for now, still called by replaceRange(String, int, int). - */ - public native void replaceText(String txt, int start, int end); - - /** - * DEPRECATED - */ - public Dimension minimumSize() { - return getMinimumSize(); - } - - /** - * DEPRECATED - */ - public Dimension minimumSize(int rows, int cols) { - return getMinimumSize(rows, cols); - } - - /** - * DEPRECATED - */ - public Dimension preferredSize(int rows, int cols) { - return getPreferredSize(rows, cols); - } - } diff --git a/jdk/src/windows/classes/sun/awt/windows/WTextComponentPeer.java b/jdk/src/windows/classes/sun/awt/windows/WTextComponentPeer.java index 5d6207d582c..762672ad48b 100644 --- a/jdk/src/windows/classes/sun/awt/windows/WTextComponentPeer.java +++ b/jdk/src/windows/classes/sun/awt/windows/WTextComponentPeer.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1996, 2001, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1996, 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 @@ -38,14 +38,20 @@ class WTextComponentPeer extends WComponentPeer implements TextComponentPeer { // TextComponentPeer implementation + @Override public void setEditable(boolean editable) { enableEditing(editable); setBackground(((TextComponent)target).getBackground()); } + @Override public native String getText(); - public native void setText(String txt); + @Override + public native void setText(String text); + @Override public native int getSelectionStart(); + @Override public native int getSelectionEnd(); + @Override public native void select(int selStart, int selEnd); // Toolkit & peer internals @@ -54,6 +60,7 @@ class WTextComponentPeer extends WComponentPeer implements TextComponentPeer { super(target); } + @Override void initialize() { TextComponent tc = (TextComponent)target; String text = tc.getText(); @@ -64,14 +71,12 @@ class WTextComponentPeer extends WComponentPeer implements TextComponentPeer { select(tc.getSelectionStart(), tc.getSelectionEnd()); setEditable(tc.isEditable()); -// oldSelectionStart = -1; // accessibility support -// oldSelectionEnd = -1; // accessibility support - super.initialize(); } native void enableEditing(boolean e); + @Override public boolean isFocusable() { return true; } @@ -81,6 +86,7 @@ class WTextComponentPeer extends WComponentPeer implements TextComponentPeer { * unfortunately resets the selection, but seems to be the * only way to get this to work. */ + @Override public void setCaretPosition(int pos) { select(pos,pos); } @@ -89,6 +95,7 @@ class WTextComponentPeer extends WComponentPeer implements TextComponentPeer { * Get the caret position by looking up the end of the current * selection. */ + @Override public int getCaretPosition() { return getSelectionStart(); } @@ -105,34 +112,8 @@ class WTextComponentPeer extends WComponentPeer implements TextComponentPeer { */ private static native void initIDs(); - // stub functions: to be fully implemented in a future release - public int getIndexAtPoint(int x, int y) { return -1; } - public Rectangle getCharacterBounds(int i) { return null; } - public long filterEvents(long mask) { return 0; } - + @Override public boolean shouldClearRectBeforePaint() { return false; } - -// -// Accessibility support -// - -/* To be fully implemented in a future release - - int oldSelectionStart; - int oldSelectionEnd; - - public native int getIndexAtPoint(int x, int y); - public native Rectangle getCharacterBounds(int i); - public native long filterEvents(long mask); - - /** - * Handle a change in the text selection endpoints - * (Note: could be simply a change in the caret location) - * - public void selectionValuesChanged(int start, int end) { - return; // Need to write implementation of this. - } -*/ } diff --git a/jdk/src/windows/classes/sun/awt/windows/WTextFieldPeer.java b/jdk/src/windows/classes/sun/awt/windows/WTextFieldPeer.java index 200ac2f036f..387fbfcb80e 100644 --- a/jdk/src/windows/classes/sun/awt/windows/WTextFieldPeer.java +++ b/jdk/src/windows/classes/sun/awt/windows/WTextFieldPeer.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1996, 2006, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1996, 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 @@ -31,16 +31,18 @@ import java.awt.event.ActionEvent; import java.awt.event.KeyEvent; import java.awt.im.InputMethodRequests; -class WTextFieldPeer extends WTextComponentPeer implements TextFieldPeer { +final class WTextFieldPeer extends WTextComponentPeer implements TextFieldPeer { // WComponentPeer overrides + @Override public Dimension getMinimumSize() { FontMetrics fm = getFontMetrics(((TextField)target).getFont()); return new Dimension(fm.stringWidth(getText()) + 24, fm.getHeight() + 8); } + @Override public boolean handleJavaKeyEvent(KeyEvent e) { switch (e.getID()) { case KeyEvent.KEY_TYPED: @@ -56,35 +58,35 @@ class WTextFieldPeer extends WTextComponentPeer implements TextFieldPeer { // TextFieldPeer implementation + @Override + public native void setEchoChar(char echoChar); - /* This should eventually be a direct native method. */ - public void setEchoChar(char c) { - setEchoCharacter(c); - } - + @Override public Dimension getPreferredSize(int cols) { return getMinimumSize(cols); } + @Override public Dimension getMinimumSize(int cols) { FontMetrics fm = getFontMetrics(((TextField)target).getFont()); return new Dimension(fm.charWidth('0') * cols + 24, fm.getHeight() + 8); } + @Override public InputMethodRequests getInputMethodRequests() { - return null; + return null; } - - // Toolkit & peer internals WTextFieldPeer(TextField target) { super(target); } + @Override native void create(WComponentPeer parent); + @Override void initialize() { TextField tf = (TextField)target; if (tf.echoCharIsSet()) { @@ -92,33 +94,4 @@ class WTextFieldPeer extends WTextComponentPeer implements TextFieldPeer { } super.initialize(); } - - // deprecated methods - - /** - * DEPRECATED but, for now, called by setEchoChar(char). - */ - public native void setEchoCharacter(char c); - - /** - * DEPRECATED - */ - public Dimension minimumSize() { - return getMinimumSize(); - } - - /** - * DEPRECATED - */ - public Dimension minimumSize(int cols) { - return getMinimumSize(cols); - } - - /** - * DEPRECATED - */ - public Dimension preferredSize(int cols) { - return getPreferredSize(cols); - } - } diff --git a/jdk/src/windows/native/sun/windows/awt_TextArea.cpp b/jdk/src/windows/native/sun/windows/awt_TextArea.cpp index 829e03a87f4..e37679e1d8b 100644 --- a/jdk/src/windows/native/sun/windows/awt_TextArea.cpp +++ b/jdk/src/windows/native/sun/windows/awt_TextArea.cpp @@ -767,11 +767,11 @@ Java_sun_awt_windows_WTextAreaPeer_create(JNIEnv *env, jobject self, /* * Class: sun_awt_windows_WTextAreaPeer - * Method: replaceText + * Method: replaceRange * Signature: (Ljava/lang/String;II)V */ JNIEXPORT void JNICALL -Java_sun_awt_windows_WTextAreaPeer_replaceText(JNIEnv *env, jobject self, +Java_sun_awt_windows_WTextAreaPeer_replaceRange(JNIEnv *env, jobject self, jstring text, jint start, jint end) { @@ -791,19 +791,4 @@ Java_sun_awt_windows_WTextAreaPeer_replaceText(JNIEnv *env, jobject self, CATCH_BAD_ALLOC; } - -/* - * Class: sun_awt_windows_WTextAreaPeer - * Method: insertText - * Signature: (Ljava/lang/String;I)V - */ -JNIEXPORT void JNICALL -Java_sun_awt_windows_WTextAreaPeer_insertText(JNIEnv *env, jobject self, - jstring text, jint pos) -{ - Java_sun_awt_windows_WTextAreaPeer_replaceText(env, self, text, pos, pos); -} - } /* extern "C" */ - - diff --git a/jdk/src/windows/native/sun/windows/awt_TextComponent.cpp b/jdk/src/windows/native/sun/windows/awt_TextComponent.cpp index eddcbca4088..2475ad64533 100644 --- a/jdk/src/windows/native/sun/windows/awt_TextComponent.cpp +++ b/jdk/src/windows/native/sun/windows/awt_TextComponent.cpp @@ -987,30 +987,6 @@ AwtTextComponent::OleCallback::GetContextMenu(WORD seltype, // Accessibility support // -/* To be fully implemented in a future release - * - * Class: sun_awt_windows_WTextComponentPeer - * Method: getIndexAtPoint - * Signature: (II)I - * -JNIEXPORT jlong JNICALL -Java_sun_awt_windows_WTextComponentPeer_filterEvents(JNIEnv *env, jobject self, jlong mask) -{ - TRY; - - PDATA pData; - JNI_CHECK_PEER_RETURN_NULL(self); - AwtTextComponent* c = (AwtTextComponent*)pData; - - jlong oldMask = c->javaEventsMask; - c->javaEventsMask = mask; - - return oldMask; - - CATCH_BAD_ALLOC_RET(0); -} -*/ - // [[[FIXME]]] need to switch to rich edit field; look for EN_SELCHANGE event instead /* * Handle WmKeyDown to catch keystrokes which may move the caret, @@ -1051,112 +1027,4 @@ MsgRouting AwtTextComponent::WmKeyDown(UINT wkey, UINT repCnt, return AwtComponent::WmKeyDown(wkey, repCnt, flags, system); } */ - -/* To be fully implemented in a future release - * - * Class: sun_awt_windows_WTextComponentPeer - * Method: getIndexAtPoint - * Signature: (II)I - * -JNIEXPORT jint JNICALL -Java_sun_awt_windows_WTextComponentPeer_getIndexAtPoint(JNIEnv *env, jobject self, jint x, jint y) -{ - TRY; - - PDATA pData; -// JNI_CHECK_PEER_RETURN_VAL(self, -1); [[[FIXME]]] Peter Korn -> should return -1 here - JNI_CHECK_PEER_RETURN_NULL(self); - AwtTextComponent* c = (AwtTextComponent*)pData; - int indicies = c->SendMessage(EM_CHARFROMPOS, (WPARAM) 0, (LPARAM) MAKELPARAM(x, y)); - int index = LOWORD(indicies); // index into the line the (x,y) coord is on - int lineIndex = c->SendMessage(EM_LINEINDEX, HIWORD(indicies)); // index of start of line - return (index + lineIndex); - - CATCH_BAD_ALLOC_RET(-1); -} -*/ - -/* To be fully implemented in a future release - * - * Class: sun_awt_windows_WTextComponentPeer - * Method: getCharacterBounds - * Signature: (I)Ljava/awt/Rectangle; - * -JNIEXPORT jobject JNICALL -Java_sun_awt_windows_WTextComponentPeer_getCharacterBounds(JNIEnv *env, jobject self, jint i) -{ - - // loop through lines with EM_LINELENGTH? e.g.: - // line = 0; ttl = 0; // index is passed in as 'i' above - // while (ttl < index) { - // ttl += SendMessage(EM_LINELENGTH, line++); - // } - // line-- (decrement back again) - // alternately, we could use EM_LINEINDEX to the same effect; perhaps slightly cleaner: - // computedIndex = 0; line = 0; - // while (computedIndex < index) { - // computedIndex = SendMessage(EM_LINEINDEX, 1 + line++); - // } - // line--; - - // EM_POSFROMCHAR - convert char index into a Point - // wParam = (LPPOINT) lpPoint; // address of structure - // receiving character position - // lParam = (LPARAM) wCharIndex; // zero-based index of character - // - // still need to turn the above into a Rect somehow... - // (use font metrics on font info for letter to get height? use - // getLineHeight type of message?). - - // WM_GETFONT - get the font struct for the window control - // wParam = lParam = 0 - // returns an HFONT - // -or- - // GetTextMetrics(hDC) to get the text info for the font selected - // into the hDC of the control (tmHeight is what we want in the - // TEXTMETRIC struct). - // also GetCharWidth32() with the char at the index in question to get - // the width of that char - // *** Can't use GetTextMetrics/GetCharWidth32, as we don't have an hDC!! *** - - TRY; - - PDATA pData; - JNI_CHECK_PEER_RETURN_NULL(self); - AwtComponent* c = (AwtComponent*)pData; -/* - int line = 0; - int lineIndex = 0; - while (lineIndex < i) { - lineIndex = c->SendMessage(EM_LINEINDEX, 1 + line++); - } - line--; // line is now the line which contains our character at position 'i' - int offsetIndex = i - lineIndex; // offsetIndex is now distance in on the line -* / - POINT p; - - c->SendMessage(EM_POSFROMCHAR, (WPARAM) &p, (LPARAM) i); // x coord is meaningful; y may not be - - // need to calculate charWidth, charHeight, and set p.y to something meangful - - jint charWidth; - jint charHeight; - -/* - HFONT font = c->SendMessage(WM_GETFONT); - if (GetCharWidth32(c->hdc, i, i, &charWidth) != 0) { // [[[FIXME]]] need to get hDC! - - JNIEnv *env = (JNIEnv *)JNU_GetEnv(jvm, JNI_VERSION_1_2); - jobject rect = JNU_NewObjectByName(env, "java/awt/Rectangle", "(IIII)V", - (jint) p.x, (jint) p.y, charWidth, charHeight); - - return rect; - } -* / - return (jobject) 0; - - CATCH_BAD_ALLOC_RET(0); -} -*/ - } /* extern "C" */ diff --git a/jdk/src/windows/native/sun/windows/awt_TextField.cpp b/jdk/src/windows/native/sun/windows/awt_TextField.cpp index 6ed120d77c6..e5afa4055e5 100644 --- a/jdk/src/windows/native/sun/windows/awt_TextField.cpp +++ b/jdk/src/windows/native/sun/windows/awt_TextField.cpp @@ -316,12 +316,12 @@ Java_sun_awt_windows_WTextFieldPeer_create(JNIEnv *env, jobject self, /* * Class: sun_awt_windows_WTextFieldPeer - * Method: setEchoCharacter + * Method: setEchoChar * Signature: (C)V */ JNIEXPORT void JNICALL -Java_sun_awt_windows_WTextFieldPeer_setEchoCharacter(JNIEnv *env, jobject self, - jchar ch) +Java_sun_awt_windows_WTextFieldPeer_setEchoChar(JNIEnv *env, jobject self, + jchar ch) { TRY; From 23cf2b8885e9144b8c8f1120b67843e5835e1d45 Mon Sep 17 00:00:00 2001 From: Leonid Romanov Date: Wed, 9 Oct 2013 01:03:33 +0400 Subject: [PATCH 102/131] 8004050: [macosx] The 'ESC' key does not work with jdk8 Reviewed-by: alexsch, serb --- .../classes/com/apple/laf/AquaComboBoxUI.java | 36 +++++++++++++------ .../com/apple/laf/AquaKeyBindings.java | 4 +-- 2 files changed, 28 insertions(+), 12 deletions(-) diff --git a/jdk/src/macosx/classes/com/apple/laf/AquaComboBoxUI.java b/jdk/src/macosx/classes/com/apple/laf/AquaComboBoxUI.java index 8e8527f6541..4b9c78b3dcd 100644 --- a/jdk/src/macosx/classes/com/apple/laf/AquaComboBoxUI.java +++ b/jdk/src/macosx/classes/com/apple/laf/AquaComboBoxUI.java @@ -281,12 +281,16 @@ public class AquaComboBoxUI extends BasicComboBoxUI implements Sizeable { actionMap.put("aquaSelectPageUp", highlightPageUpAction); actionMap.put("aquaSelectPageDown", highlightPageDownAction); + actionMap.put("aquaHidePopup", hideAction); + SwingUtilities.replaceUIActionMap(comboBox, actionMap); } - abstract class ComboBoxAction extends AbstractAction { + private abstract class ComboBoxAction extends AbstractAction { public void actionPerformed(final ActionEvent e) { - if (!comboBox.isEnabled() || !comboBox.isShowing()) return; + if (!comboBox.isEnabled() || !comboBox.isShowing()) { + return; + } if (comboBox.isPopupVisible()) { final AquaComboBoxUI ui = (AquaComboBoxUI)comboBox.getUI(); @@ -302,7 +306,7 @@ public class AquaComboBoxUI extends BasicComboBoxUI implements Sizeable { /** * Hilight _but do not select_ the next item in the list. */ - Action highlightNextAction = new ComboBoxAction() { + private Action highlightNextAction = new ComboBoxAction() { @Override public void performComboBoxAction(AquaComboBoxUI ui) { final int si = listBox.getSelectedIndex(); @@ -318,7 +322,7 @@ public class AquaComboBoxUI extends BasicComboBoxUI implements Sizeable { /** * Hilight _but do not select_ the previous item in the list. */ - Action highlightPreviousAction = new ComboBoxAction() { + private Action highlightPreviousAction = new ComboBoxAction() { @Override void performComboBoxAction(final AquaComboBoxUI ui) { final int si = listBox.getSelectedIndex(); @@ -330,7 +334,7 @@ public class AquaComboBoxUI extends BasicComboBoxUI implements Sizeable { } }; - Action highlightFirstAction = new ComboBoxAction() { + private Action highlightFirstAction = new ComboBoxAction() { @Override void performComboBoxAction(final AquaComboBoxUI ui) { listBox.setSelectedIndex(0); @@ -338,7 +342,7 @@ public class AquaComboBoxUI extends BasicComboBoxUI implements Sizeable { } }; - Action highlightLastAction = new ComboBoxAction() { + private Action highlightLastAction = new ComboBoxAction() { @Override void performComboBoxAction(final AquaComboBoxUI ui) { final int size = listBox.getModel().getSize(); @@ -347,7 +351,7 @@ public class AquaComboBoxUI extends BasicComboBoxUI implements Sizeable { } }; - Action highlightPageUpAction = new ComboBoxAction() { + private Action highlightPageUpAction = new ComboBoxAction() { @Override void performComboBoxAction(final AquaComboBoxUI ui) { final int current = listBox.getSelectedIndex(); @@ -367,7 +371,7 @@ public class AquaComboBoxUI extends BasicComboBoxUI implements Sizeable { } }; - Action highlightPageDownAction = new ComboBoxAction() { + private Action highlightPageDownAction = new ComboBoxAction() { @Override void performComboBoxAction(final AquaComboBoxUI ui) { final int current = listBox.getSelectedIndex(); @@ -482,13 +486,13 @@ public class AquaComboBoxUI extends BasicComboBoxUI implements Sizeable { // This is somewhat messy. The difference here from BasicComboBoxUI.EnterAction is that // arrow up or down does not automatically select the - static final Action triggerSelectionAction = new AbstractAction() { + private static final Action triggerSelectionAction = new AbstractAction() { public void actionPerformed(final ActionEvent e) { triggerSelectionEvent((JComboBox)e.getSource(), e); } }; - static final Action toggleSelectionAction = new AbstractAction() { + private static final Action toggleSelectionAction = new AbstractAction() { public void actionPerformed(final ActionEvent e) { final JComboBox comboBox = (JComboBox)e.getSource(); if (!comboBox.isEnabled()) return; @@ -506,6 +510,18 @@ public class AquaComboBoxUI extends BasicComboBoxUI implements Sizeable { } }; + private static Action hideAction = new AbstractAction() { + @Override + public void actionPerformed(final ActionEvent e) { + final JComboBox comboBox = (JComboBox)e.getSource(); + + if (comboBox.isPopupVisible()) { + comboBox.firePopupMenuCanceled(); + comboBox.setPopupVisible(false); + } + } + }; + public void applySizeFor(final JComponent c, final Size size) { if (arrowButton == null) return; final Border border = arrowButton.getBorder(); diff --git a/jdk/src/macosx/classes/com/apple/laf/AquaKeyBindings.java b/jdk/src/macosx/classes/com/apple/laf/AquaKeyBindings.java index 88db59f0b9f..98048262b80 100644 --- a/jdk/src/macosx/classes/com/apple/laf/AquaKeyBindings.java +++ b/jdk/src/macosx/classes/com/apple/laf/AquaKeyBindings.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -209,7 +209,7 @@ public class AquaKeyBindings { LateBoundInputMap getComboBoxInputMap() { return new LateBoundInputMap(new SimpleBinding(new String[] { - "ESCAPE", "hidePopup", + "ESCAPE", "aquaHidePopup", "PAGE_UP", "aquaSelectPageUp", "PAGE_DOWN", "aquaSelectPageDown", "HOME", "aquaSelectHome", From 68b9f08d492b18d2473a3b4638b15285d41257f5 Mon Sep 17 00:00:00 2001 From: Alan Bateman Date: Fri, 11 Oct 2013 20:47:15 +0100 Subject: [PATCH 103/131] 8019526: (fs) Files.lines, etc without Charset parameter Reviewed-by: psandoz, henryjen --- .../share/classes/java/nio/file/Files.java | 196 ++++++- .../java/nio/file/Files/BytesAndLines.java | 480 ++++++++++-------- jdk/test/java/nio/file/Files/StreamTest.java | 83 +-- 3 files changed, 501 insertions(+), 258 deletions(-) diff --git a/jdk/src/share/classes/java/nio/file/Files.java b/jdk/src/share/classes/java/nio/file/Files.java index 01629442af4..920ac93d097 100644 --- a/jdk/src/share/classes/java/nio/file/Files.java +++ b/jdk/src/share/classes/java/nio/file/Files.java @@ -43,9 +43,10 @@ import java.nio.channels.SeekableByteChannel; import java.nio.charset.Charset; import java.nio.charset.CharsetDecoder; import java.nio.charset.CharsetEncoder; +import java.nio.charset.StandardCharsets; import java.nio.file.attribute.BasicFileAttributeView; import java.nio.file.attribute.BasicFileAttributes; -import java.nio.file.attribute.DosFileAttributes; +import java.nio.file.attribute.DosFileAttributes; // javadoc import java.nio.file.attribute.FileAttribute; import java.nio.file.attribute.FileAttributeView; import java.nio.file.attribute.FileOwnerAttributeView; @@ -104,8 +105,7 @@ public final class Files { return () -> { try { c.close(); - } - catch (IOException e) { + } catch (IOException e) { throw new UncheckedIOException(e); } }; @@ -2550,7 +2550,7 @@ public final class Files { * checkExec} is invoked to check execute access to the file. */ public static boolean isExecutable(Path path) { - return isAccessible(path, AccessMode.EXECUTE); + return isAccessible(path, AccessMode.EXECUTE); } // -- Recursive operations -- @@ -2782,6 +2782,37 @@ public final class Files { return new BufferedReader(reader); } + /** + * Opens a file for reading, returning a {@code BufferedReader} to read text + * from the file in an efficient manner. Bytes from the file are decoded into + * characters using the {@link StandardCharsets#UTF_8 UTF-8} {@link Charset + * charset}. + * + *

          This method works as if invoking it were equivalent to evaluating the + * expression: + *

          {@code
          +     * Files.newBufferedReader(path, StandardCharsets.UTF_8)
          +     * }
          + * + * @param path + * the path to the file + * + * @return a new buffered reader, with default buffer size, to read text + * from the file + * + * @throws IOException + * if an I/O error occurs opening the file + * @throws SecurityException + * In the case of the default provider, and a security manager is + * installed, the {@link SecurityManager#checkRead(String) checkRead} + * method is invoked to check read access to the file. + * + * @since 1.8 + */ + public static BufferedReader newBufferedReader(Path path) throws IOException { + return newBufferedReader(path, StandardCharsets.UTF_8); + } + /** * Opens or creates a file for writing, returning a {@code BufferedWriter} * that may be used to write text to the file in an efficient manner. @@ -2827,6 +2858,41 @@ public final class Files { return new BufferedWriter(writer); } + /** + * Opens or creates a file for writing, returning a {@code BufferedWriter} + * to write text to the file in an efficient manner. The text is encoded + * into bytes for writing using the {@link StandardCharsets#UTF_8 UTF-8} + * {@link Charset charset}. + * + *

          This method works as if invoking it were equivalent to evaluating the + * expression: + *

          {@code
          +     * Files.newBufferedWriter(path, StandardCharsets.UTF_8, options)
          +     * }
          + * + * @param path + * the path to the file + * @param options + * options specifying how the file is opened + * + * @return a new buffered writer, with default buffer size, to write text + * to the file + * + * @throws IOException + * if an I/O error occurs opening or creating the file + * @throws UnsupportedOperationException + * if an unsupported option is specified + * @throws SecurityException + * In the case of the default provider, and a security manager is + * installed, the {@link SecurityManager#checkWrite(String) checkWrite} + * method is invoked to check write access to the file. + * + * @since 1.8 + */ + public static BufferedWriter newBufferedWriter(Path path, OpenOption... options) throws IOException { + return newBufferedWriter(path, StandardCharsets.UTF_8, options); + } + /** * Reads all bytes from an input stream and writes them to an output stream. */ @@ -3025,9 +3091,7 @@ public final class Files { * @throws OutOfMemoryError * if an array of the required size cannot be allocated */ - private static byte[] read(InputStream source, int initialSize) - throws IOException - { + private static byte[] read(InputStream source, int initialSize) throws IOException { int capacity = initialSize; byte[] buf = new byte[capacity]; int nread = 0; @@ -3131,9 +3195,7 @@ public final class Files { * * @see #newBufferedReader */ - public static List readAllLines(Path path, Charset cs) - throws IOException - { + public static List readAllLines(Path path, Charset cs) throws IOException { try (BufferedReader reader = newBufferedReader(path, cs)) { List result = new ArrayList<>(); for (;;) { @@ -3146,6 +3208,37 @@ public final class Files { } } + /** + * Read all lines from a file. Bytes from the file are decoded into characters + * using the {@link StandardCharsets#UTF_8 UTF-8} {@link Charset charset}. + * + *

          This method works as if invoking it were equivalent to evaluating the + * expression: + *

          {@code
          +     * Files.readAllLines(path, StandardCharsets.UTF_8)
          +     * }
          + * + * @param path + * the path to the file + * + * @return the lines from the file as a {@code List}; whether the {@code + * List} is modifiable or not is implementation dependent and + * therefore not specified + * + * @throws IOException + * if an I/O error occurs reading from the file or a malformed or + * unmappable byte sequence is read + * @throws SecurityException + * In the case of the default provider, and a security manager is + * installed, the {@link SecurityManager#checkRead(String) checkRead} + * method is invoked to check read access to the file. + * + * @since 1.8 + */ + public static List readAllLines(Path path) throws IOException { + return readAllLines(path, StandardCharsets.UTF_8); + } + /** * Writes bytes to a file. The {@code options} parameter specifies how the * the file is created or opened. If no options are present then this method @@ -3262,6 +3355,45 @@ public final class Files { return path; } + /** + * Write lines of text to a file. Characters are encoded into bytes using + * the {@link StandardCharsets#UTF_8 UTF-8} {@link Charset charset}. + * + *

          This method works as if invoking it were equivalent to evaluating the + * expression: + *

          {@code
          +     * Files.write(path, lines, StandardCharsets.UTF_8, options);
          +     * }
          + * + * @param path + * the path to the file + * @param lines + * an object to iterate over the char sequences + * @param options + * options specifying how the file is opened + * + * @return the path + * + * @throws IOException + * if an I/O error occurs writing to or creating the file, or the + * text cannot be encoded as {@code UTF-8} + * @throws UnsupportedOperationException + * if an unsupported option is specified + * @throws SecurityException + * In the case of the default provider, and a security manager is + * installed, the {@link SecurityManager#checkWrite(String) checkWrite} + * method is invoked to check write access to the file. + * + * @since 1.8 + */ + public static Path write(Path path, + Iterable lines, + OpenOption... options) + throws IOException + { + return write(path, lines, StandardCharsets.UTF_8, options); + } + // -- Stream APIs -- /** @@ -3431,9 +3563,11 @@ public final class Files { * if an I/O error is thrown when accessing the starting file. * @since 1.8 */ - public static Stream walk(Path start, int maxDepth, + public static Stream walk(Path start, + int maxDepth, FileVisitOption... options) - throws IOException { + throws IOException + { FileTreeIterator iterator = new FileTreeIterator(start, maxDepth, options); try { return StreamSupport.stream(Spliterators.spliteratorUnknownSize(iterator, Spliterator.DISTINCT), false) @@ -3484,9 +3618,7 @@ public final class Files { * @see #walk(Path, int, FileVisitOption...) * @since 1.8 */ - public static Stream walk(Path start, - FileVisitOption... options) - throws IOException { + public static Stream walk(Path start, FileVisitOption... options) throws IOException { return walk(start, Integer.MAX_VALUE, options); } @@ -3547,7 +3679,8 @@ public final class Files { int maxDepth, BiPredicate matcher, FileVisitOption... options) - throws IOException { + throws IOException + { FileTreeIterator iterator = new FileTreeIterator(start, maxDepth, options); try { return StreamSupport.stream(Spliterators.spliteratorUnknownSize(iterator, Spliterator.DISTINCT), false) @@ -3561,7 +3694,7 @@ public final class Files { } /** - * Read all lines from a file as a {@code Stream}. Unlike {@link + * Read all lines from a file as a {@code Stream}. Unlike {@link * #readAllLines(Path, Charset) readAllLines}, this method does not read * all lines into a {@code List}, but instead populates lazily as the stream * is consumed. @@ -3619,4 +3752,33 @@ public final class Files { throw e; } } + + /** + * Read all lines from a file as a {@code Stream}. Bytes from the file are + * decoded into characters using the {@link StandardCharsets#UTF_8 UTF-8} + * {@link Charset charset}. + * + *

          This method works as if invoking it were equivalent to evaluating the + * expression: + *

          {@code
          +     * Files.lines(path, StandardCharsets.UTF_8)
          +     * }
          + * + * @param path + * the path to the file + * + * @return the lines from the file as a {@code Stream} + * + * @throws IOException + * if an I/O error occurs opening the file + * @throws SecurityException + * In the case of the default provider, and a security manager is + * installed, the {@link SecurityManager#checkRead(String) checkRead} + * method is invoked to check read access to the file. + * + * @since 1.8 + */ + public static Stream lines(Path path) throws IOException { + return lines(path, StandardCharsets.UTF_8); + } } diff --git a/jdk/test/java/nio/file/Files/BytesAndLines.java b/jdk/test/java/nio/file/Files/BytesAndLines.java index 6c36c121afe..c3a1db74ce1 100644 --- a/jdk/test/java/nio/file/Files/BytesAndLines.java +++ b/jdk/test/java/nio/file/Files/BytesAndLines.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -22,262 +22,318 @@ */ /* @test - * @bug 7006126 8020669 8024788 + * @bug 7006126 8020669 8024788 8019526 * @build BytesAndLines PassThroughFileSystem - * @run main BytesAndLines + * @run testng BytesAndLines * @summary Unit test for methods for Files readAllBytes, readAllLines and * and write methods. */ -import java.nio.file.*; -import static java.nio.file.Files.*; -import java.io.*; -import java.util.*; -import java.nio.charset.*; +import java.nio.ByteBuffer; +import java.nio.CharBuffer; +import java.nio.file.Files; +import java.nio.file.Path; +import java.nio.file.Paths; +import java.nio.file.OpenOption; +import static java.nio.file.StandardOpenOption.*; +import java.nio.charset.Charset; +import java.nio.charset.CharacterCodingException; +import java.nio.charset.MalformedInputException; +import java.nio.charset.UnmappableCharacterException; +import static java.nio.charset.StandardCharsets.*; +import java.util.Arrays; +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; +import java.util.Random; +import java.util.concurrent.Callable; +import java.io.IOException; +import org.testng.annotations.AfterClass; +import org.testng.annotations.BeforeClass; +import org.testng.annotations.Test; +import static org.testng.Assert.*; + +@Test(groups = "unit") public class BytesAndLines { - static final Random rand = new Random(); - static final Charset US_ASCII = Charset.forName("US-ASCII"); + // data for text files + private static final String EN_STRING = "The quick brown fox jumps over the lazy dog"; + private static final String JA_STRING = "\u65e5\u672c\u8a9e\u6587\u5b57\u5217"; - public static void main(String[] args) throws IOException { - testReadAndWriteBytes(); - testReadLines(); - testWriteLines(); + // used for random byte content + private static Random RAND = new Random(); + + // file used by most tests + private Path tmpfile; + + @BeforeClass + void setup() throws IOException { + tmpfile = Files.createTempFile("blah", null); + } + + @AfterClass + void cleanup() throws IOException { + Files.deleteIfExists(tmpfile); } /** - * Test readAllBytes(Path) and write(Path, byte[], OpenOption...) + * Returns a byte[] of the given size with random content */ - static void testReadAndWriteBytes() throws IOException { - // exercise methods with various sizes - testReadAndWriteBytes(0); - for (int i=0; i<100; i++) { - testReadAndWriteBytes(rand.nextInt(32000)); - } + private byte[] genBytes(int size) { + byte[] arr = new byte[size]; + RAND.nextBytes(arr); + return arr; + } - // NullPointerException + /** + * Exercise NullPointerException + */ + public void testNulls() { Path file = Paths.get("foo"); + byte[] bytes = new byte[100]; List lines = Collections.emptyList(); - try { - readAllBytes(null); - throw new RuntimeException("NullPointerException expected"); - } catch (NullPointerException ignore) { } - try { - write(null, lines, Charset.defaultCharset()); - throw new RuntimeException("NullPointerException expected"); - } catch (NullPointerException ignore) { } - try { - write(file, null, Charset.defaultCharset()); - throw new RuntimeException("NullPointerException expected"); - } catch (NullPointerException ignore) { } - try { - write(file, lines, null); - throw new RuntimeException("NullPointerException expected"); - } catch (NullPointerException ignore) { } - try { - write(file, lines, Charset.defaultCharset(), (OpenOption[])null); - throw new RuntimeException("NullPointerException expected"); - } catch (NullPointerException ignore) { } - try { - OpenOption[] opts = { null }; - write(file, lines, Charset.defaultCharset(), opts); - throw new RuntimeException("NullPointerException expected"); - } catch (NullPointerException ignore) { } + checkNullPointerException(() -> Files.readAllBytes(null)); + + checkNullPointerException(() -> Files.write(null, bytes)); + checkNullPointerException(() -> Files.write(file, (byte[])null)); + checkNullPointerException(() -> Files.write(file, bytes, (OpenOption[])null)); + checkNullPointerException(() -> Files.write(file, bytes, new OpenOption[] { null } )); + + checkNullPointerException(() -> Files.readAllLines(null)); + checkNullPointerException(() -> Files.readAllLines(file, (Charset)null)); + checkNullPointerException(() -> Files.readAllLines(null, Charset.defaultCharset())); + + checkNullPointerException(() -> Files.write(null, lines)); + checkNullPointerException(() -> Files.write(file, (List)null)); + checkNullPointerException(() -> Files.write(file, lines, (OpenOption[])null)); + checkNullPointerException(() -> Files.write(file, lines, new OpenOption[] { null } )); + checkNullPointerException(() -> Files.write(null, lines, Charset.defaultCharset())); + checkNullPointerException(() -> Files.write(file, null, Charset.defaultCharset())); + checkNullPointerException(() -> Files.write(file, lines, (Charset)null)); + checkNullPointerException(() -> Files.write(file, lines, Charset.defaultCharset(), (OpenOption[])null)); + checkNullPointerException(() -> Files.write(file, lines, Charset.defaultCharset(), new OpenOption[] { null } )); + } + + private void checkNullPointerException(Callable c) { + try { + c.call(); + fail("NullPointerException expected"); + } catch (NullPointerException ignore) { + } catch (Exception e) { + fail(e + " not expected"); + } + } + + /** + * Exercise Files.readAllBytes(Path) on varied file sizes + */ + public void testReadAllBytes() throws IOException { + int size = 0; + while (size <= 16*1024) { + testReadAllBytes(size); + size += 512; + } + } + + private void testReadAllBytes(int size) throws IOException { + // write bytes to file (random content) + byte[] expected = genBytes(size); + Files.write(tmpfile, expected); + + // check expected bytes are read + byte[] read = Files.readAllBytes(tmpfile); + assertTrue(Arrays.equals(read, expected), "Bytes read not the same as written"); + } + + /** + * Linux specific test to exercise Files.readAllBytes on /proc. This is + * special because file sizes are reported as 0 even though the file + * has content. + */ + public void testReadAllBytesOnProcFS() throws IOException { // read from procfs if (System.getProperty("os.name").equals("Linux")) { - // Refer to the Linux proc(5) man page for details about /proc/self/stat file - // procfs reports it to be zero sized, even though data can be read from it - String statFile = "/proc/self/stat"; - Path pathStat = Paths.get(statFile); - byte[] data = Files.readAllBytes(pathStat); + Path statFile = Paths.get("/proc/self/stat"); + byte[] data = Files.readAllBytes(statFile); assertTrue(data.length > 0, "Files.readAllBytes('" + statFile + "') failed to read"); } - - // test readAllBytes on custom file system - Path myfile = PassThroughFileSystem.create().getPath(file.toString()); - for (int size=0; size<=1024; size+=512) { - byte[] b1 = new byte[size]; - rand.nextBytes(b1); - Files.write(myfile, b1); - byte[] b2 = Files.readAllBytes(myfile); - assertTrue(Arrays.equals(b1, b2), "bytes not equal"); - } } - - static void testReadAndWriteBytes(int size) throws IOException { - Path path = createTempFile("blah", null); + /** + * Exercise Files.readAllBytes(Path) on custom file system. This is special + * because readAllBytes was originally implemented to use FileChannel + * and so may not be supported by custom file system providers. + */ + public void testReadAllBytesOnCustomFS() throws IOException { + Path myfile = PassThroughFileSystem.create().getPath("myfile"); try { - boolean append = rand.nextBoolean(); - - byte[] b1 = new byte[size]; - rand.nextBytes(b1); - - byte[] b2 = (append) ? new byte[size] : new byte[0]; - rand.nextBytes(b2); - - // write method should create file if it doesn't exist - if (rand.nextBoolean()) - delete(path); - - // write bytes to file - Path target = write(path, b1); - assertTrue(target==path, "Unexpected path"); - assertTrue(size(path) == b1.length, "Unexpected file size"); - - // append bytes to file (might be 0 bytes) - write(path, b2, StandardOpenOption.APPEND); - assertTrue(size(path) == b1.length + b2.length, "Unexpected file size"); - - // read entire file - byte[] read = readAllBytes(path); - - // check bytes are correct - byte[] expected; - if (append) { - expected = new byte[b1.length + b2.length]; - System.arraycopy(b1, 0, expected, 0, b1.length); - System.arraycopy(b2, 0, expected, b1.length, b2.length); - } else { - expected = b1; + int size = 0; + while (size <= 1024) { + byte[] b1 = genBytes(size); + Files.write(myfile, b1); + byte[] b2 = Files.readAllBytes(myfile); + assertTrue(Arrays.equals(b1, b2), "bytes not equal"); + size += 512; } - assertTrue(Arrays.equals(read, expected), - "Bytes read not the same as bytes written"); } finally { - deleteIfExists(path); + Files.deleteIfExists(myfile); } } /** - * Test readAllLines(Path,Charset) + * Exercise Files.write(Path, byte[], OpenOption...) on various sizes */ - static void testReadLines() throws IOException { - Path tmpfile = createTempFile("blah", "txt"); - try { - List lines; + public void testWriteBytes() throws IOException { + int size = 0; + while (size < 16*1024) { + testWriteBytes(size, false); + testWriteBytes(size, true); + size += 512; + } + } - // zero lines - assertTrue(size(tmpfile) == 0, "File should be empty"); - lines = readAllLines(tmpfile, US_ASCII); + private void testWriteBytes(int size, boolean append) throws IOException { + byte[] bytes = genBytes(size); + Path result = Files.write(tmpfile, bytes); + assertTrue(result == tmpfile); + if (append) { + Files.write(tmpfile, bytes, APPEND); + assertTrue(Files.size(tmpfile) == size*2); + } + + byte[] expected; + if (append) { + expected = new byte[size << 1]; + System.arraycopy(bytes, 0, expected, 0, bytes.length); + System.arraycopy(bytes, 0, expected, bytes.length, bytes.length); + } else { + expected = bytes; + } + + byte[] read = Files.readAllBytes(tmpfile); + assertTrue(Arrays.equals(read, expected), "Bytes read not the same as written"); + } + + /** + * Exercise Files.readAllLines(Path, Charset) + */ + public void testReadAllLines() throws IOException { + // zero lines + Files.write(tmpfile, new byte[0]); + List lines = Files.readAllLines(tmpfile, US_ASCII); assertTrue(lines.isEmpty(), "No line expected"); - // one line - byte[] hi = { (byte)'h', (byte)'i' }; - write(tmpfile, hi); - lines = readAllLines(tmpfile, US_ASCII); - assertTrue(lines.size() == 1, "One line expected"); - assertTrue(lines.get(0).equals("hi"), "'Hi' expected"); + // one line + byte[] hi = { (byte)'h', (byte)'i' }; + Files.write(tmpfile, hi); + lines = Files.readAllLines(tmpfile, US_ASCII); + assertTrue(lines.size() == 1, "One line expected"); + assertTrue(lines.get(0).equals("hi"), "'Hi' expected"); - // two lines using platform's line separator - List expected = Arrays.asList("hi", "there"); - write(tmpfile, expected, US_ASCII); - assertTrue(size(tmpfile) > 0, "File is empty"); - lines = readAllLines(tmpfile, US_ASCII); - assertTrue(lines.equals(expected), "Unexpected lines"); + // two lines using platform's line separator + List expected = Arrays.asList("hi", "there"); + Files.write(tmpfile, expected, US_ASCII); + assertTrue(Files.size(tmpfile) > 0, "File is empty"); + lines = Files.readAllLines(tmpfile, US_ASCII); + assertTrue(lines.equals(expected), "Unexpected lines"); - // MalformedInputException - byte[] bad = { (byte)0xff, (byte)0xff }; - write(tmpfile, bad); - try { - readAllLines(tmpfile, US_ASCII); - throw new RuntimeException("MalformedInputException expected"); - } catch (MalformedInputException ignore) { } + // MalformedInputException + byte[] bad = { (byte)0xff, (byte)0xff }; + Files.write(tmpfile, bad); + try { + Files.readAllLines(tmpfile, US_ASCII); + fail("MalformedInputException expected"); + } catch (MalformedInputException ignore) { } + } - - // NullPointerException - try { - readAllLines(null, US_ASCII); - throw new RuntimeException("NullPointerException expected"); - } catch (NullPointerException ignore) { } - try { - readAllLines(tmpfile, null); - throw new RuntimeException("NullPointerException expected"); - } catch (NullPointerException ignore) { } - - // read from procfs - if (System.getProperty("os.name").equals("Linux")) { - // Refer to the Linux proc(5) man page for details about /proc/self/status file - // procfs reports this file to be zero sized, even though data can be read from it - String statusFile = "/proc/self/status"; - Path pathStatus = Paths.get(statusFile); - lines = Files.readAllLines(pathStatus, US_ASCII); - assertTrue(lines.size() > 0, "Files.readAllLines('" + pathStatus + "') failed to read"); - } - - } finally { - delete(tmpfile); + /** + * Linux specific test to exercise Files.readAllLines(Path) on /proc. This + * is special because file sizes are reported as 0 even though the file + * has content. + */ + public void testReadAllLinesOnProcFS() throws IOException { + if (System.getProperty("os.name").equals("Linux")) { + Path statFile = Paths.get("/proc/self/stat"); + List lines = Files.readAllLines(statFile); + assertTrue(lines.size() > 0, "Files.readAllLines('" + statFile + "') failed to read"); } } /** - * Test write(Path,Iterable,Charset,OpenOption...) + * Exercise Files.readAllLines(Path) */ - static void testWriteLines() throws IOException { - Path tmpfile = createTempFile("blah", "txt"); - try { - // write method should create file if it doesn't exist - if (rand.nextBoolean()) - delete(tmpfile); + public void testReadAllLinesUTF8() throws IOException { + Files.write(tmpfile, encodeAsUTF8(EN_STRING + "\n" + JA_STRING)); - // zero lines - Path result = write(tmpfile, Collections.emptyList(), US_ASCII); - assert(size(tmpfile) == 0); - assert(result == tmpfile); + List lines = Files.readAllLines(tmpfile); + assertTrue(lines.size() == 2, "Read " + lines.size() + " lines instead of 2"); + assertTrue(lines.get(0).equals(EN_STRING)); + assertTrue(lines.get(1).equals(JA_STRING)); - // two lines - List lines = Arrays.asList("hi", "there"); - write(tmpfile, lines, US_ASCII); - List actual = readAllLines(tmpfile, US_ASCII); - assertTrue(actual.equals(lines), "Unexpected lines"); - - // append two lines - write(tmpfile, lines, US_ASCII, StandardOpenOption.APPEND); - List expected = new ArrayList(); - expected.addAll(lines); - expected.addAll(lines); - assertTrue(expected.size() == 4, "List should have 4 elements"); - actual = readAllLines(tmpfile, US_ASCII); - assertTrue(actual.equals(expected), "Unexpected lines"); - - // UnmappableCharacterException - try { - String s = "\u00A0\u00A1"; - write(tmpfile, Arrays.asList(s), US_ASCII); - throw new RuntimeException("UnmappableCharacterException expected"); - } catch (UnmappableCharacterException ignore) { } - - // NullPointerException - try { - write(null, lines, US_ASCII); - throw new RuntimeException("NullPointerException expected"); - } catch (NullPointerException ignore) { } - try { - write(tmpfile, null, US_ASCII); - throw new RuntimeException("NullPointerException expected"); - } catch (NullPointerException ignore) { } - try { - write(tmpfile, lines, null); - throw new RuntimeException("NullPointerException expected"); - } catch (NullPointerException ignore) { } - try { - write(tmpfile, lines, US_ASCII, (OpenOption[])null); - throw new RuntimeException("NullPointerException expected"); - } catch (NullPointerException ignore) { } - try { - OpenOption[] opts = { (OpenOption)null }; - write(tmpfile, lines, US_ASCII, opts); - throw new RuntimeException("NullPointerException expected"); - } catch (NullPointerException ignore) { } - - } finally { - delete(tmpfile); - } + // a sample of malformed sequences + testReadAllLinesMalformedUTF8((byte)0xFF); // one-byte sequence + testReadAllLinesMalformedUTF8((byte)0xC0, (byte)0x80); // invalid first byte + testReadAllLinesMalformedUTF8((byte)0xC2, (byte)0x00); // invalid second byte } - static void assertTrue(boolean expr, String errmsg) { - if (!expr) - throw new RuntimeException(errmsg); + private byte[] encodeAsUTF8(String s) throws CharacterCodingException { + // not using s.getBytes here so as to catch unmappable characters + ByteBuffer bb = UTF_8.newEncoder().encode(CharBuffer.wrap(s)); + byte[] result = new byte[bb.limit()]; + bb.get(result); + assertTrue(bb.remaining() == 0); + return result; + } + + private void testReadAllLinesMalformedUTF8(byte... bytes) throws IOException { + Files.write(tmpfile, bytes); + try { + Files.readAllLines(tmpfile); + fail("MalformedInputException expected"); + } catch (MalformedInputException ignore) { } + } + + /** + * Exercise Files.write(Path, Iterable, Charset, OpenOption...) + */ + public void testWriteLines() throws IOException { + // zero lines + Path result = Files.write(tmpfile, Collections.emptyList(), US_ASCII); + assert(Files.size(tmpfile) == 0); + assert(result == tmpfile); + + // two lines + List lines = Arrays.asList("hi", "there"); + Files.write(tmpfile, lines, US_ASCII); + List actual = Files.readAllLines(tmpfile, US_ASCII); + assertTrue(actual.equals(lines), "Unexpected lines"); + + // append two lines + Files.write(tmpfile, lines, US_ASCII, APPEND); + List expected = new ArrayList<>(); + expected.addAll(lines); + expected.addAll(lines); + assertTrue(expected.size() == 4, "List should have 4 elements"); + actual = Files.readAllLines(tmpfile, US_ASCII); + assertTrue(actual.equals(expected), "Unexpected lines"); + + // UnmappableCharacterException + try { + String s = "\u00A0\u00A1"; + Files.write(tmpfile, Arrays.asList(s), US_ASCII); + fail("UnmappableCharacterException expected"); + } catch (UnmappableCharacterException ignore) { } + } + + /** + * Exercise Files.write(Path, Iterable, OpenOption...) + */ + public void testWriteLinesUTF8() throws IOException { + List lines = Arrays.asList(EN_STRING, JA_STRING); + Files.write(tmpfile, lines); + List actual = Files.readAllLines(tmpfile, UTF_8); + assertTrue(actual.equals(lines), "Unexpected lines"); } } diff --git a/jdk/test/java/nio/file/Files/StreamTest.java b/jdk/test/java/nio/file/Files/StreamTest.java index 5304492f1db..839b11f9ca5 100644 --- a/jdk/test/java/nio/file/Files/StreamTest.java +++ b/jdk/test/java/nio/file/Files/StreamTest.java @@ -22,11 +22,10 @@ */ /* @test - * @bug 8006884 - * @summary Unit test for java.nio.file.Files - * @library .. + * @bug 8006884 8019526 * @build PassThroughFileSystem FaultyFileSystem * @run testng StreamTest + * @summary Unit test for java.nio.file.Files methods that return a Stream */ import java.io.IOException; @@ -43,11 +42,13 @@ import java.nio.file.Path; import java.nio.file.Paths; import java.nio.file.attribute.BasicFileAttributes; import java.util.Arrays; +import java.util.Collections; import java.util.Iterator; import java.util.List; import java.util.Objects; import java.util.Set; import java.util.TreeSet; +import java.util.concurrent.Callable; import java.util.function.BiPredicate; import java.util.stream.Stream; import java.util.stream.Collectors; @@ -316,56 +317,80 @@ public class StreamTest { try { // zero lines assertTrue(Files.size(tmpfile) == 0, "File should be empty"); + try (Stream s = Files.lines(tmpfile)) { + checkLines(s, Collections.emptyList()); + } try (Stream s = Files.lines(tmpfile, US_ASCII)) { - assertEquals(s.mapToInt(l -> 1).reduce(0, Integer::sum), 0, "No line expected"); + checkLines(s, Collections.emptyList()); } // one line - byte[] hi = { (byte)'h', (byte)'i' }; - Files.write(tmpfile, hi); + List oneLine = Arrays.asList("hi"); + Files.write(tmpfile, oneLine, US_ASCII); + try (Stream s = Files.lines(tmpfile)) { + checkLines(s, oneLine); + } try (Stream s = Files.lines(tmpfile, US_ASCII)) { - List lines = s.collect(Collectors.toList()); - assertTrue(lines.size() == 1, "One line expected"); - assertTrue(lines.get(0).equals("hi"), "'Hi' expected"); + checkLines(s, oneLine); } // two lines using platform's line separator - List expected = Arrays.asList("hi", "there"); - Files.write(tmpfile, expected, US_ASCII); - assertTrue(Files.size(tmpfile) > 0, "File is empty"); + List twoLines = Arrays.asList("hi", "there"); + Files.write(tmpfile, twoLines, US_ASCII); + try (Stream s = Files.lines(tmpfile)) { + checkLines(s, twoLines); + } try (Stream s = Files.lines(tmpfile, US_ASCII)) { - List lines = s.collect(Collectors.toList()); - assertTrue(lines.equals(expected), "Unexpected lines"); + checkLines(s, twoLines); } // MalformedInputException byte[] bad = { (byte)0xff, (byte)0xff }; Files.write(tmpfile, bad); + try (Stream s = Files.lines(tmpfile)) { + checkMalformedInputException(s); + } try (Stream s = Files.lines(tmpfile, US_ASCII)) { - try { - List lines = s.collect(Collectors.toList()); - throw new RuntimeException("UncheckedIOException expected"); - } catch (UncheckedIOException ex) { - assertTrue(ex.getCause() instanceof MalformedInputException, - "MalformedInputException expected"); - } + checkMalformedInputException(s); } // NullPointerException - try { - Files.lines(null, US_ASCII); - throw new RuntimeException("NullPointerException expected"); - } catch (NullPointerException ignore) { } - try { - Files.lines(tmpfile, null); - throw new RuntimeException("NullPointerException expected"); - } catch (NullPointerException ignore) { } + checkNullPointerException(() -> Files.lines(null)); + checkNullPointerException(() -> Files.lines(null, US_ASCII)); + checkNullPointerException(() -> Files.lines(tmpfile, null)); } finally { Files.delete(tmpfile); } } + private void checkLines(Stream s, List expected) { + List lines = s.collect(Collectors.toList()); + assertTrue(lines.size() == expected.size(), "Unexpected number of lines"); + assertTrue(lines.equals(expected), "Unexpected content"); + } + + private void checkMalformedInputException(Stream s) { + try { + List lines = s.collect(Collectors.toList()); + fail("UncheckedIOException expected"); + } catch (UncheckedIOException ex) { + IOException cause = ex.getCause(); + assertTrue(cause instanceof MalformedInputException, + "MalformedInputException expected"); + } + } + + private void checkNullPointerException(Callable c) { + try { + c.call(); + fail("NullPointerException expected"); + } catch (NullPointerException ignore) { + } catch (Exception e) { + fail(e + " not expected"); + } + } + public void testDirectoryIteratorException() throws IOException { Path dir = testFolder.resolve("dir2"); Path trigger = dir.resolve("DirectoryIteratorException"); From 1e73553e8c83a6b55aaf79466734de0a4badb041 Mon Sep 17 00:00:00 2001 From: Karen Kinnear Date: Fri, 11 Oct 2013 15:21:23 -0700 Subject: [PATCH 104/131] 8026213: Reflection support for private interface methods Reviewed-by: forax, psandoz, dholmes, jfranck --- .../sun/reflect/AccessorGenerator.java | 4 + .../sun/reflect/MethodAccessorGenerator.java | 12 +- .../TestPrivateInterfaceMethodReflect.java | 122 ++++++++++++++++++ 3 files changed, 134 insertions(+), 4 deletions(-) create mode 100644 jdk/test/java/lang/reflect/Method/invoke/TestPrivateInterfaceMethodReflect.java diff --git a/jdk/src/share/classes/sun/reflect/AccessorGenerator.java b/jdk/src/share/classes/sun/reflect/AccessorGenerator.java index 16a19d424e8..d3eda43afb6 100644 --- a/jdk/src/share/classes/sun/reflect/AccessorGenerator.java +++ b/jdk/src/share/classes/sun/reflect/AccessorGenerator.java @@ -379,6 +379,10 @@ class AccessorGenerator implements ClassFileConstants { return Modifier.isStatic(modifiers); } + protected boolean isPrivate() { + return Modifier.isPrivate(modifiers); + } + /** Returns class name in "internal" form (i.e., '/' separators instead of '.') */ protected static String getClassName diff --git a/jdk/src/share/classes/sun/reflect/MethodAccessorGenerator.java b/jdk/src/share/classes/sun/reflect/MethodAccessorGenerator.java index 232d3c698a2..b00450ce3e7 100644 --- a/jdk/src/share/classes/sun/reflect/MethodAccessorGenerator.java +++ b/jdk/src/share/classes/sun/reflect/MethodAccessorGenerator.java @@ -639,10 +639,14 @@ class MethodAccessorGenerator extends AccessorGenerator { typeSizeInStackSlots(returnType)); } else { if (isInterface()) { - cb.opc_invokeinterface(targetMethodRef, - count, - count, - typeSizeInStackSlots(returnType)); + if (isPrivate()) { + cb.opc_invokespecial(targetMethodRef, count, 0); + } else { + cb.opc_invokeinterface(targetMethodRef, + count, + count, + typeSizeInStackSlots(returnType)); + } } else { cb.opc_invokevirtual(targetMethodRef, count, diff --git a/jdk/test/java/lang/reflect/Method/invoke/TestPrivateInterfaceMethodReflect.java b/jdk/test/java/lang/reflect/Method/invoke/TestPrivateInterfaceMethodReflect.java new file mode 100644 index 00000000000..83ead89fe69 --- /dev/null +++ b/jdk/test/java/lang/reflect/Method/invoke/TestPrivateInterfaceMethodReflect.java @@ -0,0 +1,122 @@ +/* + * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @bug 8026213 + * @summary Reflection support for private methods in interfaces + * @author Robert Field + * @run main TestPrivateInterfaceMethodReflect + */ + +import java.lang.reflect.*; + +import jdk.internal.org.objectweb.asm.ClassWriter; +import jdk.internal.org.objectweb.asm.MethodVisitor; +import jdk.internal.org.objectweb.asm.Opcodes; + +public class TestPrivateInterfaceMethodReflect { + + static final String INTERFACE_NAME = "PrivateInterfaceMethodReflectTest_Interface"; + static final String CLASS_NAME = "PrivateInterfaceMethodReflectTest_Class"; + static final int EXPECTED = 1234; + + static class TestClassLoader extends ClassLoader implements Opcodes { + + @Override + public Class findClass(String name) throws ClassNotFoundException { + byte[] b; + try { + b = loadClassData(name); + } catch (Throwable th) { + // th.printStackTrace(); + throw new ClassNotFoundException("Loading error", th); + } + return defineClass(name, b, 0, b.length); + } + + private byte[] loadClassData(String name) throws Exception { + ClassWriter cw = new ClassWriter(0); + MethodVisitor mv; + switch (name) { + case INTERFACE_NAME: + cw.visit(V1_8, ACC_ABSTRACT | ACC_INTERFACE | ACC_PUBLIC, INTERFACE_NAME, null, "java/lang/Object", null); + { + mv = cw.visitMethod(ACC_PRIVATE, "privInstance", "()I", null, null); + mv.visitCode(); + mv.visitLdcInsn(EXPECTED); + mv.visitInsn(IRETURN); + mv.visitMaxs(1, 1); + mv.visitEnd(); + } + break; + case CLASS_NAME: + cw.visit(52, ACC_SUPER | ACC_PUBLIC, CLASS_NAME, null, "java/lang/Object", new String[]{INTERFACE_NAME}); + { + mv = cw.visitMethod(ACC_PUBLIC, "", "()V", null, null); + mv.visitCode(); + mv.visitVarInsn(ALOAD, 0); + mv.visitMethodInsn(INVOKESPECIAL, "java/lang/Object", "", "()V"); + mv.visitInsn(RETURN); + mv.visitMaxs(1, 1); + mv.visitEnd(); + } + break; + default: + break; + } + cw.visitEnd(); + + return cw.toByteArray(); + } + } + + public static void main(String[] args) throws Exception { + TestClassLoader tcl = new TestClassLoader(); + Class itf = tcl.loadClass(INTERFACE_NAME); + Class k = tcl.loadClass(CLASS_NAME); + Object inst = k.newInstance(); + Method[] meths = itf.getDeclaredMethods(); + if (meths.length != 1) { + throw new Exception("Expected one method in " + INTERFACE_NAME + " instead " + meths.length); + } + + Method m = meths[0]; + int mod = m.getModifiers(); + if ((mod & Modifier.PRIVATE) == 0) { + throw new Exception("Expected " + m + " to be private"); + } + if ((mod & Modifier.STATIC) != 0) { + throw new Exception("Expected " + m + " to be instance method"); + } + + m.setAccessible(true); + for (int i = 1; i < 200; i++) { + if (!m.invoke(inst).equals(EXPECTED)) { + throw new Exception("Expected " + EXPECTED + " from " + m); + } + } + + System.out.println("Passed."); + } +} From ec67e938e252c1ecb61a2fb0d1a2f28db8ac9f65 Mon Sep 17 00:00:00 2001 From: Xue-Lei Andrew Fan Date: Sun, 13 Oct 2013 21:10:33 -0700 Subject: [PATCH 105/131] 8026119: Regression test DHEKeySizing.java failing intermittently Reviewed-by: weijun --- .../internal/ssl/DHKeyExchange/DHEKeySizing.java | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/jdk/test/sun/security/ssl/com/sun/net/ssl/internal/ssl/DHKeyExchange/DHEKeySizing.java b/jdk/test/sun/security/ssl/com/sun/net/ssl/internal/ssl/DHKeyExchange/DHEKeySizing.java index 3c61f76371f..ec61b303bc8 100644 --- a/jdk/test/sun/security/ssl/com/sun/net/ssl/internal/ssl/DHKeyExchange/DHEKeySizing.java +++ b/jdk/test/sun/security/ssl/com/sun/net/ssl/internal/ssl/DHKeyExchange/DHEKeySizing.java @@ -111,7 +111,15 @@ import java.util.Base64; public class DHEKeySizing { - private static boolean debug = true; + private final static boolean debug = true; + + // key length bias because of the stripping of leading zero bytes of + // negotiated DH keys. + // + // This is an effort to mimum intermittent failure when we cannot + // estimate what's the exact number of leading zero bytes of + // negotiated DH keys. + private final static int KEY_LEN_BIAS = 6; private SSLContext sslc; private SSLEngine ssle1; // client @@ -269,7 +277,8 @@ public class DHEKeySizing { twoToOne.flip(); log("Message length of ServerHello series: " + twoToOne.remaining()); - if (lenServerKeyEx != twoToOne.remaining()) { + if (twoToOne.remaining() < (lenServerKeyEx - KEY_LEN_BIAS) || + twoToOne.remaining() > lenServerKeyEx) { throw new Exception( "Expected to generate ServerHello series messages of " + lenServerKeyEx + " bytes, but not " + twoToOne.remaining()); @@ -289,7 +298,8 @@ public class DHEKeySizing { oneToTwo.flip(); log("Message length of ClientKeyExchange: " + oneToTwo.remaining()); - if (lenClientKeyEx != oneToTwo.remaining()) { + if (oneToTwo.remaining() < (lenClientKeyEx - KEY_LEN_BIAS) || + oneToTwo.remaining() > lenClientKeyEx) { throw new Exception( "Expected to generate ClientKeyExchange message of " + lenClientKeyEx + " bytes, but not " + oneToTwo.remaining()); From f573ee1917b325703f58e89a7d7a31502cb330ed Mon Sep 17 00:00:00 2001 From: Daniel Fuchs Date: Mon, 14 Oct 2013 10:42:36 +0200 Subject: [PATCH 106/131] 8024704: Improve API documentation of ClassLoader and ServiceLoader with respect to enumeration of resources Reviewed-by: alanb, psandoz, mchung --- jdk/src/share/classes/java/lang/ClassLoader.java | 11 +++++++++++ jdk/src/share/classes/java/util/ServiceLoader.java | 6 ++++++ 2 files changed, 17 insertions(+) diff --git a/jdk/src/share/classes/java/lang/ClassLoader.java b/jdk/src/share/classes/java/lang/ClassLoader.java index c3f2aa20458..3fd927482b3 100644 --- a/jdk/src/share/classes/java/lang/ClassLoader.java +++ b/jdk/src/share/classes/java/lang/ClassLoader.java @@ -1061,6 +1061,10 @@ public abstract class ClassLoader { * built-in to the virtual machine is searched. That failing, this method * will invoke {@link #findResource(String)} to find the resource.

          * + * @apiNote When overriding this method it is recommended that an + * implementation ensures that any delegation is consistent with the {@link + * #getResources(java.lang.String) getResources(String)} method. + * * @param name * The resource name * @@ -1094,6 +1098,13 @@ public abstract class ClassLoader { *

          The search order is described in the documentation for {@link * #getResource(String)}.

          * + * @apiNote When overriding this method it is recommended that an + * implementation ensures that any delegation is consistent with the {@link + * #getResource(java.lang.String) getResource(String)} method. This should + * ensure that the first element returned by the Enumeration's + * {@code nextElement} method is the same resource that the + * {@code getResource(String)} method would return. + * * @param name * The resource name * diff --git a/jdk/src/share/classes/java/util/ServiceLoader.java b/jdk/src/share/classes/java/util/ServiceLoader.java index aa5c3008818..f2473a950a2 100644 --- a/jdk/src/share/classes/java/util/ServiceLoader.java +++ b/jdk/src/share/classes/java/util/ServiceLoader.java @@ -453,6 +453,12 @@ public final class ServiceLoader * Invoking its {@link java.util.Iterator#remove() remove} method will * cause an {@link UnsupportedOperationException} to be thrown. * + * @implNote When adding providers to the cache, the {@link #iterator + * Iterator} processes resources in the order that the {@link + * java.lang.ClassLoader#getResources(java.lang.String) + * ClassLoader.getResources(String)} method finds the service configuration + * files. + * * @return An iterator that lazily loads providers for this loader's * service */ From 904f94625852e9029ec70f60760591e81060316b Mon Sep 17 00:00:00 2001 From: Tristan Yan Date: Mon, 14 Oct 2013 11:47:54 +0100 Subject: [PATCH 107/131] 8023555: test/java/net/Socks/SocksProxyVersion.java fails when machine name is localhost Reviewed-by: chegar, alanb --- jdk/test/java/net/Socks/SocksProxyVersion.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/jdk/test/java/net/Socks/SocksProxyVersion.java b/jdk/test/java/net/Socks/SocksProxyVersion.java index bc46c423a09..27bd1872d40 100644 --- a/jdk/test/java/net/Socks/SocksProxyVersion.java +++ b/jdk/test/java/net/Socks/SocksProxyVersion.java @@ -41,6 +41,10 @@ public class SocksProxyVersion implements Runnable { volatile boolean failed; public static void main(String[] args) throws Exception { + if (InetAddress.getLocalHost().isLoopbackAddress()) { + System.out.println("Test cannot run. getLocalHost returns a loopback address"); + return; + } new SocksProxyVersion(); } From ba1c14b52747274215341a7a529f2c294824cb0f Mon Sep 17 00:00:00 2001 From: Stefan Karlsson Date: Mon, 14 Oct 2013 14:28:50 +0200 Subject: [PATCH 108/131] 7196801: NPG: Fix java/lang/management/MemoryMXBean/LowMemoryTest2 Co-authored-by: Coleen Phillimore Reviewed-by: coleenp, sla --- .../MemoryMXBean/LowMemoryTest2.java | 25 ++++++++++++++----- .../management/MemoryMXBean/LowMemoryTest2.sh | 15 ++++++----- 2 files changed, 28 insertions(+), 12 deletions(-) diff --git a/jdk/test/java/lang/management/MemoryMXBean/LowMemoryTest2.java b/jdk/test/java/lang/management/MemoryMXBean/LowMemoryTest2.java index 059e45d409d..d0f9e9aa4ff 100644 --- a/jdk/test/java/lang/management/MemoryMXBean/LowMemoryTest2.java +++ b/jdk/test/java/lang/management/MemoryMXBean/LowMemoryTest2.java @@ -26,7 +26,7 @@ * * The test set a listener to be notified when any of the non-heap pools * exceed 80%. It then starts a thread that continuously loads classes. - * In the HotSpot implementation this causes perm space to be consumed. + * In the HotSpot implementation this causes metaspace to be consumed. * Test completes when we the notification is received or an OutOfMemory * is generated. */ @@ -100,7 +100,14 @@ public class LowMemoryTest2 { // TestNNNNNN - String name = "Test" + Integer.toString(count++); + int load_count = count++; + if (load_count > 999999) { + // The test will create a corrupt class file if the count + // exceeds 999999. Fix the test if this exception is thrown. + throw new RuntimeException("Load count exceeded"); + } + + String name = "Test" + Integer.toString(load_count); byte value[]; try { @@ -133,8 +140,9 @@ public class LowMemoryTest2 { * Note: Once the usage threshold has been exceeded the low memory * detector thread will attempt to deliver its notification - this can * potentially create a race condition with this thread contining to - * fill up perm space. To avoid the low memory detector getting an OutOfMemory - * we throttle this thread once the threshold has been exceeded. + * fill up metaspace. To avoid the low memory detector getting an + * OutOfMemory we throttle this thread once the threshold has been + * exceeded. */ public void run() { List pools = ManagementFactory.getMemoryPoolMXBeans(); @@ -180,7 +188,7 @@ public class LowMemoryTest2 { // Set threshold of 80% of all NON_HEAP memory pools // In the Hotspot implementation this means we should get a notification - // if the CodeCache or perm generation fills up. + // if the CodeCache or metaspace fills up. while (iter.hasNext()) { MemoryPoolMXBean p = (MemoryPoolMXBean) iter.next(); @@ -188,7 +196,12 @@ public class LowMemoryTest2 { // set threshold MemoryUsage mu = p.getUsage(); - long threshold = (mu.getMax() * 80) / 100; + long max = mu.getMax(); + if (max < 0) { + throw new RuntimeException("There is no maximum set for " + + p.getName() + " memory pool so the test is invalid"); + } + long threshold = (max * 80) / 100; p.setUsageThreshold(threshold); diff --git a/jdk/test/java/lang/management/MemoryMXBean/LowMemoryTest2.sh b/jdk/test/java/lang/management/MemoryMXBean/LowMemoryTest2.sh index 44b757214fd..3d97270fb35 100644 --- a/jdk/test/java/lang/management/MemoryMXBean/LowMemoryTest2.sh +++ b/jdk/test/java/lang/management/MemoryMXBean/LowMemoryTest2.sh @@ -51,14 +51,17 @@ go() { # Run test with each GC configuration # -# Notes: To ensure that perm gen fills up we disable class unloading. -# Also we set the max perm space to 8MB - otherwise the test takes too +# Notes: To ensure that metaspace fills up we disable class unloading. +# Also we set the max metaspace to 8MB - otherwise the test takes too # long to run. -go -noclassgc -XX:PermSize=8m -XX:MaxPermSize=8m -XX:+UseSerialGC LowMemoryTest2 -go -noclassgc -XX:PermSize=8m -XX:MaxPermSize=8m -XX:+UseParallelGC LowMemoryTest2 -go -noclassgc -XX:PermSize=8m -XX:MaxPermSize=8m -XX:+UseParNewGC -XX:+UseConcMarkSweepGC \ - LowMemoryTest2 +go -noclassgc -XX:MaxMetaspaceSize=16m -XX:+UseSerialGC LowMemoryTest2 +go -noclassgc -XX:MaxMetaspaceSize=16m -XX:+UseParallelGC LowMemoryTest2 +go -noclassgc -XX:MaxMetaspaceSize=16m -XX:+UseParNewGC -XX:+UseConcMarkSweepGC LowMemoryTest2 + +# Test class metaspace - might hit MaxMetaspaceSize instead if +# UseCompressedClassPointers is off or if 32 bit. +go -noclassgc -XX:MaxMetaspaceSize=16m -XX:CompressedClassSpaceSize=4m LowMemoryTest2 echo '' if [ $failures -gt 0 ]; From 70e5173968cdc245b328b3f3cf3e91786392c5ef Mon Sep 17 00:00:00 2001 From: Michael McMahon Date: Mon, 14 Oct 2013 22:09:15 +0100 Subject: [PATCH 109/131] 8014719: HttpClient/ProxyTest.java failing with IAE HttpURLPermission.parseURI Reviewed-by: alanb, chegar --- .../share/classes/java/net/HostPortrange.java | 251 +++++++++++ .../classes/java/net/HttpURLConnection.java | 2 +- ...pURLPermission.java => URLPermission.java} | 251 ++++++++--- .../www/protocol/http/HttpURLConnection.java | 23 +- .../security/tools/policytool/PolicyTool.java | 10 +- .../HttpURLPermissionTest.java | 204 --------- .../net/URLPermission/URLPermissionTest.java | 388 ++++++++++++++++++ .../URLTest.java | 2 +- .../policy.1 | 4 +- .../policy.2 | 4 +- .../policy.3 | 4 +- 11 files changed, 846 insertions(+), 297 deletions(-) create mode 100644 jdk/src/share/classes/java/net/HostPortrange.java rename jdk/src/share/classes/java/net/{HttpURLPermission.java => URLPermission.java} (59%) delete mode 100644 jdk/test/java/net/HttpURLPermission/HttpURLPermissionTest.java create mode 100644 jdk/test/java/net/URLPermission/URLPermissionTest.java rename jdk/test/java/net/{HttpURLPermission => URLPermission}/URLTest.java (99%) rename jdk/test/java/net/{HttpURLPermission => URLPermission}/policy.1 (90%) rename jdk/test/java/net/{HttpURLPermission => URLPermission}/policy.2 (91%) rename jdk/test/java/net/{HttpURLPermission => URLPermission}/policy.3 (90%) diff --git a/jdk/src/share/classes/java/net/HostPortrange.java b/jdk/src/share/classes/java/net/HostPortrange.java new file mode 100644 index 00000000000..fc5e3d98a20 --- /dev/null +++ b/jdk/src/share/classes/java/net/HostPortrange.java @@ -0,0 +1,251 @@ +/* + * 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 java.net; + +import java.net.*; +import java.util.Formatter; +import java.util.Locale; +import sun.net.util.IPAddressUtil; + +/** + * Parses a string containing a host/domain name and port range + */ +class HostPortrange { + + String hostname; + String scheme; + int[] portrange; + + boolean wildcard; + boolean literal; + boolean ipv6, ipv4; + static final int PORT_MIN = 0; + static final int PORT_MAX = (1 << 16) -1; + + boolean equals(HostPortrange that) { + return this.hostname.equals(that.hostname) + && this.portrange[0] == that.portrange[0] + && this.portrange[1] == that.portrange[1] + && this.wildcard == that.wildcard + && this.literal == that.literal; + } + + public int hashCode() { + return hostname.hashCode() + portrange[0] + portrange[1]; + } + + HostPortrange(String scheme, String str) { + // Parse the host name. A name has up to three components, the + // hostname, a port number, or two numbers representing a port + // range. "www.sun.com:8080-9090" is a valid host name. + + // With IPv6 an address can be 2010:836B:4179::836B:4179 + // An IPv6 address needs to be enclose in [] + // For ex: [2010:836B:4179::836B:4179]:8080-9090 + // Refer to RFC 2732 for more information. + + // first separate string into two fields: hoststr, portstr + String hoststr, portstr = null; + this.scheme = scheme; + + // check for IPv6 address + if (str.charAt(0) == '[') { + ipv6 = literal = true; + int rb = str.indexOf(']'); + if (rb != -1) { + hoststr = str.substring(1, rb); + } else { + throw new IllegalArgumentException("invalid IPv6 address: " + str); + } + int sep = str.indexOf(':', rb + 1); + if (sep != -1 && str.length() > sep) { + portstr = str.substring(sep + 1); + } + // need to normalize hoststr now + byte[] ip = IPAddressUtil.textToNumericFormatV6(hoststr); + if (ip == null) { + throw new IllegalArgumentException("illegal IPv6 address"); + } + StringBuilder sb = new StringBuilder(); + Formatter formatter = new Formatter(sb, Locale.US); + formatter.format("%02x%02x:%02x%02x:%02x%02x:%02x" + + "%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x", + ip[0], ip[1], ip[2], ip[3], ip[4], ip[5], ip[6], ip[7], ip[8], + ip[9], ip[10], ip[11], ip[12], ip[13], ip[14], ip[15]); + hostname = sb.toString(); + } else { + // not IPv6 therefore ':' is the port separator + + int sep = str.indexOf(':'); + if (sep != -1 && str.length() > sep) { + hoststr = str.substring(0, sep); + portstr = str.substring(sep + 1); + } else { + hoststr = sep == -1 ? str : str.substring(0, sep); + } + // is this a domain wildcard specification? + if (hoststr.lastIndexOf('*') > 0) { + throw new IllegalArgumentException("invalid host wildcard specification"); + } else if (hoststr.startsWith("*")) { + wildcard = true; + if (hoststr.equals("*")) { + hoststr = ""; + } else if (hoststr.startsWith("*.")) { + hoststr = hoststr.substring(1).toLowerCase(); // leave the '.' ? + } else { + throw new IllegalArgumentException("invalid host wildcard specification"); + } + } else { + // check if ipv4 (if rightmost label a number) + // The normal way to specify ipv4 is 4 decimal labels + // but actually three, two or single label formats valid also + // So, we recognise ipv4 by just testing the rightmost label + // being a number. + int lastdot = hoststr.lastIndexOf('.'); + if (lastdot != -1 && (hoststr.length() > 1)) { + boolean ipv4 = true; + + for (int i = lastdot + 1, len = hoststr.length(); i < len; i++) { + char c = hoststr.charAt(i); + if (c < '0' || c > '9') { + ipv4 = false; + break; + } + } + this.ipv4 = this.literal = ipv4; + if (ipv4) { + byte[] ip = IPAddressUtil.textToNumericFormatV4(hoststr); + if (ip == null) { + throw new IllegalArgumentException("illegal IPv4 address"); + } + StringBuilder sb = new StringBuilder(); + Formatter formatter = new Formatter(sb, Locale.US); + formatter.format("%d.%d.%d.%d", ip[0], ip[1], ip[2], ip[3]); + hoststr = sb.toString(); + } else { + // regular domain name + hoststr = hoststr.toLowerCase(); + } + } + } + hostname = hoststr; + } + + try { + portrange = parsePort(portstr); + } catch (Exception e) { + throw new IllegalArgumentException("invalid port range: " + portstr); + } + } + + public boolean literal() { + return literal; + } + + public boolean ipv4Literal() { + return ipv4; + } + + public boolean ipv6Literal() { + return ipv6; + } + + public String hostname() { + return hostname; + } + + public int[] portrange() { + return portrange; + } + + /** + * returns true if the hostname part started with * + * hostname returns the remaining part of the host component + * eg "*.foo.com" -> ".foo.com" or "*" -> "" + * + * @return + */ + public boolean wildcard() { + return wildcard; + } + + // these shouldn't leak outside the implementation + final static int[] HTTP_PORT = {80, 80}; + final static int[] HTTPS_PORT = {443, 443}; + final static int[] NO_PORT = {-1, -1}; + + int[] defaultPort() { + if (scheme.equals("http")) { + return HTTP_PORT; + } else if (scheme.equals("https")) { + return HTTPS_PORT; + } + return NO_PORT; + } + + int[] parsePort(String port) + { + + if (port == null || port.equals("")) { + return defaultPort(); + } + + if (port.equals("*")) { + return new int[] {PORT_MIN, PORT_MAX}; + } + + try { + int dash = port.indexOf('-'); + + if (dash == -1) { + int p = Integer.parseInt(port); + return new int[] {p, p}; + } else { + String low = port.substring(0, dash); + String high = port.substring(dash+1); + int l,h; + + if (low.equals("")) { + l = PORT_MIN; + } else { + l = Integer.parseInt(low); + } + + if (high.equals("")) { + h = PORT_MAX; + } else { + h = Integer.parseInt(high); + } + if (l < 0 || h < 0 || h
        • a "connect" {@link SocketPermission} to the host/port combination of the * destination URL or
        • - *
        • a {@link HttpURLPermission} that permits this request.
        • + *
        • a {@link URLPermission} that permits this request.
        • *

          * If automatic redirection is enabled, and this request is redirected to another * destination, then the caller must also have permission to connect to the diff --git a/jdk/src/share/classes/java/net/HttpURLPermission.java b/jdk/src/share/classes/java/net/URLPermission.java similarity index 59% rename from jdk/src/share/classes/java/net/HttpURLPermission.java rename to jdk/src/share/classes/java/net/URLPermission.java index 4e038bc739e..f6572cd3575 100644 --- a/jdk/src/share/classes/java/net/HttpURLPermission.java +++ b/jdk/src/share/classes/java/net/URLPermission.java @@ -34,18 +34,41 @@ import java.security.Permission; /** * Represents permission to access a resource or set of resources defined by a - * given http or https url, and for a given set of user-settable request methods + * given url, and for a given set of user-settable request methods * and request headers. The name of the permission is the url string. * The actions string is a concatenation of the request methods and headers. * The range of method and header names is not restricted by this class. *

          The url

          - * The url string is also used to instantiate a {@link URI} object which is - * used for comparison with other HttpURLPermission instances. Therefore, any - * references in this specification to url, mean this URI object. - * The path component of the url comprises a sequence of path segments, separated - * by '/' characters. The path is specified in a similar way to the path - * in {@link java.io.FilePermission}. There are three different ways - * as the following examples show: + * The url string has the following expected structure. + *

          + *     scheme : // authority [ / path ]
          + * 
          + * scheme will typically be http or https, but is not restricted by this + * class. + * authority is specified as:

          + *

          + *     authority = hostrange [ : portrange ]
          + *     portrange = portnumber | -portnumber | portnumber-[portnumber] | *
          + *     hostrange = ([*.] dnsname) | IPv4address | IPv6address
          + * 
          + * dnsname is a standard DNS host or domain name, ie. one or more labels + * separated by ".". IPv4address is a standard literal IPv4 address and + * IPv6address is as defined in + * RFC 2732. Literal IPv6 addresses must however, be enclosed in '[]' characters. + * The dnsname specification can be preceded by "*." which means + * the name will match any hostname whose right-most domain labels are the same as + * this name. For example, "*.oracle.com" matches "foo.bar.oracle.com" + *

          + * portrange is used to specify a port number, or a bounded or unbounded range of ports + * that this permission applies to. If portrange is absent or invalid, then a default + * port number is assumed if the scheme is {@code http} (default 80) or {@code https} + * (default 443). No default is assumed for other schemes. A wildcard may be specified + * which means all ports. + *

          + * The path component comprises a sequence of path segments, + * separated by '/' characters. path may also be empty. The path is specified + * in a similar way to the path in {@link java.io.FilePermission}. There are + * three different ways as the following examples show: * * * @@ -68,13 +91,19 @@ import java.security.Permission; *

          * The '*' and '-' may only be specified in the final segment of a path and must be * the only character in that segment. Any query or fragment components of the - * url are ignored when constructing HttpURLPermissions. + * url are ignored when constructing URLPermissions. *

          - * As a special case, urls of the form, "http:*" or "https:*" are accepted to + * As a special case, urls of the form, "scheme:*" are accepted to * mean any url of the given scheme. + *

          + * The scheme and authority components of the url string are handled + * without regard to case. This means {@link #equals(Object)}, + * {@link #hashCode()} and {@link #implies(Permission)} are case insensitive with respect + * to these components. If the authority contains a literal IP address, + * then the address is normalized for comparison. The path component is case sensitive. *

          The actions string

          - * The actions string of a HttpURLPermission is a concatenation of the method list - * and the request headers list. These are lists of the permitted HTTP request + * The actions string of a URLPermission is a concatenation of the method list + * and the request headers list. These are lists of the permitted request * methods and permitted request headers of the permission (respectively). The two lists * are separated by a colon ':' character and elements of each list are comma separated. * Some examples are: @@ -89,7 +118,7 @@ import java.security.Permission; *

          * The colon separator need not be present if the request headers list is empty. * No white-space is permitted in the actions string. The action strings supplied to - * the HttpURLPermission constructors are case-insensitive and are normalized by converting + * the URLPermission constructors are case-insensitive and are normalized by converting * method names to upper-case and header names to the form defines in RFC2616 (lower case * with initial letter of each word capitalized). Either list can contain a wild-card '*' * character which signifies all request methods or headers respectively. @@ -102,38 +131,40 @@ import java.security.Permission; * * @since 1.8 */ -public final class HttpURLPermission extends Permission { +public final class URLPermission extends Permission { private static final long serialVersionUID = -2702463814894478682L; - private transient URI uri; + private transient String scheme; + private transient String ssp; // scheme specific part + private transient String path; private transient List methods; private transient List requestHeaders; + private transient Authority authority; // serialized field private String actions; /** - * Creates a new HttpURLPermission from a url string and which permits the given + * Creates a new URLPermission from a url string and which permits the given * request methods and user-settable request headers. - * The name of the permission is its url string. Only the scheme, authority - * and path components of the url are used. Any fragment or query + * The name of the permission is the url string it was created with. Only the scheme, + * authority and path components of the url are used internally. Any fragment or query * components are ignored. The permissions action string is as specified above. * * @param url the url string * * @param actions the actions string * - * @throws IllegalArgumentException if url does not result in a valid {@link URI}, - * its scheme is not http or https, or if actions contains white-space. + * @exception IllegalArgumentException if url is invalid or if actions contains white-space. */ - public HttpURLPermission(String url, String actions) { + public URLPermission(String url, String actions) { super(url); init(actions); } private void init(String actions) { - URI uri = parseURI(getName()); + parseURI(getName()); int colon = actions.indexOf(':'); if (actions.lastIndexOf(':') != colon) { throw new IllegalArgumentException("invalid actions string"); @@ -157,19 +188,18 @@ public final class HttpURLPermission extends Permission { this.requestHeaders = Collections.unmodifiableList(l); this.actions = actions(); - this.uri = uri; } /** - * Creates a HttpURLPermission with the given url string and unrestricted + * Creates a URLPermission with the given url string and unrestricted * methods and request headers by invoking the two argument - * constructor as follows: HttpURLPermission(url, "*:*") + * constructor as follows: URLPermission(url, "*:*") * * @param url the url string * * @throws IllegalArgumentException if url does not result in a valid {@link URI} */ - public HttpURLPermission(String url) { + public URLPermission(String url) { this(url, "*:*"); } @@ -190,20 +220,23 @@ public final class HttpURLPermission extends Permission { } /** - * Checks if this HttpURLPermission implies the given permission. + * Checks if this URLPermission implies the given permission. * Specifically, the following checks are done as if in the * following sequence: *

            - *
          • if 'p' is not an instance of HttpURLPermission return false
          • + *
          • if 'p' is not an instance of URLPermission return false
          • *
          • if any of p's methods are not in this's method list, and if * this's method list is not equal to "*", then return false.
          • *
          • if any of p's headers are not in this's request header list, and if * this's request header list is not equal to "*", then return false.
          • - *
          • if this's url is equal to p's url , then return true
          • *
          • if this's url scheme is not equal to p's url scheme return false
          • *
          • if the scheme specific part of this's url is '*' return true
          • - *
          • if this's url authority is not equal to p's url authority - * return false
          • + *
          • if the set of hosts defined by p's url hostrange is not a subset of + * this's url hostrange then return false. For example, "*.foo.oracle.com" + * is a subset of "*.oracle.com". "foo.bar.oracle.com" is not + * a subset of "*.foo.oracle.com"
          • + *
          • if the portrange defined by p's url is not a subset of the + * portrange defined by this's url then return false. *
          • if the path or paths specified by p's url are contained in the * set of paths specified by this's url, then return true *
          • otherwise, return false
          • @@ -222,11 +255,11 @@ public final class HttpURLPermission extends Permission { *
          URL Examples
          Example urlDescription
          */ public boolean implies(Permission p) { - if (! (p instanceof HttpURLPermission)) { + if (! (p instanceof URLPermission)) { return false; } - HttpURLPermission that = (HttpURLPermission)p; + URLPermission that = (URLPermission)p; if (!this.methods.get(0).equals("*") && Collections.indexOfSubList(this.methods, that.methods) == -1) { @@ -244,39 +277,36 @@ public final class HttpURLPermission extends Permission { return false; } - if (this.uri.equals(that.uri)) { - return true; - } - - if (!this.uri.getScheme().equals(that.uri.getScheme())) { + if (!this.scheme.equals(that.scheme)) { return false; } - if (this.uri.getSchemeSpecificPart().equals("*")) { + if (this.ssp.equals("*")) { return true; } - String thisAuthority = this.uri.getAuthority(); - - if (thisAuthority != null && - !thisAuthority.equals(that.uri.getAuthority())) { + if (!this.authority.implies(that.authority)) { return false; } - String thispath = this.uri.getPath(); - String thatpath = that.uri.getPath(); + if (this.path == null) { + return that.path == null; + } + if (that.path == null) { + return false; + } - if (thispath.endsWith("/-")) { - String thisprefix = thispath.substring(0, thispath.length() - 1); - return thatpath.startsWith(thisprefix); + if (this.path.endsWith("/-")) { + String thisprefix = this.path.substring(0, this.path.length() - 1); + return that.path.startsWith(thisprefix); } - if (thispath.endsWith("/*")) { - String thisprefix = thispath.substring(0, thispath.length() - 1); - if (!thatpath.startsWith(thisprefix)) { + if (this.path.endsWith("/*")) { + String thisprefix = this.path.substring(0, this.path.length() - 1); + if (!that.path.startsWith(thisprefix)) { return false; } - String thatsuffix = thatpath.substring(thisprefix.length()); + String thatsuffix = that.path.substring(thisprefix.length()); // suffix must not contain '/' chars if (thatsuffix.indexOf('/') != -1) { return false; @@ -286,7 +316,7 @@ public final class HttpURLPermission extends Permission { } return true; } - return false; + return this.path.equals(that.path); } @@ -295,20 +325,35 @@ public final class HttpURLPermission extends Permission { * and p's url equals this's url. Returns false otherwise. */ public boolean equals(Object p) { - if (!(p instanceof HttpURLPermission)) { + if (!(p instanceof URLPermission)) { return false; } - HttpURLPermission that = (HttpURLPermission)p; - return this.getActions().equals(that.getActions()) && - this.uri.equals(that.uri); + URLPermission that = (URLPermission)p; + if (!this.scheme.equals(that.scheme)) { + return false; + } + if (!this.getActions().equals(that.getActions())) { + return false; + } + if (!this.authority.equals(that.authority)) { + return false; + } + if (this.path != null) { + return this.path.equals(that.path); + } else { + return that.path == null; + } } /** * Returns a hashcode calculated from the hashcode of the - * actions String and the url + * actions String and the url string. */ public int hashCode() { - return getActions().hashCode() + uri.hashCode(); + return getActions().hashCode() + + scheme.hashCode() + + authority.hashCode() + + path == null ? 0 : path.hashCode(); } @@ -371,17 +416,31 @@ public final class HttpURLPermission extends Permission { return l; } - private URI parseURI(String url) { - URI u = URI.create(url); - String scheme = u.getScheme(); - if (!(scheme.equalsIgnoreCase("http") || - scheme.equalsIgnoreCase("https"))) { - throw new IllegalArgumentException ("unexpected URL scheme"); + private void parseURI(String url) { + int len = url.length(); + int delim = url.indexOf(':'); + if (delim == -1 || delim + 1 == len) { + throw new IllegalArgumentException("invalid URL string"); } - if (!u.getSchemeSpecificPart().equals("*")) { - u = URI.create(scheme + "://" + u.getRawAuthority() + u.getRawPath()); + scheme = url.substring(0, delim).toLowerCase(); + this.ssp = url.substring(delim + 1); + + if (!ssp.startsWith("//")) { + this.authority = new Authority(scheme, ssp.toLowerCase()); + return; } - return u; + String authpath = ssp.substring(2); + + delim = authpath.indexOf('/'); + String auth; + if (delim == -1) { + this.path = ""; + auth = authpath; + } else { + auth = authpath.substring(0, delim); + this.path = authpath.substring(delim); + } + this.authority = new Authority(scheme, auth.toLowerCase()); } private String actions() { @@ -395,6 +454,7 @@ public final class HttpURLPermission extends Permission { } return b.toString(); } + /** * restore the state of this object from stream */ @@ -405,4 +465,59 @@ public final class HttpURLPermission extends Permission { init(actions); } + + static class Authority { + HostPortrange p; + + Authority(String scheme, String authority) { + p = new HostPortrange(scheme, authority); + } + + boolean implies(Authority other) { + return impliesHostrange(other) && impliesPortrange(other); + } + + private boolean impliesHostrange(Authority that) { + String thishost = this.p.hostname(); + String thathost = that.p.hostname(); + + if (p.wildcard() && thishost.equals("")) { + // this "*" implies all others + return true; + } + if (that.p.wildcard() && thathost.equals("")) { + // that "*" can only be implied by this "*" + return false; + } + if (thishost.equals(thathost)) { + // covers all cases of literal IP addresses and fixed + // domain names. + return true; + } + if (this.p.wildcard()) { + // this "*.foo.com" implies "bub.bar.foo.com" + return thathost.endsWith(thishost); + } + return false; + } + + private boolean impliesPortrange(Authority that) { + int[] thisrange = this.p.portrange(); + int[] thatrange = that.p.portrange(); + if (thisrange[0] == -1) { + /* port not specified non http/s URL */ + return true; + } + return thisrange[0] <= thatrange[0] && + thisrange[1] >= thatrange[1]; + } + + boolean equals(Authority that) { + return this.p.equals(that.p); + } + + public int hashCode() { + return p.hashCode(); + } + } } diff --git a/jdk/src/share/classes/sun/net/www/protocol/http/HttpURLConnection.java b/jdk/src/share/classes/sun/net/www/protocol/http/HttpURLConnection.java index 1efb3e1657d..0a327cca4d9 100644 --- a/jdk/src/share/classes/sun/net/www/protocol/http/HttpURLConnection.java +++ b/jdk/src/share/classes/sun/net/www/protocol/http/HttpURLConnection.java @@ -46,7 +46,7 @@ import java.net.ResponseCache; import java.net.CacheResponse; import java.net.SecureCacheResponse; import java.net.CacheRequest; -import java.net.HttpURLPermission; +import java.net.URLPermission; import java.net.Authenticator.RequestorType; import java.security.AccessController; import java.security.PrivilegedExceptionAction; @@ -389,7 +389,7 @@ public class HttpURLConnection extends java.net.HttpURLConnection { private int connectTimeout = NetworkClient.DEFAULT_CONNECT_TIMEOUT; private int readTimeout = NetworkClient.DEFAULT_READ_TIMEOUT; - /* A permission converted from a HttpURLPermission */ + /* A permission converted from a URLPermission */ private SocketPermission socketPermission; /* Logging support */ @@ -930,8 +930,7 @@ public class HttpURLConnection extends java.net.HttpURLConnection { plainConnect0(); return null; } - } -// }, null, p -- replace line above, when limited doPriv ready + }, null, p ); } catch (PrivilegedActionException e) { throw (IOException) e.getException(); @@ -943,7 +942,7 @@ public class HttpURLConnection extends java.net.HttpURLConnection { } /** - * if the caller has a HttpURLPermission for connecting to the + * if the caller has a URLPermission for connecting to the * given URL, then return a SocketPermission which permits * access to that destination. Return null otherwise. The permission * is cached in a field (which can only be changed by redirects) @@ -969,7 +968,10 @@ public class HttpURLConnection extends java.net.HttpURLConnection { String actions = getRequestMethod()+":" + getUserSetHeaders().getHeaderNamesInList(); - HttpURLPermission p = new HttpURLPermission(url.toString(), actions); + String urlstring = url.getProtocol() + "://" + url.getAuthority() + + url.getPath(); + + URLPermission p = new URLPermission(urlstring, actions); try { sm.checkPermission(p); socketPermission = newPerm; @@ -1188,8 +1190,7 @@ public class HttpURLConnection extends java.net.HttpURLConnection { public OutputStream run() throws IOException { return getOutputStream0(); } - } -// }, null, p -- replace line above, when limited doPriv ready + }, null, p ); } catch (PrivilegedActionException e) { throw (IOException) e.getException(); @@ -1372,8 +1373,7 @@ public class HttpURLConnection extends java.net.HttpURLConnection { public InputStream run() throws IOException { return getInputStream0(); } - } -// }, null, p -- replace line above, when limited doPriv ready + }, null, p ); } catch (PrivilegedActionException e) { throw (IOException) e.getException(); @@ -2507,8 +2507,7 @@ public class HttpURLConnection extends java.net.HttpURLConnection { public Boolean run() throws IOException { return followRedirect0(loc, stat, locUrl0); } - } -// }, null, p -- replace line above, when limited doPriv ready + }, null, p ); } catch (PrivilegedActionException e) { throw (IOException) e.getException(); diff --git a/jdk/src/share/classes/sun/security/tools/policytool/PolicyTool.java b/jdk/src/share/classes/sun/security/tools/policytool/PolicyTool.java index c1f12c09b7f..c4ffc670d4a 100644 --- a/jdk/src/share/classes/sun/security/tools/policytool/PolicyTool.java +++ b/jdk/src/share/classes/sun/security/tools/policytool/PolicyTool.java @@ -1447,7 +1447,7 @@ class ToolDialog extends Dialog { PERM_ARRAY.add(new AWTPerm()); PERM_ARRAY.add(new DelegationPerm()); PERM_ARRAY.add(new FilePerm()); - PERM_ARRAY.add(new HttpURLPerm()); + PERM_ARRAY.add(new URLPerm()); PERM_ARRAY.add(new InqSecContextPerm()); PERM_ARRAY.add(new LogPerm()); PERM_ARRAY.add(new MgmtPerm()); @@ -3843,10 +3843,10 @@ class FilePerm extends Perm { } } -class HttpURLPerm extends Perm { - public HttpURLPerm() { - super("HttpURLPermission", - "java.net.HttpURLPermission", +class URLPerm extends Perm { + public URLPerm() { + super("URLPermission", + "java.net.URLPermission", new String[] { "<"+ PolicyTool.rb.getString("url") + ">", }, diff --git a/jdk/test/java/net/HttpURLPermission/HttpURLPermissionTest.java b/jdk/test/java/net/HttpURLPermission/HttpURLPermissionTest.java deleted file mode 100644 index 4f4ea85d495..00000000000 --- a/jdk/test/java/net/HttpURLPermission/HttpURLPermissionTest.java +++ /dev/null @@ -1,204 +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. - * - * 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.net.HttpURLPermission; -import java.io.*; - -/** - * @test - * @bug 8010464 - */ - -public class HttpURLPermissionTest { - - // super class for all test types - abstract static class Test { - boolean expected; - abstract boolean execute(); - }; - - // Tests URL part of implies() method. This is the main test. - static class URLImpliesTest extends Test { - String arg1, arg2; - - URLImpliesTest(String arg1, String arg2, boolean expected) { - this.arg1 = arg1; - this.arg2 = arg2; - this.expected = expected; - } - - boolean execute() { - HttpURLPermission p1 = new HttpURLPermission (arg1, "GET:*"); - HttpURLPermission p2 = new HttpURLPermission (arg2, "GET:*"); - boolean result = p1.implies(p2); - return result == expected; - } - }; - - static URLImpliesTest imtest(String arg1, String arg2, boolean expected) { - return new URLImpliesTest(arg1, arg2, expected); - } - - static class ActionImpliesTest extends Test { - String arg1, arg2; - - ActionImpliesTest(String arg1, String arg2, boolean expected) { - this.arg1 = arg1; - this.arg2 = arg2; - this.expected = expected; - } - - boolean execute() { - String url1 = "http://www.foo.com/-"; - String url2 = "http://www.foo.com/a/b"; - HttpURLPermission p1 = new HttpURLPermission(url1, arg1); - HttpURLPermission p2 = new HttpURLPermission(url2, arg2); - boolean result = p1.implies(p2); - return result == expected; - } - } - - static ActionImpliesTest actest(String arg1, String arg2, boolean expected) { - return new ActionImpliesTest(arg1, arg2, expected); - } - - static Test[] pathImplies = { - // single - imtest("http://www.foo.com/", "http://www.foo.com/", true), - imtest("http://www.bar.com/", "http://www.foo.com/", false), - imtest("http://www.foo.com/a/b", "http://www.foo.com/", false), - imtest("http://www.foo.com/a/b", "http://www.foo.com/a/b/c", false), - // wildcard - imtest("http://www.foo.com/a/b/*", "http://www.foo.com/a/b/c", true), - imtest("http://www.foo.com/a/b/*", "http://www.foo.com/a/b/*", true), - imtest("http://www.foo.com/a/b/*", "http://www.foo.com/a/b/c#frag", true), - imtest("http://www.foo.com/a/b/*", "http://www.foo.com/a/b/c#frag?foo=foo", true), - imtest("http://www.foo.com/a/b/*", "http://www.foo.com/b/b/c", false), - imtest("http://www.foo.com/a/b/*", "http://www.foo.com/a/b/c.html", true), - imtest("http://www.foo.com/a/b/*", "http://www.foo.com/a/b/c.html", true), - imtest("http://www.foo.com/a/b/*", "https://www.foo.com/a/b/c", false), - // recursive - imtest("http://www.foo.com/a/b/-", "http://www.foo.com/a/b/-", true), - imtest("http://www.foo.com/a/b/-", "http://www.foo.com/a/b/c", true), - imtest("http://www.foo.com/a/b/-", "http://www.foo.com/a/b/c#frag", true), - imtest("http://www.foo.com/a/b/-", "http://www.foo.com/a/b/c#frag?foo=foo", true), - imtest("http://www.foo.com/a/b/-", "http://www.foo.com/b/b/c", false), - imtest("http://www.foo.com/a/b/-", "http://www.foo.com/a/b/c.html", true), - imtest("http://www.foo.com/a/b/-", "http://www.foo.com/a/b/c.html", true), - imtest("http://www.foo.com/a/b/-", "http://www.foo.com/a/b/c/d/e.html", true), - imtest("https://www.foo.com/a/b/-", "http://www.foo.com/a/b/c/d/e.html", false), - imtest("http://www.foo.com/a/b/-", "http://www.foo.com/a/b/c/d/e#frag", true), - imtest("http://www.foo.com/a/b/-", "https://www.foo.com/a/b/c", false), - // special cases - imtest("http:*", "https://www.foo.com/a/b/c", false), - imtest("http:*", "http://www.foo.com/a/b/c", true), - imtest("http:*", "http://foo/bar", true), - imtest("http://foo/bar", "https://foo/bar", false) - }; - - static Test[] actionImplies = { - actest("GET", "GET", true), - actest("GET", "POST", false), - actest("GET:", "PUT", false), - actest("GET:", "GET", true), - actest("GET,POST", "GET", true), - actest("GET,POST:", "GET", true), - actest("GET:X-Foo", "GET:x-foo", true), - actest("GET:X-Foo,X-bar", "GET:x-foo", true), - actest("GET:X-Foo", "GET:x-boo", false), - actest("GET:X-Foo,X-Bar", "GET:x-bar,x-foo", true), - actest("GET:X-Bar,X-Foo,X-Bar,Y-Foo", "GET:x-bar,x-foo", true), - actest("GET:*", "GET:x-bar,x-foo", true), - actest("*:*", "GET:x-bar,x-foo", true) - }; - - static boolean failed = false; - - public static void main(String args[]) throws Exception { - for (int i=0; i Date: Mon, 14 Oct 2013 17:27:20 -0700 Subject: [PATCH 110/131] 8026362: java/lang/invoke/lambda/LogGeneratedClassesTest.java failed on windows, jtreg report Fail to org.testng.SkipException Reviewed-by: chegar --- .../java/lang/invoke/lambda/LogGeneratedClassesTest.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/jdk/test/java/lang/invoke/lambda/LogGeneratedClassesTest.java b/jdk/test/java/lang/invoke/lambda/LogGeneratedClassesTest.java index c34e6e4ae79..dc34bba24b9 100644 --- a/jdk/test/java/lang/invoke/lambda/LogGeneratedClassesTest.java +++ b/jdk/test/java/lang/invoke/lambda/LogGeneratedClassesTest.java @@ -167,8 +167,12 @@ public class LogGeneratedClassesTest extends LUtils { public void testDumpDirNotWritable() throws IOException { if (! Files.getFileStore(Paths.get(".")) .supportsFileAttributeView(PosixFileAttributeView.class)) { - // No easy way to setup readonly directory - throw new SkipException("Posix not supported"); + // No easy way to setup readonly directory without POSIX + // We would like to skip the test with a cause with + // throw new SkipException("Posix not supported"); + // but jtreg will report failure so we just pass the test + // which we can look at if jtreg changed its behavior + return; } Files.createDirectory(Paths.get("readOnly"), From c839f538b65d4d1db8613fc72c570c9614ae8012 Mon Sep 17 00:00:00 2001 From: Joe Wang Date: Mon, 14 Oct 2013 22:24:49 -0700 Subject: [PATCH 111/131] 8015092: SchemaFactory cannot parse schema if whitespace added within patterns in Selector XPath expression Reviewed-by: lancea, alanb --- .../8015092/XPathWhiteSpaceTest.java | 60 +++++++++++++++++++ .../xml/jaxp/validation/8015092/idIxpns.xsd | 12 ++++ .../xml/jaxp/validation/8015092/idIxpns1.xsd | 12 ++++ .../xml/jaxp/validation/8015092/idJ029.xsd | 21 +++++++ .../xml/jaxp/validation/8015092/idJimp.xsd | 11 ++++ 5 files changed, 116 insertions(+) create mode 100644 jdk/test/javax/xml/jaxp/validation/8015092/XPathWhiteSpaceTest.java create mode 100644 jdk/test/javax/xml/jaxp/validation/8015092/idIxpns.xsd create mode 100644 jdk/test/javax/xml/jaxp/validation/8015092/idIxpns1.xsd create mode 100644 jdk/test/javax/xml/jaxp/validation/8015092/idJ029.xsd create mode 100644 jdk/test/javax/xml/jaxp/validation/8015092/idJimp.xsd diff --git a/jdk/test/javax/xml/jaxp/validation/8015092/XPathWhiteSpaceTest.java b/jdk/test/javax/xml/jaxp/validation/8015092/XPathWhiteSpaceTest.java new file mode 100644 index 00000000000..c4c4fa2ae54 --- /dev/null +++ b/jdk/test/javax/xml/jaxp/validation/8015092/XPathWhiteSpaceTest.java @@ -0,0 +1,60 @@ +/* + * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + + +/** + * @test + * @bug 8015092 + * @summary whitespace within patterns in Selector XPath expression is accepted + * @run main/othervm XPathWhiteSpaceTest + */ + +import java.io.*; +import javax.xml.XMLConstants; +import javax.xml.validation.Schema; +import javax.xml.validation.SchemaFactory; +import org.xml.sax.SAXException; + +/** + * http://www.w3.org/TR/xmlschema-1/#coss-identity-constraint + * For readability, whitespace may be used in selector XPath expressions even though + * not explicitly allowed by the grammar: + * whitespace may be freely added within patterns before or after any token. + * + * @author huizhe.wang@oracle.com + */ +public class XPathWhiteSpaceTest { + static final String XSDFILE = "idJ029.xsd"; + + public static void main(String[] args) throws Exception { + try{ + SchemaFactory schemaFactory = SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI); + Schema schema = schemaFactory.newSchema(new File(System.getProperty("test.src", "."), XSDFILE)); + } catch (SAXException e) { + throw new RuntimeException(e.getMessage()); + } + + + } + +} diff --git a/jdk/test/javax/xml/jaxp/validation/8015092/idIxpns.xsd b/jdk/test/javax/xml/jaxp/validation/8015092/idIxpns.xsd new file mode 100644 index 00000000000..941695faf53 --- /dev/null +++ b/jdk/test/javax/xml/jaxp/validation/8015092/idIxpns.xsd @@ -0,0 +1,12 @@ + + + + + + + + + + + + diff --git a/jdk/test/javax/xml/jaxp/validation/8015092/idIxpns1.xsd b/jdk/test/javax/xml/jaxp/validation/8015092/idIxpns1.xsd new file mode 100644 index 00000000000..d0ff89a7805 --- /dev/null +++ b/jdk/test/javax/xml/jaxp/validation/8015092/idIxpns1.xsd @@ -0,0 +1,12 @@ + + + + + + + + + + + + diff --git a/jdk/test/javax/xml/jaxp/validation/8015092/idJ029.xsd b/jdk/test/javax/xml/jaxp/validation/8015092/idJ029.xsd new file mode 100644 index 00000000000..9b83e2958d8 --- /dev/null +++ b/jdk/test/javax/xml/jaxp/validation/8015092/idJ029.xsd @@ -0,0 +1,21 @@ + + + + + + + + + + + + + + + + + + + + + diff --git a/jdk/test/javax/xml/jaxp/validation/8015092/idJimp.xsd b/jdk/test/javax/xml/jaxp/validation/8015092/idJimp.xsd new file mode 100644 index 00000000000..c2b966af9a5 --- /dev/null +++ b/jdk/test/javax/xml/jaxp/validation/8015092/idJimp.xsd @@ -0,0 +1,11 @@ + + + + + + + + + + + From c3a2245bba3f656923abbb407cd67f565b8f0b1e Mon Sep 17 00:00:00 2001 From: Jaroslav Bachorik Date: Tue, 15 Oct 2013 10:26:34 +0200 Subject: [PATCH 112/131] 6804470: JvmstatCountersTest.java test times out on slower machines Increasing the default timeout to cater for the slower machines Reviewed-by: alanb --- .../jmxremote/bootstrap/JvmstatCountersTest.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/jdk/test/sun/management/jmxremote/bootstrap/JvmstatCountersTest.java b/jdk/test/sun/management/jmxremote/bootstrap/JvmstatCountersTest.java index 07c9bcc33d8..442f2b4c5bd 100644 --- a/jdk/test/sun/management/jmxremote/bootstrap/JvmstatCountersTest.java +++ b/jdk/test/sun/management/jmxremote/bootstrap/JvmstatCountersTest.java @@ -29,10 +29,10 @@ * @author Luis-Miguel Alventosa * @run clean JvmstatCountersTest * @run build JvmstatCountersTest - * @run main/othervm JvmstatCountersTest 1 - * @run main/othervm -Dcom.sun.management.jmxremote JvmstatCountersTest 2 - * @run main/othervm -Dcom.sun.management.jmxremote.port=0 -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.ssl=false JvmstatCountersTest 3 - * @run main/othervm JvmstatCountersTest 4 + * @run main/othervm/timeout=600 JvmstatCountersTest 1 + * @run main/othervm/timeout=600 -Dcom.sun.management.jmxremote JvmstatCountersTest 2 + * @run main/othervm/timeout=600 -Dcom.sun.management.jmxremote.port=0 -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.ssl=false JvmstatCountersTest 3 + * @run main/othervm/timeout=600 JvmstatCountersTest 4 */ import java.io.*; From f5ed80ef596a72376921869cc103684c099c8fad Mon Sep 17 00:00:00 2001 From: Alan Bateman Date: Tue, 15 Oct 2013 10:52:09 +0100 Subject: [PATCH 113/131] 8026398: Can't load jdk.Exported, ClassNotFoundException Reviewed-by: chegar, mchung --- .../tools/buildmetaindex/BuildMetaIndex.java | 24 ++++++++++++------- 1 file changed, 16 insertions(+), 8 deletions(-) diff --git a/jdk/make/tools/src/build/tools/buildmetaindex/BuildMetaIndex.java b/jdk/make/tools/src/build/tools/buildmetaindex/BuildMetaIndex.java index f573c57e99f..f08b115912e 100644 --- a/jdk/make/tools/src/build/tools/buildmetaindex/BuildMetaIndex.java +++ b/jdk/make/tools/src/build/tools/buildmetaindex/BuildMetaIndex.java @@ -173,6 +173,12 @@ class JarMetaIndex { */ private HashMap> knownPrefixMap = new HashMap<>(); + /** + * Special value for the HashSet to indicate that there are classes in + * the top-level package. + */ + private static final String TOP_LEVEL = "TOP"; + /* * A class for mapping package prefixes to the number of * levels of package elements to include. @@ -212,7 +218,7 @@ class JarMetaIndex { /* - * We add maximum 5 second level entries to "sun", "java" and + * We add maximum 5 second level entries to "sun", "jdk", "java" and * "javax" entries. Tune this parameter to get a balance on the * cold start and footprint. */ @@ -223,6 +229,7 @@ class JarMetaIndex { JarMetaIndex(String fileName) throws IOException { jar = new JarFile(fileName); knownPrefixMap.put("sun", new HashSet()); + knownPrefixMap.put("jdk", new HashSet()); knownPrefixMap.put("java", new HashSet()); knownPrefixMap.put("javax", new HashSet()); } @@ -336,12 +343,12 @@ class JarMetaIndex { return false; } - String secondPkgElement = name.substring(firstSlashIndex + 1, - name.indexOf("/", - firstSlashIndex + 1)); - /* Add the second level package name to the corresponding hashset. */ - if (secondPkgElement != null) { + int secondSlashIndex = name.indexOf("/", firstSlashIndex+1); + if (secondSlashIndex == -1) { + pkgSet.add(TOP_LEVEL); + } else { + String secondPkgElement = name.substring(firstSlashIndex+1, secondSlashIndex); pkgSet.add(secondPkgElement); } @@ -368,8 +375,9 @@ class JarMetaIndex { if (setSize == 0) { continue; } - else if (setSize > JarMetaIndex.MAX_PKGS_WITH_KNOWN_PREFIX) { - indexSet.add(key + "/"); + if (setSize > JarMetaIndex.MAX_PKGS_WITH_KNOWN_PREFIX || + pkgSetStartsWithKey.contains(TOP_LEVEL)) { + indexSet.add(key + "/"); } else { /* If the set contains less than MAX_PKGS_WITH_KNOWN_PREFIX, add * them to the indexSet of the MetaIndex object. From c630cf1e68ebe083e344719f6264e33ecbf82a07 Mon Sep 17 00:00:00 2001 From: Daniel Fuchs Date: Tue, 15 Oct 2013 13:01:28 +0200 Subject: [PATCH 114/131] 8026404: Logging in Applet can trigger ACE: access denied ("java.lang.RuntimePermission" "modifyThreadGroup") The test 'threadGroup.getParent() == null' can sometimes throw ACE and needs to be wrapped in doPrivileged. Reviewed-by: alanb, mchung, dholmes --- jdk/src/share/classes/sun/awt/AppContext.java | 11 ++- jdk/test/TEST.groups | 1 + .../java/util/logging/TestMainAppContext.java | 85 +++++++++++++++++++ 3 files changed, 96 insertions(+), 1 deletion(-) create mode 100644 jdk/test/java/util/logging/TestMainAppContext.java diff --git a/jdk/src/share/classes/sun/awt/AppContext.java b/jdk/src/share/classes/sun/awt/AppContext.java index dbdc920dd5f..a9e86fb5f83 100644 --- a/jdk/src/share/classes/sun/awt/AppContext.java +++ b/jdk/src/share/classes/sun/awt/AppContext.java @@ -839,6 +839,15 @@ public final class AppContext { return (numAppContexts.get() == 1 && mainAppContext != null); } + private boolean hasRootThreadGroup(final AppContext ecx) { + return AccessController.doPrivileged(new PrivilegedAction() { + @Override + public Boolean run() { + return ecx.threadGroup.getParent() == null; + } + }); + } + /** * Returns the AppContext used for applet logging isolation, or null if * the default global context can be used. @@ -886,7 +895,7 @@ public final class AppContext { // See: JDK-8023258 final boolean isMainAppContext = ecx == null || mainAppContext == ecx - || mainAppContext == null && ecx.threadGroup.getParent() == null; + || mainAppContext == null && hasRootThreadGroup(ecx); return isMainAppContext ? null : ecx; } diff --git a/jdk/test/TEST.groups b/jdk/test/TEST.groups index 23c9a833209..aa305fd723c 100644 --- a/jdk/test/TEST.groups +++ b/jdk/test/TEST.groups @@ -360,6 +360,7 @@ needs_jre = \ java/security/Security/ClassLoaderDeadlock/Deadlock.sh \ java/util/logging/Listeners.java \ java/util/logging/ListenersWithSM.java \ + java/util/logging/TestMainAppContext.java \ java/util/ResourceBundle/Control/Bug6530694.java \ java/text/Bidi/BidiConformance.java \ java/text/Bidi/BidiEmbeddingTest.java \ diff --git a/jdk/test/java/util/logging/TestMainAppContext.java b/jdk/test/java/util/logging/TestMainAppContext.java new file mode 100644 index 00000000000..28c3fc1428d --- /dev/null +++ b/jdk/test/java/util/logging/TestMainAppContext.java @@ -0,0 +1,85 @@ +/* + * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ +import java.util.logging.Logger; +import sun.awt.AppContext; +import sun.awt.SunToolkit; + + +/** + * @test + * @bug 8026404 + * @summary checks that calling getLogger() from a Thread whose ThreadGroup is + * a child of the main root group doesn't throw an exception. + * @build TestMainAppContext + * @run main/othervm TestMainAppContext + * @author danielfuchs + */ +public class TestMainAppContext { + + static volatile Throwable thrown = null; + + public static void main(String... args) throws Exception { + ThreadGroup rootTG = Thread.currentThread().getThreadGroup(); + while (rootTG.getParent() != null) { + rootTG = rootTG.getParent(); + } + + ThreadGroup tg = new ThreadGroup(rootTG, "FakeApplet"); + final Thread t1 = new Thread(tg, "createNewAppContext") { + @Override + public void run() { + try { + AppContext context = SunToolkit.createNewAppContext(); + } catch(Throwable t) { + thrown = t; + } + } + }; + t1.start(); + t1.join(); + if (thrown != null) { + throw new RuntimeException("Unexpected exception: " + thrown, thrown); + } + Thread t2 = new Thread(tg, "BugDetector") { + + @Override + public void run() { + try { + Logger.getLogger("foo").info("Done"); + } catch (Throwable x) { + thrown = x; + } + } + + }; + + System.setSecurityManager(new SecurityManager()); + t2.start(); + t2.join(); + if (thrown != null) { + throw new RuntimeException("Test failed: " + thrown, thrown); + } + + } + +} From 65322444556d95c21174a0795e5242188a2ba003 Mon Sep 17 00:00:00 2001 From: Roger Riggs Date: Tue, 15 Oct 2013 13:14:03 -0400 Subject: [PATCH 115/131] 8025722: TemporalAdjusters and TemporalQueries Move static from interfaces methods to supporting classes Reviewed-by: sherman --- .../share/classes/java/time/DayOfWeek.java | 3 +- jdk/src/share/classes/java/time/Instant.java | 8 +- .../share/classes/java/time/LocalDate.java | 8 +- .../classes/java/time/LocalDateTime.java | 4 +- .../share/classes/java/time/LocalTime.java | 16 +- jdk/src/share/classes/java/time/Month.java | 5 +- jdk/src/share/classes/java/time/MonthDay.java | 4 +- .../classes/java/time/OffsetDateTime.java | 14 +- .../share/classes/java/time/OffsetTime.java | 10 +- jdk/src/share/classes/java/time/Period.java | 4 +- jdk/src/share/classes/java/time/Year.java | 6 +- .../share/classes/java/time/YearMonth.java | 6 +- jdk/src/share/classes/java/time/ZoneId.java | 9 +- .../share/classes/java/time/ZoneOffset.java | 8 +- .../java/time/chrono/AbstractChronology.java | 6 +- .../java/time/chrono/ChronoLocalDate.java | 11 +- .../java/time/chrono/ChronoLocalDateTime.java | 11 +- .../java/time/chrono/ChronoPeriodImpl.java | 4 +- .../java/time/chrono/ChronoZonedDateTime.java | 13 +- .../classes/java/time/chrono/Chronology.java | 15 +- .../share/classes/java/time/chrono/Era.java | 3 +- .../java/time/chrono/JapaneseChronology.java | 7 +- .../time/format/DateTimeFormatterBuilder.java | 31 +- .../time/format/DateTimePrintContext.java | 11 +- .../classes/java/time/format/Parsed.java | 13 +- .../java/time/temporal/TemporalAccessor.java | 10 +- .../java/time/temporal/TemporalAdjuster.java | 318 +----------------- .../java/time/temporal/TemporalAdjusters.java | 76 +++-- .../java/time/temporal/TemporalAmount.java | 4 +- .../java/time/temporal/TemporalQueries.java | 246 +++++++++++++- .../java/time/temporal/TemporalQuery.java | 221 +----------- .../java/time/temporal/package-info.java | 16 +- .../time/zone/ZoneOffsetTransitionRule.java | 4 +- .../share/classes/java/util/Formatter.java | 4 +- .../java/time/tck/java/time/TCKDayOfWeek.java | 15 +- .../java/time/tck/java/time/TCKInstant.java | 15 +- .../java/time/tck/java/time/TCKLocalDate.java | 15 +- .../time/tck/java/time/TCKLocalDateTime.java | 15 +- .../java/time/tck/java/time/TCKLocalTime.java | 17 +- .../java/time/tck/java/time/TCKMonth.java | 15 +- .../java/time/tck/java/time/TCKMonthDay.java | 15 +- .../time/tck/java/time/TCKOffsetDateTime.java | 15 +- .../time/tck/java/time/TCKOffsetTime.java | 15 +- jdk/test/java/time/tck/java/time/TCKYear.java | 19 +- .../java/time/tck/java/time/TCKYearMonth.java | 23 +- .../java/time/tck/java/time/TCKZoneId.java | 3 +- .../time/tck/java/time/TCKZoneOffset.java | 15 +- .../time/tck/java/time/TCKZonedDateTime.java | 25 +- .../time/tck/java/time/TestIsoChronology.java | 6 +- .../time/tck/java/time/chrono/CopticDate.java | 2 +- .../time/chrono/TCKChronoLocalDateTime.java | 2 +- .../time/chrono/TCKChronoZonedDateTime.java | 2 +- .../java/time/chrono/TCKIsoChronology.java | 18 +- .../time/chrono/TCKJapaneseChronology.java | 13 +- .../java/time/chrono/TCKMinguoChronology.java | 8 +- .../chrono/TCKThaiBuddhistChronology.java | 6 +- .../time/format/TCKChronoPrinterParser.java | 5 +- .../time/format/TCKDateTimeFormatters.java | 7 +- .../time/format/TCKDateTimeParseResolver.java | 86 ++--- .../format/TCKLocalizedPrinterParser.java | 8 +- .../time/format/TCKZoneIdPrinterParser.java | 34 +- .../time/temporal/TCKTemporalAdjusters.java | 89 ++--- .../time/chrono/TestUmmAlQuraChronology.java | 16 +- .../time/format/TestCharLiteralParser.java | 6 +- .../java/time/format/TestNonIsoFormatter.java | 4 +- .../java/time/format/TestNumberParser.java | 26 +- .../time/format/TestStringLiteralParser.java | 6 +- .../format/TestZoneTextPrinterParser.java | 6 +- .../time/test/java/util/TestFormatter.java | 4 +- 69 files changed, 745 insertions(+), 960 deletions(-) diff --git a/jdk/src/share/classes/java/time/DayOfWeek.java b/jdk/src/share/classes/java/time/DayOfWeek.java index 605c57710ec..ecd03f2803d 100644 --- a/jdk/src/share/classes/java/time/DayOfWeek.java +++ b/jdk/src/share/classes/java/time/DayOfWeek.java @@ -71,6 +71,7 @@ import java.time.temporal.Temporal; import java.time.temporal.TemporalAccessor; import java.time.temporal.TemporalAdjuster; import java.time.temporal.TemporalField; +import java.time.temporal.TemporalQueries; import java.time.temporal.TemporalQuery; import java.time.temporal.UnsupportedTemporalTypeException; import java.time.temporal.ValueRange; @@ -403,7 +404,7 @@ public enum DayOfWeek implements TemporalAccessor, TemporalAdjuster { @SuppressWarnings("unchecked") @Override public R query(TemporalQuery query) { - if (query == TemporalQuery.precision()) { + if (query == TemporalQueries.precision()) { return (R) DAYS; } return TemporalAccessor.super.query(query); diff --git a/jdk/src/share/classes/java/time/Instant.java b/jdk/src/share/classes/java/time/Instant.java index e7a264159d3..0ad4e2bb2fd 100644 --- a/jdk/src/share/classes/java/time/Instant.java +++ b/jdk/src/share/classes/java/time/Instant.java @@ -76,7 +76,6 @@ import java.io.DataInput; import java.io.DataOutput; import java.io.IOException; import java.io.InvalidObjectException; -import java.io.InvalidObjectException; import java.io.Serializable; import java.time.format.DateTimeFormatter; import java.time.format.DateTimeParseException; @@ -87,6 +86,7 @@ import java.time.temporal.TemporalAccessor; import java.time.temporal.TemporalAdjuster; import java.time.temporal.TemporalAmount; import java.time.temporal.TemporalField; +import java.time.temporal.TemporalQueries; import java.time.temporal.TemporalQuery; import java.time.temporal.TemporalUnit; import java.time.temporal.UnsupportedTemporalTypeException; @@ -1050,12 +1050,12 @@ public final class Instant @SuppressWarnings("unchecked") @Override public R query(TemporalQuery query) { - if (query == TemporalQuery.precision()) { + if (query == TemporalQueries.precision()) { return (R) NANOS; } // inline TemporalAccessor.super.query(query) as an optimization - if (query == TemporalQuery.chronology() || query == TemporalQuery.zoneId() || - query == TemporalQuery.zone() || query == TemporalQuery.offset()) { + if (query == TemporalQueries.chronology() || query == TemporalQueries.zoneId() || + query == TemporalQueries.zone() || query == TemporalQueries.offset()) { return null; } return query.queryFrom(this); diff --git a/jdk/src/share/classes/java/time/LocalDate.java b/jdk/src/share/classes/java/time/LocalDate.java index 4ac39968b64..e8447877a6e 100644 --- a/jdk/src/share/classes/java/time/LocalDate.java +++ b/jdk/src/share/classes/java/time/LocalDate.java @@ -78,7 +78,6 @@ import java.io.DataInput; import java.io.DataOutput; import java.io.IOException; import java.io.InvalidObjectException; -import java.io.InvalidObjectException; import java.io.Serializable; import java.time.chrono.ChronoLocalDate; import java.time.chrono.Era; @@ -92,6 +91,7 @@ import java.time.temporal.TemporalAccessor; import java.time.temporal.TemporalAdjuster; import java.time.temporal.TemporalAmount; import java.time.temporal.TemporalField; +import java.time.temporal.TemporalQueries; import java.time.temporal.TemporalQuery; import java.time.temporal.TemporalUnit; import java.time.temporal.UnsupportedTemporalTypeException; @@ -342,7 +342,7 @@ public final class LocalDate * A {@code TemporalAccessor} represents an arbitrary set of date and time information, * which this factory converts to an instance of {@code LocalDate}. *

          - * The conversion uses the {@link TemporalQuery#localDate()} query, which relies + * The conversion uses the {@link TemporalQueries#localDate()} query, which relies * on extracting the {@link ChronoField#EPOCH_DAY EPOCH_DAY} field. *

          * This method matches the signature of the functional interface {@link TemporalQuery} @@ -354,7 +354,7 @@ public final class LocalDate */ public static LocalDate from(TemporalAccessor temporal) { Objects.requireNonNull(temporal, "temporal"); - LocalDate date = temporal.query(TemporalQuery.localDate()); + LocalDate date = temporal.query(TemporalQueries.localDate()); if (date == null) { throw new DateTimeException("Unable to obtain LocalDate from TemporalAccessor: " + temporal + " of type " + temporal.getClass().getName()); @@ -1501,7 +1501,7 @@ public final class LocalDate @SuppressWarnings("unchecked") @Override public R query(TemporalQuery query) { - if (query == TemporalQuery.localDate()) { + if (query == TemporalQueries.localDate()) { return (R) this; } return ChronoLocalDate.super.query(query); diff --git a/jdk/src/share/classes/java/time/LocalDateTime.java b/jdk/src/share/classes/java/time/LocalDateTime.java index 30107f2358a..d0d1c9fc395 100644 --- a/jdk/src/share/classes/java/time/LocalDateTime.java +++ b/jdk/src/share/classes/java/time/LocalDateTime.java @@ -76,7 +76,6 @@ import java.io.DataInput; import java.io.DataOutput; import java.io.IOException; import java.io.InvalidObjectException; -import java.io.InvalidObjectException; import java.io.Serializable; import java.time.chrono.ChronoLocalDateTime; import java.time.format.DateTimeFormatter; @@ -88,6 +87,7 @@ import java.time.temporal.TemporalAccessor; import java.time.temporal.TemporalAdjuster; import java.time.temporal.TemporalAmount; import java.time.temporal.TemporalField; +import java.time.temporal.TemporalQueries; import java.time.temporal.TemporalQuery; import java.time.temporal.TemporalUnit; import java.time.temporal.UnsupportedTemporalTypeException; @@ -1579,7 +1579,7 @@ public final class LocalDateTime @SuppressWarnings("unchecked") @Override // override for Javadoc public R query(TemporalQuery query) { - if (query == TemporalQuery.localDate()) { + if (query == TemporalQueries.localDate()) { return (R) date; } return ChronoLocalDateTime.super.query(query); diff --git a/jdk/src/share/classes/java/time/LocalTime.java b/jdk/src/share/classes/java/time/LocalTime.java index 1ac9737a16f..786e84072d5 100644 --- a/jdk/src/share/classes/java/time/LocalTime.java +++ b/jdk/src/share/classes/java/time/LocalTime.java @@ -74,7 +74,6 @@ import java.io.DataInput; import java.io.DataOutput; import java.io.IOException; import java.io.InvalidObjectException; -import java.io.InvalidObjectException; import java.io.Serializable; import java.time.format.DateTimeFormatter; import java.time.format.DateTimeParseException; @@ -85,6 +84,7 @@ import java.time.temporal.TemporalAccessor; import java.time.temporal.TemporalAdjuster; import java.time.temporal.TemporalAmount; import java.time.temporal.TemporalField; +import java.time.temporal.TemporalQueries; import java.time.temporal.TemporalQuery; import java.time.temporal.TemporalUnit; import java.time.temporal.UnsupportedTemporalTypeException; @@ -383,7 +383,7 @@ public final class LocalTime * A {@code TemporalAccessor} represents an arbitrary set of date and time information, * which this factory converts to an instance of {@code LocalTime}. *

          - * The conversion uses the {@link TemporalQuery#localTime()} query, which relies + * The conversion uses the {@link TemporalQueries#localTime()} query, which relies * on extracting the {@link ChronoField#NANO_OF_DAY NANO_OF_DAY} field. *

          * This method matches the signature of the functional interface {@link TemporalQuery} @@ -395,7 +395,7 @@ public final class LocalTime */ public static LocalTime from(TemporalAccessor temporal) { Objects.requireNonNull(temporal, "temporal"); - LocalTime time = temporal.query(TemporalQuery.localTime()); + LocalTime time = temporal.query(TemporalQueries.localTime()); if (time == null) { throw new DateTimeException("Unable to obtain LocalTime from TemporalAccessor: " + temporal + " of type " + temporal.getClass().getName()); @@ -1281,14 +1281,14 @@ public final class LocalTime @SuppressWarnings("unchecked") @Override public R query(TemporalQuery query) { - if (query == TemporalQuery.chronology() || query == TemporalQuery.zoneId() || - query == TemporalQuery.zone() || query == TemporalQuery.offset()) { + if (query == TemporalQueries.chronology() || query == TemporalQueries.zoneId() || + query == TemporalQueries.zone() || query == TemporalQueries.offset()) { return null; - } else if (query == TemporalQuery.localTime()) { + } else if (query == TemporalQueries.localTime()) { return (R) this; - } else if (query == TemporalQuery.localDate()) { + } else if (query == TemporalQueries.localDate()) { return null; - } else if (query == TemporalQuery.precision()) { + } else if (query == TemporalQueries.precision()) { return (R) NANOS; } // inline TemporalAccessor.super.query(query) as an optimization diff --git a/jdk/src/share/classes/java/time/Month.java b/jdk/src/share/classes/java/time/Month.java index 578212d3d6d..2e85b6cf601 100644 --- a/jdk/src/share/classes/java/time/Month.java +++ b/jdk/src/share/classes/java/time/Month.java @@ -73,6 +73,7 @@ import java.time.temporal.Temporal; import java.time.temporal.TemporalAccessor; import java.time.temporal.TemporalAdjuster; import java.time.temporal.TemporalField; +import java.time.temporal.TemporalQueries; import java.time.temporal.TemporalQuery; import java.time.temporal.UnsupportedTemporalTypeException; import java.time.temporal.ValueRange; @@ -560,9 +561,9 @@ public enum Month implements TemporalAccessor, TemporalAdjuster { @SuppressWarnings("unchecked") @Override public R query(TemporalQuery query) { - if (query == TemporalQuery.chronology()) { + if (query == TemporalQueries.chronology()) { return (R) IsoChronology.INSTANCE; - } else if (query == TemporalQuery.precision()) { + } else if (query == TemporalQueries.precision()) { return (R) MONTHS; } return TemporalAccessor.super.query(query); diff --git a/jdk/src/share/classes/java/time/MonthDay.java b/jdk/src/share/classes/java/time/MonthDay.java index 13986b6187b..458fbc792e9 100644 --- a/jdk/src/share/classes/java/time/MonthDay.java +++ b/jdk/src/share/classes/java/time/MonthDay.java @@ -68,7 +68,6 @@ import java.io.DataInput; import java.io.DataOutput; import java.io.IOException; import java.io.InvalidObjectException; -import java.io.InvalidObjectException; import java.io.Serializable; import java.time.chrono.Chronology; import java.time.chrono.IsoChronology; @@ -80,6 +79,7 @@ import java.time.temporal.Temporal; import java.time.temporal.TemporalAccessor; import java.time.temporal.TemporalAdjuster; import java.time.temporal.TemporalField; +import java.time.temporal.TemporalQueries; import java.time.temporal.TemporalQuery; import java.time.temporal.UnsupportedTemporalTypeException; import java.time.temporal.ValueRange; @@ -582,7 +582,7 @@ public final class MonthDay @SuppressWarnings("unchecked") @Override public R query(TemporalQuery query) { - if (query == TemporalQuery.chronology()) { + if (query == TemporalQueries.chronology()) { return (R) IsoChronology.INSTANCE; } return TemporalAccessor.super.query(query); diff --git a/jdk/src/share/classes/java/time/OffsetDateTime.java b/jdk/src/share/classes/java/time/OffsetDateTime.java index df474cbc089..62deaf7a398 100644 --- a/jdk/src/share/classes/java/time/OffsetDateTime.java +++ b/jdk/src/share/classes/java/time/OffsetDateTime.java @@ -69,7 +69,6 @@ import static java.time.temporal.ChronoUnit.FOREVER; import static java.time.temporal.ChronoUnit.NANOS; import java.io.IOException; -import java.io.InvalidObjectException; import java.io.ObjectInput; import java.io.ObjectOutput; import java.io.InvalidObjectException; @@ -84,6 +83,7 @@ import java.time.temporal.TemporalAccessor; import java.time.temporal.TemporalAdjuster; import java.time.temporal.TemporalAmount; import java.time.temporal.TemporalField; +import java.time.temporal.TemporalQueries; import java.time.temporal.TemporalQuery; import java.time.temporal.TemporalUnit; import java.time.temporal.UnsupportedTemporalTypeException; @@ -1527,17 +1527,17 @@ public final class OffsetDateTime @SuppressWarnings("unchecked") @Override public R query(TemporalQuery query) { - if (query == TemporalQuery.offset() || query == TemporalQuery.zone()) { + if (query == TemporalQueries.offset() || query == TemporalQueries.zone()) { return (R) getOffset(); - } else if (query == TemporalQuery.zoneId()) { + } else if (query == TemporalQueries.zoneId()) { return null; - } else if (query == TemporalQuery.localDate()) { + } else if (query == TemporalQueries.localDate()) { return (R) toLocalDate(); - } else if (query == TemporalQuery.localTime()) { + } else if (query == TemporalQueries.localTime()) { return (R) toLocalTime(); - } else if (query == TemporalQuery.chronology()) { + } else if (query == TemporalQueries.chronology()) { return (R) IsoChronology.INSTANCE; - } else if (query == TemporalQuery.precision()) { + } else if (query == TemporalQueries.precision()) { return (R) NANOS; } // inline TemporalAccessor.super.query(query) as an optimization diff --git a/jdk/src/share/classes/java/time/OffsetTime.java b/jdk/src/share/classes/java/time/OffsetTime.java index f3f646fa250..62d141b0dca 100644 --- a/jdk/src/share/classes/java/time/OffsetTime.java +++ b/jdk/src/share/classes/java/time/OffsetTime.java @@ -70,7 +70,6 @@ import static java.time.temporal.ChronoField.OFFSET_SECONDS; import static java.time.temporal.ChronoUnit.NANOS; import java.io.IOException; -import java.io.InvalidObjectException; import java.io.ObjectInput; import java.io.ObjectOutput; import java.io.InvalidObjectException; @@ -84,6 +83,7 @@ import java.time.temporal.TemporalAccessor; import java.time.temporal.TemporalAdjuster; import java.time.temporal.TemporalAmount; import java.time.temporal.TemporalField; +import java.time.temporal.TemporalQueries; import java.time.temporal.TemporalQuery; import java.time.temporal.TemporalUnit; import java.time.temporal.UnsupportedTemporalTypeException; @@ -1068,13 +1068,13 @@ public final class OffsetTime @SuppressWarnings("unchecked") @Override public R query(TemporalQuery query) { - if (query == TemporalQuery.offset() || query == TemporalQuery.zone()) { + if (query == TemporalQueries.offset() || query == TemporalQueries.zone()) { return (R) offset; - } else if (query == TemporalQuery.zoneId() | query == TemporalQuery.chronology() || query == TemporalQuery.localDate()) { + } else if (query == TemporalQueries.zoneId() | query == TemporalQueries.chronology() || query == TemporalQueries.localDate()) { return null; - } else if (query == TemporalQuery.localTime()) { + } else if (query == TemporalQueries.localTime()) { return (R) time; - } else if (query == TemporalQuery.precision()) { + } else if (query == TemporalQueries.precision()) { return (R) NANOS; } // inline TemporalAccessor.super.query(query) as an optimization diff --git a/jdk/src/share/classes/java/time/Period.java b/jdk/src/share/classes/java/time/Period.java index bd272a9913e..998eb6075c1 100644 --- a/jdk/src/share/classes/java/time/Period.java +++ b/jdk/src/share/classes/java/time/Period.java @@ -79,7 +79,7 @@ import java.time.temporal.ChronoUnit; import java.time.temporal.Temporal; import java.time.temporal.TemporalAccessor; import java.time.temporal.TemporalAmount; -import java.time.temporal.TemporalQuery; +import java.time.temporal.TemporalQueries; import java.time.temporal.TemporalUnit; import java.time.temporal.UnsupportedTemporalTypeException; import java.util.Arrays; @@ -958,7 +958,7 @@ public final class Period */ private void validateChrono(TemporalAccessor temporal) { Objects.requireNonNull(temporal, "temporal"); - Chronology temporalChrono = temporal.query(TemporalQuery.chronology()); + Chronology temporalChrono = temporal.query(TemporalQueries.chronology()); if (temporalChrono != null && IsoChronology.INSTANCE.equals(temporalChrono) == false) { throw new DateTimeException("Chronology mismatch, expected: ISO, actual: " + temporalChrono.getId()); } diff --git a/jdk/src/share/classes/java/time/Year.java b/jdk/src/share/classes/java/time/Year.java index 1ca262ebf32..ac239cb09d8 100644 --- a/jdk/src/share/classes/java/time/Year.java +++ b/jdk/src/share/classes/java/time/Year.java @@ -74,7 +74,6 @@ import java.io.DataInput; import java.io.DataOutput; import java.io.IOException; import java.io.InvalidObjectException; -import java.io.InvalidObjectException; import java.io.Serializable; import java.time.chrono.Chronology; import java.time.chrono.IsoChronology; @@ -89,6 +88,7 @@ import java.time.temporal.TemporalAccessor; import java.time.temporal.TemporalAdjuster; import java.time.temporal.TemporalAmount; import java.time.temporal.TemporalField; +import java.time.temporal.TemporalQueries; import java.time.temporal.TemporalQuery; import java.time.temporal.TemporalUnit; import java.time.temporal.UnsupportedTemporalTypeException; @@ -812,9 +812,9 @@ public final class Year @SuppressWarnings("unchecked") @Override public R query(TemporalQuery query) { - if (query == TemporalQuery.chronology()) { + if (query == TemporalQueries.chronology()) { return (R) IsoChronology.INSTANCE; - } else if (query == TemporalQuery.precision()) { + } else if (query == TemporalQueries.precision()) { return (R) YEARS; } return Temporal.super.query(query); diff --git a/jdk/src/share/classes/java/time/YearMonth.java b/jdk/src/share/classes/java/time/YearMonth.java index 3c12784d82e..5be6ca14fed 100644 --- a/jdk/src/share/classes/java/time/YearMonth.java +++ b/jdk/src/share/classes/java/time/YearMonth.java @@ -77,7 +77,6 @@ import java.io.DataInput; import java.io.DataOutput; import java.io.IOException; import java.io.InvalidObjectException; -import java.io.InvalidObjectException; import java.io.Serializable; import java.time.chrono.Chronology; import java.time.chrono.IsoChronology; @@ -92,6 +91,7 @@ import java.time.temporal.TemporalAccessor; import java.time.temporal.TemporalAdjuster; import java.time.temporal.TemporalAmount; import java.time.temporal.TemporalField; +import java.time.temporal.TemporalQueries; import java.time.temporal.TemporalQuery; import java.time.temporal.TemporalUnit; import java.time.temporal.UnsupportedTemporalTypeException; @@ -945,9 +945,9 @@ public final class YearMonth @SuppressWarnings("unchecked") @Override public R query(TemporalQuery query) { - if (query == TemporalQuery.chronology()) { + if (query == TemporalQueries.chronology()) { return (R) IsoChronology.INSTANCE; - } else if (query == TemporalQuery.precision()) { + } else if (query == TemporalQueries.precision()) { return (R) MONTHS; } return Temporal.super.query(query); diff --git a/jdk/src/share/classes/java/time/ZoneId.java b/jdk/src/share/classes/java/time/ZoneId.java index 6d42601c5b9..51f8d514957 100644 --- a/jdk/src/share/classes/java/time/ZoneId.java +++ b/jdk/src/share/classes/java/time/ZoneId.java @@ -69,6 +69,7 @@ import java.time.format.DateTimeFormatterBuilder; import java.time.format.TextStyle; import java.time.temporal.TemporalAccessor; import java.time.temporal.TemporalField; +import java.time.temporal.TemporalQueries; import java.time.temporal.TemporalQuery; import java.time.temporal.UnsupportedTemporalTypeException; import java.time.zone.ZoneRules; @@ -492,7 +493,7 @@ public abstract class ZoneId implements Serializable { * This factory converts the arbitrary temporal object to an instance of {@code ZoneId}. *

          * The conversion will try to obtain the zone in a way that favours region-based - * zones over offset-based zones using {@link TemporalQuery#zone()}. + * zones over offset-based zones using {@link TemporalQueries#zone()}. *

          * This method matches the signature of the functional interface {@link TemporalQuery} * allowing it to be used in queries via method reference, {@code ZoneId::from}. @@ -502,7 +503,7 @@ public abstract class ZoneId implements Serializable { * @throws DateTimeException if unable to convert to a {@code ZoneId} */ public static ZoneId from(TemporalAccessor temporal) { - ZoneId obj = temporal.query(TemporalQuery.zone()); + ZoneId obj = temporal.query(TemporalQueries.zone()); if (obj == null) { throw new DateTimeException("Unable to obtain ZoneId from TemporalAccessor: " + temporal + " of type " + temporal.getClass().getName()); @@ -558,7 +559,7 @@ public abstract class ZoneId implements Serializable { * methods on the interface have no meaning to {@code ZoneId}. *

          * The returned temporal has no supported fields, with the query method - * supporting the return of the zone using {@link TemporalQuery#zoneId()}. + * supporting the return of the zone using {@link TemporalQueries#zoneId()}. * * @return a temporal equivalent to this zone, not null */ @@ -575,7 +576,7 @@ public abstract class ZoneId implements Serializable { @SuppressWarnings("unchecked") @Override public R query(TemporalQuery query) { - if (query == TemporalQuery.zoneId()) { + if (query == TemporalQueries.zoneId()) { return (R) ZoneId.this; } return TemporalAccessor.super.query(query); diff --git a/jdk/src/share/classes/java/time/ZoneOffset.java b/jdk/src/share/classes/java/time/ZoneOffset.java index e1e4993ec26..f6d78ca3727 100644 --- a/jdk/src/share/classes/java/time/ZoneOffset.java +++ b/jdk/src/share/classes/java/time/ZoneOffset.java @@ -70,13 +70,13 @@ import java.io.DataInput; import java.io.DataOutput; import java.io.IOException; import java.io.InvalidObjectException; -import java.io.InvalidObjectException; import java.io.Serializable; import java.time.temporal.ChronoField; import java.time.temporal.Temporal; import java.time.temporal.TemporalAccessor; import java.time.temporal.TemporalAdjuster; import java.time.temporal.TemporalField; +import java.time.temporal.TemporalQueries; import java.time.temporal.TemporalQuery; import java.time.temporal.UnsupportedTemporalTypeException; import java.time.temporal.ValueRange; @@ -322,7 +322,7 @@ public final class ZoneOffset * A {@code TemporalAccessor} represents some form of date and time information. * This factory converts the arbitrary temporal object to an instance of {@code ZoneOffset}. *

          - * The conversion uses the {@link TemporalQuery#offset()} query, which relies + * The conversion uses the {@link TemporalQueries#offset()} query, which relies * on extracting the {@link ChronoField#OFFSET_SECONDS OFFSET_SECONDS} field. *

          * This method matches the signature of the functional interface {@link TemporalQuery} @@ -334,7 +334,7 @@ public final class ZoneOffset */ public static ZoneOffset from(TemporalAccessor temporal) { Objects.requireNonNull(temporal, "temporal"); - ZoneOffset offset = temporal.query(TemporalQuery.offset()); + ZoneOffset offset = temporal.query(TemporalQueries.offset()); if (offset == null) { throw new DateTimeException("Unable to obtain ZoneOffset from TemporalAccessor: " + temporal + " of type " + temporal.getClass().getName()); @@ -642,7 +642,7 @@ public final class ZoneOffset @SuppressWarnings("unchecked") @Override public R query(TemporalQuery query) { - if (query == TemporalQuery.offset() || query == TemporalQuery.zone()) { + if (query == TemporalQueries.offset() || query == TemporalQueries.zone()) { return (R) this; } return TemporalAccessor.super.query(query); diff --git a/jdk/src/share/classes/java/time/chrono/AbstractChronology.java b/jdk/src/share/classes/java/time/chrono/AbstractChronology.java index 89b728e88c9..e91c596f56c 100644 --- a/jdk/src/share/classes/java/time/chrono/AbstractChronology.java +++ b/jdk/src/share/classes/java/time/chrono/AbstractChronology.java @@ -77,7 +77,7 @@ import static java.time.temporal.ChronoField.YEAR_OF_ERA; import static java.time.temporal.ChronoUnit.DAYS; import static java.time.temporal.ChronoUnit.MONTHS; import static java.time.temporal.ChronoUnit.WEEKS; -import static java.time.temporal.TemporalAdjuster.nextOrSame; +import static java.time.temporal.TemporalAdjusters.nextOrSame; import java.io.DataInput; import java.io.DataOutput; @@ -89,7 +89,7 @@ import java.time.DateTimeException; import java.time.DayOfWeek; import java.time.format.ResolverStyle; import java.time.temporal.ChronoField; -import java.time.temporal.TemporalAdjuster; +import java.time.temporal.TemporalAdjusters; import java.time.temporal.TemporalField; import java.time.temporal.ValueRange; import java.util.Comparator; @@ -561,7 +561,7 @@ public abstract class AbstractChronology implements Chronology { try { return date(y, moy, dom); } catch (DateTimeException ex) { - return date(y, moy, 1).with(TemporalAdjuster.lastDayOfMonth()); + return date(y, moy, 1).with(TemporalAdjusters.lastDayOfMonth()); } } return date(y, moy, dom); diff --git a/jdk/src/share/classes/java/time/chrono/ChronoLocalDate.java b/jdk/src/share/classes/java/time/chrono/ChronoLocalDate.java index da5f0e719ce..9fba962c5ec 100644 --- a/jdk/src/share/classes/java/time/chrono/ChronoLocalDate.java +++ b/jdk/src/share/classes/java/time/chrono/ChronoLocalDate.java @@ -77,6 +77,7 @@ import java.time.temporal.TemporalAccessor; import java.time.temporal.TemporalAdjuster; import java.time.temporal.TemporalAmount; import java.time.temporal.TemporalField; +import java.time.temporal.TemporalQueries; import java.time.temporal.TemporalQuery; import java.time.temporal.TemporalUnit; import java.time.temporal.UnsupportedTemporalTypeException; @@ -292,7 +293,7 @@ public interface ChronoLocalDate return (ChronoLocalDate) temporal; } Objects.requireNonNull(temporal, "temporal"); - Chronology chrono = temporal.query(TemporalQuery.chronology()); + Chronology chrono = temporal.query(TemporalQueries.chronology()); if (chrono == null) { throw new DateTimeException("Unable to obtain ChronoLocalDate from TemporalAccessor: " + temporal.getClass()); } @@ -511,13 +512,13 @@ public interface ChronoLocalDate @SuppressWarnings("unchecked") @Override default R query(TemporalQuery query) { - if (query == TemporalQuery.zoneId() || query == TemporalQuery.zone() || query == TemporalQuery.offset()) { + if (query == TemporalQueries.zoneId() || query == TemporalQueries.zone() || query == TemporalQueries.offset()) { return null; - } else if (query == TemporalQuery.localTime()) { + } else if (query == TemporalQueries.localTime()) { return null; - } else if (query == TemporalQuery.chronology()) { + } else if (query == TemporalQueries.chronology()) { return (R) getChronology(); - } else if (query == TemporalQuery.precision()) { + } else if (query == TemporalQueries.precision()) { return (R) DAYS; } // inline TemporalAccessor.super.query(query) as an optimization diff --git a/jdk/src/share/classes/java/time/chrono/ChronoLocalDateTime.java b/jdk/src/share/classes/java/time/chrono/ChronoLocalDateTime.java index 353673c9dcd..0607932084f 100644 --- a/jdk/src/share/classes/java/time/chrono/ChronoLocalDateTime.java +++ b/jdk/src/share/classes/java/time/chrono/ChronoLocalDateTime.java @@ -80,6 +80,7 @@ import java.time.temporal.TemporalAccessor; import java.time.temporal.TemporalAdjuster; import java.time.temporal.TemporalAmount; import java.time.temporal.TemporalField; +import java.time.temporal.TemporalQueries; import java.time.temporal.TemporalQuery; import java.time.temporal.TemporalUnit; import java.time.zone.ZoneRules; @@ -166,7 +167,7 @@ public interface ChronoLocalDateTime return (ChronoLocalDateTime) temporal; } Objects.requireNonNull(temporal, "temporal"); - Chronology chrono = temporal.query(TemporalQuery.chronology()); + Chronology chrono = temporal.query(TemporalQueries.chronology()); if (chrono == null) { throw new DateTimeException("Unable to obtain ChronoLocalDateTime from TemporalAccessor: " + temporal.getClass()); } @@ -334,13 +335,13 @@ public interface ChronoLocalDateTime @SuppressWarnings("unchecked") @Override default R query(TemporalQuery query) { - if (query == TemporalQuery.zoneId() || query == TemporalQuery.zone() || query == TemporalQuery.offset()) { + if (query == TemporalQueries.zoneId() || query == TemporalQueries.zone() || query == TemporalQueries.offset()) { return null; - } else if (query == TemporalQuery.localTime()) { + } else if (query == TemporalQueries.localTime()) { return (R) toLocalTime(); - } else if (query == TemporalQuery.chronology()) { + } else if (query == TemporalQueries.chronology()) { return (R) getChronology(); - } else if (query == TemporalQuery.precision()) { + } else if (query == TemporalQueries.precision()) { return (R) NANOS; } // inline TemporalAccessor.super.query(query) as an optimization diff --git a/jdk/src/share/classes/java/time/chrono/ChronoPeriodImpl.java b/jdk/src/share/classes/java/time/chrono/ChronoPeriodImpl.java index d301adb2d03..221ce7443f7 100644 --- a/jdk/src/share/classes/java/time/chrono/ChronoPeriodImpl.java +++ b/jdk/src/share/classes/java/time/chrono/ChronoPeriodImpl.java @@ -72,7 +72,7 @@ import java.time.temporal.ChronoUnit; import java.time.temporal.Temporal; import java.time.temporal.TemporalAccessor; import java.time.temporal.TemporalAmount; -import java.time.temporal.TemporalQuery; +import java.time.temporal.TemporalQueries; import java.time.temporal.TemporalUnit; import java.time.temporal.UnsupportedTemporalTypeException; import java.time.temporal.ValueRange; @@ -308,7 +308,7 @@ final class ChronoPeriodImpl */ private void validateChrono(TemporalAccessor temporal) { Objects.requireNonNull(temporal, "temporal"); - Chronology temporalChrono = temporal.query(TemporalQuery.chronology()); + Chronology temporalChrono = temporal.query(TemporalQueries.chronology()); if (temporalChrono != null && chrono.equals(temporalChrono) == false) { throw new DateTimeException("Chronology mismatch, expected: " + chrono.getId() + ", actual: " + temporalChrono.getId()); } diff --git a/jdk/src/share/classes/java/time/chrono/ChronoZonedDateTime.java b/jdk/src/share/classes/java/time/chrono/ChronoZonedDateTime.java index caec8558e6e..24e3a3a514c 100644 --- a/jdk/src/share/classes/java/time/chrono/ChronoZonedDateTime.java +++ b/jdk/src/share/classes/java/time/chrono/ChronoZonedDateTime.java @@ -80,6 +80,7 @@ import java.time.temporal.TemporalAccessor; import java.time.temporal.TemporalAdjuster; import java.time.temporal.TemporalAmount; import java.time.temporal.TemporalField; +import java.time.temporal.TemporalQueries; import java.time.temporal.TemporalQuery; import java.time.temporal.TemporalUnit; import java.time.temporal.UnsupportedTemporalTypeException; @@ -167,7 +168,7 @@ public interface ChronoZonedDateTime return (ChronoZonedDateTime) temporal; } Objects.requireNonNull(temporal, "temporal"); - Chronology chrono = temporal.query(TemporalQuery.chronology()); + Chronology chrono = temporal.query(TemporalQueries.chronology()); if (chrono == null) { throw new DateTimeException("Unable to obtain ChronoZonedDateTime from TemporalAccessor: " + temporal.getClass()); } @@ -481,15 +482,15 @@ public interface ChronoZonedDateTime @SuppressWarnings("unchecked") @Override default R query(TemporalQuery query) { - if (query == TemporalQuery.zone() || query == TemporalQuery.zoneId()) { + if (query == TemporalQueries.zone() || query == TemporalQueries.zoneId()) { return (R) getZone(); - } else if (query == TemporalQuery.offset()) { + } else if (query == TemporalQueries.offset()) { return (R) getOffset(); - } else if (query == TemporalQuery.localTime()) { + } else if (query == TemporalQueries.localTime()) { return (R) toLocalTime(); - } else if (query == TemporalQuery.chronology()) { + } else if (query == TemporalQueries.chronology()) { return (R) getChronology(); - } else if (query == TemporalQuery.precision()) { + } else if (query == TemporalQueries.precision()) { return (R) NANOS; } // inline TemporalAccessor.super.query(query) as an optimization diff --git a/jdk/src/share/classes/java/time/chrono/Chronology.java b/jdk/src/share/classes/java/time/chrono/Chronology.java index 22a7e69ae25..184bcbe5064 100644 --- a/jdk/src/share/classes/java/time/chrono/Chronology.java +++ b/jdk/src/share/classes/java/time/chrono/Chronology.java @@ -73,6 +73,7 @@ import java.time.format.TextStyle; import java.time.temporal.ChronoField; import java.time.temporal.TemporalAccessor; import java.time.temporal.TemporalField; +import java.time.temporal.TemporalQueries; import java.time.temporal.TemporalQuery; import java.time.temporal.UnsupportedTemporalTypeException; import java.time.temporal.ValueRange; @@ -162,10 +163,10 @@ public interface Chronology extends Comparable { * A {@code TemporalAccessor} represents an arbitrary set of date and time information, * which this factory converts to an instance of {@code Chronology}. *

          - * The conversion will obtain the chronology using {@link TemporalQuery#chronology()}. + * The conversion will obtain the chronology using {@link TemporalQueries.chronology()}. * If the specified temporal object does not have a chronology, {@link IsoChronology} is returned. *

          - * This method matches the signature of the functional interface {@link TemporalQuery} + * This method matches the signature of the functional interface {@link TemporalQueries. * allowing it to be used in queries via method reference, {@code Chronology::from}. * * @param temporal the temporal to convert, not null @@ -174,7 +175,7 @@ public interface Chronology extends Comparable { */ static Chronology from(TemporalAccessor temporal) { Objects.requireNonNull(temporal, "temporal"); - Chronology obj = temporal.query(TemporalQuery.chronology()); + Chronology obj = temporal.query(TemporalQueries.chronology()); return (obj != null ? obj : IsoChronology.INSTANCE); } @@ -434,7 +435,7 @@ public interface Chronology extends Comparable { * The conversion typically uses the {@link ChronoField#EPOCH_DAY EPOCH_DAY} * field, which is standardized across calendar systems. *

          - * This method matches the signature of the functional interface {@link TemporalQuery} + * This method matches the signature of the functional interface {@link TemporalQueries. * allowing it to be used as a query via method reference, {@code aChronology::date}. * * @param temporal the temporal object to convert, not null @@ -457,7 +458,7 @@ public interface Chronology extends Comparable { * those fields that are equivalent to the relevant objects. * The result uses this chronology. *

          - * This method matches the signature of the functional interface {@link TemporalQuery} + * This method matches the signature of the functional interface {@link TemporalQueries. * allowing it to be used as a query via method reference, {@code aChronology::localDateTime}. * * @param temporal the temporal object to convert, not null @@ -489,7 +490,7 @@ public interface Chronology extends Comparable { * those fields that are equivalent to the relevant objects. * The result uses this chronology. *

          - * This method matches the signature of the functional interface {@link TemporalQuery} + * This method matches the signature of the functional interface {@link TemporalQueries. * allowing it to be used as a query via method reference, {@code aChronology::zonedDateTime}. * * @param temporal the temporal object to convert, not null @@ -641,7 +642,7 @@ public interface Chronology extends Comparable { @SuppressWarnings("unchecked") @Override public R query(TemporalQuery query) { - if (query == TemporalQuery.chronology()) { + if (query == TemporalQueries.chronology()) { return (R) Chronology.this; } return TemporalAccessor.super.query(query); diff --git a/jdk/src/share/classes/java/time/chrono/Era.java b/jdk/src/share/classes/java/time/chrono/Era.java index 0fd31c9887d..9cf57fc8fc1 100644 --- a/jdk/src/share/classes/java/time/chrono/Era.java +++ b/jdk/src/share/classes/java/time/chrono/Era.java @@ -73,6 +73,7 @@ import java.time.temporal.Temporal; import java.time.temporal.TemporalAccessor; import java.time.temporal.TemporalAdjuster; import java.time.temporal.TemporalField; +import java.time.temporal.TemporalQueries; import java.time.temporal.TemporalQuery; import java.time.temporal.ValueRange; import java.util.Locale; @@ -265,7 +266,7 @@ public interface Era extends TemporalAccessor, TemporalAdjuster { @SuppressWarnings("unchecked") @Override default R query(TemporalQuery query) { - if (query == TemporalQuery.precision()) { + if (query == TemporalQueries.precision()) { return (R) ERAS; } return TemporalAccessor.super.query(query); diff --git a/jdk/src/share/classes/java/time/chrono/JapaneseChronology.java b/jdk/src/share/classes/java/time/chrono/JapaneseChronology.java index 09e5b692ef2..41aa39a9392 100644 --- a/jdk/src/share/classes/java/time/chrono/JapaneseChronology.java +++ b/jdk/src/share/classes/java/time/chrono/JapaneseChronology.java @@ -56,8 +56,6 @@ */ package java.time.chrono; -import java.io.InvalidObjectException; -import java.io.ObjectStreamException; import static java.time.temporal.ChronoField.DAY_OF_MONTH; import static java.time.temporal.ChronoField.DAY_OF_YEAR; import static java.time.temporal.ChronoField.ERA; @@ -67,6 +65,7 @@ import static java.time.temporal.ChronoField.YEAR_OF_ERA; import static java.time.temporal.ChronoUnit.DAYS; import static java.time.temporal.ChronoUnit.MONTHS; +import java.io.InvalidObjectException; import java.io.Serializable; import java.time.Clock; import java.time.DateTimeException; @@ -77,7 +76,7 @@ import java.time.ZoneId; import java.time.format.ResolverStyle; import java.time.temporal.ChronoField; import java.time.temporal.TemporalAccessor; -import java.time.temporal.TemporalAdjuster; +import java.time.temporal.TemporalAdjusters; import java.time.temporal.TemporalField; import java.time.temporal.UnsupportedTemporalTypeException; import java.time.temporal.ValueRange; @@ -480,7 +479,7 @@ public final class JapaneseChronology extends AbstractChronology implements Seri try { result = date(y, moy, dom); } catch (DateTimeException ex) { - result = date(y, moy, 1).with(TemporalAdjuster.lastDayOfMonth()); + result = date(y, moy, 1).with(TemporalAdjusters.lastDayOfMonth()); } // handle the era being changed // only allow if the new date is in the same Jan-Dec as the era change diff --git a/jdk/src/share/classes/java/time/format/DateTimeFormatterBuilder.java b/jdk/src/share/classes/java/time/format/DateTimeFormatterBuilder.java index 442a228fd1f..56dd7f1ce86 100644 --- a/jdk/src/share/classes/java/time/format/DateTimeFormatterBuilder.java +++ b/jdk/src/share/classes/java/time/format/DateTimeFormatterBuilder.java @@ -90,6 +90,7 @@ import java.time.temporal.ChronoField; import java.time.temporal.IsoFields; import java.time.temporal.TemporalAccessor; import java.time.temporal.TemporalField; +import java.time.temporal.TemporalQueries; import java.time.temporal.TemporalQuery; import java.time.temporal.ValueRange; import java.time.temporal.WeekFields; @@ -155,7 +156,7 @@ public final class DateTimeFormatterBuilder { * Query for a time-zone that is region-only. */ private static final TemporalQuery QUERY_REGION_ONLY = (temporal) -> { - ZoneId zone = temporal.query(TemporalQuery.zoneId()); + ZoneId zone = temporal.query(TemporalQueries.zoneId()); return (zone != null && zone instanceof ZoneOffset == false ? zone : null); }; @@ -877,7 +878,7 @@ public final class DateTimeFormatterBuilder { * This appends an instruction to format/parse the offset ID to the builder. *

          * During formatting, the offset is obtained using a mechanism equivalent - * to querying the temporal with {@link TemporalQuery#offset()}. + * to querying the temporal with {@link TemporalQueries#offset()}. * It will be printed using the format defined below. * If the offset cannot be obtained then an exception is thrown unless the * section of the formatter is optional. @@ -930,7 +931,7 @@ public final class DateTimeFormatterBuilder { *

          *

          * During formatting, the offset is obtained using a mechanism equivalent - * to querying the temporal with {@link TemporalQuery#offset()}. + * to querying the temporal with {@link TemporalQueries#offset()}. * If the offset cannot be obtained then an exception is thrown unless the * section of the formatter is optional. *

          @@ -962,7 +963,7 @@ public final class DateTimeFormatterBuilder { * for use with this method, see {@link #appendZoneOrOffsetId()}. *

          * During formatting, the zone is obtained using a mechanism equivalent - * to querying the temporal with {@link TemporalQuery#zoneId()}. + * to querying the temporal with {@link TemporalQueries#zoneId()}. * It will be printed using the result of {@link ZoneId#getId()}. * If the zone cannot be obtained then an exception is thrown unless the * section of the formatter is optional. @@ -1000,7 +1001,7 @@ public final class DateTimeFormatterBuilder { * @see #appendZoneRegionId() */ public DateTimeFormatterBuilder appendZoneId() { - appendInternal(new ZoneIdPrinterParser(TemporalQuery.zoneId(), "ZoneId()")); + appendInternal(new ZoneIdPrinterParser(TemporalQueries.zoneId(), "ZoneId()")); return this; } @@ -1012,7 +1013,7 @@ public final class DateTimeFormatterBuilder { * only if it is a region-based ID. *

          * During formatting, the zone is obtained using a mechanism equivalent - * to querying the temporal with {@link TemporalQuery#zoneId()}. + * to querying the temporal with {@link TemporalQueries#zoneId()}. * If the zone is a {@code ZoneOffset} or it cannot be obtained then * an exception is thrown unless the section of the formatter is optional. * If the zone is not an offset, then the zone will be printed using @@ -1071,7 +1072,7 @@ public final class DateTimeFormatterBuilder { * then attempts to find an offset, such as that on {@code OffsetDateTime}. *

          * During formatting, the zone is obtained using a mechanism equivalent - * to querying the temporal with {@link TemporalQuery#zone()}. + * to querying the temporal with {@link TemporalQueries#zone()}. * It will be printed using the result of {@link ZoneId#getId()}. * If the zone cannot be obtained then an exception is thrown unless the * section of the formatter is optional. @@ -1112,7 +1113,7 @@ public final class DateTimeFormatterBuilder { * @see #appendZoneId() */ public DateTimeFormatterBuilder appendZoneOrOffsetId() { - appendInternal(new ZoneIdPrinterParser(TemporalQuery.zone(), "ZoneOrOffsetId()")); + appendInternal(new ZoneIdPrinterParser(TemporalQueries.zone(), "ZoneOrOffsetId()")); return this; } @@ -1123,7 +1124,7 @@ public final class DateTimeFormatterBuilder { * the builder. *

          * During formatting, the zone is obtained using a mechanism equivalent - * to querying the temporal with {@link TemporalQuery#zoneId()}. + * to querying the temporal with {@link TemporalQueries#zoneId()}. * If the zone is a {@code ZoneOffset} it will be printed using the * result of {@link ZoneOffset#getId()}. * If the zone is not an offset, the textual name will be looked up @@ -1159,7 +1160,7 @@ public final class DateTimeFormatterBuilder { * the builder. *

          * During formatting, the zone is obtained using a mechanism equivalent - * to querying the temporal with {@link TemporalQuery#zoneId()}. + * to querying the temporal with {@link TemporalQueries#zoneId()}. * If the zone is a {@code ZoneOffset} it will be printed using the * result of {@link ZoneOffset#getId()}. * If the zone is not an offset, the textual name will be looked up @@ -1202,7 +1203,7 @@ public final class DateTimeFormatterBuilder { * This appends an instruction to format/parse the chronology ID to the builder. *

          * During formatting, the chronology is obtained using a mechanism equivalent - * to querying the temporal with {@link TemporalQuery#chronology()}. + * to querying the temporal with {@link TemporalQueries#chronology()}. * It will be printed using the result of {@link Chronology#getId()}. * If the chronology cannot be obtained then an exception is thrown unless the * section of the formatter is optional. @@ -3062,7 +3063,7 @@ public final class DateTimeFormatterBuilder { return false; } String text; - Chronology chrono = context.getTemporal().query(TemporalQuery.chronology()); + Chronology chrono = context.getTemporal().query(TemporalQueries.chronology()); if (chrono == null || chrono == IsoChronology.INSTANCE) { text = provider.getText(field, value, textStyle, context.getLocale()); } else { @@ -3590,7 +3591,7 @@ public final class DateTimeFormatterBuilder { private Set preferredZones; ZoneTextPrinterParser(TextStyle textStyle, Set preferredZones) { - super(TemporalQuery.zone(), "ZoneText(" + textStyle + ")"); + super(TemporalQueries.zone(), "ZoneText(" + textStyle + ")"); this.textStyle = Objects.requireNonNull(textStyle, "textStyle"); if (preferredZones != null && preferredZones.size() != 0) { this.preferredZones = new HashSet<>(); @@ -3647,7 +3648,7 @@ public final class DateTimeFormatterBuilder { @Override public boolean format(DateTimePrintContext context, StringBuilder buf) { - ZoneId zone = context.getValue(TemporalQuery.zoneId()); + ZoneId zone = context.getValue(TemporalQueries.zoneId()); if (zone == null) { return false; } @@ -4228,7 +4229,7 @@ public final class DateTimeFormatterBuilder { @Override public boolean format(DateTimePrintContext context, StringBuilder buf) { - Chronology chrono = context.getValue(TemporalQuery.chronology()); + Chronology chrono = context.getValue(TemporalQueries.chronology()); if (chrono == null) { return false; } diff --git a/jdk/src/share/classes/java/time/format/DateTimePrintContext.java b/jdk/src/share/classes/java/time/format/DateTimePrintContext.java index e744bb7d946..543a317e92e 100644 --- a/jdk/src/share/classes/java/time/format/DateTimePrintContext.java +++ b/jdk/src/share/classes/java/time/format/DateTimePrintContext.java @@ -75,6 +75,7 @@ import java.time.chrono.IsoChronology; import java.time.temporal.ChronoField; import java.time.temporal.TemporalAccessor; import java.time.temporal.TemporalField; +import java.time.temporal.TemporalQueries; import java.time.temporal.TemporalQuery; import java.time.temporal.ValueRange; import java.util.Locale; @@ -128,8 +129,8 @@ final class DateTimePrintContext { } // ensure minimal change (early return is an optimization) - Chronology temporalChrono = temporal.query(TemporalQuery.chronology()); - ZoneId temporalZone = temporal.query(TemporalQuery.zoneId()); + Chronology temporalChrono = temporal.query(TemporalQueries.chronology()); + ZoneId temporalZone = temporal.query(TemporalQueries.zoneId()); if (Objects.equals(overrideChrono, temporalChrono)) { overrideChrono = null; } @@ -206,13 +207,13 @@ final class DateTimePrintContext { @SuppressWarnings("unchecked") @Override public R query(TemporalQuery query) { - if (query == TemporalQuery.chronology()) { + if (query == TemporalQueries.chronology()) { return (R) effectiveChrono; } - if (query == TemporalQuery.zoneId()) { + if (query == TemporalQueries.zoneId()) { return (R) effectiveZone; } - if (query == TemporalQuery.precision()) { + if (query == TemporalQueries.precision()) { return temporal.query(query); } return query.queryFrom(this); diff --git a/jdk/src/share/classes/java/time/format/Parsed.java b/jdk/src/share/classes/java/time/format/Parsed.java index a86697a31f3..38eda948f82 100644 --- a/jdk/src/share/classes/java/time/format/Parsed.java +++ b/jdk/src/share/classes/java/time/format/Parsed.java @@ -89,6 +89,7 @@ import java.time.chrono.Chronology; import java.time.temporal.ChronoField; import java.time.temporal.TemporalAccessor; import java.time.temporal.TemporalField; +import java.time.temporal.TemporalQueries; import java.time.temporal.TemporalQuery; import java.time.temporal.UnsupportedTemporalTypeException; import java.util.HashMap; @@ -207,17 +208,17 @@ final class Parsed implements TemporalAccessor { @SuppressWarnings("unchecked") @Override public R query(TemporalQuery query) { - if (query == TemporalQuery.zoneId()) { + if (query == TemporalQueries.zoneId()) { return (R) zone; - } else if (query == TemporalQuery.chronology()) { + } else if (query == TemporalQueries.chronology()) { return (R) chrono; - } else if (query == TemporalQuery.localDate()) { + } else if (query == TemporalQueries.localDate()) { return (R) (date != null ? LocalDate.from(date) : null); - } else if (query == TemporalQuery.localTime()) { + } else if (query == TemporalQueries.localTime()) { return (R) time; - } else if (query == TemporalQuery.zone() || query == TemporalQuery.offset()) { + } else if (query == TemporalQueries.zone() || query == TemporalQueries.offset()) { return query.queryFrom(this); - } else if (query == TemporalQuery.precision()) { + } else if (query == TemporalQueries.precision()) { return null; // not a complete date/time } // inline TemporalAccessor.super.query(query) as an optimization diff --git a/jdk/src/share/classes/java/time/temporal/TemporalAccessor.java b/jdk/src/share/classes/java/time/temporal/TemporalAccessor.java index 343447e36b9..081bbbaec32 100644 --- a/jdk/src/share/classes/java/time/temporal/TemporalAccessor.java +++ b/jdk/src/share/classes/java/time/temporal/TemporalAccessor.java @@ -272,8 +272,8 @@ public interface TemporalAccessor { * @implSpec * The default implementation must behave equivalent to this code: *

          -     *  if (query == TemporalQuery.zoneId() ||
          -     *        query == TemporalQuery.chronology() || query == TemporalQuery.precision()) {
          +     *  if (query == TemporalQueries.zoneId() ||
          +     *        query == TemporalQueries.chronology() || query == TemporalQueries.precision()) {
                *    return null;
                *  }
                *  return query.queryFrom(this);
          @@ -290,7 +290,7 @@ public interface TemporalAccessor {
                * For example, an application-defined {@code HourMin} class storing the hour
                * and minute must override this method as follows:
                * 
          -     *  if (query == TemporalQuery.precision()) {
          +     *  if (query == TemporalQueries.precision()) {
                *    return MINUTES;
                *  }
                *  return TemporalAccessor.super.query(query);
          @@ -306,7 +306,9 @@ public interface TemporalAccessor {
                * @throws ArithmeticException if numeric overflow occurs
                */
               default  R query(TemporalQuery query) {
          -        if (query == TemporalQuery.zoneId() || query == TemporalQuery.chronology() || query == TemporalQuery.precision()) {
          +        if (query == TemporalQueries.zoneId()
          +                || query == TemporalQueries.chronology()
          +                || query == TemporalQueries.precision()) {
                       return null;
                   }
                   return query.queryFrom(this);
          diff --git a/jdk/src/share/classes/java/time/temporal/TemporalAdjuster.java b/jdk/src/share/classes/java/time/temporal/TemporalAdjuster.java
          index 13f8cea80d6..09b5fba7003 100644
          --- a/jdk/src/share/classes/java/time/temporal/TemporalAdjuster.java
          +++ b/jdk/src/share/classes/java/time/temporal/TemporalAdjuster.java
          @@ -62,9 +62,6 @@
           package java.time.temporal;
           
           import java.time.DateTimeException;
          -import java.time.DayOfWeek;
          -import java.time.LocalDate;
          -import java.util.function.UnaryOperator;
           
           /**
            * Strategy for adjusting a temporal object.
          @@ -86,7 +83,8 @@ import java.util.function.UnaryOperator;
            * It is recommended to use the second approach, {@code with(TemporalAdjuster)},
            * as it is a lot clearer to read in code.
            * 

          - * This class also contains a standard set of adjusters, available as static methods. + * The {@link TemporalAdjusters} class contains a standard set of adjusters, + * available as static methods. * These include: *

            *
          • finding the first or last day of the month @@ -100,9 +98,8 @@ import java.util.function.UnaryOperator; * @implSpec * This interface places no restrictions on the mutability of implementations, * however immutability is strongly recommended. - *

            - * All the implementations supplied by the static methods on this interface are immutable. * + * @see TemporalAdjusters * @since 1.8 */ @FunctionalInterface @@ -140,7 +137,7 @@ public interface TemporalAdjuster { *

            * The input temporal object may be in a calendar system other than ISO. * Implementations may choose to document compatibility with other calendar systems, - * or reject non-ISO temporal objects by {@link TemporalQuery#chronology() querying the chronology}. + * or reject non-ISO temporal objects by {@link TemporalQueries#chronology() querying the chronology}. *

            * This method may be called from multiple threads in parallel. * It must be thread-safe when invoked. @@ -152,311 +149,4 @@ public interface TemporalAdjuster { */ Temporal adjustInto(Temporal temporal); - //----------------------------------------------------------------------- - /** - * Obtains a {@code TemporalAdjuster} that wraps a date adjuster. - *

            - * The {@code TemporalAdjuster} is based on the low level {@code Temporal} interface. - * This method allows an adjustment from {@code LocalDate} to {@code LocalDate} - * to be wrapped to match the temporal-based interface. - * This is provided for convenience to make user-written adjusters simpler. - *

            - * In general, user-written adjusters should be static constants: - *

            {@code
            -     *  static TemporalAdjuster TWO_DAYS_LATER = TemporalAdjuster.ofDateAdjuster(
            -     *    date -> date.plusDays(2));
            -     * }
            - * - * @param dateBasedAdjuster the date-based adjuster, not null - * @return the temporal adjuster wrapping on the date adjuster, not null - */ - static TemporalAdjuster ofDateAdjuster(UnaryOperator dateBasedAdjuster) { - return TemporalAdjusters.ofDateAdjuster(dateBasedAdjuster); - } - - //----------------------------------------------------------------------- - /** - * Returns the "first day of month" adjuster, which returns a new date set to - * the first day of the current month. - *

            - * The ISO calendar system behaves as follows:
            - * The input 2011-01-15 will return 2011-01-01.
            - * The input 2011-02-15 will return 2011-02-01. - *

            - * The behavior is suitable for use with most calendar systems. - * It is equivalent to: - *

            -     *  temporal.with(DAY_OF_MONTH, 1);
            -     * 
            - * - * @return the first day-of-month adjuster, not null - */ - static TemporalAdjuster firstDayOfMonth() { - return TemporalAdjusters.firstDayOfMonth(); - } - - /** - * Returns the "last day of month" adjuster, which returns a new date set to - * the last day of the current month. - *

            - * The ISO calendar system behaves as follows:
            - * The input 2011-01-15 will return 2011-01-31.
            - * The input 2011-02-15 will return 2011-02-28.
            - * The input 2012-02-15 will return 2012-02-29 (leap year).
            - * The input 2011-04-15 will return 2011-04-30. - *

            - * The behavior is suitable for use with most calendar systems. - * It is equivalent to: - *

            -     *  long lastDay = temporal.range(DAY_OF_MONTH).getMaximum();
            -     *  temporal.with(DAY_OF_MONTH, lastDay);
            -     * 
            - * - * @return the last day-of-month adjuster, not null - */ - static TemporalAdjuster lastDayOfMonth() { - return TemporalAdjusters.lastDayOfMonth(); - } - - /** - * Returns the "first day of next month" adjuster, which returns a new date set to - * the first day of the next month. - *

            - * The ISO calendar system behaves as follows:
            - * The input 2011-01-15 will return 2011-02-01.
            - * The input 2011-02-15 will return 2011-03-01. - *

            - * The behavior is suitable for use with most calendar systems. - * It is equivalent to: - *

            -     *  temporal.with(DAY_OF_MONTH, 1).plus(1, MONTHS);
            -     * 
            - * - * @return the first day of next month adjuster, not null - */ - static TemporalAdjuster firstDayOfNextMonth() { - return TemporalAdjusters.firstDayOfNextMonth(); - } - - //----------------------------------------------------------------------- - /** - * Returns the "first day of year" adjuster, which returns a new date set to - * the first day of the current year. - *

            - * The ISO calendar system behaves as follows:
            - * The input 2011-01-15 will return 2011-01-01.
            - * The input 2011-02-15 will return 2011-01-01.
            - *

            - * The behavior is suitable for use with most calendar systems. - * It is equivalent to: - *

            -     *  temporal.with(DAY_OF_YEAR, 1);
            -     * 
            - * - * @return the first day-of-year adjuster, not null - */ - static TemporalAdjuster firstDayOfYear() { - return TemporalAdjusters.firstDayOfYear(); - } - - /** - * Returns the "last day of year" adjuster, which returns a new date set to - * the last day of the current year. - *

            - * The ISO calendar system behaves as follows:
            - * The input 2011-01-15 will return 2011-12-31.
            - * The input 2011-02-15 will return 2011-12-31.
            - *

            - * The behavior is suitable for use with most calendar systems. - * It is equivalent to: - *

            -     *  long lastDay = temporal.range(DAY_OF_YEAR).getMaximum();
            -     *  temporal.with(DAY_OF_YEAR, lastDay);
            -     * 
            - * - * @return the last day-of-year adjuster, not null - */ - static TemporalAdjuster lastDayOfYear() { - return TemporalAdjusters.lastDayOfYear(); - } - - /** - * Returns the "first day of next year" adjuster, which returns a new date set to - * the first day of the next year. - *

            - * The ISO calendar system behaves as follows:
            - * The input 2011-01-15 will return 2012-01-01. - *

            - * The behavior is suitable for use with most calendar systems. - * It is equivalent to: - *

            -     *  temporal.with(DAY_OF_YEAR, 1).plus(1, YEARS);
            -     * 
            - * - * @return the first day of next month adjuster, not null - */ - static TemporalAdjuster firstDayOfNextYear() { - return TemporalAdjusters.firstDayOfNextYear(); - } - - //----------------------------------------------------------------------- - /** - * Returns the first in month adjuster, which returns a new date - * in the same month with the first matching day-of-week. - * This is used for expressions like 'first Tuesday in March'. - *

            - * The ISO calendar system behaves as follows:
            - * The input 2011-12-15 for (MONDAY) will return 2011-12-05.
            - * The input 2011-12-15 for (FRIDAY) will return 2011-12-02.
            - *

            - * The behavior is suitable for use with most calendar systems. - * It uses the {@code DAY_OF_WEEK} and {@code DAY_OF_MONTH} fields - * and the {@code DAYS} unit, and assumes a seven day week. - * - * @param dayOfWeek the day-of-week, not null - * @return the first in month adjuster, not null - */ - static TemporalAdjuster firstInMonth(DayOfWeek dayOfWeek) { - return TemporalAdjuster.dayOfWeekInMonth(1, dayOfWeek); - } - - /** - * Returns the last in month adjuster, which returns a new date - * in the same month with the last matching day-of-week. - * This is used for expressions like 'last Tuesday in March'. - *

            - * The ISO calendar system behaves as follows:
            - * The input 2011-12-15 for (MONDAY) will return 2011-12-26.
            - * The input 2011-12-15 for (FRIDAY) will return 2011-12-30.
            - *

            - * The behavior is suitable for use with most calendar systems. - * It uses the {@code DAY_OF_WEEK} and {@code DAY_OF_MONTH} fields - * and the {@code DAYS} unit, and assumes a seven day week. - * - * @param dayOfWeek the day-of-week, not null - * @return the first in month adjuster, not null - */ - static TemporalAdjuster lastInMonth(DayOfWeek dayOfWeek) { - return TemporalAdjuster.dayOfWeekInMonth(-1, dayOfWeek); - } - - /** - * Returns the day-of-week in month adjuster, which returns a new date - * in the same month with the ordinal day-of-week. - * This is used for expressions like the 'second Tuesday in March'. - *

            - * The ISO calendar system behaves as follows:
            - * The input 2011-12-15 for (1,TUESDAY) will return 2011-12-06.
            - * The input 2011-12-15 for (2,TUESDAY) will return 2011-12-13.
            - * The input 2011-12-15 for (3,TUESDAY) will return 2011-12-20.
            - * The input 2011-12-15 for (4,TUESDAY) will return 2011-12-27.
            - * The input 2011-12-15 for (5,TUESDAY) will return 2012-01-03.
            - * The input 2011-12-15 for (-1,TUESDAY) will return 2011-12-27 (last in month).
            - * The input 2011-12-15 for (-4,TUESDAY) will return 2011-12-06 (3 weeks before last in month).
            - * The input 2011-12-15 for (-5,TUESDAY) will return 2011-11-29 (4 weeks before last in month).
            - * The input 2011-12-15 for (0,TUESDAY) will return 2011-11-29 (last in previous month).
            - *

            - * For a positive or zero ordinal, the algorithm is equivalent to finding the first - * day-of-week that matches within the month and then adding a number of weeks to it. - * For a negative ordinal, the algorithm is equivalent to finding the last - * day-of-week that matches within the month and then subtracting a number of weeks to it. - * The ordinal number of weeks is not validated and is interpreted leniently - * according to this algorithm. This definition means that an ordinal of zero finds - * the last matching day-of-week in the previous month. - *

            - * The behavior is suitable for use with most calendar systems. - * It uses the {@code DAY_OF_WEEK} and {@code DAY_OF_MONTH} fields - * and the {@code DAYS} unit, and assumes a seven day week. - * - * @param ordinal the week within the month, unbounded but typically from -5 to 5 - * @param dayOfWeek the day-of-week, not null - * @return the day-of-week in month adjuster, not null - */ - static TemporalAdjuster dayOfWeekInMonth(final int ordinal, DayOfWeek dayOfWeek) { - return TemporalAdjusters.dayOfWeekInMonth(ordinal, dayOfWeek); - } - - //----------------------------------------------------------------------- - /** - * Returns the next day-of-week adjuster, which adjusts the date to the - * first occurrence of the specified day-of-week after the date being adjusted. - *

            - * The ISO calendar system behaves as follows:
            - * The input 2011-01-15 (a Saturday) for parameter (MONDAY) will return 2011-01-17 (two days later).
            - * The input 2011-01-15 (a Saturday) for parameter (WEDNESDAY) will return 2011-01-19 (four days later).
            - * The input 2011-01-15 (a Saturday) for parameter (SATURDAY) will return 2011-01-22 (seven days later). - *

            - * The behavior is suitable for use with most calendar systems. - * It uses the {@code DAY_OF_WEEK} field and the {@code DAYS} unit, - * and assumes a seven day week. - * - * @param dayOfWeek the day-of-week to move the date to, not null - * @return the next day-of-week adjuster, not null - */ - static TemporalAdjuster next(DayOfWeek dayOfWeek) { - return TemporalAdjusters.next(dayOfWeek); - } - - /** - * Returns the next-or-same day-of-week adjuster, which adjusts the date to the - * first occurrence of the specified day-of-week after the date being adjusted - * unless it is already on that day in which case the same object is returned. - *

            - * The ISO calendar system behaves as follows:
            - * The input 2011-01-15 (a Saturday) for parameter (MONDAY) will return 2011-01-17 (two days later).
            - * The input 2011-01-15 (a Saturday) for parameter (WEDNESDAY) will return 2011-01-19 (four days later).
            - * The input 2011-01-15 (a Saturday) for parameter (SATURDAY) will return 2011-01-15 (same as input). - *

            - * The behavior is suitable for use with most calendar systems. - * It uses the {@code DAY_OF_WEEK} field and the {@code DAYS} unit, - * and assumes a seven day week. - * - * @param dayOfWeek the day-of-week to check for or move the date to, not null - * @return the next-or-same day-of-week adjuster, not null - */ - static TemporalAdjuster nextOrSame(DayOfWeek dayOfWeek) { - return TemporalAdjusters.nextOrSame(dayOfWeek); - } - - /** - * Returns the previous day-of-week adjuster, which adjusts the date to the - * first occurrence of the specified day-of-week before the date being adjusted. - *

            - * The ISO calendar system behaves as follows:
            - * The input 2011-01-15 (a Saturday) for parameter (MONDAY) will return 2011-01-10 (five days earlier).
            - * The input 2011-01-15 (a Saturday) for parameter (WEDNESDAY) will return 2011-01-12 (three days earlier).
            - * The input 2011-01-15 (a Saturday) for parameter (SATURDAY) will return 2011-01-08 (seven days earlier). - *

            - * The behavior is suitable for use with most calendar systems. - * It uses the {@code DAY_OF_WEEK} field and the {@code DAYS} unit, - * and assumes a seven day week. - * - * @param dayOfWeek the day-of-week to move the date to, not null - * @return the previous day-of-week adjuster, not null - */ - static TemporalAdjuster previous(DayOfWeek dayOfWeek) { - return TemporalAdjusters.previous(dayOfWeek); - } - - /** - * Returns the previous-or-same day-of-week adjuster, which adjusts the date to the - * first occurrence of the specified day-of-week before the date being adjusted - * unless it is already on that day in which case the same object is returned. - *

            - * The ISO calendar system behaves as follows:
            - * The input 2011-01-15 (a Saturday) for parameter (MONDAY) will return 2011-01-10 (five days earlier).
            - * The input 2011-01-15 (a Saturday) for parameter (WEDNESDAY) will return 2011-01-12 (three days earlier).
            - * The input 2011-01-15 (a Saturday) for parameter (SATURDAY) will return 2011-01-15 (same as input). - *

            - * The behavior is suitable for use with most calendar systems. - * It uses the {@code DAY_OF_WEEK} field and the {@code DAYS} unit, - * and assumes a seven day week. - * - * @param dayOfWeek the day-of-week to check for or move the date to, not null - * @return the previous-or-same day-of-week adjuster, not null - */ - static TemporalAdjuster previousOrSame(DayOfWeek dayOfWeek) { - return TemporalAdjusters.previousOrSame(dayOfWeek); - } - } diff --git a/jdk/src/share/classes/java/time/temporal/TemporalAdjusters.java b/jdk/src/share/classes/java/time/temporal/TemporalAdjusters.java index 293485363a4..0180c819d3b 100644 --- a/jdk/src/share/classes/java/time/temporal/TemporalAdjusters.java +++ b/jdk/src/share/classes/java/time/temporal/TemporalAdjusters.java @@ -74,13 +74,47 @@ import java.util.Objects; import java.util.function.UnaryOperator; /** - * Implementations of the static methods in {@code TemporalAdjuster} + * Common and useful TemporalAdjusters. + *

            + * Adjusters are a key tool for modifying temporal objects. + * They exist to externalize the process of adjustment, permitting different + * approaches, as per the strategy design pattern. + * Examples might be an adjuster that sets the date avoiding weekends, or one that + * sets the date to the last day of the month. + *

            + * There are two equivalent ways of using a {@code TemporalAdjuster}. + * The first is to invoke the method on the interface directly. + * The second is to use {@link Temporal#with(TemporalAdjuster)}: + *

            + *   // these two lines are equivalent, but the second approach is recommended
            + *   temporal = thisAdjuster.adjustInto(temporal);
            + *   temporal = temporal.with(thisAdjuster);
            + * 
            + * It is recommended to use the second approach, {@code with(TemporalAdjuster)}, + * as it is a lot clearer to read in code. + *

            + * This class contains a standard set of adjusters, available as static methods. + * These include: + *

              + *
            • finding the first or last day of the month + *
            • finding the first day of next month + *
            • finding the first or last day of the year + *
            • finding the first day of next year + *
            • finding the first or last day-of-week within a month, such as "first Wednesday in June" + *
            • finding the next or previous day-of-week, such as "next Thursday" + *
            * + * @implSpec + * All the implementations supplied by the static methods are immutable. + * + * @see TemporalAdjuster * @since 1.8 */ -final class TemporalAdjusters { - // work around compiler bug not allowing lambdas in static methods +public final class TemporalAdjusters { + /** + * Private constructor since this is a utility class. + */ private TemporalAdjusters() { } @@ -94,15 +128,15 @@ final class TemporalAdjusters { * This is provided for convenience to make user-written adjusters simpler. *

            * In general, user-written adjusters should be static constants: - *

            -     *  public static TemporalAdjuster TWO_DAYS_LATER = TemporalAdjuster.ofDateAdjuster(
            -     *    date -> date.plusDays(2));
            -     * 
            + *
            {@code
            +     *  static TemporalAdjuster TWO_DAYS_LATER =
            +     *       TemporalAdjusters.ofDateAdjuster(date -> date.plusDays(2));
            +     * }
            * * @param dateBasedAdjuster the date-based adjuster, not null * @return the temporal adjuster wrapping on the date adjuster, not null */ - static TemporalAdjuster ofDateAdjuster(UnaryOperator dateBasedAdjuster) { + public static TemporalAdjuster ofDateAdjuster(UnaryOperator dateBasedAdjuster) { Objects.requireNonNull(dateBasedAdjuster, "dateBasedAdjuster"); return (temporal) -> { LocalDate input = LocalDate.from(temporal); @@ -128,7 +162,7 @@ final class TemporalAdjusters { * * @return the first day-of-month adjuster, not null */ - static TemporalAdjuster firstDayOfMonth() { + public static TemporalAdjuster firstDayOfMonth() { return (temporal) -> temporal.with(DAY_OF_MONTH, 1); } @@ -151,7 +185,7 @@ final class TemporalAdjusters { * * @return the last day-of-month adjuster, not null */ - static TemporalAdjuster lastDayOfMonth() { + public static TemporalAdjuster lastDayOfMonth() { return (temporal) -> temporal.with(DAY_OF_MONTH, temporal.range(DAY_OF_MONTH).getMaximum()); } @@ -171,7 +205,7 @@ final class TemporalAdjusters { * * @return the first day of next month adjuster, not null */ - static TemporalAdjuster firstDayOfNextMonth() { + public static TemporalAdjuster firstDayOfNextMonth() { return (temporal) -> temporal.with(DAY_OF_MONTH, 1).plus(1, MONTHS); } @@ -192,7 +226,7 @@ final class TemporalAdjusters { * * @return the first day-of-year adjuster, not null */ - static TemporalAdjuster firstDayOfYear() { + public static TemporalAdjuster firstDayOfYear() { return (temporal) -> temporal.with(DAY_OF_YEAR, 1); } @@ -213,7 +247,7 @@ final class TemporalAdjusters { * * @return the last day-of-year adjuster, not null */ - static TemporalAdjuster lastDayOfYear() { + public static TemporalAdjuster lastDayOfYear() { return (temporal) -> temporal.with(DAY_OF_YEAR, temporal.range(DAY_OF_YEAR).getMaximum()); } @@ -232,7 +266,7 @@ final class TemporalAdjusters { * * @return the first day of next month adjuster, not null */ - static TemporalAdjuster firstDayOfNextYear() { + public static TemporalAdjuster firstDayOfNextYear() { return (temporal) -> temporal.with(DAY_OF_YEAR, 1).plus(1, YEARS); } @@ -253,7 +287,7 @@ final class TemporalAdjusters { * @param dayOfWeek the day-of-week, not null * @return the first in month adjuster, not null */ - static TemporalAdjuster firstInMonth(DayOfWeek dayOfWeek) { + public static TemporalAdjuster firstInMonth(DayOfWeek dayOfWeek) { return TemporalAdjusters.dayOfWeekInMonth(1, dayOfWeek); } @@ -273,7 +307,7 @@ final class TemporalAdjusters { * @param dayOfWeek the day-of-week, not null * @return the first in month adjuster, not null */ - static TemporalAdjuster lastInMonth(DayOfWeek dayOfWeek) { + public static TemporalAdjuster lastInMonth(DayOfWeek dayOfWeek) { return TemporalAdjusters.dayOfWeekInMonth(-1, dayOfWeek); } @@ -309,7 +343,7 @@ final class TemporalAdjusters { * @param dayOfWeek the day-of-week, not null * @return the day-of-week in month adjuster, not null */ - static TemporalAdjuster dayOfWeekInMonth(int ordinal, DayOfWeek dayOfWeek) { + public static TemporalAdjuster dayOfWeekInMonth(int ordinal, DayOfWeek dayOfWeek) { Objects.requireNonNull(dayOfWeek, "dayOfWeek"); int dowValue = dayOfWeek.getValue(); if (ordinal >= 0) { @@ -349,7 +383,7 @@ final class TemporalAdjusters { * @param dayOfWeek the day-of-week to move the date to, not null * @return the next day-of-week adjuster, not null */ - static TemporalAdjuster next(DayOfWeek dayOfWeek) { + public static TemporalAdjuster next(DayOfWeek dayOfWeek) { int dowValue = dayOfWeek.getValue(); return (temporal) -> { int calDow = temporal.get(DAY_OF_WEEK); @@ -375,7 +409,7 @@ final class TemporalAdjusters { * @param dayOfWeek the day-of-week to check for or move the date to, not null * @return the next-or-same day-of-week adjuster, not null */ - static TemporalAdjuster nextOrSame(DayOfWeek dayOfWeek) { + public static TemporalAdjuster nextOrSame(DayOfWeek dayOfWeek) { int dowValue = dayOfWeek.getValue(); return (temporal) -> { int calDow = temporal.get(DAY_OF_WEEK); @@ -403,7 +437,7 @@ final class TemporalAdjusters { * @param dayOfWeek the day-of-week to move the date to, not null * @return the previous day-of-week adjuster, not null */ - static TemporalAdjuster previous(DayOfWeek dayOfWeek) { + public static TemporalAdjuster previous(DayOfWeek dayOfWeek) { int dowValue = dayOfWeek.getValue(); return (temporal) -> { int calDow = temporal.get(DAY_OF_WEEK); @@ -429,7 +463,7 @@ final class TemporalAdjusters { * @param dayOfWeek the day-of-week to check for or move the date to, not null * @return the previous-or-same day-of-week adjuster, not null */ - static TemporalAdjuster previousOrSame(DayOfWeek dayOfWeek) { + public static TemporalAdjuster previousOrSame(DayOfWeek dayOfWeek) { int dowValue = dayOfWeek.getValue(); return (temporal) -> { int calDow = temporal.get(DAY_OF_WEEK); diff --git a/jdk/src/share/classes/java/time/temporal/TemporalAmount.java b/jdk/src/share/classes/java/time/temporal/TemporalAmount.java index 802dc4d73d5..0d8b8a96bb0 100644 --- a/jdk/src/share/classes/java/time/temporal/TemporalAmount.java +++ b/jdk/src/share/classes/java/time/temporal/TemporalAmount.java @@ -163,7 +163,7 @@ public interface TemporalAmount { *

            * The input temporal object may be in a calendar system other than ISO. * Implementations may choose to document compatibility with other calendar systems, - * or reject non-ISO temporal objects by {@link TemporalQuery#chronology() querying the chronology}. + * or reject non-ISO temporal objects by {@link TemporalQueries#chronology() querying the chronology}. *

            * This method may be called from multiple threads in parallel. * It must be thread-safe when invoked. @@ -205,7 +205,7 @@ public interface TemporalAmount { *

            * The input temporal object may be in a calendar system other than ISO. * Implementations may choose to document compatibility with other calendar systems, - * or reject non-ISO temporal objects by {@link TemporalQuery#chronology() querying the chronology}. + * or reject non-ISO temporal objects by {@link TemporalQueries#chronology() querying the chronology}. *

            * This method may be called from multiple threads in parallel. * It must be thread-safe when invoked. diff --git a/jdk/src/share/classes/java/time/temporal/TemporalQueries.java b/jdk/src/share/classes/java/time/temporal/TemporalQueries.java index f7c95add925..42fd4ab62a8 100644 --- a/jdk/src/share/classes/java/time/temporal/TemporalQueries.java +++ b/jdk/src/share/classes/java/time/temporal/TemporalQueries.java @@ -78,10 +78,44 @@ import java.time.chrono.Chronology; * These are defined here as they must be constants, and the definition * of lambdas does not guarantee that. By assigning them once here, * they become 'normal' Java constants. + *

            + * Queries are a key tool for extracting information from temporal objects. + * They exist to externalize the process of querying, permitting different + * approaches, as per the strategy design pattern. + * Examples might be a query that checks if the date is the day before February 29th + * in a leap year, or calculates the number of days to your next birthday. + *

            + * The {@link TemporalField} interface provides another mechanism for querying + * temporal objects. That interface is limited to returning a {@code long}. + * By contrast, queries can return any type. + *

            + * There are two equivalent ways of using a {@code TemporalQuery}. + * The first is to invoke the method on this interface directly. + * The second is to use {@link TemporalAccessor#query(TemporalQuery)}: + *

            + *   // these two lines are equivalent, but the second approach is recommended
            + *   temporal = thisQuery.queryFrom(temporal);
            + *   temporal = temporal.query(thisQuery);
            + * 
            + * It is recommended to use the second approach, {@code query(TemporalQuery)}, + * as it is a lot clearer to read in code. + *

            + * The most common implementations are method references, such as + * {@code LocalDate::from} and {@code ZoneId::from}. + * Additional common queries are provided to return: + *

              + *
            • a Chronology, + *
            • a LocalDate, + *
            • a LocalTime, + *
            • a ZoneOffset, + *
            • a precision, + *
            • a zone, or + *
            • a zoneId. + *
            * * @since 1.8 */ -final class TemporalQueries { +public final class TemporalQueries { // note that it is vital that each method supplies a constant, not a // calculated value, as they will be checked for using == // it is also vital that each constant is different (due to the == checking) @@ -93,6 +127,216 @@ final class TemporalQueries { private TemporalQueries() { } + //----------------------------------------------------------------------- + // special constants should be used to extract information from a TemporalAccessor + // that cannot be derived in other ways + // Javadoc added here, so as to pretend they are more normal than they really are + + /** + * A strict query for the {@code ZoneId}. + *

            + * This queries a {@code TemporalAccessor} for the zone. + * The zone is only returned if the date-time conceptually contains a {@code ZoneId}. + * It will not be returned if the date-time only conceptually has an {@code ZoneOffset}. + * Thus a {@link java.time.ZonedDateTime} will return the result of {@code getZone()}, + * but an {@link java.time.OffsetDateTime} will return null. + *

            + * In most cases, applications should use {@link #zone()} as this query is too strict. + *

            + * The result from JDK classes implementing {@code TemporalAccessor} is as follows:
            + * {@code LocalDate} returns null
            + * {@code LocalTime} returns null
            + * {@code LocalDateTime} returns null
            + * {@code ZonedDateTime} returns the associated zone
            + * {@code OffsetTime} returns null
            + * {@code OffsetDateTime} returns null
            + * {@code ChronoLocalDate} returns null
            + * {@code ChronoLocalDateTime} returns null
            + * {@code ChronoZonedDateTime} returns the associated zone
            + * {@code Era} returns null
            + * {@code DayOfWeek} returns null
            + * {@code Month} returns null
            + * {@code Year} returns null
            + * {@code YearMonth} returns null
            + * {@code MonthDay} returns null
            + * {@code ZoneOffset} returns null
            + * {@code Instant} returns null
            + * + * @return a query that can obtain the zone ID of a temporal, not null + */ + public static TemporalQuery zoneId() { + return TemporalQueries.ZONE_ID; + } + + /** + * A query for the {@code Chronology}. + *

            + * This queries a {@code TemporalAccessor} for the chronology. + * If the target {@code TemporalAccessor} represents a date, or part of a date, + * then it should return the chronology that the date is expressed in. + * As a result of this definition, objects only representing time, such as + * {@code LocalTime}, will return null. + *

            + * The result from JDK classes implementing {@code TemporalAccessor} is as follows:
            + * {@code LocalDate} returns {@code IsoChronology.INSTANCE}
            + * {@code LocalTime} returns null (does not represent a date)
            + * {@code LocalDateTime} returns {@code IsoChronology.INSTANCE}
            + * {@code ZonedDateTime} returns {@code IsoChronology.INSTANCE}
            + * {@code OffsetTime} returns null (does not represent a date)
            + * {@code OffsetDateTime} returns {@code IsoChronology.INSTANCE}
            + * {@code ChronoLocalDate} returns the associated chronology
            + * {@code ChronoLocalDateTime} returns the associated chronology
            + * {@code ChronoZonedDateTime} returns the associated chronology
            + * {@code Era} returns the associated chronology
            + * {@code DayOfWeek} returns null (shared across chronologies)
            + * {@code Month} returns {@code IsoChronology.INSTANCE}
            + * {@code Year} returns {@code IsoChronology.INSTANCE}
            + * {@code YearMonth} returns {@code IsoChronology.INSTANCE}
            + * {@code MonthDay} returns null {@code IsoChronology.INSTANCE}
            + * {@code ZoneOffset} returns null (does not represent a date)
            + * {@code Instant} returns null (does not represent a date)
            + *

            + * The method {@link java.time.chrono.Chronology#from(TemporalAccessor)} can be used as a + * {@code TemporalQuery} via a method reference, {@code Chronology::from}. + * That method is equivalent to this query, except that it throws an + * exception if a chronology cannot be obtained. + * + * @return a query that can obtain the chronology of a temporal, not null + */ + public static TemporalQuery chronology() { + return TemporalQueries.CHRONO; + } + + /** + * A query for the smallest supported unit. + *

            + * This queries a {@code TemporalAccessor} for the time precision. + * If the target {@code TemporalAccessor} represents a consistent or complete date-time, + * date or time then this must return the smallest precision actually supported. + * Note that fields such as {@code NANO_OF_DAY} and {@code NANO_OF_SECOND} + * are defined to always return ignoring the precision, thus this is the only + * way to find the actual smallest supported unit. + * For example, were {@code GregorianCalendar} to implement {@code TemporalAccessor} + * it would return a precision of {@code MILLIS}. + *

            + * The result from JDK classes implementing {@code TemporalAccessor} is as follows:
            + * {@code LocalDate} returns {@code DAYS}
            + * {@code LocalTime} returns {@code NANOS}
            + * {@code LocalDateTime} returns {@code NANOS}
            + * {@code ZonedDateTime} returns {@code NANOS}
            + * {@code OffsetTime} returns {@code NANOS}
            + * {@code OffsetDateTime} returns {@code NANOS}
            + * {@code ChronoLocalDate} returns {@code DAYS}
            + * {@code ChronoLocalDateTime} returns {@code NANOS}
            + * {@code ChronoZonedDateTime} returns {@code NANOS}
            + * {@code Era} returns {@code ERAS}
            + * {@code DayOfWeek} returns {@code DAYS}
            + * {@code Month} returns {@code MONTHS}
            + * {@code Year} returns {@code YEARS}
            + * {@code YearMonth} returns {@code MONTHS}
            + * {@code MonthDay} returns null (does not represent a complete date or time)
            + * {@code ZoneOffset} returns null (does not represent a date or time)
            + * {@code Instant} returns {@code NANOS}
            + * + * @return a query that can obtain the precision of a temporal, not null + */ + public static TemporalQuery precision() { + return TemporalQueries.PRECISION; + } + + //----------------------------------------------------------------------- + // non-special constants are standard queries that derive information from other information + /** + * A lenient query for the {@code ZoneId}, falling back to the {@code ZoneOffset}. + *

            + * This queries a {@code TemporalAccessor} for the zone. + * It first tries to obtain the zone, using {@link #zoneId()}. + * If that is not found it tries to obtain the {@link #offset()}. + * Thus a {@link java.time.ZonedDateTime} will return the result of {@code getZone()}, + * while an {@link java.time.OffsetDateTime} will return the result of {@code getOffset()}. + *

            + * In most cases, applications should use this query rather than {@code #zoneId()}. + *

            + * The method {@link ZoneId#from(TemporalAccessor)} can be used as a + * {@code TemporalQuery} via a method reference, {@code ZoneId::from}. + * That method is equivalent to this query, except that it throws an + * exception if a zone cannot be obtained. + * + * @return a query that can obtain the zone ID or offset of a temporal, not null + */ + public static TemporalQuery zone() { + return TemporalQueries.ZONE; + } + + /** + * A query for {@code ZoneOffset} returning null if not found. + *

            + * This returns a {@code TemporalQuery} that can be used to query a temporal + * object for the offset. The query will return null if the temporal + * object cannot supply an offset. + *

            + * The query implementation examines the {@link ChronoField#OFFSET_SECONDS OFFSET_SECONDS} + * field and uses it to create a {@code ZoneOffset}. + *

            + * The method {@link java.time.ZoneOffset#from(TemporalAccessor)} can be used as a + * {@code TemporalQuery} via a method reference, {@code ZoneOffset::from}. + * This query and {@code ZoneOffset::from} will return the same result if the + * temporal object contains an offset. If the temporal object does not contain + * an offset, then the method reference will throw an exception, whereas this + * query will return null. + * + * @return a query that can obtain the offset of a temporal, not null + */ + public static TemporalQuery offset() { + return TemporalQueries.OFFSET; + } + + /** + * A query for {@code LocalDate} returning null if not found. + *

            + * This returns a {@code TemporalQuery} that can be used to query a temporal + * object for the local date. The query will return null if the temporal + * object cannot supply a local date. + *

            + * The query implementation examines the {@link ChronoField#EPOCH_DAY EPOCH_DAY} + * field and uses it to create a {@code LocalDate}. + *

            + * The method {@link ZoneOffset#from(TemporalAccessor)} can be used as a + * {@code TemporalQuery} via a method reference, {@code LocalDate::from}. + * This query and {@code LocalDate::from} will return the same result if the + * temporal object contains a date. If the temporal object does not contain + * a date, then the method reference will throw an exception, whereas this + * query will return null. + * + * @return a query that can obtain the date of a temporal, not null + */ + public static TemporalQuery localDate() { + return TemporalQueries.LOCAL_DATE; + } + + /** + * A query for {@code LocalTime} returning null if not found. + *

            + * This returns a {@code TemporalQuery} that can be used to query a temporal + * object for the local time. The query will return null if the temporal + * object cannot supply a local time. + *

            + * The query implementation examines the {@link ChronoField#NANO_OF_DAY NANO_OF_DAY} + * field and uses it to create a {@code LocalTime}. + *

            + * The method {@link ZoneOffset#from(TemporalAccessor)} can be used as a + * {@code TemporalQuery} via a method reference, {@code LocalTime::from}. + * This query and {@code LocalTime::from} will return the same result if the + * temporal object contains a time. If the temporal object does not contain + * a time, then the method reference will throw an exception, whereas this + * query will return null. + * + * @return a query that can obtain the time of a temporal, not null + */ + public static TemporalQuery localTime() { + return TemporalQueries.LOCAL_TIME; + } + //----------------------------------------------------------------------- /** * A strict query for the {@code ZoneId}. diff --git a/jdk/src/share/classes/java/time/temporal/TemporalQuery.java b/jdk/src/share/classes/java/time/temporal/TemporalQuery.java index 188b13df61e..96142963062 100644 --- a/jdk/src/share/classes/java/time/temporal/TemporalQuery.java +++ b/jdk/src/share/classes/java/time/temporal/TemporalQuery.java @@ -62,11 +62,6 @@ package java.time.temporal; import java.time.DateTimeException; -import java.time.LocalDate; -import java.time.LocalTime; -import java.time.ZoneId; -import java.time.ZoneOffset; -import java.time.chrono.Chronology; /** * Strategy for querying a temporal object. @@ -94,12 +89,14 @@ import java.time.chrono.Chronology; *

            * The most common implementations are method references, such as * {@code LocalDate::from} and {@code ZoneId::from}. - * Additional common implementations are provided on this interface as static methods. + * Additional common queries are provided as static methods in {@link TemporalQueries}. * * @implSpec * This interface places no restrictions on the mutability of implementations, * however immutability is strongly recommended. * + * @param the type returned from the query + * * @since 1.8 */ @FunctionalInterface @@ -133,7 +130,7 @@ public interface TemporalQuery { *

            * The input temporal object may be in a calendar system other than ISO. * Implementations may choose to document compatibility with other calendar systems, - * or reject non-ISO temporal objects by {@link TemporalQuery#chronology() querying the chronology}. + * or reject non-ISO temporal objects by {@link TemporalQueries#chronology() querying the chronology}. *

            * This method may be called from multiple threads in parallel. * It must be thread-safe when invoked. @@ -145,214 +142,4 @@ public interface TemporalQuery { */ R queryFrom(TemporalAccessor temporal); - //----------------------------------------------------------------------- - // special constants should be used to extract information from a TemporalAccessor - // that cannot be derived in other ways - // Javadoc added here, so as to pretend they are more normal than they really are - - /** - * A strict query for the {@code ZoneId}. - *

            - * This queries a {@code TemporalAccessor} for the zone. - * The zone is only returned if the date-time conceptually contains a {@code ZoneId}. - * It will not be returned if the date-time only conceptually has an {@code ZoneOffset}. - * Thus a {@link java.time.ZonedDateTime} will return the result of {@code getZone()}, - * but an {@link java.time.OffsetDateTime} will return null. - *

            - * In most cases, applications should use {@link #zone()} as this query is too strict. - *

            - * The result from JDK classes implementing {@code TemporalAccessor} is as follows:
            - * {@code LocalDate} returns null
            - * {@code LocalTime} returns null
            - * {@code LocalDateTime} returns null
            - * {@code ZonedDateTime} returns the associated zone
            - * {@code OffsetTime} returns null
            - * {@code OffsetDateTime} returns null
            - * {@code ChronoLocalDate} returns null
            - * {@code ChronoLocalDateTime} returns null
            - * {@code ChronoZonedDateTime} returns the associated zone
            - * {@code Era} returns null
            - * {@code DayOfWeek} returns null
            - * {@code Month} returns null
            - * {@code Year} returns null
            - * {@code YearMonth} returns null
            - * {@code MonthDay} returns null
            - * {@code ZoneOffset} returns null
            - * {@code Instant} returns null
            - * - * @return a query that can obtain the zone ID of a temporal, not null - */ - static TemporalQuery zoneId() { - return TemporalQueries.ZONE_ID; - } - - /** - * A query for the {@code Chronology}. - *

            - * This queries a {@code TemporalAccessor} for the chronology. - * If the target {@code TemporalAccessor} represents a date, or part of a date, - * then it should return the chronology that the date is expressed in. - * As a result of this definition, objects only representing time, such as - * {@code LocalTime}, will return null. - *

            - * The result from JDK classes implementing {@code TemporalAccessor} is as follows:
            - * {@code LocalDate} returns {@code IsoChronology.INSTANCE}
            - * {@code LocalTime} returns null (does not represent a date)
            - * {@code LocalDateTime} returns {@code IsoChronology.INSTANCE}
            - * {@code ZonedDateTime} returns {@code IsoChronology.INSTANCE}
            - * {@code OffsetTime} returns null (does not represent a date)
            - * {@code OffsetDateTime} returns {@code IsoChronology.INSTANCE}
            - * {@code ChronoLocalDate} returns the associated chronology
            - * {@code ChronoLocalDateTime} returns the associated chronology
            - * {@code ChronoZonedDateTime} returns the associated chronology
            - * {@code Era} returns the associated chronology
            - * {@code DayOfWeek} returns null (shared across chronologies)
            - * {@code Month} returns {@code IsoChronology.INSTANCE}
            - * {@code Year} returns {@code IsoChronology.INSTANCE}
            - * {@code YearMonth} returns {@code IsoChronology.INSTANCE}
            - * {@code MonthDay} returns null {@code IsoChronology.INSTANCE}
            - * {@code ZoneOffset} returns null (does not represent a date)
            - * {@code Instant} returns null (does not represent a date)
            - *

            - * The method {@link java.time.chrono.Chronology#from(TemporalAccessor)} can be used as a - * {@code TemporalQuery} via a method reference, {@code Chronology::from}. - * That method is equivalent to this query, except that it throws an - * exception if a chronology cannot be obtained. - * - * @return a query that can obtain the chronology of a temporal, not null - */ - static TemporalQuery chronology() { - return TemporalQueries.CHRONO; - } - - /** - * A query for the smallest supported unit. - *

            - * This queries a {@code TemporalAccessor} for the time precision. - * If the target {@code TemporalAccessor} represents a consistent or complete date-time, - * date or time then this must return the smallest precision actually supported. - * Note that fields such as {@code NANO_OF_DAY} and {@code NANO_OF_SECOND} - * are defined to always return ignoring the precision, thus this is the only - * way to find the actual smallest supported unit. - * For example, were {@code GregorianCalendar} to implement {@code TemporalAccessor} - * it would return a precision of {@code MILLIS}. - *

            - * The result from JDK classes implementing {@code TemporalAccessor} is as follows:
            - * {@code LocalDate} returns {@code DAYS}
            - * {@code LocalTime} returns {@code NANOS}
            - * {@code LocalDateTime} returns {@code NANOS}
            - * {@code ZonedDateTime} returns {@code NANOS}
            - * {@code OffsetTime} returns {@code NANOS}
            - * {@code OffsetDateTime} returns {@code NANOS}
            - * {@code ChronoLocalDate} returns {@code DAYS}
            - * {@code ChronoLocalDateTime} returns {@code NANOS}
            - * {@code ChronoZonedDateTime} returns {@code NANOS}
            - * {@code Era} returns {@code ERAS}
            - * {@code DayOfWeek} returns {@code DAYS}
            - * {@code Month} returns {@code MONTHS}
            - * {@code Year} returns {@code YEARS}
            - * {@code YearMonth} returns {@code MONTHS}
            - * {@code MonthDay} returns null (does not represent a complete date or time)
            - * {@code ZoneOffset} returns null (does not represent a date or time)
            - * {@code Instant} returns {@code NANOS}
            - * - * @return a query that can obtain the precision of a temporal, not null - */ - static TemporalQuery precision() { - return TemporalQueries.PRECISION; - } - - //----------------------------------------------------------------------- - // non-special constants are standard queries that derive information from other information - /** - * A lenient query for the {@code ZoneId}, falling back to the {@code ZoneOffset}. - *

            - * This queries a {@code TemporalAccessor} for the zone. - * It first tries to obtain the zone, using {@link #zoneId()}. - * If that is not found it tries to obtain the {@link #offset()}. - * Thus a {@link java.time.ZonedDateTime} will return the result of {@code getZone()}, - * while an {@link java.time.OffsetDateTime} will return the result of {@code getOffset()}. - *

            - * In most cases, applications should use this query rather than {@code #zoneId()}. - *

            - * The method {@link ZoneId#from(TemporalAccessor)} can be used as a - * {@code TemporalQuery} via a method reference, {@code ZoneId::from}. - * That method is equivalent to this query, except that it throws an - * exception if a zone cannot be obtained. - * - * @return a query that can obtain the zone ID or offset of a temporal, not null - */ - static TemporalQuery zone() { - return TemporalQueries.ZONE; - } - - /** - * A query for {@code ZoneOffset} returning null if not found. - *

            - * This returns a {@code TemporalQuery} that can be used to query a temporal - * object for the offset. The query will return null if the temporal - * object cannot supply an offset. - *

            - * The query implementation examines the {@link ChronoField#OFFSET_SECONDS OFFSET_SECONDS} - * field and uses it to create a {@code ZoneOffset}. - *

            - * The method {@link java.time.ZoneOffset#from(TemporalAccessor)} can be used as a - * {@code TemporalQuery} via a method reference, {@code ZoneOffset::from}. - * This query and {@code ZoneOffset::from} will return the same result if the - * temporal object contains an offset. If the temporal object does not contain - * an offset, then the method reference will throw an exception, whereas this - * query will return null. - * - * @return a query that can obtain the offset of a temporal, not null - */ - static TemporalQuery offset() { - return TemporalQueries.OFFSET; - } - - /** - * A query for {@code LocalDate} returning null if not found. - *

            - * This returns a {@code TemporalQuery} that can be used to query a temporal - * object for the local date. The query will return null if the temporal - * object cannot supply a local date. - *

            - * The query implementation examines the {@link ChronoField#EPOCH_DAY EPOCH_DAY} - * field and uses it to create a {@code LocalDate}. - *

            - * The method {@link ZoneOffset#from(TemporalAccessor)} can be used as a - * {@code TemporalQuery} via a method reference, {@code LocalDate::from}. - * This query and {@code LocalDate::from} will return the same result if the - * temporal object contains a date. If the temporal object does not contain - * a date, then the method reference will throw an exception, whereas this - * query will return null. - * - * @return a query that can obtain the date of a temporal, not null - */ - static TemporalQuery localDate() { - return TemporalQueries.LOCAL_DATE; - } - - /** - * A query for {@code LocalTime} returning null if not found. - *

            - * This returns a {@code TemporalQuery} that can be used to query a temporal - * object for the local time. The query will return null if the temporal - * object cannot supply a local time. - *

            - * The query implementation examines the {@link ChronoField#NANO_OF_DAY NANO_OF_DAY} - * field and uses it to create a {@code LocalTime}. - *

            - * The method {@link ZoneOffset#from(TemporalAccessor)} can be used as a - * {@code TemporalQuery} via a method reference, {@code LocalTime::from}. - * This query and {@code LocalTime::from} will return the same result if the - * temporal object contains a time. If the temporal object does not contain - * a time, then the method reference will throw an exception, whereas this - * query will return null. - * - * @return a query that can obtain the time of a temporal, not null - */ - static TemporalQuery localTime() { - return TemporalQueries.LOCAL_TIME; - } - } diff --git a/jdk/src/share/classes/java/time/temporal/package-info.java b/jdk/src/share/classes/java/time/temporal/package-info.java index fe4d3f891b6..d3e9c0559bd 100644 --- a/jdk/src/share/classes/java/time/temporal/package-info.java +++ b/jdk/src/share/classes/java/time/temporal/package-info.java @@ -81,7 +81,7 @@ * A unit is used to measure an amount of time, such as years, days or minutes. * All units implement {@link java.time.temporal.TemporalUnit}. * The set of well known units is defined in {@link java.time.temporal.ChronoUnit}, such as {@code DAYS}. - * The unit interface is designed to allow applications defined units. + * The unit interface is designed to allow application defined units. *

            *

            * A field is used to express part of a larger date-time, such as year, month-of-year or second-of-minute. @@ -89,7 +89,7 @@ * The set of well known fields are defined in {@link java.time.temporal.ChronoField}, such as {@code HOUR_OF_DAY}. * Additional fields are defined by {@link java.time.temporal.JulianFields}, {@link java.time.temporal.WeekFields} * and {@link java.time.temporal.IsoFields}. - * The field interface is designed to allow applications defined fields. + * The field interface is designed to allow application defined fields. *

            *

            * This package provides tools that allow the units and fields of date and time to be accessed @@ -112,23 +112,23 @@ * such as the "last day of the month", or "next Wednesday". * These are modeled as functions that adjust a base date-time. * The functions implement {@link java.time.temporal.TemporalAdjuster} and operate on {@code Temporal}. - * A set of common functions are provided in {@code TemporalAdjuster}. + * A set of common functions are provided in {@link java.time.temporal.TemporalAdjusters}. * For example, to find the first occurrence of a day-of-week after a given date, use - * {@link java.time.temporal.TemporalAdjuster#next(DayOfWeek)}, such as + * {@link java.time.temporal.TemporalAdjusters#next(DayOfWeek)}, such as * {@code date.with(next(MONDAY))}. - * Applications can also define adjusters by implementing {@code TemporalAdjuster}. + * Applications can also define adjusters by implementing {@link java.time.temporal.TemporalAdjuster}. *

            *

            * The {@link java.time.temporal.TemporalAmount} interface models amounts of relative time. *

            *

            - * In addition to adjusting a date-time, an interface is provided to enable querying - + * In addition to adjusting a date-time, an interface is provided to enable querying via * {@link java.time.temporal.TemporalQuery}. * The most common implementations of the query interface are method references. * The {@code from(TemporalAccessor)} methods on major classes can all be used, such as * {@code LocalDate::from} or {@code Month::from}. - * Further implementations are provided in {@code TemporalQuery} as static methods. - * Applications can also define queries by implementing {@code TemporalQuery}. + * Further implementations are provided in {@link java.time.temporal.TemporalQueries} as static methods. + * Applications can also define queries by implementing {@link java.time.temporal.TemporalQuery}. *

            * *

            Weeks

            diff --git a/jdk/src/share/classes/java/time/zone/ZoneOffsetTransitionRule.java b/jdk/src/share/classes/java/time/zone/ZoneOffsetTransitionRule.java index 20e97f023f8..95c66e6f275 100644 --- a/jdk/src/share/classes/java/time/zone/ZoneOffsetTransitionRule.java +++ b/jdk/src/share/classes/java/time/zone/ZoneOffsetTransitionRule.java @@ -61,8 +61,8 @@ */ package java.time.zone; -import static java.time.temporal.TemporalAdjuster.nextOrSame; -import static java.time.temporal.TemporalAdjuster.previousOrSame; +import static java.time.temporal.TemporalAdjusters.nextOrSame; +import static java.time.temporal.TemporalAdjusters.previousOrSame; import java.io.DataInput; import java.io.DataOutput; diff --git a/jdk/src/share/classes/java/util/Formatter.java b/jdk/src/share/classes/java/util/Formatter.java index 3f30c5ebaae..a94234aee7e 100644 --- a/jdk/src/share/classes/java/util/Formatter.java +++ b/jdk/src/share/classes/java/util/Formatter.java @@ -56,7 +56,7 @@ import java.time.ZoneId; import java.time.ZoneOffset; import java.time.temporal.ChronoField; import java.time.temporal.TemporalAccessor; -import java.time.temporal.TemporalQuery; +import java.time.temporal.TemporalQueries; import sun.misc.DoubleConsts; import sun.misc.FormattedFloatingDecimal; @@ -4153,7 +4153,7 @@ public final class Formatter implements Closeable, Flushable { break; } case DateTime.ZONE: { // 'Z' (symbol) - ZoneId zid = t.query(TemporalQuery.zone()); + ZoneId zid = t.query(TemporalQueries.zone()); if (zid == null) { throw new IllegalFormatConversionException(c, t.getClass()); } diff --git a/jdk/test/java/time/tck/java/time/TCKDayOfWeek.java b/jdk/test/java/time/tck/java/time/TCKDayOfWeek.java index 3bf782ba954..e3f0e719ccb 100644 --- a/jdk/test/java/time/tck/java/time/TCKDayOfWeek.java +++ b/jdk/test/java/time/tck/java/time/TCKDayOfWeek.java @@ -77,6 +77,7 @@ import java.time.temporal.JulianFields; import java.time.temporal.Temporal; import java.time.temporal.TemporalAccessor; import java.time.temporal.TemporalField; +import java.time.temporal.TemporalQueries; import java.time.temporal.TemporalQuery; import java.util.ArrayList; import java.util.Arrays; @@ -215,13 +216,13 @@ public class TCKDayOfWeek extends AbstractDateTimeTest { @DataProvider(name="query") Object[][] data_query() { return new Object[][] { - {DayOfWeek.FRIDAY, TemporalQuery.chronology(), null}, - {DayOfWeek.FRIDAY, TemporalQuery.zoneId(), null}, - {DayOfWeek.FRIDAY, TemporalQuery.precision(), ChronoUnit.DAYS}, - {DayOfWeek.FRIDAY, TemporalQuery.zone(), null}, - {DayOfWeek.FRIDAY, TemporalQuery.offset(), null}, - {DayOfWeek.FRIDAY, TemporalQuery.localDate(), null}, - {DayOfWeek.FRIDAY, TemporalQuery.localTime(), null}, + {DayOfWeek.FRIDAY, TemporalQueries.chronology(), null}, + {DayOfWeek.FRIDAY, TemporalQueries.zoneId(), null}, + {DayOfWeek.FRIDAY, TemporalQueries.precision(), ChronoUnit.DAYS}, + {DayOfWeek.FRIDAY, TemporalQueries.zone(), null}, + {DayOfWeek.FRIDAY, TemporalQueries.offset(), null}, + {DayOfWeek.FRIDAY, TemporalQueries.localDate(), null}, + {DayOfWeek.FRIDAY, TemporalQueries.localTime(), null}, }; } diff --git a/jdk/test/java/time/tck/java/time/TCKInstant.java b/jdk/test/java/time/tck/java/time/TCKInstant.java index bf6ac9e7026..ee3898e1bb1 100644 --- a/jdk/test/java/time/tck/java/time/TCKInstant.java +++ b/jdk/test/java/time/tck/java/time/TCKInstant.java @@ -97,6 +97,7 @@ import java.time.temporal.TemporalAccessor; import java.time.temporal.TemporalAdjuster; import java.time.temporal.TemporalAmount; import java.time.temporal.TemporalField; +import java.time.temporal.TemporalQueries; import java.time.temporal.TemporalQuery; import java.time.temporal.TemporalUnit; import java.time.temporal.UnsupportedTemporalTypeException; @@ -401,13 +402,13 @@ public class TCKInstant extends AbstractDateTimeTest { @DataProvider(name="query") Object[][] data_query() { return new Object[][] { - {TEST_12345_123456789, TemporalQuery.chronology(), null}, - {TEST_12345_123456789, TemporalQuery.zoneId(), null}, - {TEST_12345_123456789, TemporalQuery.precision(), NANOS}, - {TEST_12345_123456789, TemporalQuery.zone(), null}, - {TEST_12345_123456789, TemporalQuery.offset(), null}, - {TEST_12345_123456789, TemporalQuery.localDate(), null}, - {TEST_12345_123456789, TemporalQuery.localTime(), null}, + {TEST_12345_123456789, TemporalQueries.chronology(), null}, + {TEST_12345_123456789, TemporalQueries.zoneId(), null}, + {TEST_12345_123456789, TemporalQueries.precision(), NANOS}, + {TEST_12345_123456789, TemporalQueries.zone(), null}, + {TEST_12345_123456789, TemporalQueries.offset(), null}, + {TEST_12345_123456789, TemporalQueries.localDate(), null}, + {TEST_12345_123456789, TemporalQueries.localTime(), null}, }; } diff --git a/jdk/test/java/time/tck/java/time/TCKLocalDate.java b/jdk/test/java/time/tck/java/time/TCKLocalDate.java index cb41a707945..02e2f0789f6 100644 --- a/jdk/test/java/time/tck/java/time/TCKLocalDate.java +++ b/jdk/test/java/time/tck/java/time/TCKLocalDate.java @@ -113,6 +113,7 @@ import java.time.temporal.Temporal; import java.time.temporal.TemporalAccessor; import java.time.temporal.TemporalAdjuster; import java.time.temporal.TemporalField; +import java.time.temporal.TemporalQueries; import java.time.temporal.TemporalQuery; import java.time.temporal.TemporalUnit; import java.time.temporal.UnsupportedTemporalTypeException; @@ -693,13 +694,13 @@ public class TCKLocalDate extends AbstractDateTimeTest { @DataProvider(name="query") Object[][] data_query() { return new Object[][] { - {TEST_2007_07_15, TemporalQuery.chronology(), IsoChronology.INSTANCE}, - {TEST_2007_07_15, TemporalQuery.zoneId(), null}, - {TEST_2007_07_15, TemporalQuery.precision(), ChronoUnit.DAYS}, - {TEST_2007_07_15, TemporalQuery.zone(), null}, - {TEST_2007_07_15, TemporalQuery.offset(), null}, - {TEST_2007_07_15, TemporalQuery.localDate(), TEST_2007_07_15}, - {TEST_2007_07_15, TemporalQuery.localTime(), null}, + {TEST_2007_07_15, TemporalQueries.chronology(), IsoChronology.INSTANCE}, + {TEST_2007_07_15, TemporalQueries.zoneId(), null}, + {TEST_2007_07_15, TemporalQueries.precision(), ChronoUnit.DAYS}, + {TEST_2007_07_15, TemporalQueries.zone(), null}, + {TEST_2007_07_15, TemporalQueries.offset(), null}, + {TEST_2007_07_15, TemporalQueries.localDate(), TEST_2007_07_15}, + {TEST_2007_07_15, TemporalQueries.localTime(), null}, }; } diff --git a/jdk/test/java/time/tck/java/time/TCKLocalDateTime.java b/jdk/test/java/time/tck/java/time/TCKLocalDateTime.java index 62b53b3b8a3..6303f5acdc0 100644 --- a/jdk/test/java/time/tck/java/time/TCKLocalDateTime.java +++ b/jdk/test/java/time/tck/java/time/TCKLocalDateTime.java @@ -134,6 +134,7 @@ import java.time.temporal.TemporalAccessor; import java.time.temporal.TemporalAdjuster; import java.time.temporal.TemporalAmount; import java.time.temporal.TemporalField; +import java.time.temporal.TemporalQueries; import java.time.temporal.TemporalQuery; import java.time.temporal.TemporalUnit; import java.util.ArrayList; @@ -1017,13 +1018,13 @@ public class TCKLocalDateTime extends AbstractDateTimeTest { @DataProvider(name="query") Object[][] data_query() { return new Object[][] { - {TEST_2007_07_15_12_30_40_987654321, TemporalQuery.chronology(), IsoChronology.INSTANCE}, - {TEST_2007_07_15_12_30_40_987654321, TemporalQuery.zoneId(), null}, - {TEST_2007_07_15_12_30_40_987654321, TemporalQuery.precision(), ChronoUnit.NANOS}, - {TEST_2007_07_15_12_30_40_987654321, TemporalQuery.zone(), null}, - {TEST_2007_07_15_12_30_40_987654321, TemporalQuery.offset(), null}, - {TEST_2007_07_15_12_30_40_987654321, TemporalQuery.localDate(), LocalDate.of(2007, 7, 15)}, - {TEST_2007_07_15_12_30_40_987654321, TemporalQuery.localTime(), LocalTime.of(12, 30, 40, 987654321)}, + {TEST_2007_07_15_12_30_40_987654321, TemporalQueries.chronology(), IsoChronology.INSTANCE}, + {TEST_2007_07_15_12_30_40_987654321, TemporalQueries.zoneId(), null}, + {TEST_2007_07_15_12_30_40_987654321, TemporalQueries.precision(), ChronoUnit.NANOS}, + {TEST_2007_07_15_12_30_40_987654321, TemporalQueries.zone(), null}, + {TEST_2007_07_15_12_30_40_987654321, TemporalQueries.offset(), null}, + {TEST_2007_07_15_12_30_40_987654321, TemporalQueries.localDate(), LocalDate.of(2007, 7, 15)}, + {TEST_2007_07_15_12_30_40_987654321, TemporalQueries.localTime(), LocalTime.of(12, 30, 40, 987654321)}, }; } diff --git a/jdk/test/java/time/tck/java/time/TCKLocalTime.java b/jdk/test/java/time/tck/java/time/TCKLocalTime.java index bac3f8587d1..704533afca0 100644 --- a/jdk/test/java/time/tck/java/time/TCKLocalTime.java +++ b/jdk/test/java/time/tck/java/time/TCKLocalTime.java @@ -116,6 +116,7 @@ import java.time.temporal.TemporalAccessor; import java.time.temporal.TemporalAdjuster; import java.time.temporal.TemporalAmount; import java.time.temporal.TemporalField; +import java.time.temporal.TemporalQueries; import java.time.temporal.TemporalQuery; import java.time.temporal.TemporalUnit; import java.time.temporal.UnsupportedTemporalTypeException; @@ -143,7 +144,7 @@ public class TCKLocalTime extends AbstractDateTimeTest { private static final TemporalUnit[] INVALID_UNITS; static { EnumSet set = EnumSet.range(DAYS, FOREVER); - INVALID_UNITS = (TemporalUnit[]) set.toArray(new TemporalUnit[set.size()]); + INVALID_UNITS = set.toArray(new TemporalUnit[set.size()]); } @BeforeMethod @@ -654,13 +655,13 @@ public class TCKLocalTime extends AbstractDateTimeTest { @DataProvider(name="query") Object[][] data_query() { return new Object[][] { - {TEST_12_30_40_987654321, TemporalQuery.chronology(), null}, - {TEST_12_30_40_987654321, TemporalQuery.zoneId(), null}, - {TEST_12_30_40_987654321, TemporalQuery.precision(), ChronoUnit.NANOS}, - {TEST_12_30_40_987654321, TemporalQuery.zone(), null}, - {TEST_12_30_40_987654321, TemporalQuery.offset(), null}, - {TEST_12_30_40_987654321, TemporalQuery.localDate(), null}, - {TEST_12_30_40_987654321, TemporalQuery.localTime(), TEST_12_30_40_987654321}, + {TEST_12_30_40_987654321, TemporalQueries.chronology(), null}, + {TEST_12_30_40_987654321, TemporalQueries.zoneId(), null}, + {TEST_12_30_40_987654321, TemporalQueries.precision(), ChronoUnit.NANOS}, + {TEST_12_30_40_987654321, TemporalQueries.zone(), null}, + {TEST_12_30_40_987654321, TemporalQueries.offset(), null}, + {TEST_12_30_40_987654321, TemporalQueries.localDate(), null}, + {TEST_12_30_40_987654321, TemporalQueries.localTime(), TEST_12_30_40_987654321}, }; } diff --git a/jdk/test/java/time/tck/java/time/TCKMonth.java b/jdk/test/java/time/tck/java/time/TCKMonth.java index 3bff8c9beb6..df879e7d1db 100644 --- a/jdk/test/java/time/tck/java/time/TCKMonth.java +++ b/jdk/test/java/time/tck/java/time/TCKMonth.java @@ -73,6 +73,7 @@ import java.time.temporal.ChronoUnit; import java.time.temporal.JulianFields; import java.time.temporal.TemporalAccessor; import java.time.temporal.TemporalField; +import java.time.temporal.TemporalQueries; import java.time.temporal.TemporalQuery; import java.util.ArrayList; import java.util.Arrays; @@ -207,13 +208,13 @@ public class TCKMonth extends AbstractDateTimeTest { @DataProvider(name="query") Object[][] data_query() { return new Object[][] { - {Month.JUNE, TemporalQuery.chronology(), IsoChronology.INSTANCE}, - {Month.JUNE, TemporalQuery.zoneId(), null}, - {Month.JUNE, TemporalQuery.precision(), ChronoUnit.MONTHS}, - {Month.JUNE, TemporalQuery.zone(), null}, - {Month.JUNE, TemporalQuery.offset(), null}, - {Month.JUNE, TemporalQuery.localDate(), null}, - {Month.JUNE, TemporalQuery.localTime(), null}, + {Month.JUNE, TemporalQueries.chronology(), IsoChronology.INSTANCE}, + {Month.JUNE, TemporalQueries.zoneId(), null}, + {Month.JUNE, TemporalQueries.precision(), ChronoUnit.MONTHS}, + {Month.JUNE, TemporalQueries.zone(), null}, + {Month.JUNE, TemporalQueries.offset(), null}, + {Month.JUNE, TemporalQueries.localDate(), null}, + {Month.JUNE, TemporalQueries.localTime(), null}, }; } diff --git a/jdk/test/java/time/tck/java/time/TCKMonthDay.java b/jdk/test/java/time/tck/java/time/TCKMonthDay.java index e9b1730cb71..99a711666d8 100644 --- a/jdk/test/java/time/tck/java/time/TCKMonthDay.java +++ b/jdk/test/java/time/tck/java/time/TCKMonthDay.java @@ -86,6 +86,7 @@ import java.time.temporal.ChronoField; import java.time.temporal.JulianFields; import java.time.temporal.TemporalAccessor; import java.time.temporal.TemporalField; +import java.time.temporal.TemporalQueries; import java.time.temporal.TemporalQuery; import java.util.ArrayList; import java.util.Arrays; @@ -428,13 +429,13 @@ public class TCKMonthDay extends AbstractDateTimeTest { @DataProvider(name="query") Object[][] data_query() { return new Object[][] { - {TEST_07_15, TemporalQuery.chronology(), IsoChronology.INSTANCE}, - {TEST_07_15, TemporalQuery.zoneId(), null}, - {TEST_07_15, TemporalQuery.precision(), null}, - {TEST_07_15, TemporalQuery.zone(), null}, - {TEST_07_15, TemporalQuery.offset(), null}, - {TEST_07_15, TemporalQuery.localDate(), null}, - {TEST_07_15, TemporalQuery.localTime(), null}, + {TEST_07_15, TemporalQueries.chronology(), IsoChronology.INSTANCE}, + {TEST_07_15, TemporalQueries.zoneId(), null}, + {TEST_07_15, TemporalQueries.precision(), null}, + {TEST_07_15, TemporalQueries.zone(), null}, + {TEST_07_15, TemporalQueries.offset(), null}, + {TEST_07_15, TemporalQueries.localDate(), null}, + {TEST_07_15, TemporalQueries.localTime(), null}, }; } diff --git a/jdk/test/java/time/tck/java/time/TCKOffsetDateTime.java b/jdk/test/java/time/tck/java/time/TCKOffsetDateTime.java index 0ced814d06b..b77b7a8ba15 100644 --- a/jdk/test/java/time/tck/java/time/TCKOffsetDateTime.java +++ b/jdk/test/java/time/tck/java/time/TCKOffsetDateTime.java @@ -132,6 +132,7 @@ import java.time.temporal.Temporal; import java.time.temporal.TemporalAccessor; import java.time.temporal.TemporalAdjuster; import java.time.temporal.TemporalField; +import java.time.temporal.TemporalQueries; import java.time.temporal.TemporalQuery; import java.time.temporal.TemporalUnit; import java.util.ArrayList; @@ -635,13 +636,13 @@ public class TCKOffsetDateTime extends AbstractDateTimeTest { @DataProvider(name="query") Object[][] data_query() { return new Object[][] { - {TEST_2008_6_30_11_30_59_000000500, TemporalQuery.chronology(), IsoChronology.INSTANCE}, - {TEST_2008_6_30_11_30_59_000000500, TemporalQuery.zoneId(), null}, - {TEST_2008_6_30_11_30_59_000000500, TemporalQuery.precision(), ChronoUnit.NANOS}, - {TEST_2008_6_30_11_30_59_000000500, TemporalQuery.zone(), OFFSET_PONE}, - {TEST_2008_6_30_11_30_59_000000500, TemporalQuery.offset(), OFFSET_PONE}, - {TEST_2008_6_30_11_30_59_000000500, TemporalQuery.localDate(), LocalDate.of(2008, 6, 30)}, - {TEST_2008_6_30_11_30_59_000000500, TemporalQuery.localTime(), LocalTime.of(11, 30, 59, 500)}, + {TEST_2008_6_30_11_30_59_000000500, TemporalQueries.chronology(), IsoChronology.INSTANCE}, + {TEST_2008_6_30_11_30_59_000000500, TemporalQueries.zoneId(), null}, + {TEST_2008_6_30_11_30_59_000000500, TemporalQueries.precision(), ChronoUnit.NANOS}, + {TEST_2008_6_30_11_30_59_000000500, TemporalQueries.zone(), OFFSET_PONE}, + {TEST_2008_6_30_11_30_59_000000500, TemporalQueries.offset(), OFFSET_PONE}, + {TEST_2008_6_30_11_30_59_000000500, TemporalQueries.localDate(), LocalDate.of(2008, 6, 30)}, + {TEST_2008_6_30_11_30_59_000000500, TemporalQueries.localTime(), LocalTime.of(11, 30, 59, 500)}, }; } diff --git a/jdk/test/java/time/tck/java/time/TCKOffsetTime.java b/jdk/test/java/time/tck/java/time/TCKOffsetTime.java index 5bc2312ea0f..d373be443f3 100644 --- a/jdk/test/java/time/tck/java/time/TCKOffsetTime.java +++ b/jdk/test/java/time/tck/java/time/TCKOffsetTime.java @@ -115,6 +115,7 @@ import java.time.temporal.TemporalAccessor; import java.time.temporal.TemporalAdjuster; import java.time.temporal.TemporalAmount; import java.time.temporal.TemporalField; +import java.time.temporal.TemporalQueries; import java.time.temporal.TemporalQuery; import java.time.temporal.TemporalUnit; import java.util.ArrayList; @@ -605,13 +606,13 @@ public class TCKOffsetTime extends AbstractDateTimeTest { @DataProvider(name="query") Object[][] data_query() { return new Object[][] { - {TEST_11_30_59_500_PONE, TemporalQuery.chronology(), null}, - {TEST_11_30_59_500_PONE, TemporalQuery.zoneId(), null}, - {TEST_11_30_59_500_PONE, TemporalQuery.precision(), ChronoUnit.NANOS}, - {TEST_11_30_59_500_PONE, TemporalQuery.zone(), OFFSET_PONE}, - {TEST_11_30_59_500_PONE, TemporalQuery.offset(), OFFSET_PONE}, - {TEST_11_30_59_500_PONE, TemporalQuery.localDate(), null}, - {TEST_11_30_59_500_PONE, TemporalQuery.localTime(), LocalTime.of(11, 30, 59, 500)}, + {TEST_11_30_59_500_PONE, TemporalQueries.chronology(), null}, + {TEST_11_30_59_500_PONE, TemporalQueries.zoneId(), null}, + {TEST_11_30_59_500_PONE, TemporalQueries.precision(), ChronoUnit.NANOS}, + {TEST_11_30_59_500_PONE, TemporalQueries.zone(), OFFSET_PONE}, + {TEST_11_30_59_500_PONE, TemporalQueries.offset(), OFFSET_PONE}, + {TEST_11_30_59_500_PONE, TemporalQueries.localDate(), null}, + {TEST_11_30_59_500_PONE, TemporalQueries.localTime(), LocalTime.of(11, 30, 59, 500)}, }; } diff --git a/jdk/test/java/time/tck/java/time/TCKYear.java b/jdk/test/java/time/tck/java/time/TCKYear.java index 59d464a5373..75ed80e13ea 100644 --- a/jdk/test/java/time/tck/java/time/TCKYear.java +++ b/jdk/test/java/time/tck/java/time/TCKYear.java @@ -99,6 +99,7 @@ import java.time.temporal.Temporal; import java.time.temporal.TemporalAccessor; import java.time.temporal.TemporalAmount; import java.time.temporal.TemporalField; +import java.time.temporal.TemporalQueries; import java.time.temporal.TemporalQuery; import java.time.temporal.TemporalUnit; import java.time.temporal.UnsupportedTemporalTypeException; @@ -411,13 +412,13 @@ public class TCKYear extends AbstractDateTimeTest { @DataProvider(name="query") Object[][] data_query() { return new Object[][] { - {TEST_2008, TemporalQuery.chronology(), IsoChronology.INSTANCE}, - {TEST_2008, TemporalQuery.zoneId(), null}, - {TEST_2008, TemporalQuery.precision(), ChronoUnit.YEARS}, - {TEST_2008, TemporalQuery.zone(), null}, - {TEST_2008, TemporalQuery.offset(), null}, - {TEST_2008, TemporalQuery.localDate(), null}, - {TEST_2008, TemporalQuery.localTime(), null}, + {TEST_2008, TemporalQueries.chronology(), IsoChronology.INSTANCE}, + {TEST_2008, TemporalQueries.zoneId(), null}, + {TEST_2008, TemporalQueries.precision(), ChronoUnit.YEARS}, + {TEST_2008, TemporalQueries.zone(), null}, + {TEST_2008, TemporalQueries.offset(), null}, + {TEST_2008, TemporalQueries.localDate(), null}, + {TEST_2008, TemporalQueries.localTime(), null}, }; } @@ -596,7 +597,7 @@ public class TCKYear extends AbstractDateTimeTest { } @Test(dataProvider="plus_long_TemporalUnit") - public void test_plus_long_TemporalUnit(Year base, long amount, TemporalUnit unit, Year expectedYear, Class expectedEx) { + public void test_plus_long_TemporalUnit(Year base, long amount, TemporalUnit unit, Year expectedYear, Class expectedEx) { if (expectedEx == null) { assertEquals(base.plus(amount, unit), expectedYear); } else { @@ -728,7 +729,7 @@ public class TCKYear extends AbstractDateTimeTest { } @Test(dataProvider="minus_long_TemporalUnit") - public void test_minus_long_TemporalUnit(Year base, long amount, TemporalUnit unit, Year expectedYear, Class expectedEx) { + public void test_minus_long_TemporalUnit(Year base, long amount, TemporalUnit unit, Year expectedYear, Class expectedEx) { if (expectedEx == null) { assertEquals(base.minus(amount, unit), expectedYear); } else { diff --git a/jdk/test/java/time/tck/java/time/TCKYearMonth.java b/jdk/test/java/time/tck/java/time/TCKYearMonth.java index bb16839bda1..e922f72323f 100644 --- a/jdk/test/java/time/tck/java/time/TCKYearMonth.java +++ b/jdk/test/java/time/tck/java/time/TCKYearMonth.java @@ -100,6 +100,7 @@ import java.time.temporal.JulianFields; import java.time.temporal.TemporalAccessor; import java.time.temporal.TemporalAmount; import java.time.temporal.TemporalField; +import java.time.temporal.TemporalQueries; import java.time.temporal.TemporalQuery; import java.time.temporal.TemporalUnit; import java.time.temporal.UnsupportedTemporalTypeException; @@ -476,13 +477,13 @@ public class TCKYearMonth extends AbstractDateTimeTest { @DataProvider(name="query") Object[][] data_query() { return new Object[][] { - {TEST_2008_06, TemporalQuery.chronology(), IsoChronology.INSTANCE}, - {TEST_2008_06, TemporalQuery.zoneId(), null}, - {TEST_2008_06, TemporalQuery.precision(), ChronoUnit.MONTHS}, - {TEST_2008_06, TemporalQuery.zone(), null}, - {TEST_2008_06, TemporalQuery.offset(), null}, - {TEST_2008_06, TemporalQuery.localDate(), null}, - {TEST_2008_06, TemporalQuery.localTime(), null}, + {TEST_2008_06, TemporalQueries.chronology(), IsoChronology.INSTANCE}, + {TEST_2008_06, TemporalQueries.zoneId(), null}, + {TEST_2008_06, TemporalQueries.precision(), ChronoUnit.MONTHS}, + {TEST_2008_06, TemporalQueries.zone(), null}, + {TEST_2008_06, TemporalQueries.offset(), null}, + {TEST_2008_06, TemporalQueries.localDate(), null}, + {TEST_2008_06, TemporalQueries.localTime(), null}, }; } @@ -768,7 +769,7 @@ public class TCKYearMonth extends AbstractDateTimeTest { } @Test(dataProvider="plus_long_TemporalUnit") - public void test_plus_long_TemporalUnit(YearMonth base, long amount, TemporalUnit unit, YearMonth expectedYearMonth, Class expectedEx) { + public void test_plus_long_TemporalUnit(YearMonth base, long amount, TemporalUnit unit, YearMonth expectedYearMonth, Class expectedEx) { if (expectedEx == null) { assertEquals(base.plus(amount, unit), expectedYearMonth); } else { @@ -820,7 +821,7 @@ public class TCKYearMonth extends AbstractDateTimeTest { } @Test(dataProvider="plus_TemporalAmount") - public void test_plus_TemporalAmount(YearMonth base, TemporalAmount temporalAmount, YearMonth expectedYearMonth, Class expectedEx) { + public void test_plus_TemporalAmount(YearMonth base, TemporalAmount temporalAmount, YearMonth expectedYearMonth, Class expectedEx) { if (expectedEx == null) { assertEquals(base.plus(temporalAmount), expectedYearMonth); } else { @@ -983,7 +984,7 @@ public class TCKYearMonth extends AbstractDateTimeTest { } @Test(dataProvider="minus_long_TemporalUnit") - public void test_minus_long_TemporalUnit(YearMonth base, long amount, TemporalUnit unit, YearMonth expectedYearMonth, Class expectedEx) { + public void test_minus_long_TemporalUnit(YearMonth base, long amount, TemporalUnit unit, YearMonth expectedYearMonth, Class expectedEx) { if (expectedEx == null) { assertEquals(base.minus(amount, unit), expectedYearMonth); } else { @@ -1035,7 +1036,7 @@ public class TCKYearMonth extends AbstractDateTimeTest { } @Test(dataProvider="minus_TemporalAmount") - public void test_minus_TemporalAmount(YearMonth base, TemporalAmount temporalAmount, YearMonth expectedYearMonth, Class expectedEx) { + public void test_minus_TemporalAmount(YearMonth base, TemporalAmount temporalAmount, YearMonth expectedYearMonth, Class expectedEx) { if (expectedEx == null) { assertEquals(base.minus(temporalAmount), expectedYearMonth); } else { diff --git a/jdk/test/java/time/tck/java/time/TCKZoneId.java b/jdk/test/java/time/tck/java/time/TCKZoneId.java index 0d47403db4e..c036deeb7e7 100644 --- a/jdk/test/java/time/tck/java/time/TCKZoneId.java +++ b/jdk/test/java/time/tck/java/time/TCKZoneId.java @@ -76,6 +76,7 @@ import java.time.ZoneOffset; import java.time.format.TextStyle; import java.time.temporal.TemporalAccessor; import java.time.temporal.TemporalField; +import java.time.temporal.TemporalQueries; import java.time.temporal.TemporalQuery; import java.time.zone.ZoneRulesException; import java.util.HashMap; @@ -559,7 +560,7 @@ public class TCKZoneId extends AbstractTCKTest { @SuppressWarnings("unchecked") @Override public R query(TemporalQuery query) { - if (query == TemporalQuery.zoneId()) { + if (query == TemporalQueries.zoneId()) { return (R) ZoneId.of("Europe/Paris"); } return TemporalAccessor.super.query(query); diff --git a/jdk/test/java/time/tck/java/time/TCKZoneOffset.java b/jdk/test/java/time/tck/java/time/TCKZoneOffset.java index cf9098a188b..c121079dae6 100644 --- a/jdk/test/java/time/tck/java/time/TCKZoneOffset.java +++ b/jdk/test/java/time/tck/java/time/TCKZoneOffset.java @@ -81,6 +81,7 @@ import java.time.temporal.ChronoField; import java.time.temporal.JulianFields; import java.time.temporal.TemporalAccessor; import java.time.temporal.TemporalField; +import java.time.temporal.TemporalQueries; import java.time.temporal.TemporalQuery; import java.util.ArrayList; import java.util.Arrays; @@ -523,13 +524,13 @@ public class TCKZoneOffset extends AbstractDateTimeTest { @DataProvider(name="query") Object[][] data_query() { return new Object[][] { - {ZoneOffset.UTC, TemporalQuery.chronology(), null}, - {ZoneOffset.UTC, TemporalQuery.zoneId(), null}, - {ZoneOffset.UTC, TemporalQuery.precision(), null}, - {ZoneOffset.UTC, TemporalQuery.zone(), ZoneOffset.UTC}, - {ZoneOffset.UTC, TemporalQuery.offset(), ZoneOffset.UTC}, - {ZoneOffset.UTC, TemporalQuery.localDate(), null}, - {ZoneOffset.UTC, TemporalQuery.localTime(), null}, + {ZoneOffset.UTC, TemporalQueries.chronology(), null}, + {ZoneOffset.UTC, TemporalQueries.zoneId(), null}, + {ZoneOffset.UTC, TemporalQueries.precision(), null}, + {ZoneOffset.UTC, TemporalQueries.zone(), ZoneOffset.UTC}, + {ZoneOffset.UTC, TemporalQueries.offset(), ZoneOffset.UTC}, + {ZoneOffset.UTC, TemporalQueries.localDate(), null}, + {ZoneOffset.UTC, TemporalQueries.localTime(), null}, }; } diff --git a/jdk/test/java/time/tck/java/time/TCKZonedDateTime.java b/jdk/test/java/time/tck/java/time/TCKZonedDateTime.java index 4c5319d483a..fb743e87b14 100644 --- a/jdk/test/java/time/tck/java/time/TCKZonedDateTime.java +++ b/jdk/test/java/time/tck/java/time/TCKZonedDateTime.java @@ -126,6 +126,7 @@ import java.time.temporal.TemporalAccessor; import java.time.temporal.TemporalAdjuster; import java.time.temporal.TemporalAmount; import java.time.temporal.TemporalField; +import java.time.temporal.TemporalQueries; import java.time.temporal.TemporalQuery; import java.time.temporal.TemporalUnit; import java.util.ArrayList; @@ -685,7 +686,7 @@ public class TCKZonedDateTime extends AbstractDateTimeTest { @SuppressWarnings("unchecked") @Override public R query(TemporalQuery query) { - if (query == TemporalQuery.zoneId()) { + if (query == TemporalQueries.zoneId()) { return (R) TEST_DATE_TIME_PARIS.getZone(); } return TemporalAccessor.super.query(query); @@ -709,7 +710,7 @@ public class TCKZonedDateTime extends AbstractDateTimeTest { @SuppressWarnings("unchecked") @Override public R query(TemporalQuery query) { - if (query == TemporalQuery.zoneId()) { + if (query == TemporalQueries.zoneId()) { return (R) TEST_DATE_TIME_PARIS.getZone(); } return TemporalAccessor.super.query(query); @@ -964,32 +965,32 @@ public class TCKZonedDateTime extends AbstractDateTimeTest { //----------------------------------------------------------------------- @Test public void test_query_chrono() { - assertEquals(TEST_DATE_TIME.query(TemporalQuery.chronology()), IsoChronology.INSTANCE); - assertEquals(TemporalQuery.chronology().queryFrom(TEST_DATE_TIME), IsoChronology.INSTANCE); + assertEquals(TEST_DATE_TIME.query(TemporalQueries.chronology()), IsoChronology.INSTANCE); + assertEquals(TemporalQueries.chronology().queryFrom(TEST_DATE_TIME), IsoChronology.INSTANCE); } @Test public void test_query_zoneId() { - assertEquals(TEST_DATE_TIME.query(TemporalQuery.zoneId()), TEST_DATE_TIME.getZone()); - assertEquals(TemporalQuery.zoneId().queryFrom(TEST_DATE_TIME), TEST_DATE_TIME.getZone()); + assertEquals(TEST_DATE_TIME.query(TemporalQueries.zoneId()), TEST_DATE_TIME.getZone()); + assertEquals(TemporalQueries.zoneId().queryFrom(TEST_DATE_TIME), TEST_DATE_TIME.getZone()); } @Test public void test_query_precision() { - assertEquals(TEST_DATE_TIME.query(TemporalQuery.precision()), NANOS); - assertEquals(TemporalQuery.precision().queryFrom(TEST_DATE_TIME), NANOS); + assertEquals(TEST_DATE_TIME.query(TemporalQueries.precision()), NANOS); + assertEquals(TemporalQueries.precision().queryFrom(TEST_DATE_TIME), NANOS); } @Test public void test_query_offset() { - assertEquals(TEST_DATE_TIME.query(TemporalQuery.offset()), TEST_DATE_TIME.getOffset()); - assertEquals(TemporalQuery.offset().queryFrom(TEST_DATE_TIME), TEST_DATE_TIME.getOffset()); + assertEquals(TEST_DATE_TIME.query(TemporalQueries.offset()), TEST_DATE_TIME.getOffset()); + assertEquals(TemporalQueries.offset().queryFrom(TEST_DATE_TIME), TEST_DATE_TIME.getOffset()); } @Test public void test_query_zone() { - assertEquals(TEST_DATE_TIME.query(TemporalQuery.zone()), TEST_DATE_TIME.getZone()); - assertEquals(TemporalQuery.zone().queryFrom(TEST_DATE_TIME), TEST_DATE_TIME.getZone()); + assertEquals(TEST_DATE_TIME.query(TemporalQueries.zone()), TEST_DATE_TIME.getZone()); + assertEquals(TemporalQueries.zone().queryFrom(TEST_DATE_TIME), TEST_DATE_TIME.getZone()); } @Test(expectedExceptions=NullPointerException.class) diff --git a/jdk/test/java/time/tck/java/time/TestIsoChronology.java b/jdk/test/java/time/tck/java/time/TestIsoChronology.java index c99ec2a3ac4..5b1a5c67cf3 100644 --- a/jdk/test/java/time/tck/java/time/TestIsoChronology.java +++ b/jdk/test/java/time/tck/java/time/TestIsoChronology.java @@ -80,7 +80,7 @@ import java.time.chrono.HijrahEra; import java.time.chrono.IsoChronology; import java.time.chrono.IsoEra; import java.time.temporal.ChronoField; -import java.time.temporal.TemporalAdjuster; +import java.time.temporal.TemporalAdjusters; import org.testng.Assert; import org.testng.annotations.DataProvider; @@ -208,14 +208,14 @@ public class TestIsoChronology { @Test public void test_adjust1() { LocalDate base = IsoChronology.INSTANCE.date(1728, 10, 28); - LocalDate test = base.with(TemporalAdjuster.lastDayOfMonth()); + LocalDate test = base.with(TemporalAdjusters.lastDayOfMonth()); assertEquals(test, IsoChronology.INSTANCE.date(1728, 10, 31)); } @Test public void test_adjust2() { LocalDate base = IsoChronology.INSTANCE.date(1728, 12, 2); - LocalDate test = base.with(TemporalAdjuster.lastDayOfMonth()); + LocalDate test = base.with(TemporalAdjusters.lastDayOfMonth()); assertEquals(test, IsoChronology.INSTANCE.date(1728, 12, 31)); } diff --git a/jdk/test/java/time/tck/java/time/chrono/CopticDate.java b/jdk/test/java/time/tck/java/time/chrono/CopticDate.java index c0da6975623..a296c5940ec 100644 --- a/jdk/test/java/time/tck/java/time/chrono/CopticDate.java +++ b/jdk/test/java/time/tck/java/time/chrono/CopticDate.java @@ -308,7 +308,7 @@ public final class CopticDate @Override public Period until(ChronoLocalDate endDate) { // TODO: untested - CopticDate end = (CopticDate) getChronology().date(endDate); + CopticDate end = getChronology().date(endDate); long totalMonths = (end.prolepticYear - this.prolepticYear) * 13 + (end.month - this.month); // safe int days = end.day - this.day; if (totalMonths > 0 && days < 0) { diff --git a/jdk/test/java/time/tck/java/time/chrono/TCKChronoLocalDateTime.java b/jdk/test/java/time/tck/java/time/chrono/TCKChronoLocalDateTime.java index 51b68bb7c1f..9f9de499dd8 100644 --- a/jdk/test/java/time/tck/java/time/chrono/TCKChronoLocalDateTime.java +++ b/jdk/test/java/time/tck/java/time/chrono/TCKChronoLocalDateTime.java @@ -346,7 +346,7 @@ public class TCKChronoLocalDateTime { //----------------------------------------------------------------------- @Test(dataProvider="calendars") public void test_getChronology(Chronology chrono) { - ChronoLocalDateTime test = chrono.localDateTime(LocalDateTime.of(2010, 6, 30, 11, 30)); + ChronoLocalDateTime test = chrono.localDateTime(LocalDateTime.of(2010, 6, 30, 11, 30)); assertEquals(test.getChronology(), chrono); } diff --git a/jdk/test/java/time/tck/java/time/chrono/TCKChronoZonedDateTime.java b/jdk/test/java/time/tck/java/time/chrono/TCKChronoZonedDateTime.java index 0cabccab036..c3a1d2dcb70 100644 --- a/jdk/test/java/time/tck/java/time/chrono/TCKChronoZonedDateTime.java +++ b/jdk/test/java/time/tck/java/time/chrono/TCKChronoZonedDateTime.java @@ -347,7 +347,7 @@ public class TCKChronoZonedDateTime { //----------------------------------------------------------------------- @Test(dataProvider="calendars") public void test_getChronology(Chronology chrono) { - ChronoZonedDateTime test = chrono.zonedDateTime(ZonedDateTime.of(2010, 6, 30, 11, 30, 0, 0, ZoneOffset.UTC)); + ChronoZonedDateTime test = chrono.zonedDateTime(ZonedDateTime.of(2010, 6, 30, 11, 30, 0, 0, ZoneOffset.UTC)); assertEquals(test.getChronology(), chrono); } diff --git a/jdk/test/java/time/tck/java/time/chrono/TCKIsoChronology.java b/jdk/test/java/time/tck/java/time/chrono/TCKIsoChronology.java index a69f556b5cd..0cd8eed5fed 100644 --- a/jdk/test/java/time/tck/java/time/chrono/TCKIsoChronology.java +++ b/jdk/test/java/time/tck/java/time/chrono/TCKIsoChronology.java @@ -70,7 +70,9 @@ import java.time.chrono.IsoChronology; import java.time.format.ResolverStyle; import java.time.temporal.ChronoField; import java.time.temporal.TemporalAccessor; +import java.time.temporal.TemporalAdjusters; import java.time.temporal.TemporalField; +import java.time.temporal.TemporalQueries; import java.time.temporal.TemporalQuery; import java.util.HashMap; import java.util.Map; @@ -107,7 +109,7 @@ public class TCKIsoChronology { @SuppressWarnings("unchecked") @Override public R query(TemporalQuery query) { - if (query == TemporalQuery.chronology()) { + if (query == TemporalQueries.chronology()) { return (R) IsoChronology.INSTANCE; } throw new UnsupportedOperationException(); @@ -130,7 +132,7 @@ public class TCKIsoChronology { @Override public R query(TemporalQuery query) { - if (query == TemporalQuery.chronology()) { + if (query == TemporalQueries.chronology()) { return null; } throw new UnsupportedOperationException(); @@ -166,7 +168,7 @@ public class TCKIsoChronology { @SuppressWarnings("unchecked") @Override public R query(TemporalQuery query) { - if (query == TemporalQuery.localDate()) { + if (query == TemporalQueries.localDate()) { return (R) LocalDate.of(2012, 6, 30); } throw new UnsupportedOperationException(); @@ -205,10 +207,10 @@ public class TCKIsoChronology { @SuppressWarnings("unchecked") @Override public R query(TemporalQuery query) { - if (query == TemporalQuery.localDate()) { + if (query == TemporalQueries.localDate()) { return (R) LocalDate.of(2012, 6, 30); } - if (query == TemporalQuery.localTime()) { + if (query == TemporalQueries.localTime()) { return (R) LocalTime.of(12, 30, 40); } throw new UnsupportedOperationException(); @@ -254,13 +256,13 @@ public class TCKIsoChronology { @SuppressWarnings("unchecked") @Override public R query(TemporalQuery query) { - if (query == TemporalQuery.localDate()) { + if (query == TemporalQueries.localDate()) { return (R) LocalDate.of(2012, 6, 30); } - if (query == TemporalQuery.localTime()) { + if (query == TemporalQueries.localTime()) { return (R) LocalTime.of(12, 30, 40); } - if (query == TemporalQuery.zoneId() || query == TemporalQuery.zone()) { + if (query == TemporalQueries.zoneId() || query == TemporalQueries.zone()) { return (R) ZoneId.of("Europe/London"); } throw new UnsupportedOperationException(); diff --git a/jdk/test/java/time/tck/java/time/chrono/TCKJapaneseChronology.java b/jdk/test/java/time/tck/java/time/chrono/TCKJapaneseChronology.java index fd53b0f0be1..2bc1f4c8ce7 100644 --- a/jdk/test/java/time/tck/java/time/chrono/TCKJapaneseChronology.java +++ b/jdk/test/java/time/tck/java/time/chrono/TCKJapaneseChronology.java @@ -92,10 +92,9 @@ import java.time.chrono.ThaiBuddhistChronology; import java.time.format.ResolverStyle; import java.time.temporal.ChronoField; import java.time.temporal.ChronoUnit; -import java.time.temporal.Temporal; -import java.time.temporal.TemporalAdjuster; +import java.time.temporal.TemporalAdjusters; import java.time.temporal.TemporalField; -import java.time.temporal.TemporalQuery; +import java.time.temporal.TemporalQueries; import java.time.temporal.ValueRange; import java.util.HashMap; @@ -229,7 +228,7 @@ public class TCKJapaneseChronology { @Test(dataProvider="createByEra") public void test_createByEra_query(JapaneseEra era, int yoe, int moy, int dom, int doy, LocalDate iso) { JapaneseDate test = JapaneseDate.of(era, yoe, moy, dom); - assertEquals(test.query(TemporalQuery.localDate()), iso); + assertEquals(test.query(TemporalQueries.localDate()), iso); } @Test(dataProvider="createByEra") @@ -297,7 +296,7 @@ public class TCKJapaneseChronology { @Test(dataProvider="createByProleptic") public void test_createByProleptic_query(int y, int moy, int dom, int doy, LocalDate iso) { JapaneseDate test = JapaneseDate.of(y, moy, dom); - assertEquals(test.query(TemporalQuery.localDate()), iso); + assertEquals(test.query(TemporalQueries.localDate()), iso); } @Test(dataProvider="createByProleptic") @@ -495,14 +494,14 @@ public class TCKJapaneseChronology { @Test public void test_adjust1() { JapaneseDate base = JapaneseChronology.INSTANCE.date(1928, 10, 29); - JapaneseDate test = base.with(TemporalAdjuster.lastDayOfMonth()); + JapaneseDate test = base.with(TemporalAdjusters.lastDayOfMonth()); assertEquals(test, JapaneseChronology.INSTANCE.date(1928, 10, 31)); } @Test public void test_adjust2() { JapaneseDate base = JapaneseChronology.INSTANCE.date(1928, 12, 2); - JapaneseDate test = base.with(TemporalAdjuster.lastDayOfMonth()); + JapaneseDate test = base.with(TemporalAdjusters.lastDayOfMonth()); assertEquals(test, JapaneseChronology.INSTANCE.date(1928, 12, 31)); } diff --git a/jdk/test/java/time/tck/java/time/chrono/TCKMinguoChronology.java b/jdk/test/java/time/tck/java/time/chrono/TCKMinguoChronology.java index ad98e9119b3..53089a6eef4 100644 --- a/jdk/test/java/time/tck/java/time/chrono/TCKMinguoChronology.java +++ b/jdk/test/java/time/tck/java/time/chrono/TCKMinguoChronology.java @@ -82,15 +82,15 @@ import java.time.chrono.Era; import java.time.chrono.IsoChronology; import java.time.chrono.JapaneseDate; import java.time.chrono.MinguoChronology; -import java.time.chrono.MinguoDate; import java.time.chrono.MinguoEra; +import java.time.chrono.MinguoDate; import java.time.chrono.ThaiBuddhistChronology; import java.time.chrono.ThaiBuddhistDate; import java.time.format.ResolverStyle; import java.time.temporal.ChronoField; import java.time.temporal.ChronoUnit; import java.time.temporal.TemporalAccessor; -import java.time.temporal.TemporalAdjuster; +import java.time.temporal.TemporalAdjusters; import java.time.temporal.TemporalField; import java.util.HashMap; import java.util.List; @@ -360,14 +360,14 @@ public class TCKMinguoChronology { @Test public void test_adjust1() { MinguoDate base = MinguoChronology.INSTANCE.date(2012, 10, 29); - MinguoDate test = base.with(TemporalAdjuster.lastDayOfMonth()); + MinguoDate test = base.with(TemporalAdjusters.lastDayOfMonth()); assertEquals(test, MinguoChronology.INSTANCE.date(2012, 10, 31)); } @Test public void test_adjust2() { MinguoDate base = MinguoChronology.INSTANCE.date(1728, 12, 2); - MinguoDate test = base.with(TemporalAdjuster.lastDayOfMonth()); + MinguoDate test = base.with(TemporalAdjusters.lastDayOfMonth()); assertEquals(test, MinguoChronology.INSTANCE.date(1728, 12, 31)); } diff --git a/jdk/test/java/time/tck/java/time/chrono/TCKThaiBuddhistChronology.java b/jdk/test/java/time/tck/java/time/chrono/TCKThaiBuddhistChronology.java index 5557641738a..955fdeaefdc 100644 --- a/jdk/test/java/time/tck/java/time/chrono/TCKThaiBuddhistChronology.java +++ b/jdk/test/java/time/tck/java/time/chrono/TCKThaiBuddhistChronology.java @@ -88,7 +88,7 @@ import java.time.chrono.ThaiBuddhistEra; import java.time.format.ResolverStyle; import java.time.temporal.ChronoField; import java.time.temporal.ChronoUnit; -import java.time.temporal.TemporalAdjuster; +import java.time.temporal.TemporalAdjusters; import java.time.temporal.TemporalField; import java.time.temporal.ValueRange; import java.util.HashMap; @@ -366,14 +366,14 @@ public class TCKThaiBuddhistChronology { @Test public void test_adjust1() { ThaiBuddhistDate base = ThaiBuddhistChronology.INSTANCE.date(1728, 10, 29); - ThaiBuddhistDate test = base.with(TemporalAdjuster.lastDayOfMonth()); + ThaiBuddhistDate test = base.with(TemporalAdjusters.lastDayOfMonth()); assertEquals(test, ThaiBuddhistChronology.INSTANCE.date(1728, 10, 31)); } @Test public void test_adjust2() { ThaiBuddhistDate base = ThaiBuddhistChronology.INSTANCE.date(1728, 12, 2); - ThaiBuddhistDate test = base.with(TemporalAdjuster.lastDayOfMonth()); + ThaiBuddhistDate test = base.with(TemporalAdjusters.lastDayOfMonth()); assertEquals(test, ThaiBuddhistChronology.INSTANCE.date(1728, 12, 31)); } diff --git a/jdk/test/java/time/tck/java/time/format/TCKChronoPrinterParser.java b/jdk/test/java/time/tck/java/time/format/TCKChronoPrinterParser.java index de3b91c7f75..882bf9ccd44 100644 --- a/jdk/test/java/time/tck/java/time/format/TCKChronoPrinterParser.java +++ b/jdk/test/java/time/tck/java/time/format/TCKChronoPrinterParser.java @@ -68,6 +68,7 @@ import java.time.chrono.JapaneseChronology; import java.time.chrono.ThaiBuddhistChronology; import java.time.format.DateTimeFormatterBuilder; import java.time.temporal.TemporalAccessor; +import java.time.temporal.TemporalQueries; import java.time.temporal.TemporalQuery; import java.util.Locale; @@ -122,7 +123,7 @@ public class TCKChronoPrinterParser { TemporalAccessor parsed = builder.toFormatter().parseUnresolved(text, pos); assertEquals(pos.getIndex(), expected.getId().length()); assertEquals(pos.getErrorIndex(), -1); - assertEquals(parsed.query(TemporalQuery.chronology()), expected); + assertEquals(parsed.query(TemporalQueries.chronology()), expected); } @Test(dataProvider="parseValid") @@ -140,7 +141,7 @@ public class TCKChronoPrinterParser { TemporalAccessor parsed = builder.toFormatter().parseUnresolved(text.toLowerCase(Locale.ENGLISH), pos); assertEquals(pos.getIndex(), expected.getId().length()); assertEquals(pos.getErrorIndex(), -1); - assertEquals(parsed.query(TemporalQuery.chronology()), expected); + assertEquals(parsed.query(TemporalQueries.chronology()), expected); } //----------------------------------------------------------------------- diff --git a/jdk/test/java/time/tck/java/time/format/TCKDateTimeFormatters.java b/jdk/test/java/time/tck/java/time/format/TCKDateTimeFormatters.java index d431fa4acb3..e370521b7f0 100644 --- a/jdk/test/java/time/tck/java/time/format/TCKDateTimeFormatters.java +++ b/jdk/test/java/time/tck/java/time/format/TCKDateTimeFormatters.java @@ -94,6 +94,7 @@ import java.time.format.TextStyle; import java.time.temporal.IsoFields; import java.time.temporal.TemporalAccessor; import java.time.temporal.TemporalField; +import java.time.temporal.TemporalQueries; import java.time.temporal.TemporalQuery; import java.util.HashMap; import java.util.Iterator; @@ -1405,8 +1406,8 @@ public class TCKDateTimeFormatters { assertEquals(parsed.isSupported(field), true); parsed.getLong(field); } - assertEquals(parsed.query(TemporalQuery.chronology()), expected.chrono); - assertEquals(parsed.query(TemporalQuery.zoneId()), expected.zone); + assertEquals(parsed.query(TemporalQueries.chronology()), expected.chrono); + assertEquals(parsed.query(TemporalQueries.zoneId()), expected.zone); } //------------------------------------------------------------------------- @@ -1471,7 +1472,7 @@ public class TCKDateTimeFormatters { @SuppressWarnings("unchecked") @Override public R query(TemporalQuery query) { - if (query == TemporalQuery.zoneId()) { + if (query == TemporalQueries.zoneId()) { return (R) zoneId; } return TemporalAccessor.super.query(query); diff --git a/jdk/test/java/time/tck/java/time/format/TCKDateTimeParseResolver.java b/jdk/test/java/time/tck/java/time/format/TCKDateTimeParseResolver.java index b99d9bb4730..2efd8cd4641 100644 --- a/jdk/test/java/time/tck/java/time/format/TCKDateTimeParseResolver.java +++ b/jdk/test/java/time/tck/java/time/format/TCKDateTimeParseResolver.java @@ -113,7 +113,7 @@ import java.time.temporal.IsoFields; import java.time.temporal.Temporal; import java.time.temporal.TemporalAccessor; import java.time.temporal.TemporalField; -import java.time.temporal.TemporalQuery; +import java.time.temporal.TemporalQueries; import java.time.temporal.TemporalUnit; import java.time.temporal.ValueRange; import java.util.Map; @@ -147,8 +147,8 @@ public class TCKDateTimeParseResolver { DateTimeFormatter f = new DateTimeFormatterBuilder().appendValue(field1).toFormatter(); TemporalAccessor accessor = f.parse(str); - assertEquals(accessor.query(TemporalQuery.localDate()), null); - assertEquals(accessor.query(TemporalQuery.localTime()), null); + assertEquals(accessor.query(TemporalQueries.localDate()), null); + assertEquals(accessor.query(TemporalQueries.localTime()), null); assertEquals(accessor.isSupported(field1), true); assertEquals(accessor.getLong(field1), value1); } @@ -186,8 +186,8 @@ public class TCKDateTimeParseResolver { .appendValue(field2).toFormatter(); TemporalAccessor accessor = f.parse(str); - assertEquals(accessor.query(TemporalQuery.localDate()), null); - assertEquals(accessor.query(TemporalQuery.localTime()), null); + assertEquals(accessor.query(TemporalQueries.localDate()), null); + assertEquals(accessor.query(TemporalQueries.localTime()), null); assertEquals(accessor.isSupported(field1), true); assertEquals(accessor.isSupported(field2), true); assertEquals(accessor.getLong(field1), value1); @@ -218,8 +218,8 @@ public class TCKDateTimeParseResolver { .appendValue(field3).toFormatter(); TemporalAccessor accessor = f.parse(str); - assertEquals(accessor.query(TemporalQuery.localDate()), null); - assertEquals(accessor.query(TemporalQuery.localTime()), null); + assertEquals(accessor.query(TemporalQueries.localDate()), null); + assertEquals(accessor.query(TemporalQueries.localTime()), null); assertEquals(accessor.isSupported(field1), true); assertEquals(accessor.isSupported(field2), true); assertEquals(accessor.isSupported(field3), true); @@ -252,8 +252,8 @@ public class TCKDateTimeParseResolver { DateTimeFormatter f = new DateTimeFormatterBuilder().appendValue(field1).toFormatter(); TemporalAccessor accessor = f.parse(str); - assertEquals(accessor.query(TemporalQuery.localDate()), null); - assertEquals(accessor.query(TemporalQuery.localTime()), null); + assertEquals(accessor.query(TemporalQueries.localDate()), null); + assertEquals(accessor.query(TemporalQueries.localTime()), null); if (expectedField1 != null) { assertEquals(accessor.isSupported(expectedField1), true); assertEquals(accessor.getLong(expectedField1), expectedValue1.longValue()); @@ -278,8 +278,8 @@ public class TCKDateTimeParseResolver { DateTimeFormatter f = new DateTimeFormatterBuilder().appendValue(field1).toFormatter(); TemporalAccessor accessor = f.parse(str); - assertEquals(accessor.query(TemporalQuery.localDate()), expectedDate); - assertEquals(accessor.query(TemporalQuery.localTime()), null); + assertEquals(accessor.query(TemporalQueries.localDate()), expectedDate); + assertEquals(accessor.query(TemporalQueries.localTime()), null); } //----------------------------------------------------------------------- @@ -303,8 +303,8 @@ public class TCKDateTimeParseResolver { DateTimeFormatter f = new DateTimeFormatterBuilder().appendValue(field1).toFormatter(); TemporalAccessor accessor = f.parse(str); - assertEquals(accessor.query(TemporalQuery.localDate()), null); - assertEquals(accessor.query(TemporalQuery.localTime()), expectedTime); + assertEquals(accessor.query(TemporalQueries.localDate()), null); + assertEquals(accessor.query(TemporalQueries.localTime()), expectedTime); } //----------------------------------------------------------------------- @@ -334,8 +334,8 @@ public class TCKDateTimeParseResolver { .appendValue(field2).toFormatter(); TemporalAccessor accessor = f.parse(str); - assertEquals(accessor.query(TemporalQuery.localDate()), null); - assertEquals(accessor.query(TemporalQuery.localTime()), null); + assertEquals(accessor.query(TemporalQueries.localDate()), null); + assertEquals(accessor.query(TemporalQueries.localTime()), null); if (expectedField1 != null) { assertEquals(accessor.isSupported(expectedField1), true); assertEquals(accessor.getLong(expectedField1), expectedValue1.longValue()); @@ -382,8 +382,8 @@ public class TCKDateTimeParseResolver { .appendValue(field2).toFormatter(); TemporalAccessor accessor = f.parse(str); - assertEquals(accessor.query(TemporalQuery.localDate()), expectedDate); - assertEquals(accessor.query(TemporalQuery.localTime()), null); + assertEquals(accessor.query(TemporalQueries.localDate()), expectedDate); + assertEquals(accessor.query(TemporalQueries.localTime()), null); } //----------------------------------------------------------------------- @@ -469,8 +469,8 @@ public class TCKDateTimeParseResolver { .appendValue(field2).toFormatter(); TemporalAccessor accessor = f.parse(str); - assertEquals(accessor.query(TemporalQuery.localDate()), null); - assertEquals(accessor.query(TemporalQuery.localTime()), expectedTime); + assertEquals(accessor.query(TemporalQueries.localDate()), null); + assertEquals(accessor.query(TemporalQueries.localTime()), expectedTime); } //----------------------------------------------------------------------- @@ -502,8 +502,8 @@ public class TCKDateTimeParseResolver { .appendValue(field3).toFormatter(); TemporalAccessor accessor = f.parse(str); - assertEquals(accessor.query(TemporalQuery.localDate()), expectedDate); - assertEquals(accessor.query(TemporalQuery.localTime()), null); + assertEquals(accessor.query(TemporalQueries.localDate()), expectedDate); + assertEquals(accessor.query(TemporalQueries.localTime()), null); } //----------------------------------------------------------------------- @@ -535,8 +535,8 @@ public class TCKDateTimeParseResolver { .appendValue(field4).toFormatter(); TemporalAccessor accessor = f.parse(str); - assertEquals(accessor.query(TemporalQuery.localDate()), expectedDate); - assertEquals(accessor.query(TemporalQuery.localTime()), null); + assertEquals(accessor.query(TemporalQueries.localDate()), expectedDate); + assertEquals(accessor.query(TemporalQueries.localTime()), null); } //----------------------------------------------------------------------- @@ -603,8 +603,8 @@ public class TCKDateTimeParseResolver { for (ResolverStyle s : styles) { if (expectedTime != null) { TemporalAccessor accessor = f.withResolverStyle(s).parse(""); - assertEquals(accessor.query(TemporalQuery.localDate()), null, "ResolverStyle: " + s); - assertEquals(accessor.query(TemporalQuery.localTime()), expectedTime, "ResolverStyle: " + s); + assertEquals(accessor.query(TemporalQueries.localDate()), null, "ResolverStyle: " + s); + assertEquals(accessor.query(TemporalQueries.localTime()), expectedTime, "ResolverStyle: " + s); assertEquals(accessor.query(DateTimeFormatter.parsedExcessDays()), excessPeriod, "ResolverStyle: " + s); } else { try { @@ -629,8 +629,8 @@ public class TCKDateTimeParseResolver { for (ResolverStyle s : styles) { if (expectedTime != null) { TemporalAccessor accessor = f.withResolverStyle(s).parse(""); - assertEquals(accessor.query(TemporalQuery.localDate()), null, "ResolverStyle: " + s); - assertEquals(accessor.query(TemporalQuery.localTime()), expectedTime.minusNanos(nano), "ResolverStyle: " + s); + assertEquals(accessor.query(TemporalQueries.localDate()), null, "ResolverStyle: " + s); + assertEquals(accessor.query(TemporalQueries.localTime()), expectedTime.minusNanos(nano), "ResolverStyle: " + s); assertEquals(accessor.query(DateTimeFormatter.parsedExcessDays()), excessPeriod, "ResolverStyle: " + s); } else { try { @@ -658,8 +658,8 @@ public class TCKDateTimeParseResolver { LocalDate expectedDate = LocalDate.of(2012, 6, 30).plus(excessPeriod); for (ResolverStyle s : styles) { TemporalAccessor accessor = f.withResolverStyle(s).parse(""); - assertEquals(accessor.query(TemporalQuery.localDate()), expectedDate, "ResolverStyle: " + s); - assertEquals(accessor.query(TemporalQuery.localTime()), expectedTime, "ResolverStyle: " + s); + assertEquals(accessor.query(TemporalQueries.localDate()), expectedDate, "ResolverStyle: " + s); + assertEquals(accessor.query(TemporalQueries.localTime()), expectedTime, "ResolverStyle: " + s); assertEquals(accessor.query(DateTimeFormatter.parsedExcessDays()), Period.ZERO, "ResolverStyle: " + s); } } @@ -696,8 +696,8 @@ public class TCKDateTimeParseResolver { if (expectedSecond != null) { TemporalAccessor accessor = f.withResolverStyle(style).parse(str); - assertEquals(accessor.query(TemporalQuery.localDate()), null); - assertEquals(accessor.query(TemporalQuery.localTime()), LocalTime.ofSecondOfDay(expectedSecond)); + assertEquals(accessor.query(TemporalQueries.localDate()), null); + assertEquals(accessor.query(TemporalQueries.localTime()), LocalTime.ofSecondOfDay(expectedSecond)); assertEquals(accessor.query(DateTimeFormatter.parsedExcessDays()), Period.ofDays(expectedDays)); } else { try { @@ -740,8 +740,8 @@ public class TCKDateTimeParseResolver { if (expectedMinute != null) { TemporalAccessor accessor = f.withResolverStyle(style).parse(str); - assertEquals(accessor.query(TemporalQuery.localDate()), null); - assertEquals(accessor.query(TemporalQuery.localTime()), LocalTime.ofSecondOfDay(expectedMinute * 60)); + assertEquals(accessor.query(TemporalQueries.localDate()), null); + assertEquals(accessor.query(TemporalQueries.localTime()), LocalTime.ofSecondOfDay(expectedMinute * 60)); assertEquals(accessor.query(DateTimeFormatter.parsedExcessDays()), Period.ofDays(expectedDays)); } else { try { @@ -784,8 +784,8 @@ public class TCKDateTimeParseResolver { if (expectedHour != null) { TemporalAccessor accessor = f.withResolverStyle(style).parse(str); - assertEquals(accessor.query(TemporalQuery.localDate()), null); - assertEquals(accessor.query(TemporalQuery.localTime()), LocalTime.of(expectedHour, 0)); + assertEquals(accessor.query(TemporalQueries.localDate()), null); + assertEquals(accessor.query(TemporalQueries.localTime()), LocalTime.of(expectedHour, 0)); assertEquals(accessor.query(DateTimeFormatter.parsedExcessDays()), Period.ofDays(expectedDays)); } else { try { @@ -828,8 +828,8 @@ public class TCKDateTimeParseResolver { if (expectedValue != null) { TemporalAccessor accessor = f.withResolverStyle(style).parse(str); - assertEquals(accessor.query(TemporalQuery.localDate()), null); - assertEquals(accessor.query(TemporalQuery.localTime()), null); + assertEquals(accessor.query(TemporalQueries.localDate()), null); + assertEquals(accessor.query(TemporalQueries.localTime()), null); assertEquals(accessor.isSupported(CLOCK_HOUR_OF_AMPM), false); assertEquals(accessor.isSupported(HOUR_OF_AMPM), true); assertEquals(accessor.getLong(HOUR_OF_AMPM), expectedValue.longValue()); @@ -871,8 +871,8 @@ public class TCKDateTimeParseResolver { if (expectedValue != null) { TemporalAccessor accessor = f.withResolverStyle(style).parse(str); - assertEquals(accessor.query(TemporalQuery.localDate()), null); - assertEquals(accessor.query(TemporalQuery.localTime()), null); + assertEquals(accessor.query(TemporalQueries.localDate()), null); + assertEquals(accessor.query(TemporalQueries.localTime()), null); assertEquals(accessor.isSupported(AMPM_OF_DAY), true); assertEquals(accessor.getLong(AMPM_OF_DAY), expectedValue.longValue()); } else { @@ -933,8 +933,8 @@ public class TCKDateTimeParseResolver { }; DateTimeFormatter f = new DateTimeFormatterBuilder().appendValue(field).toFormatter(); TemporalAccessor accessor = f.parse("1234567890"); - assertEquals(accessor.query(TemporalQuery.localDate()), null); - assertEquals(accessor.query(TemporalQuery.localTime()), LocalTime.of(0, 0, 1, 234_567_890)); + assertEquals(accessor.query(TemporalQueries.localDate()), null); + assertEquals(accessor.query(TemporalQueries.localTime()), LocalTime.of(0, 0, 1, 234_567_890)); } @Test @@ -985,8 +985,8 @@ public class TCKDateTimeParseResolver { }; DateTimeFormatter f = new DateTimeFormatterBuilder().appendValue(field).toFormatter(); TemporalAccessor accessor = f.parse("1234567890"); - assertEquals(accessor.query(TemporalQuery.localDate()), LocalDate.of(2010, 6, 30)); - assertEquals(accessor.query(TemporalQuery.localTime()), LocalTime.of(12, 30)); + assertEquals(accessor.query(TemporalQueries.localDate()), LocalDate.of(2010, 6, 30)); + assertEquals(accessor.query(TemporalQueries.localTime()), LocalTime.of(12, 30)); } @Test(expectedExceptions = DateTimeParseException.class) diff --git a/jdk/test/java/time/tck/java/time/format/TCKLocalizedPrinterParser.java b/jdk/test/java/time/tck/java/time/format/TCKLocalizedPrinterParser.java index 075d862e72c..27c05759968 100644 --- a/jdk/test/java/time/tck/java/time/format/TCKLocalizedPrinterParser.java +++ b/jdk/test/java/time/tck/java/time/format/TCKLocalizedPrinterParser.java @@ -123,7 +123,7 @@ public class TCKLocalizedPrinterParser { }; } - @SuppressWarnings("deprecated") + @SuppressWarnings("deprecation") @Test(dataProvider="date") public void test_date_print(LocalDate date, FormatStyle dateStyle, int dateStyleOld, Locale locale) { DateFormat old = DateFormat.getDateInstance(dateStyleOld, locale); @@ -135,7 +135,7 @@ public class TCKLocalizedPrinterParser { assertEquals(formatted, text); } - @SuppressWarnings("deprecated") + @SuppressWarnings("deprecation") @Test(dataProvider="date") public void test_date_parse(LocalDate date, FormatStyle dateStyle, int dateStyleOld, Locale locale) { DateFormat old = DateFormat.getDateInstance(dateStyleOld, locale); @@ -176,7 +176,7 @@ public class TCKLocalizedPrinterParser { }; } - @SuppressWarnings("deprecated") + @SuppressWarnings("deprecation") @Test(dataProvider="time") public void test_time_print(LocalTime time, FormatStyle timeStyle, int timeStyleOld, Locale locale) { DateFormat old = DateFormat.getTimeInstance(timeStyleOld, locale); @@ -188,7 +188,7 @@ public class TCKLocalizedPrinterParser { assertEquals(formatted, text); } - @SuppressWarnings("deprecated") + @SuppressWarnings("deprecation") @Test(dataProvider="time") public void test_time_parse(LocalTime time, FormatStyle timeStyle, int timeStyleOld, Locale locale) { DateFormat old = DateFormat.getTimeInstance(timeStyleOld, locale); diff --git a/jdk/test/java/time/tck/java/time/format/TCKZoneIdPrinterParser.java b/jdk/test/java/time/tck/java/time/format/TCKZoneIdPrinterParser.java index 414d390c610..122da8608c2 100644 --- a/jdk/test/java/time/tck/java/time/format/TCKZoneIdPrinterParser.java +++ b/jdk/test/java/time/tck/java/time/format/TCKZoneIdPrinterParser.java @@ -71,7 +71,7 @@ import java.time.ZonedDateTime; import java.time.format.DateTimeFormatter; import java.time.format.DateTimeFormatterBuilder; import java.time.temporal.TemporalAccessor; -import java.time.temporal.TemporalQuery; +import java.time.temporal.TemporalQueries; import java.util.Locale; import java.util.Objects; @@ -214,9 +214,9 @@ public class TCKZoneIdPrinterParser { assertEquals(pos.getErrorIndex(), expectedErrorIndex, "Incorrect error index parsing: " + text); assertEquals(pos.getIndex(), expectedIndex, "Incorrect index parsing: " + text); if (expected != null) { - assertEquals(parsed.query(TemporalQuery.zoneId()), expected, "Incorrect zoneId parsing: " + text); - assertEquals(parsed.query(TemporalQuery.offset()), null, "Incorrect offset parsing: " + text); - assertEquals(parsed.query(TemporalQuery.zone()), expected, "Incorrect zone parsing: " + text); + assertEquals(parsed.query(TemporalQueries.zoneId()), expected, "Incorrect zoneId parsing: " + text); + assertEquals(parsed.query(TemporalQueries.offset()), null, "Incorrect offset parsing: " + text); + assertEquals(parsed.query(TemporalQueries.zone()), expected, "Incorrect zone parsing: " + text); } else { assertEquals(parsed, null); } @@ -231,9 +231,9 @@ public class TCKZoneIdPrinterParser { assertEquals(pos.getErrorIndex(), expectedErrorIndex >= 0 ? expectedErrorIndex + 3 : expectedErrorIndex, "Incorrect error index parsing: " + prefixText); assertEquals(pos.getIndex(), expectedIndex + 3, "Incorrect index parsing: " + prefixText); if (expected != null) { - assertEquals(parsed.query(TemporalQuery.zoneId()), expected, "Incorrect zoneId parsing: " + prefixText); - assertEquals(parsed.query(TemporalQuery.offset()), null, "Incorrect offset parsing: " + prefixText); - assertEquals(parsed.query(TemporalQuery.zone()), expected, "Incorrect zone parsing: " + prefixText); + assertEquals(parsed.query(TemporalQueries.zoneId()), expected, "Incorrect zoneId parsing: " + prefixText); + assertEquals(parsed.query(TemporalQueries.offset()), null, "Incorrect offset parsing: " + prefixText); + assertEquals(parsed.query(TemporalQueries.zone()), expected, "Incorrect zone parsing: " + prefixText); } else { assertEquals(parsed, null); } @@ -247,9 +247,9 @@ public class TCKZoneIdPrinterParser { assertEquals(pos.getErrorIndex(), expectedErrorIndex, "Incorrect error index parsing: " + suffixText); assertEquals(pos.getIndex(), expectedIndex, "Incorrect index parsing: " + suffixText); if (expected != null) { - assertEquals(parsed.query(TemporalQuery.zoneId()), expected, "Incorrect zoneId parsing: " + suffixText); - assertEquals(parsed.query(TemporalQuery.offset()), null, "Incorrect offset parsing: " + suffixText); - assertEquals(parsed.query(TemporalQuery.zone()), expected, "Incorrect zone parsing: " + suffixText); + assertEquals(parsed.query(TemporalQueries.zoneId()), expected, "Incorrect zoneId parsing: " + suffixText); + assertEquals(parsed.query(TemporalQueries.offset()), null, "Incorrect offset parsing: " + suffixText); + assertEquals(parsed.query(TemporalQueries.zone()), expected, "Incorrect zone parsing: " + suffixText); } else { assertEquals(parsed, null); } @@ -269,9 +269,9 @@ public class TCKZoneIdPrinterParser { assertEquals(pos.getIndex(), expectedIndex, "Incorrect index parsing: " + lcText); assertEquals(pos.getErrorIndex(), expectedErrorIndex, "Incorrect error index parsing: " + lcText); if (expected != null) { - assertEquals(parsed.query(TemporalQuery.zoneId()), expected); - assertEquals(parsed.query(TemporalQuery.offset()), null); - assertEquals(parsed.query(TemporalQuery.zone()), expected); + assertEquals(parsed.query(TemporalQueries.zoneId()), expected); + assertEquals(parsed.query(TemporalQueries.offset()), null); + assertEquals(parsed.query(TemporalQueries.zone()), expected); } else { assertEquals(parsed, null); } @@ -286,10 +286,10 @@ public class TCKZoneIdPrinterParser { assertEquals(pos.getErrorIndex(), expectedErrorIndex, "Incorrect error index parsing: " + lcText); assertEquals(pos.getIndex(), expectedIndex, "Incorrect index parsing: " + lcText); if (expected != null) { - ZoneId zid = parsed.query(TemporalQuery.zoneId()); - assertEquals(parsed.query(TemporalQuery.zoneId()), expected, "Incorrect zoneId parsing: " + lcText); - assertEquals(parsed.query(TemporalQuery.offset()), null, "Incorrect offset parsing: " + lcText); - assertEquals(parsed.query(TemporalQuery.zone()), expected, "Incorrect zone parsing: " + lcText); + ZoneId zid = parsed.query(TemporalQueries.zoneId()); + assertEquals(parsed.query(TemporalQueries.zoneId()), expected, "Incorrect zoneId parsing: " + lcText); + assertEquals(parsed.query(TemporalQueries.offset()), null, "Incorrect offset parsing: " + lcText); + assertEquals(parsed.query(TemporalQueries.zone()), expected, "Incorrect zone parsing: " + lcText); } else { assertEquals(parsed, null); } diff --git a/jdk/test/java/time/tck/java/time/temporal/TCKTemporalAdjusters.java b/jdk/test/java/time/tck/java/time/temporal/TCKTemporalAdjusters.java index 66f129c0906..b901125fc30 100644 --- a/jdk/test/java/time/tck/java/time/temporal/TCKTemporalAdjusters.java +++ b/jdk/test/java/time/tck/java/time/temporal/TCKTemporalAdjusters.java @@ -73,12 +73,13 @@ import java.time.DayOfWeek; import java.time.LocalDate; import java.time.Month; import java.time.temporal.TemporalAdjuster; +import java.time.temporal.TemporalAdjusters; import org.testng.annotations.DataProvider; import org.testng.annotations.Test; /** - * Test TemporalAdjuster. + * Test TemporalAdjusters. */ @Test public class TCKTemporalAdjusters { @@ -88,13 +89,13 @@ public class TCKTemporalAdjusters { //----------------------------------------------------------------------- @Test public void factory_ofDateAdjuster() { - TemporalAdjuster test = TemporalAdjuster.ofDateAdjuster(date -> date.plusDays(2)); + TemporalAdjuster test = TemporalAdjusters.ofDateAdjuster(date -> date.plusDays(2)); assertEquals(LocalDate.of(2012, 6, 30).with(test), LocalDate.of(2012, 7, 2)); } @Test(expectedExceptions = NullPointerException.class) public void factory_ofDateAdjuster_null() { - TemporalAdjuster.ofDateAdjuster(null); + TemporalAdjusters.ofDateAdjuster(null); } @@ -103,7 +104,7 @@ public class TCKTemporalAdjusters { //----------------------------------------------------------------------- @Test public void factory_firstDayOfMonth() { - assertNotNull(TemporalAdjuster.firstDayOfMonth()); + assertNotNull(TemporalAdjusters.firstDayOfMonth()); } @Test @@ -111,7 +112,7 @@ public class TCKTemporalAdjusters { for (Month month : Month.values()) { for (int i = 1; i <= month.length(false); i++) { LocalDate date = date(2007, month, i); - LocalDate test = (LocalDate) TemporalAdjuster.firstDayOfMonth().adjustInto(date); + LocalDate test = (LocalDate) TemporalAdjusters.firstDayOfMonth().adjustInto(date); assertEquals(test.getYear(), 2007); assertEquals(test.getMonth(), month); assertEquals(test.getDayOfMonth(), 1); @@ -124,7 +125,7 @@ public class TCKTemporalAdjusters { for (Month month : Month.values()) { for (int i = 1; i <= month.length(true); i++) { LocalDate date = date(2008, month, i); - LocalDate test = (LocalDate) TemporalAdjuster.firstDayOfMonth().adjustInto(date); + LocalDate test = (LocalDate) TemporalAdjusters.firstDayOfMonth().adjustInto(date); assertEquals(test.getYear(), 2008); assertEquals(test.getMonth(), month); assertEquals(test.getDayOfMonth(), 1); @@ -137,7 +138,7 @@ public class TCKTemporalAdjusters { //----------------------------------------------------------------------- @Test public void factory_lastDayOfMonth() { - assertNotNull(TemporalAdjuster.lastDayOfMonth()); + assertNotNull(TemporalAdjusters.lastDayOfMonth()); } @Test @@ -145,7 +146,7 @@ public class TCKTemporalAdjusters { for (Month month : Month.values()) { for (int i = 1; i <= month.length(false); i++) { LocalDate date = date(2007, month, i); - LocalDate test = (LocalDate) TemporalAdjuster.lastDayOfMonth().adjustInto(date); + LocalDate test = (LocalDate) TemporalAdjusters.lastDayOfMonth().adjustInto(date); assertEquals(test.getYear(), 2007); assertEquals(test.getMonth(), month); assertEquals(test.getDayOfMonth(), month.length(false)); @@ -158,7 +159,7 @@ public class TCKTemporalAdjusters { for (Month month : Month.values()) { for (int i = 1; i <= month.length(true); i++) { LocalDate date = date(2008, month, i); - LocalDate test = (LocalDate) TemporalAdjuster.lastDayOfMonth().adjustInto(date); + LocalDate test = (LocalDate) TemporalAdjusters.lastDayOfMonth().adjustInto(date); assertEquals(test.getYear(), 2008); assertEquals(test.getMonth(), month); assertEquals(test.getDayOfMonth(), month.length(true)); @@ -171,7 +172,7 @@ public class TCKTemporalAdjusters { //----------------------------------------------------------------------- @Test public void factory_firstDayOfNextMonth() { - assertNotNull(TemporalAdjuster.firstDayOfNextMonth()); + assertNotNull(TemporalAdjusters.firstDayOfNextMonth()); } @Test @@ -179,7 +180,7 @@ public class TCKTemporalAdjusters { for (Month month : Month.values()) { for (int i = 1; i <= month.length(false); i++) { LocalDate date = date(2007, month, i); - LocalDate test = (LocalDate) TemporalAdjuster.firstDayOfNextMonth().adjustInto(date); + LocalDate test = (LocalDate) TemporalAdjusters.firstDayOfNextMonth().adjustInto(date); assertEquals(test.getYear(), month == DECEMBER ? 2008 : 2007); assertEquals(test.getMonth(), month.plus(1)); assertEquals(test.getDayOfMonth(), 1); @@ -192,7 +193,7 @@ public class TCKTemporalAdjusters { for (Month month : Month.values()) { for (int i = 1; i <= month.length(true); i++) { LocalDate date = date(2008, month, i); - LocalDate test = (LocalDate) TemporalAdjuster.firstDayOfNextMonth().adjustInto(date); + LocalDate test = (LocalDate) TemporalAdjusters.firstDayOfNextMonth().adjustInto(date); assertEquals(test.getYear(), month == DECEMBER ? 2009 : 2008); assertEquals(test.getMonth(), month.plus(1)); assertEquals(test.getDayOfMonth(), 1); @@ -205,7 +206,7 @@ public class TCKTemporalAdjusters { //----------------------------------------------------------------------- @Test public void factory_firstDayOfYear() { - assertNotNull(TemporalAdjuster.firstDayOfYear()); + assertNotNull(TemporalAdjusters.firstDayOfYear()); } @Test @@ -213,7 +214,7 @@ public class TCKTemporalAdjusters { for (Month month : Month.values()) { for (int i = 1; i <= month.length(false); i++) { LocalDate date = date(2007, month, i); - LocalDate test = (LocalDate) TemporalAdjuster.firstDayOfYear().adjustInto(date); + LocalDate test = (LocalDate) TemporalAdjusters.firstDayOfYear().adjustInto(date); assertEquals(test.getYear(), 2007); assertEquals(test.getMonth(), Month.JANUARY); assertEquals(test.getDayOfMonth(), 1); @@ -226,7 +227,7 @@ public class TCKTemporalAdjusters { for (Month month : Month.values()) { for (int i = 1; i <= month.length(true); i++) { LocalDate date = date(2008, month, i); - LocalDate test = (LocalDate) TemporalAdjuster.firstDayOfYear().adjustInto(date); + LocalDate test = (LocalDate) TemporalAdjusters.firstDayOfYear().adjustInto(date); assertEquals(test.getYear(), 2008); assertEquals(test.getMonth(), Month.JANUARY); assertEquals(test.getDayOfMonth(), 1); @@ -239,7 +240,7 @@ public class TCKTemporalAdjusters { //----------------------------------------------------------------------- @Test public void factory_lastDayOfYear() { - assertNotNull(TemporalAdjuster.lastDayOfYear()); + assertNotNull(TemporalAdjusters.lastDayOfYear()); } @Test @@ -247,7 +248,7 @@ public class TCKTemporalAdjusters { for (Month month : Month.values()) { for (int i = 1; i <= month.length(false); i++) { LocalDate date = date(2007, month, i); - LocalDate test = (LocalDate) TemporalAdjuster.lastDayOfYear().adjustInto(date); + LocalDate test = (LocalDate) TemporalAdjusters.lastDayOfYear().adjustInto(date); assertEquals(test.getYear(), 2007); assertEquals(test.getMonth(), Month.DECEMBER); assertEquals(test.getDayOfMonth(), 31); @@ -260,7 +261,7 @@ public class TCKTemporalAdjusters { for (Month month : Month.values()) { for (int i = 1; i <= month.length(true); i++) { LocalDate date = date(2008, month, i); - LocalDate test = (LocalDate) TemporalAdjuster.lastDayOfYear().adjustInto(date); + LocalDate test = (LocalDate) TemporalAdjusters.lastDayOfYear().adjustInto(date); assertEquals(test.getYear(), 2008); assertEquals(test.getMonth(), Month.DECEMBER); assertEquals(test.getDayOfMonth(), 31); @@ -273,7 +274,7 @@ public class TCKTemporalAdjusters { //----------------------------------------------------------------------- @Test public void factory_firstDayOfNextYear() { - assertNotNull(TemporalAdjuster.firstDayOfNextYear()); + assertNotNull(TemporalAdjusters.firstDayOfNextYear()); } @Test @@ -281,7 +282,7 @@ public class TCKTemporalAdjusters { for (Month month : Month.values()) { for (int i = 1; i <= month.length(false); i++) { LocalDate date = date(2007, month, i); - LocalDate test = (LocalDate) TemporalAdjuster.firstDayOfNextYear().adjustInto(date); + LocalDate test = (LocalDate) TemporalAdjusters.firstDayOfNextYear().adjustInto(date); assertEquals(test.getYear(), 2008); assertEquals(test.getMonth(), JANUARY); assertEquals(test.getDayOfMonth(), 1); @@ -294,7 +295,7 @@ public class TCKTemporalAdjusters { for (Month month : Month.values()) { for (int i = 1; i <= month.length(true); i++) { LocalDate date = date(2008, month, i); - LocalDate test = (LocalDate) TemporalAdjuster.firstDayOfNextYear().adjustInto(date); + LocalDate test = (LocalDate) TemporalAdjusters.firstDayOfNextYear().adjustInto(date); assertEquals(test.getYear(), 2009); assertEquals(test.getMonth(), JANUARY); assertEquals(test.getDayOfMonth(), 1); @@ -307,12 +308,12 @@ public class TCKTemporalAdjusters { //----------------------------------------------------------------------- @Test public void factory_dayOfWeekInMonth() { - assertNotNull(TemporalAdjuster.dayOfWeekInMonth(1, MONDAY)); + assertNotNull(TemporalAdjusters.dayOfWeekInMonth(1, MONDAY)); } @Test(expectedExceptions=NullPointerException.class) public void factory_dayOfWeekInMonth_nullDayOfWeek() { - TemporalAdjuster.dayOfWeekInMonth(1, null); + TemporalAdjusters.dayOfWeekInMonth(1, null); } @DataProvider(name = "dayOfWeekInMonth_positive") @@ -338,7 +339,7 @@ public class TCKTemporalAdjusters { for (int ordinal = 1; ordinal <= 5; ordinal++) { for (int day = 1; day <= Month.of(month).length(false); day++) { LocalDate date = date(year, month, day); - LocalDate test = (LocalDate) TemporalAdjuster.dayOfWeekInMonth(ordinal, dow).adjustInto(date); + LocalDate test = (LocalDate) TemporalAdjusters.dayOfWeekInMonth(ordinal, dow).adjustInto(date); assertEquals(test, expected.plusWeeks(ordinal - 1)); } } @@ -366,7 +367,7 @@ public class TCKTemporalAdjusters { public void test_dayOfWeekInMonth_zero(int year, int month, DayOfWeek dow, LocalDate expected) { for (int day = 1; day <= Month.of(month).length(false); day++) { LocalDate date = date(year, month, day); - LocalDate test = (LocalDate) TemporalAdjuster.dayOfWeekInMonth(0, dow).adjustInto(date); + LocalDate test = (LocalDate) TemporalAdjusters.dayOfWeekInMonth(0, dow).adjustInto(date); assertEquals(test, expected); } } @@ -394,7 +395,7 @@ public class TCKTemporalAdjusters { for (int ordinal = 0; ordinal < 5; ordinal++) { for (int day = 1; day <= Month.of(month).length(false); day++) { LocalDate date = date(year, month, day); - LocalDate test = (LocalDate) TemporalAdjuster.dayOfWeekInMonth(-1 - ordinal, dow).adjustInto(date); + LocalDate test = (LocalDate) TemporalAdjusters.dayOfWeekInMonth(-1 - ordinal, dow).adjustInto(date); assertEquals(test, expected.minusWeeks(ordinal)); } } @@ -405,19 +406,19 @@ public class TCKTemporalAdjusters { //----------------------------------------------------------------------- @Test public void factory_firstInMonth() { - assertNotNull(TemporalAdjuster.firstInMonth(MONDAY)); + assertNotNull(TemporalAdjusters.firstInMonth(MONDAY)); } @Test(expectedExceptions=NullPointerException.class) public void factory_firstInMonth_nullDayOfWeek() { - TemporalAdjuster.firstInMonth(null); + TemporalAdjusters.firstInMonth(null); } @Test(dataProvider = "dayOfWeekInMonth_positive") public void test_firstInMonth(int year, int month, DayOfWeek dow, LocalDate expected) { for (int day = 1; day <= Month.of(month).length(false); day++) { LocalDate date = date(year, month, day); - LocalDate test = (LocalDate) TemporalAdjuster.firstInMonth(dow).adjustInto(date); + LocalDate test = (LocalDate) TemporalAdjusters.firstInMonth(dow).adjustInto(date); assertEquals(test, expected, "day-of-month=" + day); } } @@ -427,19 +428,19 @@ public class TCKTemporalAdjusters { //----------------------------------------------------------------------- @Test public void factory_lastInMonth() { - assertNotNull(TemporalAdjuster.lastInMonth(MONDAY)); + assertNotNull(TemporalAdjusters.lastInMonth(MONDAY)); } @Test(expectedExceptions=NullPointerException.class) public void factory_lastInMonth_nullDayOfWeek() { - TemporalAdjuster.lastInMonth(null); + TemporalAdjusters.lastInMonth(null); } @Test(dataProvider = "dayOfWeekInMonth_negative") public void test_lastInMonth(int year, int month, DayOfWeek dow, LocalDate expected) { for (int day = 1; day <= Month.of(month).length(false); day++) { LocalDate date = date(year, month, day); - LocalDate test = (LocalDate) TemporalAdjuster.lastInMonth(dow).adjustInto(date); + LocalDate test = (LocalDate) TemporalAdjusters.lastInMonth(dow).adjustInto(date); assertEquals(test, expected, "day-of-month=" + day); } } @@ -449,12 +450,12 @@ public class TCKTemporalAdjusters { //----------------------------------------------------------------------- @Test public void factory_next() { - assertNotNull(TemporalAdjuster.next(MONDAY)); + assertNotNull(TemporalAdjusters.next(MONDAY)); } @Test(expectedExceptions = NullPointerException.class) public void factory_next_nullDayOfWeek() { - TemporalAdjuster.next(null); + TemporalAdjusters.next(null); } @Test @@ -464,7 +465,7 @@ public class TCKTemporalAdjusters { LocalDate date = date(2007, month, i); for (DayOfWeek dow : DayOfWeek.values()) { - LocalDate test = (LocalDate) TemporalAdjuster.next(dow).adjustInto(date); + LocalDate test = (LocalDate) TemporalAdjusters.next(dow).adjustInto(date); assertSame(test.getDayOfWeek(), dow, date + " " + test); @@ -488,12 +489,12 @@ public class TCKTemporalAdjusters { //----------------------------------------------------------------------- @Test public void factory_nextOrCurrent() { - assertNotNull(TemporalAdjuster.nextOrSame(MONDAY)); + assertNotNull(TemporalAdjusters.nextOrSame(MONDAY)); } @Test(expectedExceptions = NullPointerException.class) public void factory_nextOrCurrent_nullDayOfWeek() { - TemporalAdjuster.nextOrSame(null); + TemporalAdjusters.nextOrSame(null); } @Test @@ -503,7 +504,7 @@ public class TCKTemporalAdjusters { LocalDate date = date(2007, month, i); for (DayOfWeek dow : DayOfWeek.values()) { - LocalDate test = (LocalDate) TemporalAdjuster.nextOrSame(dow).adjustInto(date); + LocalDate test = (LocalDate) TemporalAdjusters.nextOrSame(dow).adjustInto(date); assertSame(test.getDayOfWeek(), dow); @@ -529,12 +530,12 @@ public class TCKTemporalAdjusters { //----------------------------------------------------------------------- @Test public void factory_previous() { - assertNotNull(TemporalAdjuster.previous(MONDAY)); + assertNotNull(TemporalAdjusters.previous(MONDAY)); } @Test(expectedExceptions = NullPointerException.class) public void factory_previous_nullDayOfWeek() { - TemporalAdjuster.previous(null); + TemporalAdjusters.previous(null); } @Test @@ -544,7 +545,7 @@ public class TCKTemporalAdjusters { LocalDate date = date(2007, month, i); for (DayOfWeek dow : DayOfWeek.values()) { - LocalDate test = (LocalDate) TemporalAdjuster.previous(dow).adjustInto(date); + LocalDate test = (LocalDate) TemporalAdjusters.previous(dow).adjustInto(date); assertSame(test.getDayOfWeek(), dow, date + " " + test); @@ -568,12 +569,12 @@ public class TCKTemporalAdjusters { //----------------------------------------------------------------------- @Test public void factory_previousOrCurrent() { - assertNotNull(TemporalAdjuster.previousOrSame(MONDAY)); + assertNotNull(TemporalAdjusters.previousOrSame(MONDAY)); } @Test(expectedExceptions = NullPointerException.class) public void factory_previousOrCurrent_nullDayOfWeek() { - TemporalAdjuster.previousOrSame(null); + TemporalAdjusters.previousOrSame(null); } @Test @@ -583,7 +584,7 @@ public class TCKTemporalAdjusters { LocalDate date = date(2007, month, i); for (DayOfWeek dow : DayOfWeek.values()) { - LocalDate test = (LocalDate) TemporalAdjuster.previousOrSame(dow).adjustInto(date); + LocalDate test = (LocalDate) TemporalAdjusters.previousOrSame(dow).adjustInto(date); assertSame(test.getDayOfWeek(), dow); diff --git a/jdk/test/java/time/test/java/time/chrono/TestUmmAlQuraChronology.java b/jdk/test/java/time/test/java/time/chrono/TestUmmAlQuraChronology.java index 05a6d4b515d..9fbe6d1c017 100644 --- a/jdk/test/java/time/test/java/time/chrono/TestUmmAlQuraChronology.java +++ b/jdk/test/java/time/test/java/time/chrono/TestUmmAlQuraChronology.java @@ -60,7 +60,7 @@ import java.time.format.FormatStyle; import java.time.temporal.ChronoField; import java.time.temporal.ChronoUnit; import java.time.temporal.TemporalAccessor; -import java.time.temporal.TemporalAdjuster; +import java.time.temporal.TemporalAdjusters; import java.time.temporal.ValueRange; import java.time.temporal.WeekFields; import java.util.Locale; @@ -357,12 +357,12 @@ public class TestUmmAlQuraChronology { @Test public void test_temporalDayAdjustments() { HijrahDate date = HijrahDate.of(1554, 7, 21); - assertEquals(date.with(TemporalAdjuster.firstDayOfMonth()), HijrahDate.of(1554, 7, 1)); - assertEquals(date.with(TemporalAdjuster.lastDayOfMonth()), HijrahDate.of(1554, 7, 29)); - assertEquals(date.with(TemporalAdjuster.firstDayOfNextMonth()), HijrahDate.of(1554, 8, 1)); - assertEquals(date.with(TemporalAdjuster.firstDayOfNextYear()), HijrahDate.of(1555, 1, 1)); - assertEquals(date.with(TemporalAdjuster.firstDayOfYear()), HijrahDate.of(1554, 1, 1)); - assertEquals(date.with(TemporalAdjuster.lastDayOfYear()), HijrahDate.of(1554, 12, 30)); + assertEquals(date.with(TemporalAdjusters.firstDayOfMonth()), HijrahDate.of(1554, 7, 1)); + assertEquals(date.with(TemporalAdjusters.lastDayOfMonth()), HijrahDate.of(1554, 7, 29)); + assertEquals(date.with(TemporalAdjusters.firstDayOfNextMonth()), HijrahDate.of(1554, 8, 1)); + assertEquals(date.with(TemporalAdjusters.firstDayOfNextYear()), HijrahDate.of(1555, 1, 1)); + assertEquals(date.with(TemporalAdjusters.firstDayOfYear()), HijrahDate.of(1554, 1, 1)); + assertEquals(date.with(TemporalAdjusters.lastDayOfYear()), HijrahDate.of(1554, 12, 30)); } // Data provider for string representation of the date instances @@ -412,7 +412,7 @@ public class TestUmmAlQuraChronology { @Test(dataProvider="monthDays") public void test_lastDayOfMonth(int year, int month, int numDays) { HijrahDate hDate = HijrahChronology.INSTANCE.date(year, month, 1); - hDate = hDate.with(TemporalAdjuster.lastDayOfMonth()); + hDate = hDate.with(TemporalAdjusters.lastDayOfMonth()); assertEquals(hDate.get(ChronoField.DAY_OF_MONTH), numDays); } diff --git a/jdk/test/java/time/test/java/time/format/TestCharLiteralParser.java b/jdk/test/java/time/test/java/time/format/TestCharLiteralParser.java index 92cd6f885d9..696aab0f539 100644 --- a/jdk/test/java/time/test/java/time/format/TestCharLiteralParser.java +++ b/jdk/test/java/time/test/java/time/format/TestCharLiteralParser.java @@ -66,7 +66,7 @@ import static org.testng.Assert.fail; import java.text.ParsePosition; import java.time.temporal.TemporalAccessor; -import java.time.temporal.TemporalQuery; +import java.time.temporal.TemporalQueries; import org.testng.annotations.DataProvider; import org.testng.annotations.Test; @@ -111,8 +111,8 @@ public class TestCharLiteralParser extends AbstractTestPrinterParser { } else { assertEquals(ppos.getIndex(), expectedPos); assertEquals(parsed.isSupported(YEAR), false); - assertEquals(parsed.query(TemporalQuery.chronology()), null); - assertEquals(parsed.query(TemporalQuery.zoneId()), null); + assertEquals(parsed.query(TemporalQueries.chronology()), null); + assertEquals(parsed.query(TemporalQueries.zoneId()), null); } } diff --git a/jdk/test/java/time/test/java/time/format/TestNonIsoFormatter.java b/jdk/test/java/time/test/java/time/format/TestNonIsoFormatter.java index 7246a82af20..6747cdc93a5 100644 --- a/jdk/test/java/time/test/java/time/format/TestNonIsoFormatter.java +++ b/jdk/test/java/time/test/java/time/format/TestNonIsoFormatter.java @@ -39,7 +39,7 @@ import java.time.format.DateTimeParseException; import java.time.format.FormatStyle; import java.time.format.TextStyle; import java.time.temporal.TemporalAccessor; -import java.time.temporal.TemporalQuery; +import java.time.temporal.TemporalQueries; import java.util.Locale; import org.testng.annotations.BeforeMethod; @@ -163,7 +163,7 @@ public class TestNonIsoFormatter { String text = dtf.format(chrono.dateNow()); assertEquals(text, expected); TemporalAccessor ta = dtf.parse(text); - Chronology cal = ta.query(TemporalQuery.chronology()); + Chronology cal = ta.query(TemporalQueries.chronology()); assertEquals(cal, chrono); } } diff --git a/jdk/test/java/time/test/java/time/format/TestNumberParser.java b/jdk/test/java/time/test/java/time/format/TestNumberParser.java index 3e657582185..f3ac13b791d 100644 --- a/jdk/test/java/time/test/java/time/format/TestNumberParser.java +++ b/jdk/test/java/time/test/java/time/format/TestNumberParser.java @@ -72,7 +72,7 @@ import java.time.format.DateTimeFormatter; import java.time.format.SignStyle; import java.time.temporal.TemporalAccessor; import java.time.temporal.TemporalField; -import java.time.temporal.TemporalQuery; +import java.time.temporal.TemporalQueries; import org.testng.annotations.DataProvider; import org.testng.annotations.Test; @@ -178,8 +178,8 @@ public class TestNumberParser extends AbstractTestPrinterParser { assertTrue(subsequentWidth >= 0); assertEquals(ppos.getIndex(), expectedPos + subsequentWidth); assertEquals(parsed.getLong(DAY_OF_MONTH), expectedValue); - assertEquals(parsed.query(TemporalQuery.chronology()), null); - assertEquals(parsed.query(TemporalQuery.zoneId()), null); + assertEquals(parsed.query(TemporalQueries.chronology()), null); + assertEquals(parsed.query(TemporalQueries.zoneId()), null); } } @@ -198,8 +198,8 @@ public class TestNumberParser extends AbstractTestPrinterParser { assertTrue(subsequentWidth >= 0); assertEquals(ppos.getIndex(), expectedPos + subsequentWidth); assertEquals(parsed.getLong(DAY_OF_WEEK), expectedValue); - assertEquals(parsed.query(TemporalQuery.chronology()), null); - assertEquals(parsed.query(TemporalQuery.zoneId()), null); + assertEquals(parsed.query(TemporalQueries.chronology()), null); + assertEquals(parsed.query(TemporalQueries.zoneId()), null); } } @@ -313,8 +313,8 @@ public class TestNumberParser extends AbstractTestPrinterParser { } else { assertEquals(pos.getIndex(), parseLen); assertEquals(parsed.getLong(DAY_OF_MONTH), (long)parseVal); - assertEquals(parsed.query(TemporalQuery.chronology()), null); - assertEquals(parsed.query(TemporalQuery.zoneId()), null); + assertEquals(parsed.query(TemporalQueries.chronology()), null); + assertEquals(parsed.query(TemporalQueries.zoneId()), null); } } @@ -423,8 +423,8 @@ public class TestNumberParser extends AbstractTestPrinterParser { } else { assertEquals(pos.getIndex(), parseLen); assertEquals(parsed.getLong(DAY_OF_MONTH), (long)parseVal); - assertEquals(parsed.query(TemporalQuery.chronology()), null); - assertEquals(parsed.query(TemporalQuery.zoneId()), null); + assertEquals(parsed.query(TemporalQueries.chronology()), null); + assertEquals(parsed.query(TemporalQueries.zoneId()), null); } } @@ -514,8 +514,8 @@ public class TestNumberParser extends AbstractTestPrinterParser { } else { assertEquals(pos.getIndex(), parseLen); assertEquals(parsed.getLong(DAY_OF_MONTH), (long)parseVal); - assertEquals(parsed.query(TemporalQuery.chronology()), null); - assertEquals(parsed.query(TemporalQuery.zoneId()), null); + assertEquals(parsed.query(TemporalQueries.chronology()), null); + assertEquals(parsed.query(TemporalQueries.zoneId()), null); } } @@ -552,8 +552,8 @@ public class TestNumberParser extends AbstractTestPrinterParser { assertEquals(pos.getIndex(), parseLen); assertEquals(parsed.getLong(MONTH_OF_YEAR), (long) parseMonth); assertEquals(parsed.getLong(DAY_OF_MONTH), (long) parsedDay); - assertEquals(parsed.query(TemporalQuery.chronology()), null); - assertEquals(parsed.query(TemporalQuery.zoneId()), null); + assertEquals(parsed.query(TemporalQueries.chronology()), null); + assertEquals(parsed.query(TemporalQueries.zoneId()), null); } } diff --git a/jdk/test/java/time/test/java/time/format/TestStringLiteralParser.java b/jdk/test/java/time/test/java/time/format/TestStringLiteralParser.java index 8b624417820..f8f5147f921 100644 --- a/jdk/test/java/time/test/java/time/format/TestStringLiteralParser.java +++ b/jdk/test/java/time/test/java/time/format/TestStringLiteralParser.java @@ -66,7 +66,7 @@ import static org.testng.Assert.fail; import java.text.ParsePosition; import java.time.temporal.TemporalAccessor; -import java.time.temporal.TemporalQuery; +import java.time.temporal.TemporalQueries; import org.testng.annotations.DataProvider; import org.testng.annotations.Test; @@ -114,8 +114,8 @@ public class TestStringLiteralParser extends AbstractTestPrinterParser { } else { assertEquals(ppos.getIndex(), expectedPos); assertEquals(parsed.isSupported(YEAR), false); - assertEquals(parsed.query(TemporalQuery.chronology()), null); - assertEquals(parsed.query(TemporalQuery.zoneId()), null); + assertEquals(parsed.query(TemporalQueries.chronology()), null); + assertEquals(parsed.query(TemporalQueries.zoneId()), null); } } diff --git a/jdk/test/java/time/test/java/time/format/TestZoneTextPrinterParser.java b/jdk/test/java/time/test/java/time/format/TestZoneTextPrinterParser.java index 7ab8804a9ad..6e37235619b 100644 --- a/jdk/test/java/time/test/java/time/format/TestZoneTextPrinterParser.java +++ b/jdk/test/java/time/test/java/time/format/TestZoneTextPrinterParser.java @@ -33,7 +33,7 @@ import java.time.format.DateTimeFormatter; import java.time.format.DateTimeFormatterBuilder; import java.time.format.TextStyle; import java.time.temporal.ChronoField; -import java.time.temporal.TemporalQuery; +import java.time.temporal.TemporalQueries; import java.time.zone.ZoneRulesProvider; import java.util.Arrays; import java.util.Date; @@ -150,7 +150,7 @@ public class TestZoneTextPrinterParser extends AbstractTestPrinterParser { .toFormatter(locale) .withDecimalStyle(DecimalStyle.of(locale)); - String ret = fmt.parse(text, TemporalQuery.zone()).getId(); + String ret = fmt.parse(text, TemporalQueries.zone()).getId(); System.out.printf("[%-5s %s] %24s -> %s(%s)%n", locale.toString(), @@ -186,7 +186,7 @@ public class TestZoneTextPrinterParser extends AbstractTestPrinterParser { if (ci) { text = text.toUpperCase(); } - String ret = fmt.parse(text, TemporalQuery.zone()).getId(); + String ret = fmt.parse(text, TemporalQueries.zone()).getId(); // TBD: need an excluding list // assertEquals(...); if (ret.equals(expected) || diff --git a/jdk/test/java/time/test/java/util/TestFormatter.java b/jdk/test/java/time/test/java/util/TestFormatter.java index 4c3ac4b6039..ac183ba6678 100644 --- a/jdk/test/java/time/test/java/util/TestFormatter.java +++ b/jdk/test/java/time/test/java/util/TestFormatter.java @@ -36,7 +36,7 @@ import java.time.chrono.ChronoZonedDateTime; import java.time.chrono.Chronology; import java.time.temporal.ChronoField; -import java.time.temporal.TemporalQuery; +import java.time.temporal.TemporalQueries; import java.time.temporal.TemporalAccessor; import java.util.*; @@ -134,7 +134,7 @@ public class TestFormatter { Class c = o.getClass(); String clname = c.getName().substring(c.getPackage().getName().length() + 1); if (o instanceof TemporalAccessor) { - Chronology chrono = ((TemporalAccessor)o).query(TemporalQuery.chronology()); + Chronology chrono = ((TemporalAccessor)o).query(TemporalQueries.chronology()); if (chrono != null) { clname = clname + "(" + chrono.getId() + ")"; } From 71f33254816a17ff741e0119e16db28181d7b43b Mon Sep 17 00:00:00 2001 From: Ivan Gerasimov Date: Tue, 15 Oct 2013 21:15:17 +0400 Subject: [PATCH 116/131] 8023431: Test java/util/zip/GZIP/GZIPInZip.java failed Properly close PipedStreams. Additional testing for malformed input Reviewed-by: darcy, sherman --- jdk/test/java/util/zip/GZIP/GZIPInZip.java | 51 +++++++++++++++------- 1 file changed, 35 insertions(+), 16 deletions(-) diff --git a/jdk/test/java/util/zip/GZIP/GZIPInZip.java b/jdk/test/java/util/zip/GZIP/GZIPInZip.java index 558ad962e26..fab869ae1b6 100644 --- a/jdk/test/java/util/zip/GZIP/GZIPInZip.java +++ b/jdk/test/java/util/zip/GZIP/GZIPInZip.java @@ -22,12 +22,15 @@ */ /* @test - * @bug 7021870 - * @summary Reading last gzip chain member must not close the input stream + * @bug 7021870 8023431 + * @summary Reading last gzip chain member must not close the input stream. + * Garbage following gzip entry must be ignored. */ -import java.io.*; -import java.util.*; +import java.io.IOException; +import java.io.InputStream; +import java.io.PipedInputStream; +import java.io.PipedOutputStream; import java.util.zip.GZIPInputStream; import java.util.zip.GZIPOutputStream; import java.util.zip.ZipEntry; @@ -40,6 +43,15 @@ public class GZIPInZip { private static volatile Throwable trouble; public static void main(String[] args) throws Throwable { + doTest(false, false); + doTest(false, true); + doTest(true, false); + doTest(true, true); + } + + private static void doTest(final boolean appendGarbage, + final boolean limitGISBuff) + throws Throwable { final PipedOutputStream pos = new PipedOutputStream(); final PipedInputStream pis = new PipedInputStream(pos); @@ -47,17 +59,23 @@ public class GZIPInZip { Thread compressor = new Thread() { public void run() { final byte[] xbuf = { 'x' }; - try { - ZipOutputStream zos = new ZipOutputStream(pos); + try (ZipOutputStream zos = new ZipOutputStream(pos)) { zos.putNextEntry(new ZipEntry("a.gz")); - GZIPOutputStream gos1 = new GZIPOutputStream(zos); - gos1.write(xbuf); gos1.finish(); + try (GZIPOutputStream gos1 = new GZIPOutputStream(zos)) { + gos1.write(xbuf); + gos1.finish(); + } + if (appendGarbage) + zos.write(xbuf); + zos.closeEntry(); zos.putNextEntry(new ZipEntry("b.gz")); - GZIPOutputStream gos2 = new GZIPOutputStream(zos); - gos2.write(xbuf); gos2.finish(); + try (GZIPOutputStream gos2 = new GZIPOutputStream(zos)) { + gos2.write(xbuf); + gos2.finish(); + } zos.closeEntry(); } catch (Throwable t) { @@ -68,19 +86,20 @@ public class GZIPInZip { Thread uncompressor = new Thread() { public void run() { - try { - ZipInputStream zis = new ZipInputStream(pis); + try (ZipInputStream zis = new ZipInputStream(pis)) { zis.getNextEntry(); - InputStream gis = new GZIPInputStream(zis); - // try to read more than the entry has - gis.skip(2); + try (InputStream gis = limitGISBuff ? + new GZIPInputStream(zis, 4) : + new GZIPInputStream(zis)) { + // try to read more than the entry has + gis.skip(2); + } try { zis.getNextEntry(); } catch (IOException e) { throw new AssertionError("ZIP stream was prematurely closed"); } - } catch (Throwable t) { trouble = t; } From efa036f678174fa47cd7abb6bbc8a247ab75747b Mon Sep 17 00:00:00 2001 From: Chris Hegarty Date: Tue, 15 Oct 2013 20:46:47 +0100 Subject: [PATCH 117/131] 8026513: ProblemList.txt Updates (10/2013) Reviewed-by: alanb --- jdk/test/ProblemList.txt | 3 +++ 1 file changed, 3 insertions(+) diff --git a/jdk/test/ProblemList.txt b/jdk/test/ProblemList.txt index 441fe67325b..cf4d9b8e514 100644 --- a/jdk/test/ProblemList.txt +++ b/jdk/test/ProblemList.txt @@ -138,6 +138,9 @@ java/lang/ThreadLocal/ThreadLocalSupplierTest.java generic-all java/lang/instrument/RetransformBigClass.sh generic-all java/lang/instrument/RedefineBigClass.sh generic-all +# 8026502 +java/lang/invoke/MethodHandleConstants.java generic-all + ############################################################################ # jdk_management From 3c035b0aacf8a8c684315f310a5ef9504b9c8b5e Mon Sep 17 00:00:00 2001 From: Brian Burkhalter Date: Tue, 15 Oct 2013 16:45:04 -0700 Subject: [PATCH 118/131] 8010371: getaddrinfo can fail with EAI_SYSTEM/EAGAIN, causes UnknownHostException to be thrown Modify UHE exception message for EAI_AGAIN failures. Reviewed-by: alanb, chegar, michaelm, dsamersoff --- jdk/src/solaris/native/java/net/Inet4AddressImpl.c | 3 +-- jdk/src/windows/native/java/net/Inet4AddressImpl.c | 4 ++++ jdk/src/windows/native/java/net/Inet6AddressImpl.c | 8 +++++++- 3 files changed, 12 insertions(+), 3 deletions(-) diff --git a/jdk/src/solaris/native/java/net/Inet4AddressImpl.c b/jdk/src/solaris/native/java/net/Inet4AddressImpl.c index 9a4d32ebf96..44f3b7aa4a5 100644 --- a/jdk/src/solaris/native/java/net/Inet4AddressImpl.c +++ b/jdk/src/solaris/native/java/net/Inet4AddressImpl.c @@ -178,8 +178,7 @@ Java_java_net_Inet4AddressImpl_lookupAllHostAddr(JNIEnv *env, jobject this, if (error) { /* report error */ - JNU_ThrowByName(env, JNU_JAVANETPKG "UnknownHostException", - (char *)hostname); + ThrowUnknownHostExceptionWithGaiError(env, hostname, error); JNU_ReleaseStringPlatformChars(env, host, hostname); return NULL; } else { diff --git a/jdk/src/windows/native/java/net/Inet4AddressImpl.c b/jdk/src/windows/native/java/net/Inet4AddressImpl.c index d7cf8e5a395..97aab6f9c14 100644 --- a/jdk/src/windows/native/java/net/Inet4AddressImpl.c +++ b/jdk/src/windows/native/java/net/Inet4AddressImpl.c @@ -241,6 +241,10 @@ Java_java_net_Inet4AddressImpl_lookupAllHostAddr(JNIEnv *env, jobject this, addrp++; i++; } + } else if (WSAGetLastError() == WSATRY_AGAIN) { + NET_ThrowByNameWithLastError(env, + JNU_JAVANETPKG "UnknownHostException", + hostname); } else { JNU_ThrowByName(env, JNU_JAVANETPKG "UnknownHostException", hostname); } diff --git a/jdk/src/windows/native/java/net/Inet6AddressImpl.c b/jdk/src/windows/native/java/net/Inet6AddressImpl.c index c124f91f4d5..0e6fc308a44 100644 --- a/jdk/src/windows/native/java/net/Inet6AddressImpl.c +++ b/jdk/src/windows/native/java/net/Inet6AddressImpl.c @@ -131,7 +131,13 @@ Java_java_net_Inet6AddressImpl_lookupAllHostAddr(JNIEnv *env, jobject this, error = getaddrinfo(hostname, NULL, &hints, &res); - if (error) { + if (WSAGetLastError() == WSATRY_AGAIN) { + NET_ThrowByNameWithLastError(env, + JNU_JAVANETPKG "UnknownHostException", + hostname); + JNU_ReleaseStringPlatformChars(env, host, hostname); + return NULL; + } else if (error) { /* report error */ JNU_ThrowByName(env, JNU_JAVANETPKG "UnknownHostException", (char *)hostname); From 04360f139e2b66c23635b669927973489d94a39c Mon Sep 17 00:00:00 2001 From: David Holmes Date: Tue, 15 Oct 2013 20:54:00 -0400 Subject: [PATCH 119/131] 8026378: TEST_BUG: Clean up TEST.groups Reviewed-by: mduigou, mchung, alanb --- jdk/test/TEST.groups | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/jdk/test/TEST.groups b/jdk/test/TEST.groups index aa305fd723c..c680117cc93 100644 --- a/jdk/test/TEST.groups +++ b/jdk/test/TEST.groups @@ -86,7 +86,6 @@ jdk_collections = \ # java.util.stream (JSR-335) jdk_stream = \ java/util/Optional \ - java/util/SummaryStatistics \ java/util/function \ java/util/stream @@ -126,7 +125,6 @@ jdk_security3 = \ javax/security \ com/sun/security \ com/sun/org/apache/xml/internal/security \ - com/oracle/security \ sun/security \ lib/security @@ -319,7 +317,6 @@ needs_jdk = \ java/net/URLClassLoader/closetest/GetResourceAsStream.java \ java/util/Collections/EmptyIterator.java \ java/util/concurrent/locks/Lock/TimedAcquireLeak.java \ - java/util/jar/Manifest/CreateManifest.java \ java/util/jar/JarInputStream/ExtraFileInMetaInf.java \ java/util/logging/AnonLoggerWeakRefLeak.sh \ java/util/logging/LoggerWeakRefLeak.sh \ @@ -358,6 +355,7 @@ needs_jre = \ java/net/URLConnection/HandleContentTypeWithAttrs.java \ java/security/Security/ClassLoaderDeadlock/ClassLoaderDeadlock.sh \ java/security/Security/ClassLoaderDeadlock/Deadlock.sh \ + java/util/jar/Manifest/CreateManifest.java \ java/util/logging/Listeners.java \ java/util/logging/ListenersWithSM.java \ java/util/logging/TestMainAppContext.java \ @@ -528,10 +526,10 @@ needs_compact2 = \ java/net/CookieHandler/EmptyCookieHeader.java \ java/net/HttpCookie/IllegalCookieNameTest.java \ java/net/HttpURLConnection/UnmodifiableMaps.java \ - java/net/HttpURLPermission/URLTest.java \ java/net/ResponseCache/Test.java \ java/net/URLClassLoader/ClassLoad.java \ java/net/URLClassLoader/closetest/CloseTest.java \ + java/net/URLPermission/URLTest.java \ java/nio/Buffer/Chars.java \ java/nio/file/Files/StreamTest.java \ java/security/BasicPermission/Wildcard.java \ @@ -539,7 +537,6 @@ needs_compact2 = \ java/util/Arrays/SetAllTest.java \ java/util/BitSet/BitSetStreamTest.java \ java/util/Collection/CollectionDefaults.java \ - java/util/Collection/ListDefaults.java \ java/util/Collections/CheckedIdentityMap.java \ java/util/Collections/CheckedMapBash.java \ java/util/Collections/CheckedSetBash.java \ @@ -551,6 +548,7 @@ needs_compact2 = \ java/util/Comparator/TypeTest.java \ java/util/Iterator/IteratorDefaults.java \ java/util/Iterator/PrimitiveIteratorDefaults.java \ + java/util/List/ListDefaults.java \ java/util/Map/BasicSerialization.java \ java/util/Map/Defaults.java \ java/util/Map/EntryComparators.java \ From 45dc5dd0df06cfec29dfb72c88f24f4b17fa26f2 Mon Sep 17 00:00:00 2001 From: Weijun Wang Date: Wed, 16 Oct 2013 14:39:00 +0800 Subject: [PATCH 120/131] 8025124: InitialToken.useNullKey incorrectly applies NULL_KEY in some cases Reviewed-by: xuelei --- .../sun/security/jgss/krb5/InitialToken.java | 25 +++++++------------ .../classes/sun/security/krb5/KrbCred.java | 5 +++- 2 files changed, 13 insertions(+), 17 deletions(-) diff --git a/jdk/src/share/classes/sun/security/jgss/krb5/InitialToken.java b/jdk/src/share/classes/sun/security/jgss/krb5/InitialToken.java index 8e462fdc486..c15ddd23529 100644 --- a/jdk/src/share/classes/sun/security/jgss/krb5/InitialToken.java +++ b/jdk/src/share/classes/sun/security/jgss/krb5/InitialToken.java @@ -277,24 +277,17 @@ abstract class InitialToken extends Krb5Token { byte[] credBytes = new byte[credLen]; System.arraycopy(checksumBytes, 28, credBytes, 0, credLen); - CipherHelper cipherHelper = context.getCipherHelper(key); - if (useNullKey(cipherHelper)) { - delegCreds = - new KrbCred(credBytes, EncryptionKey.NULL_KEY). - getDelegatedCreds()[0]; - } else { - KrbCred cred; - try { - cred = new KrbCred(credBytes, key); - } catch (KrbException e) { - if (subKey != null) { - cred = new KrbCred(credBytes, subKey); - } else { - throw e; - } + KrbCred cred; + try { + cred = new KrbCred(credBytes, key); + } catch (KrbException ke) { + if (subKey != null) { + cred = new KrbCred(credBytes, subKey); + } else { + throw ke; } - delegCreds = cred.getDelegatedCreds()[0]; } + delegCreds = cred.getDelegatedCreds()[0]; } } diff --git a/jdk/src/share/classes/sun/security/krb5/KrbCred.java b/jdk/src/share/classes/sun/security/krb5/KrbCred.java index 64dada1d35e..586a6660977 100644 --- a/jdk/src/share/classes/sun/security/krb5/KrbCred.java +++ b/jdk/src/share/classes/sun/security/krb5/KrbCred.java @@ -119,7 +119,7 @@ public class KrbCred { return credMessg; } - // Used in InitialToken, key always NULL_KEY + // Used in InitialToken, NULL_KEY might be used public KrbCred(byte[] asn1Message, EncryptionKey key) throws KrbException, IOException { @@ -127,6 +127,9 @@ public class KrbCred { ticket = credMessg.tickets[0]; + if (credMessg.encPart.getEType() == 0) { + key = EncryptionKey.NULL_KEY; + } byte[] temp = credMessg.encPart.decrypt(key, KeyUsage.KU_ENC_KRB_CRED_PART); byte[] plainText = credMessg.encPart.reset(temp); From ec06d2fa6ccd79e222e75ad9ff354ceb46af4c0e Mon Sep 17 00:00:00 2001 From: Erik Joelsson Date: Wed, 16 Oct 2013 13:50:13 +0200 Subject: [PATCH 121/131] 6604021: RMIC is defaulting to BOOT jdk version, needs to be rmic.jar Reviewed-by: dholmes, chegar --- jdk/makefiles/GendataBreakIterator.gmk | 10 +++--- jdk/makefiles/GenerateClasses.gmk | 35 +++++++++++++++---- jdk/makefiles/Setup.gmk | 9 +++-- .../share/classes/sun/tools/tree/Node.java | 4 +-- 4 files changed, 43 insertions(+), 15 deletions(-) diff --git a/jdk/makefiles/GendataBreakIterator.gmk b/jdk/makefiles/GendataBreakIterator.gmk index fca47b36650..e06b367f498 100644 --- a/jdk/makefiles/GendataBreakIterator.gmk +++ b/jdk/makefiles/GendataBreakIterator.gmk @@ -1,5 +1,5 @@ # -# Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # # This code is free software; you can redistribute it and/or modify it @@ -44,17 +44,17 @@ TEXT_SOURCES = $(TEXT_PKG)/BreakIteratorRules.java \ BREAK_ITERATOR_DIR = $(JDK_OUTPUTDIR)/break_iterator BREAK_ITERATOR_CLASSES = $(BREAK_ITERATOR_DIR)/classes -# JAVAC_SOURCE_PATH_UGLY_OVERRIDE is set to isolate the compile to just those +# JAVAC_SOURCE_PATH_OVERRIDE is set to isolate the compile to just those # two files in that directory and not get anything implicit from -# surrounding directories which aren't jdk 6 compatible. -# Because we are targeting jdk 6, but the surrounding source code is jdk 7. Ugh. +# surrounding directories which aren't jdk N-1 compatible. +# Because we are targeting jdk N-1, but the surrounding source code is jdk N. # These two files should be moved out to a build tool! We have to disable # sjavac here as well. $(eval $(call SetupJavaCompilation,BUILD_BREAKITERATOR,\ SETUP:=GENERATE_OLDBYTECODE,\ SRC:=$(TEXT_SRCDIR),\ DISABLE_SJAVAC:=true,\ - JAVAC_SOURCE_PATH_UGLY_OVERRIDE:=$(TEXT_SRCDIR)/$(TEXT_PKG),\ + JAVAC_SOURCE_PATH_OVERRIDE := $(TEXT_SRCDIR)/$(TEXT_PKG), \ INCLUDES:=$(TEXT_PKG),\ INCLUDE_FILES:=$(TEXT_SOURCES),\ BIN:=$(BREAK_ITERATOR_CLASSES))) diff --git a/jdk/makefiles/GenerateClasses.gmk b/jdk/makefiles/GenerateClasses.gmk index 3ee2a050d2f..072e411aa0b 100644 --- a/jdk/makefiles/GenerateClasses.gmk +++ b/jdk/makefiles/GenerateClasses.gmk @@ -1,5 +1,5 @@ # -# Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # # This code is free software; you can redistribute it and/or modify it @@ -28,12 +28,33 @@ default: all include $(SPEC) include MakeBase.gmk include RMICompilation.gmk +include JavaCompilation.gmk +include Setup.gmk -# To ensure the latest stub generator files are picked up from corba repo -# when available, we need to run with latest rmic version available. -ifneq ($(COMPILE_TYPE),cross) - RMIC := $(FIXPATH) $(JDK_OUTPUTDIR)/bin/rmic -endif +########################################################################################## + +RMIC_PKGS := \ + sun/rmi/rmic \ + sun/tools/asm \ + sun/tools/java \ + sun/tools/javac \ + sun/tools/tree \ + sun/tools/util \ + # + +$(eval $(call SetupJavaCompilation,BUILD_BOOTSTRAP_RMIC, \ + SETUP := GENERATE_OLDBYTECODE, \ + SRC := $(JDK_TOPDIR)/src/share/classes, \ + INCLUDES := $(RMIC_PKGS), \ + BIN := $(JDK_OUTPUTDIR)/btclasses_rmic, \ + COPY := .properties, \ + JAVAC_SOURCE_PATH_OVERRIDE := $(addprefix $(JDK_TOPDIR)/src/share/classes/, $(RMIC_PKGS)))) + +########################################################################################## + +BTRMIC_CP := $(CORBA_OUTPUTDIR)/btjars/btcorba.jar$(PATH_SEP)$(JDK_OUTPUTDIR)/btclasses_rmic$(PATH_SEP)$(BOOTSTRAP_JAVAC_JAR) +BTRMIC_ARGS := "-Xbootclasspath/p:$(BTRMIC_CP)" -cp $(BTRMIC_CP) +RMIC := $(JAVA) $(BTRMIC_ARGS) sun.rmi.rmic.Main CLASSES_DIR := $(JDK_OUTPUTDIR)/classes # NOTE: If the smart javac dependency management is reintroduced, these classes risk @@ -91,6 +112,8 @@ GENCLASSES += $(filter %.java,$(RMI_SRC)) ########################################################################################## +$(RMI_12) $(RMI_11) $(RMI_IIOP) $(RMI_SRC): $(BUILD_BOOTSTRAP_RMIC) + $(RMIC_GENSRC_DIR)/_the.classes.removed: $(GENCLASSES) $(FIND) $(RMIC_GENSRC_DIR) -name "*.class" $(FIND_DELETE) $(TOUCH) $@ diff --git a/jdk/makefiles/Setup.gmk b/jdk/makefiles/Setup.gmk index 4da575fed1a..3c957475ec2 100644 --- a/jdk/makefiles/Setup.gmk +++ b/jdk/makefiles/Setup.gmk @@ -29,13 +29,18 @@ DISABLE_WARNINGS:=-Xlint:all,-deprecation,-unchecked,-rawtypes,-cast,-serial,-de # make JAVAC_WARNINGS="-Xlint:all -Xmaxwarns 10000" JAVAC_WARNINGS:=-Xlint:-unchecked,-deprecation,-overrides,classfile,dep-ann,divzero,varargs -Werror +# Any java code executed during a JDK build to build other parts of the JDK must be +# executed by the bootstrap JDK (probably with -Xbootclasspath/p: ) and for this +# purpose must be built with -target PREVIOUS for bootstrapping purposes, which +# requires restricting to language level and api of previous JDK. +# # The generate old bytecode javac setup uses the new compiler to compile for the # boot jdk to generate tools that need to be run with the boot jdk. -# Thus we force the target bytecode to 7. +# Thus we force the target bytecode to the previous JDK version. $(eval $(call SetupJavaCompiler,GENERATE_OLDBYTECODE,\ JVM:=$(JAVA),\ JAVAC:=$(NEW_JAVAC),\ - FLAGS:=-source 7 -target 7 -bootclasspath $(BOOT_RTJAR) $(DISABLE_WARNINGS),\ + FLAGS := $(BOOT_JDK_SOURCETARGET) -bootclasspath $(BOOT_RTJAR) $(DISABLE_WARNINGS), \ SERVER_DIR:=$(SJAVAC_SERVER_DIR),\ SERVER_JVM:=$(SJAVAC_SERVER_JAVA))) diff --git a/jdk/src/share/classes/sun/tools/tree/Node.java b/jdk/src/share/classes/sun/tools/tree/Node.java index e07b6b8ef10..0b0ff451f79 100644 --- a/jdk/src/share/classes/sun/tools/tree/Node.java +++ b/jdk/src/share/classes/sun/tools/tree/Node.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1994, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1994, 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 @@ -108,7 +108,7 @@ class Node implements Constants, Cloneable { return super.clone(); } catch (CloneNotSupportedException e) { // this shouldn't happen, since we are Cloneable - throw new InternalError(e); + throw (InternalError) new InternalError().initCause(e); } } From 1fe89b3d7034605ee3e5ad1541c0f0a149b46f89 Mon Sep 17 00:00:00 2001 From: Rob McKenna Date: Wed, 16 Oct 2013 15:06:27 +0100 Subject: [PATCH 122/131] 8026245: InetAddress.getLocalHost crash if IPv6 disabled (macosx) Reviewed-by: chegar, alanb --- .../native/java/net/Inet4AddressImpl.c | 4 +- .../native/java/net/Inet6AddressImpl.c | 43 ++++++------------- .../net/InetAddress/GetLocalHostWithSM.java | 6 ++- jdk/test/java/net/Socket/GetLocalAddress.java | 7 ++- 4 files changed, 24 insertions(+), 36 deletions(-) diff --git a/jdk/src/solaris/native/java/net/Inet4AddressImpl.c b/jdk/src/solaris/native/java/net/Inet4AddressImpl.c index 44f3b7aa4a5..6ef0aca4946 100644 --- a/jdk/src/solaris/native/java/net/Inet4AddressImpl.c +++ b/jdk/src/solaris/native/java/net/Inet4AddressImpl.c @@ -70,6 +70,8 @@ static void initializeInetClasses(JNIEnv *env) #if defined(_ALLBSD_SOURCE) && !defined(HAS_GLIBC_GETHOSTBY_R) +extern jobjectArray lookupIfLocalhost(JNIEnv *env, const char *hostname, jboolean includeV6); + /* Use getaddrinfo(3), which is thread safe */ /************************************************************************ * Inet4AddressImpl @@ -378,8 +380,6 @@ Java_java_net_Inet4AddressImpl_getLocalHostName(JNIEnv *env, jobject this) { return (*env)->NewStringUTF(env, hostname); } -extern jobjectArray lookupIfLocalhost(JNIEnv *env, const char *hostname, jboolean includeV6); - /* * Find an internet address for a given hostname. Note that this * code only works for addresses of type INET. The translation diff --git a/jdk/src/solaris/native/java/net/Inet6AddressImpl.c b/jdk/src/solaris/native/java/net/Inet6AddressImpl.c index 9f81cf8af59..d83db702286 100644 --- a/jdk/src/solaris/native/java/net/Inet6AddressImpl.c +++ b/jdk/src/solaris/native/java/net/Inet6AddressImpl.c @@ -122,9 +122,11 @@ static jclass ni_ia4cls; static jclass ni_ia6cls; static jmethodID ni_ia4ctrID; static jmethodID ni_ia6ctrID; +static jboolean preferIPv6Address; static void initializeInetClasses(JNIEnv *env) { + jfieldID ni_preferIPv6AddressID; static int initialized = 0; if (!initialized) { ni_iacls = (*env)->FindClass(env, "java/net/InetAddress"); @@ -135,6 +137,10 @@ static void initializeInetClasses(JNIEnv *env) ni_ia6cls = (*env)->NewGlobalRef(env, ni_ia6cls); ni_ia4ctrID = (*env)->GetMethodID(env, ni_ia4cls, "", "()V"); ni_ia6ctrID = (*env)->GetMethodID(env, ni_ia6cls, "", "()V"); + ni_preferIPv6AddressID = + (*env)->GetStaticFieldID(env, ni_iacls, "preferIPv6Address", "Z"); + preferIPv6Address = + (*env)->GetStaticBooleanField(env, ia_class, ia_preferIPv6AddressID); initialized = 1; } } @@ -145,7 +151,6 @@ __private_extern__ jobjectArray lookupIfLocalhost(JNIEnv *env, const char *hostname, jboolean includeV6) { jobjectArray result = NULL; - jboolean preferIPv6Address; char myhostname[NI_MAXHOST+1]; struct ifaddrs *ifa = NULL; int familyOrder = 0; @@ -157,9 +162,6 @@ lookupIfLocalhost(JNIEnv *env, const char *hostname, jboolean includeV6) // Make sure static variables we need are set. initializeInetClasses(env); - /* get the address preference */ - preferIPv6Address = (*env)->GetStaticBooleanField(env, ia_class, ia_preferIPv6AddressID); - /* If the requested name matches this host's hostname, return IP addresses * from all attached interfaces. (#2844683 et al) This prevents undesired * PPP dialup, but may return addresses that don't actually correspond to @@ -278,7 +280,6 @@ Java_java_net_Inet6AddressImpl_lookupAllHostAddr(JNIEnv *env, jobject this, const char *hostname; jobjectArray ret = 0; int retLen = 0; - jboolean preferIPv6Address; int error=0; #ifdef AF_INET6 @@ -296,36 +297,18 @@ Java_java_net_Inet6AddressImpl_lookupAllHostAddr(JNIEnv *env, jobject this, #ifdef MACOSX /* - * If getaddrinfo has failed and we're looking up the local machine, we - * attempt to get the address from getifaddrs. This ensures we get an - * IPv6 address for the local machine. + * If we're looking up the local machine, attempt to get the address + * from getifaddrs. This ensures we get an IPv6 address for the local + * machine. */ - if (error) { - ret = lookupIfLocalhost(env, hostname, JNI_TRUE); - if (ret != NULL || (*env)->ExceptionCheck(env)) { - JNU_ReleaseStringPlatformChars(env, host, hostname); - return ret; - } + ret = lookupIfLocalhost(env, hostname, JNI_TRUE); + if (ret != NULL || (*env)->ExceptionCheck(env)) { + JNU_ReleaseStringPlatformChars(env, host, hostname); + return ret; } #endif #ifdef AF_INET6 - static jfieldID ia_preferIPv6AddressID; - if (ia_preferIPv6AddressID == NULL) { - jclass c = (*env)->FindClass(env,"java/net/InetAddress"); - if (c) { - ia_preferIPv6AddressID = - (*env)->GetStaticFieldID(env, c, "preferIPv6Address", "Z"); - } - if (ia_preferIPv6AddressID == NULL) { - JNU_ReleaseStringPlatformChars(env, host, hostname); - return NULL; - } - } - /* get the address preference */ - preferIPv6Address - = (*env)->GetStaticBooleanField(env, ia_class, ia_preferIPv6AddressID); - /* Try once, with our static buffer. */ memset(&hints, 0, sizeof(hints)); hints.ai_flags = AI_CANONNAME; diff --git a/jdk/test/java/net/InetAddress/GetLocalHostWithSM.java b/jdk/test/java/net/InetAddress/GetLocalHostWithSM.java index c8d06acb613..9701a741472 100644 --- a/jdk/test/java/net/InetAddress/GetLocalHostWithSM.java +++ b/jdk/test/java/net/InetAddress/GetLocalHostWithSM.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 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 @@ -23,9 +23,11 @@ /** * @test - * @bug 4531817 + * @bug 4531817 8026245 * @summary Inet[46]Address.localHost need doPrivileged * @run main/othervm GetLocalHostWithSM + * @run main/othervm -Djava.net.preferIPv4Stack=true GetLocalHostWithSM + * @run main/othervm -Djava.net.preferIPv6Addresses=true GetLocalHostWithSM * files needed: GetLocalHostWithSM.java, MyPrincipal.java, and policy.file */ diff --git a/jdk/test/java/net/Socket/GetLocalAddress.java b/jdk/test/java/net/Socket/GetLocalAddress.java index 606ba644ced..e9573d2eff1 100644 --- a/jdk/test/java/net/Socket/GetLocalAddress.java +++ b/jdk/test/java/net/Socket/GetLocalAddress.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 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 @@ -23,7 +23,10 @@ /* * @test - * @bug 4106601 + * @bug 4106601 8026245 + * @run main/othervm GetLocalAddress + * @run main/othervm -Djava.net.preferIPv4Stack=true GetLocalAddress + * @run main/othervm -Djava.net.preferIPv6Addresses=true GetLocalAddress * @summary Test the java.net.socket.GetLocalAddress method * */ From fb1bcf242f9326001487b32883c0931a24c6497e Mon Sep 17 00:00:00 2001 From: Daniel Fuchs Date: Wed, 16 Oct 2013 17:19:09 +0200 Subject: [PATCH 123/131] 8011638: Remove deprecated methods in sun.util.logging.PlatformLogger Reviewed-by: psandoz, mchung, alanb, chegar --- .../share/classes/sun/font/FontUtilities.java | 6 +- .../sun/util/logging/PlatformLogger.java | 69 ++++---------- .../sun/util/logging/PlatformLoggerTest.java | 91 +++++++++++-------- 3 files changed, 74 insertions(+), 92 deletions(-) diff --git a/jdk/src/share/classes/sun/font/FontUtilities.java b/jdk/src/share/classes/sun/font/FontUtilities.java index 2284c11714a..04a4f9f5add 100644 --- a/jdk/src/share/classes/sun/font/FontUtilities.java +++ b/jdk/src/share/classes/sun/font/FontUtilities.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2008, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2008, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -133,9 +133,9 @@ public final class FontUtilities { debugFonts = true; logger = PlatformLogger.getLogger("sun.java2d"); if (debugLevel.equals("warning")) { - logger.setLevel(PlatformLogger.WARNING); + logger.setLevel(PlatformLogger.Level.WARNING); } else if (debugLevel.equals("severe")) { - logger.setLevel(PlatformLogger.SEVERE); + logger.setLevel(PlatformLogger.Level.SEVERE); } } diff --git a/jdk/src/share/classes/sun/util/logging/PlatformLogger.java b/jdk/src/share/classes/sun/util/logging/PlatformLogger.java index 9a1b8930477..532b397b223 100644 --- a/jdk/src/share/classes/sun/util/logging/PlatformLogger.java +++ b/jdk/src/share/classes/sun/util/logging/PlatformLogger.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2009, 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 @@ -85,22 +85,18 @@ import sun.misc.SharedSecrets; * @since 1.7 */ public class PlatformLogger { - /* - * These constants should be shortcuts to Level enum constants that - * the clients of sun.util.logging.PlatformLogger require no source - * modification and avoid the conversion from int to Level enum. - * - * This can be done when JavaFX is converted to use the new PlatformLogger.Level API. - */ - public static final int OFF = Integer.MAX_VALUE; - public static final int SEVERE = 1000; - public static final int WARNING = 900; - public static final int INFO = 800; - public static final int CONFIG = 700; - public static final int FINE = 500; - public static final int FINER = 400; - public static final int FINEST = 300; - public static final int ALL = Integer.MIN_VALUE; + + // The integer values must match that of {@code java.util.logging.Level} + // objects. + private static final int OFF = Integer.MAX_VALUE; + private static final int SEVERE = 1000; + private static final int WARNING = 900; + private static final int INFO = 800; + private static final int CONFIG = 700; + private static final int FINE = 500; + private static final int FINER = 400; + private static final int FINEST = 300; + private static final int ALL = Integer.MIN_VALUE; /** * PlatformLogger logging levels. @@ -127,14 +123,14 @@ public class PlatformLogger { /* java.util.logging.Level */ Object javaLevel; // ascending order for binary search matching the list of enum constants - private static final int[] levelValues = new int[] { + private static final int[] LEVEL_VALUES = new int[] { PlatformLogger.ALL, PlatformLogger.FINEST, PlatformLogger.FINER, PlatformLogger.FINE, PlatformLogger.CONFIG, PlatformLogger.INFO, PlatformLogger.WARNING, PlatformLogger.SEVERE, PlatformLogger.OFF }; public int intValue() { - return levelValues[this.ordinal()]; + return LEVEL_VALUES[this.ordinal()]; } static Level valueOf(int level) { @@ -153,7 +149,7 @@ public class PlatformLogger { } // return the nearest Level value >= the given level, // for level > SEVERE, return SEVERE and exclude OFF - int i = Arrays.binarySearch(levelValues, 0, levelValues.length-2, level); + int i = Arrays.binarySearch(LEVEL_VALUES, 0, LEVEL_VALUES.length-2, level); return values()[i >= 0 ? i : (-i-1)]; } } @@ -261,39 +257,6 @@ public class PlatformLogger { return loggerProxy.name; } - /** - * Returns true if a message of the given level would actually - * be logged by this logger. - * - * @deprecated Use isLoggable(Level) instead. - */ - @Deprecated - public boolean isLoggable(int levelValue) { - return isLoggable(Level.valueOf(levelValue)); - } - - /** - * Gets the current log level. Returns 0 if the current effective level is - * not set (equivalent to Logger.getLevel() returns null). - * - * @deprecated Use level() instead - */ - @Deprecated - public int getLevel() { - Level level = loggerProxy.getLevel(); - return level != null ? level.intValue() : 0; - } - - /** - * Sets the log level. - * - * @deprecated Use setLevel(Level) instead - */ - @Deprecated - public void setLevel(int newLevel) { - loggerProxy.setLevel(newLevel == 0 ? null : Level.valueOf(newLevel)); - } - /** * Returns true if a message of the given level would actually * be logged by this logger. diff --git a/jdk/test/sun/util/logging/PlatformLoggerTest.java b/jdk/test/sun/util/logging/PlatformLoggerTest.java index ac399c097e4..3fdab49addd 100644 --- a/jdk/test/sun/util/logging/PlatformLoggerTest.java +++ b/jdk/test/sun/util/logging/PlatformLoggerTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2009, 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 @@ -23,7 +23,7 @@ /* * @test - * @bug 6882376 6985460 8010309 + * @bug 6882376 6985460 8010309 8011638 * @summary Test if java.util.logging.Logger is created before and after * logging is enabled. Also validate some basic PlatformLogger * operations. othervm mode to make sure java.util.logging @@ -34,8 +34,10 @@ */ import java.lang.reflect.Field; +import java.lang.reflect.Modifier; import java.util.logging.*; import sun.util.logging.PlatformLogger; +import sun.util.logging.LoggingSupport; import static sun.util.logging.PlatformLogger.Level.*; public class PlatformLoggerTest { @@ -104,17 +106,6 @@ public class PlatformLoggerTest { throw new RuntimeException("logger " + logger.getName() + ": " + level + (expected ? " not loggable" : " loggable")); } - - if (logger.isLoggable(level.intValue()) != expected) { - throw new RuntimeException("logger " + logger.getName() + ": " + level.intValue() + - (expected ? " not loggable" : " loggable")); - } - - int value = level.intValue() + 5; // custom level value - if (expected && !logger.isLoggable(value)) { - throw new RuntimeException("logger " + logger.getName() + ": " + value + - " not loggable"); - } } private static void checkLevel(PlatformLogger logger, PlatformLogger.Level level) { @@ -122,11 +113,6 @@ public class PlatformLoggerTest { throw new RuntimeException("Invalid level for logger " + logger.getName() + ": " + logger.level() + " != " + level); } - - if (logger.getLevel() != level.intValue()) { - throw new RuntimeException("Invalid level for logger " + - logger.getName() + ": " + logger.getLevel() + " != " + level.intValue()); - } } private static void checkLogger(String name, Level level) { @@ -177,6 +163,11 @@ public class PlatformLoggerTest { checkLoggerLevel(logger, Level.ALL); } } + + Logger javaLogger = Logger.getLogger("foo.bar.baz"); + for (Level level : levels) { + checkJavaLoggerLevel(javaLogger, level); + } } private static void checkLoggerLevel(PlatformLogger logger, Level level) { @@ -196,6 +187,50 @@ public class PlatformLoggerTest { } } + private static void checkJavaLoggerLevel(Logger logger, Level level) { + // This method exercise the mapping of java level to platform level + // when the java level is not one of the standard levels... + + System.out.println("Testing Java Level with: " + level.getName()); + + // create a brand new java logger + Logger javaLogger = (Logger) LoggingSupport.getLogger(logger.getName()+"."+level.getName()); + + // Set a non standard java.util.logging.Level on the java logger + // (except for OFF & ALL - which will remain unchanged) + int intValue = level.intValue(); + if (level != Level.ALL && level != Level.OFF) { + intValue -= 7; + } + javaLogger.setLevel(Level.parse(String.valueOf(intValue))); + + // check the level set in java.util.logging.Logger + Level effectiveLevel = javaLogger.getLevel(); + System.out.println("Effective Java Level used is: " + effectiveLevel); + + if (effectiveLevel.intValue() != intValue) { + throw new RuntimeException("Retrieved backing java.util.logging.Logger level.intValue() " + + effectiveLevel.intValue() + " is not the expected " + intValue); + } + if (intValue != level.intValue() && javaLogger.getLevel() == level) { + throw new RuntimeException("Retrieved backing java.util.logging.Logger level " + + effectiveLevel + " is " + level); + } + if (intValue == level.intValue() && javaLogger.getLevel() != level) { + throw new RuntimeException("Retrieved backing java.util.logging.Logger level " + + effectiveLevel + " is not " + level); + } + + // check the level set in the PlatformLogger + PlatformLogger plogger = PlatformLogger.getLogger(javaLogger.getName()); + PlatformLogger.Level expected = PlatformLogger.Level.valueOf(level.getName()); + if (plogger.level() != expected) { + throw new RuntimeException("Retrieved backing PlatformLogger level " + + plogger.level() + " is not the expected " + expected); + + } + } + private static void checkPlatformLoggerLevelMapping(Level level) { // map the given level to PlatformLogger.Level of the same name and value PlatformLogger.Level platformLevel = PlatformLogger.Level.valueOf(level.getName()); @@ -203,26 +238,10 @@ public class PlatformLoggerTest { throw new RuntimeException("Mismatched level: " + level + " PlatformLogger.Level" + platformLevel); } - - try { - // validate if there is a public static final field in PlatformLogger - Field constantField = PlatformLogger.class.getField(level.getName()); - int l = (int) constantField.get(null); - if (l != platformLevel.intValue()) { - throw new RuntimeException("static final " + level.getName() + " (" + - l + ") != " + platformLevel.intValue()); - } - } catch (Exception e) { - throw new RuntimeException("No public static PlatformLogger." + level.getName() + - " field", e); - } - if (!platformLevel.name().equals(level.getName())) + if (!platformLevel.name().equals(level.getName())) { throw new RuntimeException("The value of PlatformLogger." + level.getName() + ".name() is " + platformLevel.name() + " but expected " + level.getName()); - - if (platformLevel.intValue() != level.intValue()) - throw new RuntimeException("The value of PlatformLogger." + level.intValue() + ".intValue() is " - + platformLevel.intValue() + " but expected " + level.intValue()); + } } static Point[] getPoints() { From 9ef30e9ae7d0ce96ddce6e7f67edb9088110a4bb Mon Sep 17 00:00:00 2001 From: Daniel Fuchs Date: Wed, 16 Oct 2013 20:47:30 +0200 Subject: [PATCH 124/131] 8013839: Enhance Logger API for handling of resource bundles 4814565: (rb) add method to get basename from a ResourceBundle Adds Logger.setResourceBundle(ResourceBundle) and ResourceBundle.getBaseBundleName() Reviewed-by: mchung, naoto --- .../classes/java/util/ResourceBundle.java | 18 + .../classes/java/util/logging/Logger.java | 260 ++++++++++-- .../TestGetBaseBundleName.java | 144 +++++++ .../resources/ListBundle.java | 41 ++ .../resources/ListBundle_fr.java | 41 ++ .../resources/PropertyBundle.properties | 24 ++ .../resources/PropertyBundle_fr.properties | 24 ++ .../Logger/logrb/TestLogrbResourceBundle.java | 381 +++++++++++++++++ .../Logger/logrb/resources/ListBundle.java | 41 ++ .../Logger/logrb/resources/ListBundle_fr.java | 41 ++ .../logrb/resources/PropertyBundle.properties | 24 ++ .../resources/PropertyBundle_fr.properties | 24 ++ .../TestSetResourceBundle.java | 393 ++++++++++++++++++ .../resources/ListBundle.java | 41 ++ .../resources/ListBundle_fr.java | 41 ++ .../resources/PropertyBundle.properties | 24 ++ .../resources/PropertyBundle_fr.properties | 24 ++ 17 files changed, 1560 insertions(+), 26 deletions(-) create mode 100644 jdk/test/java/util/ResourceBundle/getBaseBundleName/TestGetBaseBundleName.java create mode 100644 jdk/test/java/util/ResourceBundle/getBaseBundleName/resources/ListBundle.java create mode 100644 jdk/test/java/util/ResourceBundle/getBaseBundleName/resources/ListBundle_fr.java create mode 100644 jdk/test/java/util/ResourceBundle/getBaseBundleName/resources/PropertyBundle.properties create mode 100644 jdk/test/java/util/ResourceBundle/getBaseBundleName/resources/PropertyBundle_fr.properties create mode 100644 jdk/test/java/util/logging/Logger/logrb/TestLogrbResourceBundle.java create mode 100644 jdk/test/java/util/logging/Logger/logrb/resources/ListBundle.java create mode 100644 jdk/test/java/util/logging/Logger/logrb/resources/ListBundle_fr.java create mode 100644 jdk/test/java/util/logging/Logger/logrb/resources/PropertyBundle.properties create mode 100644 jdk/test/java/util/logging/Logger/logrb/resources/PropertyBundle_fr.properties create mode 100644 jdk/test/java/util/logging/Logger/setResourceBundle/TestSetResourceBundle.java create mode 100644 jdk/test/java/util/logging/Logger/setResourceBundle/resources/ListBundle.java create mode 100644 jdk/test/java/util/logging/Logger/setResourceBundle/resources/ListBundle_fr.java create mode 100644 jdk/test/java/util/logging/Logger/setResourceBundle/resources/PropertyBundle.properties create mode 100644 jdk/test/java/util/logging/Logger/setResourceBundle/resources/PropertyBundle_fr.properties diff --git a/jdk/src/share/classes/java/util/ResourceBundle.java b/jdk/src/share/classes/java/util/ResourceBundle.java index b16174d30b7..c2900fa3ce9 100644 --- a/jdk/src/share/classes/java/util/ResourceBundle.java +++ b/jdk/src/share/classes/java/util/ResourceBundle.java @@ -310,6 +310,24 @@ public abstract class ResourceBundle { */ private static final ReferenceQueue referenceQueue = new ReferenceQueue<>(); + /** + * Returns the base name of this bundle, if known, or {@code null} if unknown. + * + * If not null, then this is the value of the {@code baseName} parameter + * that was passed to the {@code ResourceBundle.getBundle(...)} method + * when the resource bundle was loaded. + * + * @return The base name of the resource bundle, as provided to and expected + * by the {@code ResourceBundle.getBundle(...)} methods. + * + * @see #getBundle(java.lang.String, java.util.Locale, java.lang.ClassLoader) + * + * @since 1.8 + */ + public String getBaseBundleName() { + return name; + } + /** * The parent bundle of this bundle. * The parent bundle is searched by {@link #getObject getObject} diff --git a/jdk/src/share/classes/java/util/logging/Logger.java b/jdk/src/share/classes/java/util/logging/Logger.java index 19e31352c43..d6739176995 100644 --- a/jdk/src/share/classes/java/util/logging/Logger.java +++ b/jdk/src/share/classes/java/util/logging/Logger.java @@ -88,17 +88,21 @@ import sun.reflect.Reflection; * the LogRecord to its output Handlers. By default, loggers also * publish to their parent's Handlers, recursively up the tree. *

            - * Each Logger may have a ResourceBundle name associated with it. - * The named bundle will be used for localizing logging messages. - * If a Logger does not have its own ResourceBundle name, then - * it will inherit the ResourceBundle name from its parent, - * recursively up the tree. + * Each Logger may have a {@code ResourceBundle} associated with it. + * The {@code ResourceBundle} may be specified by name, using the + * {@link #getLogger(java.lang.String, java.lang.String)} factory + * method, or by value - using the {@link + * #setResourceBundle(java.util.ResourceBundle) setResourceBundle} method. + * This bundle will be used for localizing logging messages. + * If a Logger does not have its own {@code ResourceBundle} or resource bundle + * name, then it will inherit the {@code ResourceBundle} or resource bundle name + * from its parent, recursively up the tree. *

            * Most of the logger output methods take a "msg" argument. This * msg argument may be either a raw value or a localization key. * During formatting, if the logger has (or inherits) a localization - * ResourceBundle and if the ResourceBundle has a mapping for the msg - * string, then the msg string is replaced by the localized value. + * {@code ResourceBundle} and if the {@code ResourceBundle} has a mapping for + * the msg string, then the msg string is replaced by the localized value. * Otherwise the original msg string is used. Typically, formatters use * java.text.MessageFormat style formatting to format parameters, so * for example a format string "{0} {1}" would format two parameters @@ -131,10 +135,30 @@ import sun.reflect.Reflection; logger.log(Level.FINER, DiagnosisMessages::systemHealthStatus); *

            - * When mapping ResourceBundle names to ResourceBundles, the Logger - * will first try to use the Thread's ContextClassLoader. If that - * is null it will try the - * {@linkplain java.lang.ClassLoader#getSystemClassLoader() system ClassLoader} instead. + * When looking for a {@code ResourceBundle}, the logger will first look at + * whether a bundle was specified using {@link + * #setResourceBundle(java.util.ResourceBundle) setResourceBundle}, and then + * only whether a resource bundle name was specified through the {@link + * #getLogger(java.lang.String, java.lang.String) getLogger} factory method. + * If no {@code ResourceBundle} or no resource bundle name is found, + * then it will use the nearest {@code ResourceBundle} or resource bundle + * name inherited from its parent tree.
            + * When a {@code ResourceBundle} was inherited or specified through the + * {@link + * #setResourceBundle(java.util.ResourceBundle) setResourceBundle} method, then + * that {@code ResourceBundle} will be used. Otherwise if the logger only + * has or inherited a resource bundle name, then that resource bundle name + * will be mapped to a {@code ResourceBundle} object, using the default Locale + * at the time of logging. + *
            When mapping resource bundle names to + * {@code ResourceBundle} objects, the logger will first try to use the + * Thread's {@linkplain java.lang.Thread#getContextClassLoader() context class + * loader} to map the given resource bundle name to a {@code ResourceBundle}. + * If the thread context class loader is {@code null}, it will try the + * {@linkplain java.lang.ClassLoader#getSystemClassLoader() system class loader} + * instead. If the {@code ResourceBundle} is still not found, it will use the + * class loader of the first caller of the {@link + * #getLogger(java.lang.String, java.lang.String) getLogger} factory method. *

            * Formatting (including localization) is the responsibility of * the output Handler, which will typically call a Formatter. @@ -154,7 +178,7 @@ import sun.reflect.Reflection; *

          • * There are a set of "logrb" method (for "log with resource bundle") * that are like the "logp" method, but also take an explicit resource - * bundle name for use in localizing the log message. + * bundle object for use in localizing the log message. *

          • * There are convenience methods for tracing method entries (the * "entering" methods), method returns (the "exiting" methods) and @@ -198,18 +222,20 @@ public class Logger { private String name; private final CopyOnWriteArrayList handlers = new CopyOnWriteArrayList<>(); - private String resourceBundleName; + private String resourceBundleName; // Base name of the bundle. + private ResourceBundle userBundle; // Bundle set through setResourceBundle. private volatile boolean useParentHandlers = true; private volatile Filter filter; private boolean anonymous; + // Cache to speed up behavior of findResourceBundle: private ResourceBundle catalog; // Cached resource bundle private String catalogName; // name associated with catalog private Locale catalogLocale; // locale associated with catalog // The fields relating to parent-child relationships and levels // are managed under a separate lock, the treeLock. - private static Object treeLock = new Object(); + private static final Object treeLock = new Object(); // We keep weak references from parents to children, but strong // references from children to parents. private volatile Logger parent; // our nearest parent. @@ -372,6 +398,7 @@ public class Logger { static boolean disableCallerCheck = getBooleanProperty("sun.util.logging.disableCallerCheck"); private static boolean getBooleanProperty(final String key) { String s = AccessController.doPrivileged(new PrivilegedAction() { + @Override public String run() { return System.getProperty(key); } @@ -579,11 +606,18 @@ public class Logger { /** * Retrieve the localization resource bundle for this - * logger for the current default locale. Note that if - * the result is null, then the Logger will use a resource - * bundle inherited from its parent. + * logger. + * This method will return a {@code ResourceBundle} that was either + * set by the {@link + * #setResourceBundle(java.util.ResourceBundle) setResourceBundle} method or + * mapped from the + * the resource bundle name set via the {@link + * Logger#getLogger(java.lang.String, java.lang.String) getLogger} factory + * method for the current default locale. + *
            Note that if the result is {@code null}, then the Logger will use a resource + * bundle or resource bundle name inherited from its parent. * - * @return localization bundle (may be null) + * @return localization bundle (may be {@code null}) */ public ResourceBundle getResourceBundle() { return findResourceBundle(getResourceBundleName(), true); @@ -591,10 +625,16 @@ public class Logger { /** * Retrieve the localization resource bundle name for this - * logger. Note that if the result is null, then the Logger - * will use a resource bundle name inherited from its parent. + * logger. + * This is either the name specified through the {@link + * #getLogger(java.lang.String, java.lang.String) getLogger} factory method, + * or the {@linkplain ResourceBundle#getBaseBundleName() base name} of the + * ResourceBundle set through {@link + * #setResourceBundle(java.util.ResourceBundle) setResourceBundle} method. + *
            Note that if the result is {@code null}, then the Logger will use a resource + * bundle or resource bundle name inherited from its parent. * - * @return localization bundle name (may be null) + * @return localization bundle name (may be {@code null}) */ public String getResourceBundleName() { return resourceBundleName; @@ -665,10 +705,11 @@ public class Logger { // resource bundle and then call "void log(LogRecord)". private void doLog(LogRecord lr) { lr.setLoggerName(name); - String ebname = getEffectiveResourceBundleName(); - if (ebname != null && !ebname.equals(SYSTEM_LOGGER_RB_NAME)) { + final ResourceBundle bundle = getEffectiveResourceBundle(); + final String ebname = getEffectiveResourceBundleName(); + if (ebname != null && bundle != null) { lr.setResourceBundleName(ebname); - lr.setResourceBundle(findResourceBundle(ebname, true)); + lr.setResourceBundle(bundle); } log(lr); } @@ -1000,6 +1041,16 @@ public class Logger { log(lr); } + // Private support method for logging for "logrb" methods. + private void doLog(LogRecord lr, ResourceBundle rb) { + lr.setLoggerName(name); + if (rb != null) { + lr.setResourceBundleName(rb.getBaseBundleName()); + lr.setResourceBundle(rb); + } + log(lr); + } + /** * Log a message, specifying source class, method, and resource bundle name * with no arguments. @@ -1018,7 +1069,11 @@ public class Logger { * @param bundleName name of resource bundle to localize msg, * can be null * @param msg The string message (or a key in the message catalog) + * @deprecated Use {@link #logrb(java.util.logging.Level, java.lang.String, + * java.lang.String, java.util.ResourceBundle, java.lang.String, + * java.lang.Object...)} instead. */ + @Deprecated public void logrb(Level level, String sourceClass, String sourceMethod, String bundleName, String msg) { if (!isLoggable(level)) { @@ -1049,7 +1104,11 @@ public class Logger { * can be null * @param msg The string message (or a key in the message catalog) * @param param1 Parameter to the log message. + * @deprecated Use {@link #logrb(java.util.logging.Level, java.lang.String, + * java.lang.String, java.util.ResourceBundle, java.lang.String, + * java.lang.Object...)} instead */ + @Deprecated public void logrb(Level level, String sourceClass, String sourceMethod, String bundleName, String msg, Object param1) { if (!isLoggable(level)) { @@ -1082,7 +1141,11 @@ public class Logger { * can be null. * @param msg The string message (or a key in the message catalog) * @param params Array of parameters to the message + * @deprecated Use {@link #logrb(java.util.logging.Level, java.lang.String, + * java.lang.String, java.util.ResourceBundle, java.lang.String, + * java.lang.Object...)} instead. */ + @Deprecated public void logrb(Level level, String sourceClass, String sourceMethod, String bundleName, String msg, Object params[]) { if (!isLoggable(level)) { @@ -1095,6 +1158,41 @@ public class Logger { doLog(lr, bundleName); } + /** + * Log a message, specifying source class, method, and resource bundle, + * with an optional list of message parameters. + *

            + * If the logger is currently enabled for the given message + * level then a corresponding LogRecord is created and forwarded + * to all the registered output Handler objects. + *

            + * The {@code msg} string is localized using the given resource bundle. + * If the resource bundle is {@code null}, then the {@code msg} string is not + * localized. + *

            + * @param level One of the message level identifiers, e.g., SEVERE + * @param sourceClass Name of the class that issued the logging request + * @param sourceMethod Name of the method that issued the logging request + * @param bundle Resource bundle to localize {@code msg}, + * can be {@code null}. + * @param msg The string message (or a key in the message catalog) + * @param params Parameters to the message (optional, may be none). + * @since 1.8 + */ + public void logrb(Level level, String sourceClass, String sourceMethod, + ResourceBundle bundle, String msg, Object... params) { + if (!isLoggable(level)) { + return; + } + LogRecord lr = new LogRecord(level, msg); + lr.setSourceClassName(sourceClass); + lr.setSourceMethodName(sourceMethod); + if (params != null && params.length != 0) { + lr.setParameters(params); + } + doLog(lr, bundle); + } + /** * Log a message, specifying source class, method, and resource bundle name, * with associated Throwable information. @@ -1119,7 +1217,11 @@ public class Logger { * can be null * @param msg The string message (or a key in the message catalog) * @param thrown Throwable associated with log message. + * @deprecated Use {@link #logrb(java.util.logging.Level, java.lang.String, + * java.lang.String, java.util.ResourceBundle, java.lang.String, + * java.lang.Throwable)} instead. */ + @Deprecated public void logrb(Level level, String sourceClass, String sourceMethod, String bundleName, String msg, Throwable thrown) { if (!isLoggable(level)) { @@ -1132,6 +1234,43 @@ public class Logger { doLog(lr, bundleName); } + /** + * Log a message, specifying source class, method, and resource bundle, + * with associated Throwable information. + *

            + * If the logger is currently enabled for the given message + * level then the given arguments are stored in a LogRecord + * which is forwarded to all registered output handlers. + *

            + * The {@code msg} string is localized using the given resource bundle. + * If the resource bundle is {@code null}, then the {@code msg} string is not + * localized. + *

            + * Note that the thrown argument is stored in the LogRecord thrown + * property, rather than the LogRecord parameters property. Thus it is + * processed specially by output Formatters and is not treated + * as a formatting parameter to the LogRecord message property. + *

            + * @param level One of the message level identifiers, e.g., SEVERE + * @param sourceClass Name of the class that issued the logging request + * @param sourceMethod Name of the method that issued the logging request + * @param bundle Resource bundle to localize {@code msg}, + * can be {@code null} + * @param msg The string message (or a key in the message catalog) + * @param thrown Throwable associated with the log message. + * @since 1.8 + */ + public void logrb(Level level, String sourceClass, String sourceMethod, + ResourceBundle bundle, String msg, Throwable thrown) { + if (!isLoggable(level)) { + return; + } + LogRecord lr = new LogRecord(level, msg); + lr.setSourceClassName(sourceClass); + lr.setSourceMethodName(sourceMethod); + lr.setThrown(thrown); + doLog(lr, bundle); + } //====================================================================== // Start of convenience methods for logging method entries and returns. @@ -1610,6 +1749,7 @@ public class Logger { private static ResourceBundle findSystemResourceBundle(final Locale locale) { // the resource bundle is in a restricted package return AccessController.doPrivileged(new PrivilegedAction() { + @Override public ResourceBundle run() { try { return ResourceBundle.getBundle(SYSTEM_LOGGER_RB_NAME, @@ -1650,7 +1790,10 @@ public class Logger { Locale currentLocale = Locale.getDefault(); // Normally we should hit on our simple one entry cache. - if (catalog != null && currentLocale.equals(catalogLocale) + if (userBundle != null && + name.equals(resourceBundleName)) { + return userBundle; + } else if (catalog != null && currentLocale.equals(catalogLocale) && name.equals(catalogName)) { return catalog; } @@ -1737,6 +1880,45 @@ public class Logger { resourceBundleName = name; } + /** + * Sets a resource bundle on this logger. + * All messages will be logged using the given resource bundle for its + * specific {@linkplain ResourceBundle#getLocale locale}. + * @param bundle The resource bundle that this logger shall use. + * @throws NullPointerException if the given bundle is {@code null}. + * @throws IllegalArgumentException if the given bundle doesn't have a + * {@linkplain ResourceBundle#getBaseBundleName base name}, + * or if this logger already has a resource bundle set but + * the given bundle has a different base name. + * @throws SecurityException if a security manager exists and if + * the caller does not have LoggingPermission("control"). + * @since 1.8 + */ + public void setResourceBundle(ResourceBundle bundle) { + checkPermission(); + + // Will throw NPE if bundle is null. + final String baseName = bundle.getBaseBundleName(); + + // bundle must have a name + if (baseName == null || baseName.isEmpty()) { + throw new IllegalArgumentException("resource bundle must have a name"); + } + + synchronized (this) { + final boolean canReplaceResourceBundle = resourceBundleName == null + || resourceBundleName.equals(baseName); + + if (!canReplaceResourceBundle) { + throw new IllegalArgumentException("can't replace resource bundle"); + } + + + userBundle = bundle; + resourceBundleName = baseName; + } + } + /** * Return the parent for this Logger. *

            @@ -1813,7 +1995,7 @@ public class Logger { // we didn't have a previous parent ref = manager.new LoggerWeakRef(this); } - ref.setParentRef(new WeakReference(parent)); + ref.setParentRef(new WeakReference<>(parent)); parent.kids.add(ref); // As a result of the reparenting, the effective level @@ -1895,4 +2077,30 @@ public class Logger { } + private ResourceBundle getEffectiveResourceBundle() { + Logger target = this; + if (SYSTEM_LOGGER_RB_NAME.equals(resourceBundleName)) return null; + ResourceBundle localRB = getResourceBundle(); + if (localRB != null) { + return localRB; + } + + while (target != null) { + final ResourceBundle rb = target.userBundle; + if (rb != null) { + return rb; + } + final String rbn = target.getResourceBundleName(); + if (rbn != null) { + if (!SYSTEM_LOGGER_RB_NAME.equals(rbn)) { + return findResourceBundle(rbn, true); + } else { + return null; + } + } + target = target.getParent(); + } + return null; + } + } diff --git a/jdk/test/java/util/ResourceBundle/getBaseBundleName/TestGetBaseBundleName.java b/jdk/test/java/util/ResourceBundle/getBaseBundleName/TestGetBaseBundleName.java new file mode 100644 index 00000000000..aca4017c7d2 --- /dev/null +++ b/jdk/test/java/util/ResourceBundle/getBaseBundleName/TestGetBaseBundleName.java @@ -0,0 +1,144 @@ +/* + * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ +import java.util.Collections; +import java.util.Enumeration; +import java.util.Locale; +import java.util.MissingResourceException; +import java.util.PropertyResourceBundle; +import java.util.ResourceBundle; + +/** + * @test + * @bug 4814565 + * @summary tests ResourceBundle.getBaseBundleName(); + * @build TestGetBaseBundleName resources.ListBundle resources.ListBundle_fr + * @run main TestGetBaseBundleName + * @author danielfuchs + */ +public class TestGetBaseBundleName { + + final static String PROPERTY_BUNDLE_NAME = "resources/PropertyBundle"; + final static String LIST_BUNDLE_NAME = "resources.ListBundle"; + + public static String getBaseName(ResourceBundle bundle) { + return bundle == null ? null : bundle.getBaseBundleName(); + } + + public static void main(String... args) throws Exception { + + Locale defaultLocale = Locale.getDefault(); + System.out.println("Default locale is: " + defaultLocale); + for (String baseName : new String[] { + PROPERTY_BUNDLE_NAME, + LIST_BUNDLE_NAME + }) { + ResourceBundle bundle = ResourceBundle.getBundle(baseName); + System.out.println(getBaseName(bundle)); + if (!Locale.ROOT.equals(bundle.getLocale())) { + throw new RuntimeException("Unexpected locale: " + + bundle.getLocale()); + } + if (!baseName.equals(getBaseName(bundle))) { + throw new RuntimeException("Unexpected base name: " + + getBaseName(bundle)); + } + Locale.setDefault(Locale.FRENCH); + try { + ResourceBundle bundle_fr = ResourceBundle.getBundle(baseName); + if (!Locale.FRENCH.equals(bundle_fr.getLocale())) { + throw new RuntimeException("Unexpected locale: " + + bundle_fr.getLocale()); + } + if (!baseName.equals(getBaseName(bundle_fr))) { + throw new RuntimeException("Unexpected base name: " + + getBaseName(bundle_fr)); + } + } finally { + Locale.setDefault(defaultLocale); + } + } + + final ResourceBundle bundle = new ResourceBundle() { + @Override + protected Object handleGetObject(String key) { + if ("dummy".equals(key)) return "foo"; + throw new MissingResourceException("Missing key", + this.getClass().getName(), key); + } + @Override + public Enumeration getKeys() { + return Collections.enumeration(java.util.Arrays.asList( + new String[] {"dummy"})); + } + }; + + if (getBaseName(bundle) != null) { + throw new RuntimeException("Expected null baseName, got " + + getBaseName(bundle)); + } + + final ResourceBundle bundle2 = new ResourceBundle() { + @Override + protected Object handleGetObject(String key) { + if ("dummy".equals(key)) return "foo"; + throw new MissingResourceException("Missing key", + this.getClass().getName(), key); + } + @Override + public Enumeration getKeys() { + return Collections.enumeration(java.util.Arrays.asList( + new String[] {"dummy"})); + } + + @Override + public String getBaseBundleName() { + return this.getClass().getName(); + } + + + }; + + if (!bundle2.getClass().getName().equals(getBaseName(bundle2))) { + throw new RuntimeException("Expected " + + bundle2.getClass().getName() + ", got " + + getBaseName(bundle2)); + } + + ResourceBundle propertyBundle = new PropertyResourceBundle( + TestGetBaseBundleName.class.getResourceAsStream( + PROPERTY_BUNDLE_NAME+".properties")); + + if (getBaseName(propertyBundle) != null) { + throw new RuntimeException("Expected null baseName, got " + + getBaseName(propertyBundle)); + } + + ResourceBundle listBundle = new resources.ListBundle_fr(); + if (getBaseName(listBundle) != null) { + throw new RuntimeException("Expected null baseName, got " + + getBaseName(listBundle)); + } + + + } +} diff --git a/jdk/test/java/util/ResourceBundle/getBaseBundleName/resources/ListBundle.java b/jdk/test/java/util/ResourceBundle/getBaseBundleName/resources/ListBundle.java new file mode 100644 index 00000000000..121db291418 --- /dev/null +++ b/jdk/test/java/util/ResourceBundle/getBaseBundleName/resources/ListBundle.java @@ -0,0 +1,41 @@ +/* + * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ +package resources; + +import java.util.ListResourceBundle; + +/** + * + * @author danielfuchs + */ +public class ListBundle extends ListResourceBundle { + + @Override + protected Object[][] getContents() { + return new Object[][] { + { "dummy", "foo" }, + }; + + } + +} diff --git a/jdk/test/java/util/ResourceBundle/getBaseBundleName/resources/ListBundle_fr.java b/jdk/test/java/util/ResourceBundle/getBaseBundleName/resources/ListBundle_fr.java new file mode 100644 index 00000000000..b168bf7abeb --- /dev/null +++ b/jdk/test/java/util/ResourceBundle/getBaseBundleName/resources/ListBundle_fr.java @@ -0,0 +1,41 @@ +/* + * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ +package resources; + +import java.util.ListResourceBundle; + +/** + * + * @author danielfuchs + */ +public class ListBundle_fr extends ListResourceBundle { + + @Override + protected Object[][] getContents() { + return new Object[][] { + { "dummy", "toto" }, + }; + + } + +} diff --git a/jdk/test/java/util/ResourceBundle/getBaseBundleName/resources/PropertyBundle.properties b/jdk/test/java/util/ResourceBundle/getBaseBundleName/resources/PropertyBundle.properties new file mode 100644 index 00000000000..343c648257f --- /dev/null +++ b/jdk/test/java/util/ResourceBundle/getBaseBundleName/resources/PropertyBundle.properties @@ -0,0 +1,24 @@ +# +# Copyright (c) 20013, 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. +# +dummy=foo + diff --git a/jdk/test/java/util/ResourceBundle/getBaseBundleName/resources/PropertyBundle_fr.properties b/jdk/test/java/util/ResourceBundle/getBaseBundleName/resources/PropertyBundle_fr.properties new file mode 100644 index 00000000000..3120271049a --- /dev/null +++ b/jdk/test/java/util/ResourceBundle/getBaseBundleName/resources/PropertyBundle_fr.properties @@ -0,0 +1,24 @@ +# +# Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +# +# This code is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License version 2 only, as +# published by the Free Software Foundation. +# +# This code is distributed in the hope that it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +# version 2 for more details (a copy is included in the LICENSE file that +# accompanied this code). +# +# You should have received a copy of the GNU General Public License version +# 2 along with this work; if not, write to the Free Software Foundation, +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. +# +# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA +# or visit www.oracle.com if you need additional information or have any +# questions. +# +dummy=toto + diff --git a/jdk/test/java/util/logging/Logger/logrb/TestLogrbResourceBundle.java b/jdk/test/java/util/logging/Logger/logrb/TestLogrbResourceBundle.java new file mode 100644 index 00000000000..f47219492f2 --- /dev/null +++ b/jdk/test/java/util/logging/Logger/logrb/TestLogrbResourceBundle.java @@ -0,0 +1,381 @@ +/* + * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ +import java.util.Arrays; +import java.util.Locale; +import java.util.Objects; +import java.util.ResourceBundle; +import java.util.logging.Handler; +import java.util.logging.Level; +import java.util.logging.LogRecord; +import java.util.logging.Logger; +import resources.ListBundle; + +/** + * @test + * @bug 8013839 + * @summary tests Logger.logrb(..., ResourceBundle); + * @build TestLogrbResourceBundle resources.ListBundle resources.ListBundle_fr + * @run main TestLogrbResourceBundle + * @author danielfuchs + */ +public class TestLogrbResourceBundle { + + final static String LIST_BUNDLE_NAME = "resources.ListBundle"; + final static String PROPERTY_BUNDLE_NAME = "resources.PropertyBundle"; + + /** + * A dummy handler class that we can use to check the bundle/bundle name + * that was present in the last LogRecord instance published. + */ + static final class TestHandler extends Handler { + ResourceBundle lastBundle = null; + String lastBundleName = null; + Object[] lastParams = null; + Throwable lastThrown = null; + String lastMessage = null; + @Override + public void publish(LogRecord record) { + lastBundle = record.getResourceBundle(); + lastBundleName = record.getResourceBundleName(); + lastParams = record.getParameters(); + lastThrown = record.getThrown(); + lastMessage = record.getMessage(); + } + + @Override + public void flush() { + } + + @Override + public void close() throws SecurityException { + } + } + + /** + * We're going to do the same test with each of the different new logrb + * forms. + *

              + *
            • LOGRB_NO_ARGS: calling logrb with no message argument. + *
            • LOGRB_SINGLE_ARG: calling logrb with a single message argument. + *
            • LOGRB_ARG_ARRAY: calling logrb with an array of message arguments. + *
            • LOGRB_VARARGS: calling logrb with a variable list of message arguments. + *
            • LOGRB_THROWABLE: calling logrb with an exception. + *
            + */ + private static enum TestCase { + LOGRB_NO_ARGS, LOGRB_SINGLE_ARG, LOGRB_ARG_ARRAY, LOGRB_VARARGS, LOGRB_THROWABLE; + + public void logrb(Logger logger, ResourceBundle bundle) { + switch(this) { + case LOGRB_NO_ARGS: + logger.logrb(Level.CONFIG, + TestLogrbResourceBundle.class.getName(), + "main", bundle, "dummy"); + break; + case LOGRB_SINGLE_ARG: + logger.logrb(Level.CONFIG, + TestLogrbResourceBundle.class.getName(), + "main", bundle, "dummy", "bar"); + break; + case LOGRB_ARG_ARRAY: + logger.logrb(Level.CONFIG, + TestLogrbResourceBundle.class.getName(), + "main", bundle, "dummy", + new Object[] { "bar", "baz"} ); + break; + case LOGRB_VARARGS: + logger.logrb(Level.CONFIG, + TestLogrbResourceBundle.class.getName(), + "main", bundle, "dummy", + "bar", "baz" ); + break; + case LOGRB_THROWABLE: + logger.logrb(Level.CONFIG, + TestLogrbResourceBundle.class.getName(), + "main", bundle, "dummy", + new Exception("dummy exception") ); + break; + default: + } + } + + /** + * Checks that the last published logged record had the expected data. + * @param handler the TestHandler through which the record was published. + */ + public void checkLogged(TestHandler handler) { + checkLogged(handler.lastMessage, handler.lastParams, handler.lastThrown); + } + + private void checkLogged(String message, Object[] parameters, Throwable thrown) { + switch(this) { + case LOGRB_NO_ARGS: + if ("dummy".equals(message) && thrown == null + && (parameters == null || parameters.length == 0)) { + return; // OK: all was as expected. + } + break; + case LOGRB_SINGLE_ARG: + if ("dummy".equals(message) && thrown == null + && parameters != null + && parameters.length == 1 + && "bar".equals(parameters[0])) { + return; // OK: all was as expected. + } + break; + case LOGRB_VARARGS: + case LOGRB_ARG_ARRAY: + if ("dummy".equals(message) && thrown == null + && parameters != null + && parameters.length > 1 + && Arrays.deepEquals(new Object[] { "bar", "baz"}, + parameters)) { + return; // OK: all was as expected. + } + break; + case LOGRB_THROWABLE: + if ("dummy".equals(message) && thrown != null + && thrown.getClass() == Exception.class + && "dummy exception".equals(thrown.getMessage())) { + return; // OK: all was as expected. + } + break; + default: + } + + // We had some unexpected stuff: throw exception. + throw new RuntimeException(this + ": " + + "Unexpected content in last published log record: " + + "\n\tmessage=\"" + message + "\"" + + "\n\tparameters=" + Arrays.toString(parameters) + + "\n\tthrown=" + thrown); + } + } + + static String getBaseName(ResourceBundle bundle) { + return bundle == null ? null : bundle.getBaseBundleName(); + } + + public static void main(String... args) throws Exception { + + Locale defaultLocale = Locale.getDefault(); + + final ResourceBundle bundle = ResourceBundle.getBundle(LIST_BUNDLE_NAME); + final ResourceBundle bundle_fr = + ResourceBundle.getBundle(LIST_BUNDLE_NAME, Locale.FRENCH); + final ResourceBundle propertyBundle = ResourceBundle.getBundle(PROPERTY_BUNDLE_NAME); + final ResourceBundle propertyBundle_fr = + ResourceBundle.getBundle(PROPERTY_BUNDLE_NAME, Locale.FRENCH); + Logger foobar = Logger.getLogger("foo.bar"); + final TestHandler handler = new TestHandler(); + foobar.addHandler(handler); + foobar.setLevel(Level.CONFIG); + + final ResourceBundle anonBundle = new ListBundle(); + try { + // First we're going to call logrb on a logger that + // has no bundle set... + + // For each possible logrb form... + for (TestCase test : TestCase.values()) { + // For various resource bundles + for (ResourceBundle b : new ResourceBundle[] { + anonBundle, bundle, bundle_fr, propertyBundle, + anonBundle, null, propertyBundle_fr, + }) { + // Prints the resource bundle base name (can be null, + // we don't enforce non-null names in logrb. + final String baseName = getBaseName(b); + System.out.println("Testing " + test + " with " + baseName); + + // log in the 'foobar' logger using bundle 'b' + test.logrb(foobar, b); + + // check that the correct bundle was set in the published + // LogRecord + if (handler.lastBundle != b) { + throw new RuntimeException("Unexpected bundle: " + + handler.lastBundle); + } + + // check that the correct bundle name was set in the published + // LogRecord + if (!Objects.equals(handler.lastBundleName, baseName)) { + throw new RuntimeException("Unexpected bundle name: " + + handler.lastBundleName); + } + + // check that calling foobar.logrb() had no side effect on + // the bundle used by foobar. foobar should still have no + // bundle set. + if (foobar.getResourceBundle() != null) { + throw new RuntimeException("Unexpected bundle: " + + foobar.getResourceBundle()); + } + if (foobar.getResourceBundleName() != null) { + throw new RuntimeException("Unexpected bundle: " + + foobar.getResourceBundleName()); + } + + // Test that the last published log record had all the + // data that this test case had logged (message, parameters, + // thrown... + test.checkLogged(handler); + } + } + + // No we're going to set a resource bundle on the foobar logger + // and do it all again... + + // For the same bundle in two different locales + for (ResourceBundle propBundle : new ResourceBundle[] { + propertyBundle, propertyBundle_fr, + }) { + + // set the bundle on foobar... + foobar.setResourceBundle(propBundle); + + // check the bundle was correctly set... + if (!propBundle.equals(foobar.getResourceBundle())) { + throw new RuntimeException("Unexpected bundle: " + + foobar.getResourceBundle()); + } + if (!Objects.equals(getBaseName(propBundle), foobar.getResourceBundleName())) { + throw new RuntimeException("Unexpected bundle name: " + + foobar.getResourceBundleName()); + } + + System.out.println("Configuring " + foobar.getName() + " with " + + propBundle); + + // for each possible logrb form... + for (TestCase test : TestCase.values()) { + + // for various resource bundles + for (ResourceBundle b : new ResourceBundle[] { + anonBundle, bundle, null, bundle_fr, propertyBundle, + anonBundle, propertyBundle_fr, + }) { + + final String baseName = getBaseName(b); + System.out.println("Testing " + test + " with " + baseName); + + // call foobar.logrb + test.logrb(foobar, b); + + // check which resource bundle was used (should be + // the one passed to logrb) + if (handler.lastBundle != b) { + throw new RuntimeException("Unexpected bundle: " + + handler.lastBundle); + } + if (!Objects.equals(handler.lastBundleName, baseName)) { + throw new RuntimeException("Unexpected bundle name: " + + handler.lastBundleName); + } + + // Verify there was no side effect on the bundle that + // had been previously set on the logger... + if (foobar.getResourceBundle() != propBundle) { + throw new RuntimeException("Unexpected bundle: " + + foobar.getResourceBundle()); + } + if (!Objects.equals(getBaseName(propBundle), + foobar.getResourceBundleName())) { + throw new RuntimeException("Unexpected bundle name: " + + foobar.getResourceBundleName()); + } + + // Checked that the published LogRecord had the + // expected content logged by this test case. + test.checkLogged(handler); + } + } + } + + // Now we're going to the same thing, but with a logger which + // has an inherited resource bundle. + Logger foobaz = Logger.getLogger("foo.bar.baz"); + + // check that foobaz has no bundle set locally. + if (foobaz.getResourceBundle() != null) { + throw new RuntimeException("Unexpected bundle: " + + foobaz.getResourceBundle()); + } + if (foobaz.getResourceBundleName() != null) { + throw new RuntimeException("Unexpected bundle: " + + foobaz.getResourceBundle()); + } + + // The current locale should have no effect on logrb. + Locale.setDefault(Locale.GERMAN); // shouldn't change anything... + + // for each possible logrb form + for (TestCase test : TestCase.values()) { + + // for various resource bundle + for (ResourceBundle b : new ResourceBundle[] { + anonBundle, bundle, bundle_fr, propertyBundle, null, + anonBundle, propertyBundle_fr, + }) { + final String baseName = getBaseName(b); + System.out.println("Testing " + test + " with " + + foobaz.getName() + " and " + + baseName); + + // call foobaz.logrb with the bundle + test.logrb(foobaz, b); + + // check that the bundle passed to logrb was used. + if (handler.lastBundle != b) { + throw new RuntimeException("Unexpected bundle: " + + handler.lastBundle); + } + if (!Objects.equals(handler.lastBundleName, baseName)) { + throw new RuntimeException("Unexpected bundle name: " + + handler.lastBundleName); + } + + // check that there was no effect on the bundle set + // on foobaz: it should still be null. + if (foobaz.getResourceBundle() != null) { + throw new RuntimeException("Unexpected bundle: " + + foobaz.getResourceBundle()); + } + if (foobaz.getResourceBundleName() != null) { + throw new RuntimeException("Unexpected bundle: " + + foobaz.getResourceBundleName()); + } + + // check that the last published log record had all the + // data that was logged by this testcase. + test.checkLogged(handler); + } + } + + } finally { + Locale.setDefault(defaultLocale); + } + + } +} diff --git a/jdk/test/java/util/logging/Logger/logrb/resources/ListBundle.java b/jdk/test/java/util/logging/Logger/logrb/resources/ListBundle.java new file mode 100644 index 00000000000..121db291418 --- /dev/null +++ b/jdk/test/java/util/logging/Logger/logrb/resources/ListBundle.java @@ -0,0 +1,41 @@ +/* + * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ +package resources; + +import java.util.ListResourceBundle; + +/** + * + * @author danielfuchs + */ +public class ListBundle extends ListResourceBundle { + + @Override + protected Object[][] getContents() { + return new Object[][] { + { "dummy", "foo" }, + }; + + } + +} diff --git a/jdk/test/java/util/logging/Logger/logrb/resources/ListBundle_fr.java b/jdk/test/java/util/logging/Logger/logrb/resources/ListBundle_fr.java new file mode 100644 index 00000000000..b168bf7abeb --- /dev/null +++ b/jdk/test/java/util/logging/Logger/logrb/resources/ListBundle_fr.java @@ -0,0 +1,41 @@ +/* + * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ +package resources; + +import java.util.ListResourceBundle; + +/** + * + * @author danielfuchs + */ +public class ListBundle_fr extends ListResourceBundle { + + @Override + protected Object[][] getContents() { + return new Object[][] { + { "dummy", "toto" }, + }; + + } + +} diff --git a/jdk/test/java/util/logging/Logger/logrb/resources/PropertyBundle.properties b/jdk/test/java/util/logging/Logger/logrb/resources/PropertyBundle.properties new file mode 100644 index 00000000000..343c648257f --- /dev/null +++ b/jdk/test/java/util/logging/Logger/logrb/resources/PropertyBundle.properties @@ -0,0 +1,24 @@ +# +# Copyright (c) 20013, 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. +# +dummy=foo + diff --git a/jdk/test/java/util/logging/Logger/logrb/resources/PropertyBundle_fr.properties b/jdk/test/java/util/logging/Logger/logrb/resources/PropertyBundle_fr.properties new file mode 100644 index 00000000000..3120271049a --- /dev/null +++ b/jdk/test/java/util/logging/Logger/logrb/resources/PropertyBundle_fr.properties @@ -0,0 +1,24 @@ +# +# Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +# +# This code is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License version 2 only, as +# published by the Free Software Foundation. +# +# This code is distributed in the hope that it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +# version 2 for more details (a copy is included in the LICENSE file that +# accompanied this code). +# +# You should have received a copy of the GNU General Public License version +# 2 along with this work; if not, write to the Free Software Foundation, +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. +# +# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA +# or visit www.oracle.com if you need additional information or have any +# questions. +# +dummy=toto + diff --git a/jdk/test/java/util/logging/Logger/setResourceBundle/TestSetResourceBundle.java b/jdk/test/java/util/logging/Logger/setResourceBundle/TestSetResourceBundle.java new file mode 100644 index 00000000000..3ba69e7af49 --- /dev/null +++ b/jdk/test/java/util/logging/Logger/setResourceBundle/TestSetResourceBundle.java @@ -0,0 +1,393 @@ +/* + * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ +import java.security.AccessControlException; +import java.security.Permission; +import java.security.Permissions; +import java.security.Policy; +import java.security.ProtectionDomain; +import java.util.Locale; +import java.util.Objects; +import java.util.PropertyPermission; +import java.util.ResourceBundle; +import java.util.logging.Handler; +import java.util.logging.Level; +import java.util.logging.LogManager; +import java.util.logging.LogRecord; +import java.util.logging.Logger; +import java.util.logging.LoggingPermission; +import resources.ListBundle; + +/** + * @test + * @bug 8013839 + * @summary tests Logger.setResourceBundle; + * @build TestSetResourceBundle resources.ListBundle resources.ListBundle_fr + * @run main/othervm TestSetResourceBundle UNSECURE + * @run main/othervm TestSetResourceBundle PERMISSION + * @run main/othervm TestSetResourceBundle SECURE + * @author danielfuchs + */ +public class TestSetResourceBundle { + + final static String LIST_BUNDLE_NAME = "resources.ListBundle"; + final static String PROPERTY_BUNDLE_NAME = "resources.PropertyBundle"; + + /** + * A dummy handler class that we can use to check the bundle/bundle name + * that was present in the last LogRecord instance published. + */ + static final class TestHandler extends Handler { + ResourceBundle lastBundle = null; + String lastBundleName = null; + @Override + public void publish(LogRecord record) { + lastBundle = record.getResourceBundle(); + lastBundleName = record.getResourceBundleName(); + } + + @Override + public void flush() { + } + + @Override + public void close() throws SecurityException { + } + } + + /** + * We will test setResourceBundle() in 3 configurations. + * UNSECURE: No security manager. + * SECURE: With the security manager present - and the required + * LoggingPermission("control") granted. + * PERMISSION: With the security manager present - and the required + * LoggingPermission("control") *not* granted. Here we will + * test that the expected security permission is thrown. + */ + public static enum TestCase { + UNSECURE, SECURE, PERMISSION; + public void run(String name) throws Exception { + System.out.println("Running test case: " + name()); + switch (this) { + case UNSECURE: + testUnsecure(name); + break; + case SECURE: + testSecure(name); + break; + case PERMISSION: + testPermission(name); + break; + default: + throw new Error("Unknown test case: "+this); + } + } + public String loggerName(String name) { + return name().toLowerCase(Locale.ROOT) + "." + name; + } + } + + public static void main(String... args) throws Exception { + + Locale defaultLocale = Locale.getDefault(); + + if (args == null || args.length == 0) { + args = new String[] { + TestCase.UNSECURE.name(), + TestCase.SECURE.name() + }; + } + + for (String testName : args) { + TestCase test = TestCase.valueOf(testName); + try { + test.run(test.loggerName("foo.bar")); + } finally { + Locale.setDefault(defaultLocale); + } + } + } + + /** + * Test without security manager. + * @param loggerName The logger to use. + * @throws Exception if the test fails. + */ + public static void testUnsecure(String loggerName) throws Exception { + if (System.getSecurityManager() != null) { + throw new Error("Security manager is set"); + } + test(loggerName); + } + + /** + * Test with security manager. + * @param loggerName The logger to use. + * @throws Exception if the test fails. + */ + public static void testSecure(String loggerName) throws Exception { + if (System.getSecurityManager() != null) { + throw new Error("Security manager is already set"); + } + Policy.setPolicy(new SimplePolicy(TestCase.SECURE)); + System.setSecurityManager(new SecurityManager()); + test(loggerName); + } + + /** + * Test the LoggingPermission("control") is required. + * @param loggerName The logger to use. + */ + public static void testPermission(String loggerName) { + if (System.getSecurityManager() != null) { + throw new Error("Security manager is already set"); + } + Policy.setPolicy(new SimplePolicy(TestCase.PERMISSION)); + System.setSecurityManager(new SecurityManager()); + final ResourceBundle bundle = ResourceBundle.getBundle(LIST_BUNDLE_NAME); + Logger foobar = Logger.getLogger(loggerName); + try { + foobar.setResourceBundle(bundle); + throw new RuntimeException("Permission not checked!"); + } catch (AccessControlException x) { + if (x.getPermission() instanceof LoggingPermission) { + if ("control".equals(x.getPermission().getName())) { + System.out.println("Got expected exception: " + x); + return; + } + } + throw new RuntimeException("Unexpected exception: "+x, x); + } + + } + + static String getBaseName(ResourceBundle bundle) { + return bundle == null ? null : bundle.getBaseBundleName(); + } + + public static void test(String loggerName) throws Exception { + + final ResourceBundle bundle = ResourceBundle.getBundle(LIST_BUNDLE_NAME); + Logger foobar = Logger.getLogger(loggerName); + + // Checks that IAE is thrown if the bundle has a null base name. + try { + foobar.setResourceBundle(new ListBundle()); + throw new RuntimeException("Expected exception not raised!"); + } catch (IllegalArgumentException x) { + System.out.println("Got expected exception: " + x); + } + + // Verify that resource bundle was not set. + if (foobar.getResourceBundle() != null) { + throw new RuntimeException("Unexpected bundle: " + + foobar.getResourceBundle()); + } + if (foobar.getResourceBundleName() != null) { + throw new RuntimeException("Unexpected bundle: " + + foobar.getResourceBundleName()); + } + + // Set acceptable resource bundle on logger. + foobar.setResourceBundle(bundle); + + // check that the bundle has been set correctly + if (bundle != foobar.getResourceBundle()) { + throw new RuntimeException("Unexpected bundle: " + + foobar.getResourceBundle()); + } + if (!Objects.equals(getBaseName(bundle), foobar.getResourceBundleName())) { + throw new RuntimeException("Unexpected bundle name: " + + foobar.getResourceBundleName()); + } + + // Check that we can replace the bundle with a bundle of the same name. + final ResourceBundle bundle_fr = + ResourceBundle.getBundle(LIST_BUNDLE_NAME, Locale.FRENCH); + foobar.setResourceBundle(bundle_fr); + + if (bundle_fr != foobar.getResourceBundle()) { + throw new RuntimeException("Unexpected bundle: " + + foobar.getResourceBundle()); + } + if (!Objects.equals(getBaseName(bundle_fr), foobar.getResourceBundleName())) { + throw new RuntimeException("Unexpected bundle name: " + + foobar.getResourceBundleName()); + } + + // Create a child logger + Logger foobaz = Logger.getLogger(loggerName + ".baz"); + + // Check that the child logger does not have a bundle set locally + if (foobaz.getResourceBundle() != null) { + throw new RuntimeException("Unexpected bundle: " + + foobar.getResourceBundle()); + } + if (foobaz.getResourceBundleName() != null) { + throw new RuntimeException("Unexpected bundle: " + + foobar.getResourceBundleName()); + } + + + // Add a handler on the child logger. + final TestHandler handler = new TestHandler(); + foobaz.addHandler(handler); + + // log a message on the child logger + foobaz.severe("dummy"); + + // checks that the message has been logged with the bundle + // inherited from the parent logger + if (!LIST_BUNDLE_NAME.equals(handler.lastBundleName)) { + throw new RuntimeException("Unexpected bundle name: " + + handler.lastBundleName); + } + if (!bundle_fr.equals(handler.lastBundle)) { + throw new RuntimeException("Unexpected bundle: " + + handler.lastBundle); + } + + // Check that we can get set a bundle on the child logger + // using Logger.getLogger. + foobaz = Logger.getLogger(loggerName + ".baz", PROPERTY_BUNDLE_NAME); + + // check that the child logger has the correct bundle. + // it should no longer inherit it from its parent. + if (!PROPERTY_BUNDLE_NAME.equals(foobaz.getResourceBundleName())) { + throw new RuntimeException("Unexpected bundle name: " + + foobaz.getResourceBundleName()); + } + if (!PROPERTY_BUNDLE_NAME.equals(foobaz.getResourceBundle().getBaseBundleName())) { + throw new RuntimeException("Unexpected bundle name: " + + foobaz.getResourceBundle().getBaseBundleName()); + } + + // log a message on the child logger + foobaz.severe("dummy"); + + // check that the last published log record has the appropriate + // bundle. + if (!PROPERTY_BUNDLE_NAME.equals(handler.lastBundleName)) { + throw new RuntimeException("Unexpected bundle name: " + + handler.lastBundleName); + } + if (foobaz.getResourceBundle() != handler.lastBundle) { + throw new RuntimeException("Unexpected bundle: " + + handler.lastBundle); + } + + // try to set a bundle that has a different name, and checks that + // it fails in IAE. + try { + foobaz.setResourceBundle(bundle_fr); + throw new RuntimeException("Expected exception not raised!"); + } catch (IllegalArgumentException x) { + System.out.println("Got expected exception: " + x); + } + + // Test with a subclass of logger which overrides + // getResourceBundle() and getResourceBundleName() + Logger customLogger = new Logger(foobar.getName()+".bie", null) { + @Override + public ResourceBundle getResourceBundle() { + return bundle_fr; + } + + @Override + public String getResourceBundleName() { + return PROPERTY_BUNDLE_NAME; + } + }; + + final TestHandler handler2 = new TestHandler(); + customLogger.addHandler(handler2); + customLogger.setLevel(Level.FINE); + LogManager.getLogManager().addLogger(customLogger); + + Logger l = Logger.getLogger(customLogger.getName()); + if (l != customLogger) { + throw new RuntimeException("Wrong logger: " + l); + } + + // log on the custom logger. + customLogger.fine("dummy"); + + // check that the log record had the correct bundle. + if (! PROPERTY_BUNDLE_NAME.equals(handler2.lastBundleName)) { + throw new RuntimeException("Unexpected bundle name: " + + handler2.lastBundleName); + } + if (! PROPERTY_BUNDLE_NAME.equals(customLogger.getResourceBundleName())) { + throw new RuntimeException("Unexpected bundle name: " + + customLogger.getResourceBundleName()); + } + if (bundle_fr != handler2.lastBundle) { + throw new RuntimeException("Unexpected bundle: " + + handler2.lastBundle); + } + if (bundle_fr != customLogger.getResourceBundle()) { + throw new RuntimeException("Unexpected bundle: " + + customLogger.getResourceBundle()); + } + + // Do the same thing again with a child of the custom logger. + Logger biebar = Logger.getLogger(customLogger.getName() + ".bar"); + biebar.fine("dummy"); + + // because getResourceBundleName() is called on parent logger + // we will have handler2.lastBundleName = PROPERTY_BUNDLE_NAME + if (!PROPERTY_BUNDLE_NAME.equals(handler2.lastBundleName)) { + throw new RuntimeException("Unexpected bundle name: " + + handler2.lastBundleName); + } + // because getResourceBundle() is not called on parent logger + // we will have getBaseName(handler2.lastBundle) = PROPERTY_BUNDLE_NAME + // and not handler2.lastBundle = bundle_fr + if (handler2.lastBundle == null) { + throw new RuntimeException("Unexpected bundle: " + + handler2.lastBundle); + } + if (!PROPERTY_BUNDLE_NAME.equals(getBaseName(handler2.lastBundle))) { + throw new RuntimeException("Unexpected bundle name: " + + getBaseName(handler2.lastBundle)); + } + } + + public static class SimplePolicy extends Policy { + + final Permissions permissions; + public SimplePolicy(TestCase test) { + permissions = new Permissions(); + if (test != TestCase.PERMISSION) { + permissions.add(new LoggingPermission("control", null)); + } + // required for calling Locale.setDefault in the test. + permissions.add(new PropertyPermission("user.language", "write")); + } + + @Override + public boolean implies(ProtectionDomain domain, Permission permission) { + return permissions.implies(permission); + } + } + +} diff --git a/jdk/test/java/util/logging/Logger/setResourceBundle/resources/ListBundle.java b/jdk/test/java/util/logging/Logger/setResourceBundle/resources/ListBundle.java new file mode 100644 index 00000000000..121db291418 --- /dev/null +++ b/jdk/test/java/util/logging/Logger/setResourceBundle/resources/ListBundle.java @@ -0,0 +1,41 @@ +/* + * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ +package resources; + +import java.util.ListResourceBundle; + +/** + * + * @author danielfuchs + */ +public class ListBundle extends ListResourceBundle { + + @Override + protected Object[][] getContents() { + return new Object[][] { + { "dummy", "foo" }, + }; + + } + +} diff --git a/jdk/test/java/util/logging/Logger/setResourceBundle/resources/ListBundle_fr.java b/jdk/test/java/util/logging/Logger/setResourceBundle/resources/ListBundle_fr.java new file mode 100644 index 00000000000..b168bf7abeb --- /dev/null +++ b/jdk/test/java/util/logging/Logger/setResourceBundle/resources/ListBundle_fr.java @@ -0,0 +1,41 @@ +/* + * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ +package resources; + +import java.util.ListResourceBundle; + +/** + * + * @author danielfuchs + */ +public class ListBundle_fr extends ListResourceBundle { + + @Override + protected Object[][] getContents() { + return new Object[][] { + { "dummy", "toto" }, + }; + + } + +} diff --git a/jdk/test/java/util/logging/Logger/setResourceBundle/resources/PropertyBundle.properties b/jdk/test/java/util/logging/Logger/setResourceBundle/resources/PropertyBundle.properties new file mode 100644 index 00000000000..343c648257f --- /dev/null +++ b/jdk/test/java/util/logging/Logger/setResourceBundle/resources/PropertyBundle.properties @@ -0,0 +1,24 @@ +# +# Copyright (c) 20013, 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. +# +dummy=foo + diff --git a/jdk/test/java/util/logging/Logger/setResourceBundle/resources/PropertyBundle_fr.properties b/jdk/test/java/util/logging/Logger/setResourceBundle/resources/PropertyBundle_fr.properties new file mode 100644 index 00000000000..3120271049a --- /dev/null +++ b/jdk/test/java/util/logging/Logger/setResourceBundle/resources/PropertyBundle_fr.properties @@ -0,0 +1,24 @@ +# +# Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +# +# This code is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License version 2 only, as +# published by the Free Software Foundation. +# +# This code is distributed in the hope that it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +# version 2 for more details (a copy is included in the LICENSE file that +# accompanied this code). +# +# You should have received a copy of the GNU General Public License version +# 2 along with this work; if not, write to the Free Software Foundation, +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. +# +# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA +# or visit www.oracle.com if you need additional information or have any +# questions. +# +dummy=toto + From f1e20eb482631cdf2ecc580cd84f8ece0fe1feb0 Mon Sep 17 00:00:00 2001 From: Mike Duigou Date: Wed, 16 Oct 2013 13:03:58 -0700 Subject: [PATCH 125/131] 8025910: rename substream(long) -> skip and remove substream(long,long) Reviewed-by: psandoz, henryjen --- .../java/util/stream/DoublePipeline.java | 17 +-- .../java/util/stream/DoubleStream.java | 55 +++++--- .../classes/java/util/stream/IntPipeline.java | 23 +-- .../classes/java/util/stream/IntStream.java | 55 +++++--- .../java/util/stream/LongPipeline.java | 23 +-- .../classes/java/util/stream/LongStream.java | 55 +++++--- .../java/util/stream/ReferencePipeline.java | 23 +-- .../classes/java/util/stream/Stream.java | 55 +++++--- .../java/util/stream/SpinedBufferTest.java | 8 +- .../stream/InfiniteStreamWithLimitOpTest.java | 24 ++-- .../java/util/stream/IntSliceOpTest.java | 96 ++++++------- .../tests/java/util/stream/SliceOpTest.java | 131 +++++++++--------- 12 files changed, 264 insertions(+), 301 deletions(-) diff --git a/jdk/src/share/classes/java/util/stream/DoublePipeline.java b/jdk/src/share/classes/java/util/stream/DoublePipeline.java index 43b3d04bed9..6af346c56b1 100644 --- a/jdk/src/share/classes/java/util/stream/DoublePipeline.java +++ b/jdk/src/share/classes/java/util/stream/DoublePipeline.java @@ -340,24 +340,17 @@ abstract class DoublePipeline } @Override - public final DoubleStream substream(long startingOffset) { - if (startingOffset < 0) - throw new IllegalArgumentException(Long.toString(startingOffset)); - if (startingOffset == 0) + public final DoubleStream skip(long n) { + if (n < 0) + throw new IllegalArgumentException(Long.toString(n)); + if (n == 0) return this; else { long limit = -1; - return SliceOps.makeDouble(this, startingOffset, limit); + return SliceOps.makeDouble(this, n, limit); } } - @Override - public final DoubleStream substream(long startingOffset, long endingOffset) { - if (startingOffset < 0 || endingOffset < startingOffset) - throw new IllegalArgumentException(String.format("substream(%d, %d)", startingOffset, endingOffset)); - return SliceOps.makeDouble(this, startingOffset, endingOffset - startingOffset); - } - @Override public final DoubleStream sorted() { return SortedOps.makeDouble(this); diff --git a/jdk/src/share/classes/java/util/stream/DoubleStream.java b/jdk/src/share/classes/java/util/stream/DoubleStream.java index 02f1cdf025b..b50471d02da 100644 --- a/jdk/src/share/classes/java/util/stream/DoubleStream.java +++ b/jdk/src/share/classes/java/util/stream/DoubleStream.java @@ -289,6 +289,20 @@ public interface DoubleStream extends BaseStream { *

            This is a short-circuiting * stateful intermediate operation. * + * @apiNote + * While {@code limit()} is generally a cheap operation on sequential + * stream pipelines, it can be quite expensive on ordered parallel pipelines, + * especially for large values of {@code maxSize}, since {@code limit(n)} + * is constrained to return not just any n elements, but the + * first n elements in the encounter order. Using an unordered + * stream source (such as {@link #generate(DoubleSupplier)}) or removing the + * ordering constraint with {@link #unordered()} may result in significant + * speedups of {@code limit()} in parallel pipelines, if the semantics of + * your situation permit. If consistency with encounter order is required, + * and you are experiencing poor performance or memory utilization with + * {@code limit()} in parallel pipelines, switching to sequential execution + * with {@link #sequential()} may improve performance. + * * @param maxSize the number of elements the stream should be limited to * @return the new stream * @throws IllegalArgumentException if {@code maxSize} is negative @@ -297,37 +311,32 @@ public interface DoubleStream extends BaseStream { /** * Returns a stream consisting of the remaining elements of this stream - * after discarding the first {@code startInclusive} elements of the stream. - * If this stream contains fewer than {@code startInclusive} elements then an + * after discarding the first {@code n} elements of the stream. + * If this stream contains fewer than {@code n} elements then an * empty stream will be returned. * *

            This is a stateful * intermediate operation. * - * @param startInclusive the number of leading elements to skip - * @return the new stream - * @throws IllegalArgumentException if {@code startInclusive} is negative - */ - DoubleStream substream(long startInclusive); - - /** - * Returns a stream consisting of the remaining elements of this stream - * after discarding the first {@code startInclusive} elements and truncating - * the result to be no longer than {@code endExclusive - startInclusive} - * elements in length. If this stream contains fewer than - * {@code startInclusive} elements then an empty stream will be returned. + * @apiNote + * While {@code skip()} is generally a cheap operation on sequential + * stream pipelines, it can be quite expensive on ordered parallel pipelines, + * especially for large values of {@code n}, since {@code skip(n)} + * is constrained to skip not just any n elements, but the + * first n elements in the encounter order. Using an unordered + * stream source (such as {@link #generate(DoubleSupplier)}) or removing the + * ordering constraint with {@link #unordered()} may result in significant + * speedups of {@code skip()} in parallel pipelines, if the semantics of + * your situation permit. If consistency with encounter order is required, + * and you are experiencing poor performance or memory utilization with + * {@code skip()} in parallel pipelines, switching to sequential execution + * with {@link #sequential()} may improve performance. * - *

            This is a short-circuiting - * stateful intermediate operation. - * - * @param startInclusive the starting position of the substream, inclusive - * @param endExclusive the ending position of the substream, exclusive + * @param n the number of leading elements to skip * @return the new stream - * @throws IllegalArgumentException if {@code startInclusive} or - * {@code endExclusive} is negative or {@code startInclusive} is greater - * than {@code endExclusive} + * @throws IllegalArgumentException if {@code n} is negative */ - DoubleStream substream(long startInclusive, long endExclusive); + DoubleStream skip(long n); /** * Performs an action for each element of this stream. diff --git a/jdk/src/share/classes/java/util/stream/IntPipeline.java b/jdk/src/share/classes/java/util/stream/IntPipeline.java index 13f7e0a9731..94dfb7e6cd8 100644 --- a/jdk/src/share/classes/java/util/stream/IntPipeline.java +++ b/jdk/src/share/classes/java/util/stream/IntPipeline.java @@ -368,32 +368,21 @@ abstract class IntPipeline // Stateful intermediate ops from IntStream - private IntStream slice(long skip, long limit) { - return SliceOps.makeInt(this, skip, limit); - } - @Override public final IntStream limit(long maxSize) { if (maxSize < 0) throw new IllegalArgumentException(Long.toString(maxSize)); - return slice(0, maxSize); + return SliceOps.makeInt(this, 0, maxSize); } @Override - public final IntStream substream(long startingOffset) { - if (startingOffset < 0) - throw new IllegalArgumentException(Long.toString(startingOffset)); - if (startingOffset == 0) + public final IntStream skip(long n) { + if (n < 0) + throw new IllegalArgumentException(Long.toString(n)); + if (n == 0) return this; else - return slice(startingOffset, -1); - } - - @Override - public final IntStream substream(long startingOffset, long endingOffset) { - if (startingOffset < 0 || endingOffset < startingOffset) - throw new IllegalArgumentException(String.format("substream(%d, %d)", startingOffset, endingOffset)); - return slice(startingOffset, endingOffset - startingOffset); + return SliceOps.makeInt(this, n, -1); } @Override diff --git a/jdk/src/share/classes/java/util/stream/IntStream.java b/jdk/src/share/classes/java/util/stream/IntStream.java index 07f9ab5dc78..ae0eb4951d3 100644 --- a/jdk/src/share/classes/java/util/stream/IntStream.java +++ b/jdk/src/share/classes/java/util/stream/IntStream.java @@ -287,6 +287,20 @@ public interface IntStream extends BaseStream { *

            This is a short-circuiting * stateful intermediate operation. * + * @apiNote + * While {@code limit()} is generally a cheap operation on sequential + * stream pipelines, it can be quite expensive on ordered parallel pipelines, + * especially for large values of {@code maxSize}, since {@code limit(n)} + * is constrained to return not just any n elements, but the + * first n elements in the encounter order. Using an unordered + * stream source (such as {@link #generate(IntSupplier)}) or removing the + * ordering constraint with {@link #unordered()} may result in significant + * speedups of {@code limit()} in parallel pipelines, if the semantics of + * your situation permit. If consistency with encounter order is required, + * and you are experiencing poor performance or memory utilization with + * {@code limit()} in parallel pipelines, switching to sequential execution + * with {@link #sequential()} may improve performance. + * * @param maxSize the number of elements the stream should be limited to * @return the new stream * @throws IllegalArgumentException if {@code maxSize} is negative @@ -295,37 +309,32 @@ public interface IntStream extends BaseStream { /** * Returns a stream consisting of the remaining elements of this stream - * after discarding the first {@code startInclusive} elements of the stream. - * If this stream contains fewer than {@code startInclusive} elements then an + * after discarding the first {@code n} elements of the stream. + * If this stream contains fewer than {@code n} elements then an * empty stream will be returned. * *

            This is a stateful * intermediate operation. * - * @param startInclusive the number of leading elements to skip - * @return the new stream - * @throws IllegalArgumentException if {@code startInclusive} is negative - */ - IntStream substream(long startInclusive); - - /** - * Returns a stream consisting of the remaining elements of this stream - * after discarding the first {@code startInclusive} elements and truncating - * the result to be no longer than {@code endExclusive - startInclusive} - * elements in length. If this stream contains fewer than - * {@code startInclusive} elements then an empty stream will be returned. + * @apiNote + * While {@code skip()} is generally a cheap operation on sequential + * stream pipelines, it can be quite expensive on ordered parallel pipelines, + * especially for large values of {@code n}, since {@code skip(n)} + * is constrained to skip not just any n elements, but the + * first n elements in the encounter order. Using an unordered + * stream source (such as {@link #generate(IntSupplier)}) or removing the + * ordering constraint with {@link #unordered()} may result in significant + * speedups of {@code skip()} in parallel pipelines, if the semantics of + * your situation permit. If consistency with encounter order is required, + * and you are experiencing poor performance or memory utilization with + * {@code skip()} in parallel pipelines, switching to sequential execution + * with {@link #sequential()} may improve performance. * - *

            This is a short-circuiting - * stateful intermediate operation. - * - * @param startInclusive the starting position of the substream, inclusive - * @param endExclusive the ending position of the substream, exclusive + * @param n the number of leading elements to skip * @return the new stream - * @throws IllegalArgumentException if {@code startInclusive} or - * {@code endExclusive} is negative or {@code startInclusive} is greater - * than {@code endExclusive} + * @throws IllegalArgumentException if {@code n} is negative */ - IntStream substream(long startInclusive, long endExclusive); + IntStream skip(long n); /** * Performs an action for each element of this stream. diff --git a/jdk/src/share/classes/java/util/stream/LongPipeline.java b/jdk/src/share/classes/java/util/stream/LongPipeline.java index 5ed030e02a1..88e919e717c 100644 --- a/jdk/src/share/classes/java/util/stream/LongPipeline.java +++ b/jdk/src/share/classes/java/util/stream/LongPipeline.java @@ -349,32 +349,21 @@ abstract class LongPipeline // Stateful intermediate ops from LongStream - private LongStream slice(long skip, long limit) { - return SliceOps.makeLong(this, skip, limit); - } - @Override public final LongStream limit(long maxSize) { if (maxSize < 0) throw new IllegalArgumentException(Long.toString(maxSize)); - return slice(0, maxSize); + return SliceOps.makeLong(this, 0, maxSize); } @Override - public final LongStream substream(long startingOffset) { - if (startingOffset < 0) - throw new IllegalArgumentException(Long.toString(startingOffset)); - if (startingOffset == 0) + public final LongStream skip(long n) { + if (n < 0) + throw new IllegalArgumentException(Long.toString(n)); + if (n == 0) return this; else - return slice(startingOffset, -1); - } - - @Override - public final LongStream substream(long startingOffset, long endingOffset) { - if (startingOffset < 0 || endingOffset < startingOffset) - throw new IllegalArgumentException(String.format("substream(%d, %d)", startingOffset, endingOffset)); - return slice(startingOffset, endingOffset - startingOffset); + return SliceOps.makeLong(this, n, -1); } @Override diff --git a/jdk/src/share/classes/java/util/stream/LongStream.java b/jdk/src/share/classes/java/util/stream/LongStream.java index ca61d2f200e..0b8fb157fb1 100644 --- a/jdk/src/share/classes/java/util/stream/LongStream.java +++ b/jdk/src/share/classes/java/util/stream/LongStream.java @@ -287,6 +287,20 @@ public interface LongStream extends BaseStream { *

            This is a short-circuiting * stateful intermediate operation. * + * @apiNote + * While {@code limit()} is generally a cheap operation on sequential + * stream pipelines, it can be quite expensive on ordered parallel pipelines, + * especially for large values of {@code maxSize}, since {@code limit(n)} + * is constrained to return not just any n elements, but the + * first n elements in the encounter order. Using an unordered + * stream source (such as {@link #generate(LongSupplier)}) or removing the + * ordering constraint with {@link #unordered()} may result in significant + * speedups of {@code limit()} in parallel pipelines, if the semantics of + * your situation permit. If consistency with encounter order is required, + * and you are experiencing poor performance or memory utilization with + * {@code limit()} in parallel pipelines, switching to sequential execution + * with {@link #sequential()} may improve performance. + * * @param maxSize the number of elements the stream should be limited to * @return the new stream * @throws IllegalArgumentException if {@code maxSize} is negative @@ -295,37 +309,32 @@ public interface LongStream extends BaseStream { /** * Returns a stream consisting of the remaining elements of this stream - * after discarding the first {@code startInclusive} elements of the stream. - * If this stream contains fewer than {@code startInclusive} elements then an + * after discarding the first {@code n} elements of the stream. + * If this stream contains fewer than {@code n} elements then an * empty stream will be returned. * *

            This is a stateful * intermediate operation. * - * @param startInclusive the number of leading elements to skip - * @return the new stream - * @throws IllegalArgumentException if {@code startInclusive} is negative - */ - LongStream substream(long startInclusive); - - /** - * Returns a stream consisting of the remaining elements of this stream - * after discarding the first {@code startInclusive} elements and truncating - * the result to be no longer than {@code endExclusive - startInclusive} - * elements in length. If this stream contains fewer than - * {@code startInclusive} elements then an empty stream will be returned. + * @apiNote + * While {@code skip()} is generally a cheap operation on sequential + * stream pipelines, it can be quite expensive on ordered parallel pipelines, + * especially for large values of {@code n}, since {@code skip(n)} + * is constrained to skip not just any n elements, but the + * first n elements in the encounter order. Using an unordered + * stream source (such as {@link #generate(LongSupplier)}) or removing the + * ordering constraint with {@link #unordered()} may result in significant + * speedups of {@code skip()} in parallel pipelines, if the semantics of + * your situation permit. If consistency with encounter order is required, + * and you are experiencing poor performance or memory utilization with + * {@code skip()} in parallel pipelines, switching to sequential execution + * with {@link #sequential()} may improve performance. * - *

            This is a short-circuiting - * stateful intermediate operation. - * - * @param startInclusive the starting position of the substream, inclusive - * @param endExclusive the ending position of the substream, exclusive + * @param n the number of leading elements to skip * @return the new stream - * @throws IllegalArgumentException if {@code startInclusive} or - * {@code endExclusive} is negative or {@code startInclusive} is greater - * than {@code endExclusive} + * @throws IllegalArgumentException if {@code n} is negative */ - LongStream substream(long startInclusive, long endExclusive); + LongStream skip(long n); /** * Performs an action for each element of this stream. diff --git a/jdk/src/share/classes/java/util/stream/ReferencePipeline.java b/jdk/src/share/classes/java/util/stream/ReferencePipeline.java index 0efd978f21c..8f5da0e55e7 100644 --- a/jdk/src/share/classes/java/util/stream/ReferencePipeline.java +++ b/jdk/src/share/classes/java/util/stream/ReferencePipeline.java @@ -394,32 +394,21 @@ abstract class ReferencePipeline return SortedOps.makeRef(this, comparator); } - private Stream slice(long skip, long limit) { - return SliceOps.makeRef(this, skip, limit); - } - @Override public final Stream limit(long maxSize) { if (maxSize < 0) throw new IllegalArgumentException(Long.toString(maxSize)); - return slice(0, maxSize); + return SliceOps.makeRef(this, 0, maxSize); } @Override - public final Stream substream(long startingOffset) { - if (startingOffset < 0) - throw new IllegalArgumentException(Long.toString(startingOffset)); - if (startingOffset == 0) + public final Stream skip(long n) { + if (n < 0) + throw new IllegalArgumentException(Long.toString(n)); + if (n == 0) return this; else - return slice(startingOffset, -1); - } - - @Override - public final Stream substream(long startingOffset, long endingOffset) { - if (startingOffset < 0 || endingOffset < startingOffset) - throw new IllegalArgumentException(String.format("substream(%d, %d)", startingOffset, endingOffset)); - return slice(startingOffset, endingOffset - startingOffset); + return SliceOps.makeRef(this, n, -1); } // Terminal operations from Stream diff --git a/jdk/src/share/classes/java/util/stream/Stream.java b/jdk/src/share/classes/java/util/stream/Stream.java index a48d59d39d9..1961359d9b5 100644 --- a/jdk/src/share/classes/java/util/stream/Stream.java +++ b/jdk/src/share/classes/java/util/stream/Stream.java @@ -365,6 +365,20 @@ public interface Stream extends BaseStream> { *

            This is a short-circuiting * stateful intermediate operation. * + * @apiNote + * While {@code limit()} is generally a cheap operation on sequential + * stream pipelines, it can be quite expensive on ordered parallel pipelines, + * especially for large values of {@code maxSize}, since {@code limit(n)} + * is constrained to return not just any n elements, but the + * first n elements in the encounter order. Using an unordered + * stream source (such as {@link #generate(Supplier)}) or removing the + * ordering constraint with {@link #unordered()} may result in significant + * speedups of {@code limit()} in parallel pipelines, if the semantics of + * your situation permit. If consistency with encounter order is required, + * and you are experiencing poor performance or memory utilization with + * {@code limit()} in parallel pipelines, switching to sequential execution + * with {@link #sequential()} may improve performance. + * * @param maxSize the number of elements the stream should be limited to * @return the new stream * @throws IllegalArgumentException if {@code maxSize} is negative @@ -373,37 +387,32 @@ public interface Stream extends BaseStream> { /** * Returns a stream consisting of the remaining elements of this stream - * after discarding the first {@code startInclusive} elements of the stream. - * If this stream contains fewer than {@code startInclusive} elements then an + * after discarding the first {@code n} elements of the stream. + * If this stream contains fewer than {@code n} elements then an * empty stream will be returned. * *

            This is a stateful * intermediate operation. * - * @param startInclusive the number of leading elements to skip - * @return the new stream - * @throws IllegalArgumentException if {@code startInclusive} is negative - */ - Stream substream(long startInclusive); - - /** - * Returns a stream consisting of the remaining elements of this stream - * after discarding the first {@code startInclusive} elements and truncating - * the result to be no longer than {@code endExclusive - startInclusive} - * elements in length. If this stream contains fewer than - * {@code startInclusive} elements then an empty stream will be returned. + * @apiNote + * While {@code skip()} is generally a cheap operation on sequential + * stream pipelines, it can be quite expensive on ordered parallel pipelines, + * especially for large values of {@code n}, since {@code skip(n)} + * is constrained to skip not just any n elements, but the + * first n elements in the encounter order. Using an unordered + * stream source (such as {@link #generate(Supplier)}) or removing the + * ordering constraint with {@link #unordered()} may result in significant + * speedups of {@code skip()} in parallel pipelines, if the semantics of + * your situation permit. If consistency with encounter order is required, + * and you are experiencing poor performance or memory utilization with + * {@code skip()} in parallel pipelines, switching to sequential execution + * with {@link #sequential()} may improve performance. * - *

            This is a short-circuiting - * stateful intermediate operation. - * - * @param startInclusive the starting position of the substream, inclusive - * @param endExclusive the ending position of the substream, exclusive + * @param n the number of leading elements to skip * @return the new stream - * @throws IllegalArgumentException if {@code startInclusive} or - * {@code endExclusive} is negative or {@code startInclusive} is greater - * than {@code endExclusive} + * @throws IllegalArgumentException if {@code n} is negative */ - Stream substream(long startInclusive, long endExclusive); + Stream skip(long n); /** * Performs an action for each element of this stream. diff --git a/jdk/test/java/util/stream/boottest/java/util/stream/SpinedBufferTest.java b/jdk/test/java/util/stream/boottest/java/util/stream/SpinedBufferTest.java index 8f9c4ffd886..26a62cab6ba 100644 --- a/jdk/test/java/util/stream/boottest/java/util/stream/SpinedBufferTest.java +++ b/jdk/test/java/util/stream/boottest/java/util/stream/SpinedBufferTest.java @@ -109,7 +109,7 @@ public class SpinedBufferTest { List end = Arrays.stream(array) .boxed() - .substream(array.length - lastSplitSize) + .skip(array.length - lastSplitSize) .collect(Collectors.toList()); assertEquals(contentOfLastSplit, end); } @@ -184,7 +184,7 @@ public class SpinedBufferTest { List end = Arrays.stream(array) .boxed() - .substream(array.length - lastSplitSize) + .skip(array.length - lastSplitSize) .collect(Collectors.toList()); assertEquals(contentOfLastSplit, end); } @@ -259,7 +259,7 @@ public class SpinedBufferTest { List end = Arrays.stream(array) .boxed() - .substream(array.length - lastSplitSize) + .skip(array.length - lastSplitSize) .collect(Collectors.toList()); assertEquals(contentOfLastSplit, end); } @@ -335,7 +335,7 @@ public class SpinedBufferTest { List end = Arrays.stream(array) .boxed() - .substream(array.length - lastSplitSize) + .skip(array.length - lastSplitSize) .collect(Collectors.toList()); assertEquals(contentOfLastSplit, end); } diff --git a/jdk/test/java/util/stream/test/org/openjdk/tests/java/util/stream/InfiniteStreamWithLimitOpTest.java b/jdk/test/java/util/stream/test/org/openjdk/tests/java/util/stream/InfiniteStreamWithLimitOpTest.java index 0915839415c..e082e9df7ad 100644 --- a/jdk/test/java/util/stream/test/org/openjdk/tests/java/util/stream/InfiniteStreamWithLimitOpTest.java +++ b/jdk/test/java/util/stream/test/org/openjdk/tests/java/util/stream/InfiniteStreamWithLimitOpTest.java @@ -63,10 +63,8 @@ public class InfiniteStreamWithLimitOpTest extends OpTestCase { data.add(new Object[]{f.apply("Stream.limit(%d)"), (UnaryOperator) s -> s.limit(SKIP_LIMIT_SIZE)}); - data.add(new Object[]{f.apply("Stream.substream(%d)"), - (UnaryOperator) s -> s.substream(SKIP_LIMIT_SIZE, SKIP_LIMIT_SIZE * 2)}); - data.add(new Object[]{f.apply("Stream.substream(%1$d).limit(%1$d)"), - (UnaryOperator) s -> s.substream(SKIP_LIMIT_SIZE).limit(SKIP_LIMIT_SIZE)}); + data.add(new Object[]{f.apply("Stream.skip(%1$d).limit(%1$d)"), + (UnaryOperator) s -> s.skip(SKIP_LIMIT_SIZE).limit(SKIP_LIMIT_SIZE)}); return data.toArray(new Object[0][]); } @@ -79,10 +77,8 @@ public class InfiniteStreamWithLimitOpTest extends OpTestCase { data.add(new Object[]{f.apply("IntStream.limit(%d)"), (UnaryOperator) s -> s.limit(SKIP_LIMIT_SIZE)}); - data.add(new Object[]{f.apply("IntStream.substream(%d)"), - (UnaryOperator) s -> s.substream(SKIP_LIMIT_SIZE, SKIP_LIMIT_SIZE * 2)}); - data.add(new Object[]{f.apply("IntStream.substream(%1$d).limit(%1$d)"), - (UnaryOperator) s -> s.substream(SKIP_LIMIT_SIZE).limit(SKIP_LIMIT_SIZE)}); + data.add(new Object[]{f.apply("IntStream.skip(%1$d).limit(%1$d)"), + (UnaryOperator) s -> s.skip(SKIP_LIMIT_SIZE).limit(SKIP_LIMIT_SIZE)}); return data.toArray(new Object[0][]); } @@ -95,10 +91,8 @@ public class InfiniteStreamWithLimitOpTest extends OpTestCase { data.add(new Object[]{f.apply("LongStream.limit(%d)"), (UnaryOperator) s -> s.limit(SKIP_LIMIT_SIZE)}); - data.add(new Object[]{f.apply("LongStream.substream(%d)"), - (UnaryOperator) s -> s.substream(SKIP_LIMIT_SIZE, SKIP_LIMIT_SIZE * 2)}); - data.add(new Object[]{f.apply("LongStream.substream(%1$d).limit(%1$d)"), - (UnaryOperator) s -> s.substream(SKIP_LIMIT_SIZE).limit(SKIP_LIMIT_SIZE)}); + data.add(new Object[]{f.apply("LongStream.skip(%1$d).limit(%1$d)"), + (UnaryOperator) s -> s.skip(SKIP_LIMIT_SIZE).limit(SKIP_LIMIT_SIZE)}); return data.toArray(new Object[0][]); } @@ -111,10 +105,8 @@ public class InfiniteStreamWithLimitOpTest extends OpTestCase { data.add(new Object[]{f.apply("DoubleStream.limit(%d)"), (UnaryOperator) s -> s.limit(SKIP_LIMIT_SIZE)}); - data.add(new Object[]{f.apply("DoubleStream.substream(%d)"), - (UnaryOperator) s -> s.substream(SKIP_LIMIT_SIZE, SKIP_LIMIT_SIZE * 2)}); - data.add(new Object[]{f.apply("DoubleStream.substream(%1$d).limit(%1$d)"), - (UnaryOperator) s -> s.substream(SKIP_LIMIT_SIZE).limit(SKIP_LIMIT_SIZE)}); + data.add(new Object[]{f.apply("DoubleStream.skip(%1$d).limit(%1$d)"), + (UnaryOperator) s -> s.skip(SKIP_LIMIT_SIZE).limit(SKIP_LIMIT_SIZE)}); return data.toArray(new Object[0][]); } diff --git a/jdk/test/java/util/stream/test/org/openjdk/tests/java/util/stream/IntSliceOpTest.java b/jdk/test/java/util/stream/test/org/openjdk/tests/java/util/stream/IntSliceOpTest.java index 0d74f487325..51d1362dabd 100644 --- a/jdk/test/java/util/stream/test/org/openjdk/tests/java/util/stream/IntSliceOpTest.java +++ b/jdk/test/java/util/stream/test/org/openjdk/tests/java/util/stream/IntSliceOpTest.java @@ -44,27 +44,27 @@ public class IntSliceOpTest extends OpTestCase { private static final int[] EMPTY_INT_ARRAY = new int[0]; public void testSkip() { - assertCountSum(IntStream.range(0, 0).substream(0).boxed(), 0, 0); - assertCountSum(IntStream.range(0, 0).substream(4).boxed(), 0, 0); - assertCountSum(IntStream.range(1, 5).substream(4).boxed(), 0, 0); - assertCountSum(IntStream.range(1, 5).substream(2).boxed(), 2, 7); - assertCountSum(IntStream.range(1, 5).substream(0).boxed(), 4, 10); + assertCountSum(IntStream.range(0, 0).skip(0).boxed(), 0, 0); + assertCountSum(IntStream.range(0, 0).skip(4).boxed(), 0, 0); + assertCountSum(IntStream.range(1, 5).skip(4).boxed(), 0, 0); + assertCountSum(IntStream.range(1, 5).skip(2).boxed(), 2, 7); + assertCountSum(IntStream.range(1, 5).skip(0).boxed(), 4, 10); - assertCountSum(IntStream.range(0, 0).parallel().substream(0).boxed(), 0, 0); - assertCountSum(IntStream.range(0, 0).parallel().substream(4).boxed(), 0, 0); - assertCountSum(IntStream.range(1, 5).parallel().substream(4).boxed(), 0, 0); - assertCountSum(IntStream.range(1, 5).parallel().substream(2).boxed(), 2, 7); - assertCountSum(IntStream.range(1, 5).parallel().substream(0).boxed(), 4, 10); + assertCountSum(IntStream.range(0, 0).parallel().skip(0).boxed(), 0, 0); + assertCountSum(IntStream.range(0, 0).parallel().skip(4).boxed(), 0, 0); + assertCountSum(IntStream.range(1, 5).parallel().skip(4).boxed(), 0, 0); + assertCountSum(IntStream.range(1, 5).parallel().skip(2).boxed(), 2, 7); + assertCountSum(IntStream.range(1, 5).parallel().skip(0).boxed(), 4, 10); - exerciseOps(EMPTY_INT_ARRAY, s -> s.substream(0), EMPTY_INT_ARRAY); - exerciseOps(EMPTY_INT_ARRAY, s -> s.substream(10), EMPTY_INT_ARRAY); + exerciseOps(EMPTY_INT_ARRAY, s -> s.skip(0), EMPTY_INT_ARRAY); + exerciseOps(EMPTY_INT_ARRAY, s -> s.skip(10), EMPTY_INT_ARRAY); - exerciseOps(IntStream.range(1, 2).toArray(), s -> s.substream(0), IntStream.range(1, 2).toArray()); - exerciseOps(IntStream.range(1, 2).toArray(), s -> s.substream(1), EMPTY_INT_ARRAY); - exerciseOps(IntStream.range(1, 101).toArray(), s -> s.substream(0), IntStream.range(1, 101).toArray()); - exerciseOps(IntStream.range(1, 101).toArray(), s -> s.substream(10), IntStream.range(11, 101).toArray()); - exerciseOps(IntStream.range(1, 101).toArray(), s -> s.substream(100), EMPTY_INT_ARRAY); - exerciseOps(IntStream.range(1, 101).toArray(), s -> s.substream(200), EMPTY_INT_ARRAY); + exerciseOps(IntStream.range(1, 2).toArray(), s -> s.skip(0), IntStream.range(1, 2).toArray()); + exerciseOps(IntStream.range(1, 2).toArray(), s -> s.skip(1), EMPTY_INT_ARRAY); + exerciseOps(IntStream.range(1, 101).toArray(), s -> s.skip(0), IntStream.range(1, 101).toArray()); + exerciseOps(IntStream.range(1, 101).toArray(), s -> s.skip(10), IntStream.range(11, 101).toArray()); + exerciseOps(IntStream.range(1, 101).toArray(), s -> s.skip(100), EMPTY_INT_ARRAY); + exerciseOps(IntStream.range(1, 101).toArray(), s -> s.skip(200), EMPTY_INT_ARRAY); } public void testLimit() { @@ -92,41 +92,23 @@ public class IntSliceOpTest extends OpTestCase { } public void testSkipLimit() { - exerciseOps(EMPTY_INT_ARRAY, s -> s.substream(0).limit(0), EMPTY_INT_ARRAY); - exerciseOps(EMPTY_INT_ARRAY, s -> s.substream(0).limit(10), EMPTY_INT_ARRAY); - exerciseOps(EMPTY_INT_ARRAY, s -> s.substream(10).limit(0), EMPTY_INT_ARRAY); - exerciseOps(EMPTY_INT_ARRAY, s -> s.substream(10).limit(10), EMPTY_INT_ARRAY); + exerciseOps(EMPTY_INT_ARRAY, s -> s.skip(0).limit(0), EMPTY_INT_ARRAY); + exerciseOps(EMPTY_INT_ARRAY, s -> s.skip(0).limit(10), EMPTY_INT_ARRAY); + exerciseOps(EMPTY_INT_ARRAY, s -> s.skip(10).limit(0), EMPTY_INT_ARRAY); + exerciseOps(EMPTY_INT_ARRAY, s -> s.skip(10).limit(10), EMPTY_INT_ARRAY); - exerciseOps(IntStream.range(1, 101).toArray(), s -> s.substream(0).limit(100), IntStream.range(1, 101).toArray()); - exerciseOps(IntStream.range(1, 101).toArray(), s -> s.substream(0).limit(10), IntStream.range(1, 11).toArray()); - exerciseOps(IntStream.range(1, 101).toArray(), s -> s.substream(0).limit(0), EMPTY_INT_ARRAY); - exerciseOps(IntStream.range(1, 101).toArray(), s -> s.substream(10).limit(100), IntStream.range(11, 101).toArray()); - exerciseOps(IntStream.range(1, 101).toArray(), s -> s.substream(10).limit(10), IntStream.range(11, 21).toArray()); - exerciseOps(IntStream.range(1, 101).toArray(), s -> s.substream(10).limit(0), EMPTY_INT_ARRAY); - exerciseOps(IntStream.range(1, 101).toArray(), s -> s.substream(100).limit(100), EMPTY_INT_ARRAY); - exerciseOps(IntStream.range(1, 101).toArray(), s -> s.substream(100).limit(10), EMPTY_INT_ARRAY); - exerciseOps(IntStream.range(1, 101).toArray(), s -> s.substream(100).limit(0), EMPTY_INT_ARRAY); - exerciseOps(IntStream.range(1, 101).toArray(), s -> s.substream(200).limit(100), EMPTY_INT_ARRAY); - exerciseOps(IntStream.range(1, 101).toArray(), s -> s.substream(200).limit(10), EMPTY_INT_ARRAY); - exerciseOps(IntStream.range(1, 101).toArray(), s -> s.substream(200).limit(0), EMPTY_INT_ARRAY); - } - - public void testSlice() { - exerciseOps(EMPTY_INT_ARRAY, s -> s.substream(0, 0), EMPTY_INT_ARRAY); - exerciseOps(EMPTY_INT_ARRAY, s -> s.substream(10, 10), EMPTY_INT_ARRAY); - - exerciseOps(IntStream.range(1, 101).toArray(), s -> s.substream(0, 100), IntStream.range(1, 101).toArray()); - exerciseOps(IntStream.range(1, 101).toArray(), s -> s.substream(0, 10), IntStream.range(1, 11).toArray()); - exerciseOps(IntStream.range(1, 101).toArray(), s -> s.substream(0, 0), EMPTY_INT_ARRAY); - exerciseOps(IntStream.range(1, 101).toArray(), s -> s.substream(10, 110), IntStream.range(11, 101).toArray()); - exerciseOps(IntStream.range(1, 101).toArray(), s -> s.substream(10, 20), IntStream.range(11, 21).toArray()); - exerciseOps(IntStream.range(1, 101).toArray(), s -> s.substream(10, 10), EMPTY_INT_ARRAY); - exerciseOps(IntStream.range(1, 101).toArray(), s -> s.substream(100, 200), EMPTY_INT_ARRAY); - exerciseOps(IntStream.range(1, 101).toArray(), s -> s.substream(100, 110), EMPTY_INT_ARRAY); - exerciseOps(IntStream.range(1, 101).toArray(), s -> s.substream(100, 100), EMPTY_INT_ARRAY); - exerciseOps(IntStream.range(1, 101).toArray(), s -> s.substream(200, 300), EMPTY_INT_ARRAY); - exerciseOps(IntStream.range(1, 101).toArray(), s -> s.substream(200, 210), EMPTY_INT_ARRAY); - exerciseOps(IntStream.range(1, 101).toArray(), s -> s.substream(200, 200), EMPTY_INT_ARRAY); + exerciseOps(IntStream.range(1, 101).toArray(), s -> s.skip(0).limit(100), IntStream.range(1, 101).toArray()); + exerciseOps(IntStream.range(1, 101).toArray(), s -> s.skip(0).limit(10), IntStream.range(1, 11).toArray()); + exerciseOps(IntStream.range(1, 101).toArray(), s -> s.skip(0).limit(0), EMPTY_INT_ARRAY); + exerciseOps(IntStream.range(1, 101).toArray(), s -> s.skip(10).limit(100), IntStream.range(11, 101).toArray()); + exerciseOps(IntStream.range(1, 101).toArray(), s -> s.skip(10).limit(10), IntStream.range(11, 21).toArray()); + exerciseOps(IntStream.range(1, 101).toArray(), s -> s.skip(10).limit(0), EMPTY_INT_ARRAY); + exerciseOps(IntStream.range(1, 101).toArray(), s -> s.skip(100).limit(100), EMPTY_INT_ARRAY); + exerciseOps(IntStream.range(1, 101).toArray(), s -> s.skip(100).limit(10), EMPTY_INT_ARRAY); + exerciseOps(IntStream.range(1, 101).toArray(), s -> s.skip(100).limit(0), EMPTY_INT_ARRAY); + exerciseOps(IntStream.range(1, 101).toArray(), s -> s.skip(200).limit(100), EMPTY_INT_ARRAY); + exerciseOps(IntStream.range(1, 101).toArray(), s -> s.skip(200).limit(10), EMPTY_INT_ARRAY); + exerciseOps(IntStream.range(1, 101).toArray(), s -> s.skip(200).limit(0), EMPTY_INT_ARRAY); } private int sliceSize(int dataSize, int skip, int limit) { @@ -146,10 +128,10 @@ public class IntSliceOpTest extends OpTestCase { for (int s : skips) { setContext("skip", s); - Collection sr = exerciseOps(data, st -> st.substream(s)); + Collection sr = exerciseOps(data, st -> st.skip(s)); assertEquals(sr.size(), sliceSize(data.size(), s)); - sr = exerciseOps(data, st -> st.substream(s).substream(s / 2)); + sr = exerciseOps(data, st -> st.skip(s).skip(s / 2)); assertEquals(sr.size(), sliceSize(sliceSize(data.size(), s), s / 2)); } } @@ -163,10 +145,10 @@ public class IntSliceOpTest extends OpTestCase { setContext("skip", s); for (int limit : limits) { setContext("limit", limit); - Collection sr = exerciseOps(data, st -> st.substream(s).limit(limit)); + Collection sr = exerciseOps(data, st -> st.skip(s).limit(limit)); assertEquals(sr.size(), sliceSize(sliceSize(data.size(), s), 0, limit)); - sr = exerciseOps(data, st -> st.substream(s, limit+s)); + sr = exerciseOps(data, st -> st.skip(s).limit(limit)); assertEquals(sr.size(), sliceSize(data.size(), s, limit)); } } @@ -204,7 +186,7 @@ public class IntSliceOpTest extends OpTestCase { } public void testSkipParallel() { - int[] l = IntStream.range(1, 1001).parallel().substream(200).limit(200).sequential().toArray(); + int[] l = IntStream.range(1, 1001).parallel().skip(200).limit(200).sequential().toArray(); assertEquals(l.length, 200); assertEquals(l[l.length - 1], 400); } diff --git a/jdk/test/java/util/stream/test/org/openjdk/tests/java/util/stream/SliceOpTest.java b/jdk/test/java/util/stream/test/org/openjdk/tests/java/util/stream/SliceOpTest.java index a02348623c2..44499d021ce 100644 --- a/jdk/test/java/util/stream/test/org/openjdk/tests/java/util/stream/SliceOpTest.java +++ b/jdk/test/java/util/stream/test/org/openjdk/tests/java/util/stream/SliceOpTest.java @@ -50,27 +50,27 @@ import static java.util.stream.LambdaTestHelpers.*; public class SliceOpTest extends OpTestCase { public void testSkip() { - assertCountSum(countTo(0).stream().substream(0), 0, 0); - assertCountSum(countTo(0).stream().substream(4), 0, 0); - assertCountSum(countTo(4).stream().substream(4), 0, 0); - assertCountSum(countTo(4).stream().substream(2), 2, 7); - assertCountSum(countTo(4).stream().substream(0), 4, 10); + assertCountSum(countTo(0).stream().skip(0), 0, 0); + assertCountSum(countTo(0).stream().skip(4), 0, 0); + assertCountSum(countTo(4).stream().skip(4), 0, 0); + assertCountSum(countTo(4).stream().skip(2), 2, 7); + assertCountSum(countTo(4).stream().skip(0), 4, 10); - assertCountSum(countTo(0).parallelStream().substream(0), 0, 0); - assertCountSum(countTo(0).parallelStream().substream(4), 0, 0); - assertCountSum(countTo(4).parallelStream().substream(4), 0, 0); - assertCountSum(countTo(4).parallelStream().substream(2), 2, 7); - assertCountSum(countTo(4).parallelStream().substream(0), 4, 10); + assertCountSum(countTo(0).parallelStream().skip(0), 0, 0); + assertCountSum(countTo(0).parallelStream().skip(4), 0, 0); + assertCountSum(countTo(4).parallelStream().skip(4), 0, 0); + assertCountSum(countTo(4).parallelStream().skip(2), 2, 7); + assertCountSum(countTo(4).parallelStream().skip(0), 4, 10); - exerciseOps(Collections.emptyList(), s -> s.substream(0), Collections.emptyList()); - exerciseOps(Collections.emptyList(), s -> s.substream(10), Collections.emptyList()); + exerciseOps(Collections.emptyList(), s -> s.skip(0), Collections.emptyList()); + exerciseOps(Collections.emptyList(), s -> s.skip(10), Collections.emptyList()); - exerciseOps(countTo(1), s -> s.substream(0), countTo(1)); - exerciseOps(countTo(1), s -> s.substream(1), Collections.emptyList()); - exerciseOps(countTo(100), s -> s.substream(0), countTo(100)); - exerciseOps(countTo(100), s -> s.substream(10), range(11, 100)); - exerciseOps(countTo(100), s -> s.substream(100), Collections.emptyList()); - exerciseOps(countTo(100), s -> s.substream(200), Collections.emptyList()); + exerciseOps(countTo(1), s -> s.skip(0), countTo(1)); + exerciseOps(countTo(1), s -> s.skip(1), Collections.emptyList()); + exerciseOps(countTo(100), s -> s.skip(0), countTo(100)); + exerciseOps(countTo(100), s -> s.skip(10), range(11, 100)); + exerciseOps(countTo(100), s -> s.skip(100), Collections.emptyList()); + exerciseOps(countTo(100), s -> s.skip(200), Collections.emptyList()); } public void testLimit() { @@ -97,43 +97,43 @@ public class SliceOpTest extends OpTestCase { } public void testSkipLimit() { - exerciseOps(Collections.emptyList(), s -> s.substream(0).limit(0), Collections.emptyList()); - exerciseOps(Collections.emptyList(), s -> s.substream(0).limit(10), Collections.emptyList()); - exerciseOps(Collections.emptyList(), s -> s.substream(10).limit(0), Collections.emptyList()); - exerciseOps(Collections.emptyList(), s -> s.substream(10).limit(10), Collections.emptyList()); + exerciseOps(Collections.emptyList(), s -> s.skip(0).limit(0), Collections.emptyList()); + exerciseOps(Collections.emptyList(), s -> s.skip(0).limit(10), Collections.emptyList()); + exerciseOps(Collections.emptyList(), s -> s.skip(10).limit(0), Collections.emptyList()); + exerciseOps(Collections.emptyList(), s -> s.skip(10).limit(10), Collections.emptyList()); - exerciseOps(countTo(100), s -> s.substream(0).limit(100), countTo(100)); - exerciseOps(countTo(100), s -> s.substream(0).limit(10), countTo(10)); - exerciseOps(countTo(100), s -> s.substream(0).limit(0), Collections.emptyList()); - exerciseOps(countTo(100), s -> s.substream(10).limit(100), range(11, 100)); - exerciseOps(countTo(100), s -> s.substream(10).limit(10), range(11, 20)); - exerciseOps(countTo(100), s -> s.substream(10).limit(0), Collections.emptyList()); - exerciseOps(countTo(100), s -> s.substream(100).limit(100), Collections.emptyList()); - exerciseOps(countTo(100), s -> s.substream(100).limit(10), Collections.emptyList()); - exerciseOps(countTo(100), s -> s.substream(100).limit(0), Collections.emptyList()); - exerciseOps(countTo(100), s -> s.substream(200).limit(100), Collections.emptyList()); - exerciseOps(countTo(100), s -> s.substream(200).limit(10), Collections.emptyList()); - exerciseOps(countTo(100), s -> s.substream(200).limit(0), Collections.emptyList()); + exerciseOps(countTo(100), s -> s.skip(0).limit(100), countTo(100)); + exerciseOps(countTo(100), s -> s.skip(0).limit(10), countTo(10)); + exerciseOps(countTo(100), s -> s.skip(0).limit(0), Collections.emptyList()); + exerciseOps(countTo(100), s -> s.skip(10).limit(100), range(11, 100)); + exerciseOps(countTo(100), s -> s.skip(10).limit(10), range(11, 20)); + exerciseOps(countTo(100), s -> s.skip(10).limit(0), Collections.emptyList()); + exerciseOps(countTo(100), s -> s.skip(100).limit(100), Collections.emptyList()); + exerciseOps(countTo(100), s -> s.skip(100).limit(10), Collections.emptyList()); + exerciseOps(countTo(100), s -> s.skip(100).limit(0), Collections.emptyList()); + exerciseOps(countTo(100), s -> s.skip(200).limit(100), Collections.emptyList()); + exerciseOps(countTo(100), s -> s.skip(200).limit(10), Collections.emptyList()); + exerciseOps(countTo(100), s -> s.skip(200).limit(0), Collections.emptyList()); } public void testSlice() { - exerciseOps(Collections.emptyList(), s -> s.substream(0, 0), Collections.emptyList()); - exerciseOps(Collections.emptyList(), s -> s.substream(0, 10), Collections.emptyList()); - exerciseOps(Collections.emptyList(), s -> s.substream(10, 10), Collections.emptyList()); - exerciseOps(Collections.emptyList(), s -> s.substream(10, 20), Collections.emptyList()); + exerciseOps(Collections.emptyList(), s -> s.skip(0).limit(0), Collections.emptyList()); + exerciseOps(Collections.emptyList(), s -> s.skip(0).limit(10), Collections.emptyList()); + exerciseOps(Collections.emptyList(), s -> s.skip(10).limit(10), Collections.emptyList()); + exerciseOps(Collections.emptyList(), s -> s.skip(10).limit(20), Collections.emptyList()); - exerciseOps(countTo(100), s -> s.substream(0, 100), countTo(100)); - exerciseOps(countTo(100), s -> s.substream(0, 10), countTo(10)); - exerciseOps(countTo(100), s -> s.substream(0, 0), Collections.emptyList()); - exerciseOps(countTo(100), s -> s.substream(10, 110), range(11, 100)); - exerciseOps(countTo(100), s -> s.substream(10, 20), range(11, 20)); - exerciseOps(countTo(100), s -> s.substream(10, 10), Collections.emptyList()); - exerciseOps(countTo(100), s -> s.substream(100, 200), Collections.emptyList()); - exerciseOps(countTo(100), s -> s.substream(100, 110), Collections.emptyList()); - exerciseOps(countTo(100), s -> s.substream(100, 100), Collections.emptyList()); - exerciseOps(countTo(100), s -> s.substream(200, 300), Collections.emptyList()); - exerciseOps(countTo(100), s -> s.substream(200, 210), Collections.emptyList()); - exerciseOps(countTo(100), s -> s.substream(200, 200), Collections.emptyList()); + exerciseOps(countTo(100), s -> s.skip(0).limit(100), countTo(100)); + exerciseOps(countTo(100), s -> s.skip(0).limit(10), countTo(10)); + exerciseOps(countTo(100), s -> s.skip(0).limit(0), Collections.emptyList()); + exerciseOps(countTo(100), s -> s.skip(10).limit(100), range(11, 100)); + exerciseOps(countTo(100), s -> s.skip(10).limit(10), range(11, 20)); + exerciseOps(countTo(100), s -> s.skip(10).limit(0), Collections.emptyList()); + exerciseOps(countTo(100), s -> s.skip(100).limit(100), Collections.emptyList()); + exerciseOps(countTo(100), s -> s.skip(100).limit(10), Collections.emptyList()); + exerciseOps(countTo(100), s -> s.skip(100).limit(0), Collections.emptyList()); + exerciseOps(countTo(100), s -> s.skip(200).limit(100), Collections.emptyList()); + exerciseOps(countTo(100), s -> s.skip(200).limit(10), Collections.emptyList()); + exerciseOps(countTo(100), s -> s.skip(200).limit(0), Collections.emptyList()); } private int sliceSize(int dataSize, int skip, int limit) { @@ -156,17 +156,17 @@ public class SliceOpTest extends OpTestCase { setContext("skip", s); testSliceMulti(data, sliceSize(data.size(), s), - st -> st.substream(s), - st -> st.substream(s), - st -> st.substream(s), - st -> st.substream(s)); + st -> st.skip(s), + st -> st.skip(s), + st -> st.skip(s), + st -> st.skip(s)); testSliceMulti(data, sliceSize(sliceSize(data.size(), s), s/2), - st -> st.substream(s).substream(s / 2), - st -> st.substream(s).substream(s / 2), - st -> st.substream(s).substream(s / 2), - st -> st.substream(s).substream(s / 2)); + st -> st.skip(s).skip(s / 2), + st -> st.skip(s).skip(s / 2), + st -> st.skip(s).skip(s / 2), + st -> st.skip(s).skip(s / 2)); } } @@ -182,17 +182,10 @@ public class SliceOpTest extends OpTestCase { setContext("limit", l); testSliceMulti(data, sliceSize(sliceSize(data.size(), s), 0, l), - st -> st.substream(s).limit(l), - st -> st.substream(s).limit(l), - st -> st.substream(s).limit(l), - st -> st.substream(s).limit(l)); - - testSliceMulti(data, - sliceSize(data.size(), s, l), - st -> st.substream(s, l+s), - st -> st.substream(s, l+s), - st -> st.substream(s, l+s), - st -> st.substream(s, l+s)); + st -> st.skip(s).limit(l), + st -> st.skip(s).limit(l), + st -> st.skip(s).limit(l), + st -> st.skip(s).limit(l)); } } } From a8aaf9f52ad337dce479a7bb5e6876e2dd53db7b Mon Sep 17 00:00:00 2001 From: Aleksei Efimov Date: Sun, 13 Oct 2013 14:19:31 +0400 Subject: [PATCH 126/131] 8025255: (tz) Support tzdata2013g Reviewed-by: okutsu, mfang --- jdk/make/sun/javazic/tzdata/VERSION | 2 +- jdk/make/sun/javazic/tzdata/africa | 52 +++++-- jdk/make/sun/javazic/tzdata/antarctica | 27 ++-- jdk/make/sun/javazic/tzdata/asia | 91 +++++++---- jdk/make/sun/javazic/tzdata/australasia | 31 +++- jdk/make/sun/javazic/tzdata/backward | 14 +- jdk/make/sun/javazic/tzdata/etcetera | 4 +- jdk/make/sun/javazic/tzdata/europe | 126 +++++++++++----- jdk/make/sun/javazic/tzdata/iso3166.tab | 6 +- jdk/make/sun/javazic/tzdata/leapseconds | 70 ++------- jdk/make/sun/javazic/tzdata/northamerica | 142 +++++++----------- jdk/make/sun/javazic/tzdata/southamerica | 57 +++++-- jdk/make/sun/javazic/tzdata/zone.tab | 32 ++-- .../sun/util/resources/TimeZoneNames.java | 20 ++- .../util/resources/de/TimeZoneNames_de.java | 67 ++++----- .../util/resources/es/TimeZoneNames_es.java | 47 +++--- .../util/resources/fr/TimeZoneNames_fr.java | 59 ++++---- .../util/resources/it/TimeZoneNames_it.java | 63 ++++---- .../util/resources/ja/TimeZoneNames_ja.java | 77 +++++----- .../util/resources/ko/TimeZoneNames_ko.java | 77 +++++----- .../resources/pt/TimeZoneNames_pt_BR.java | 77 +++++----- .../util/resources/sv/TimeZoneNames_sv.java | 75 +++++---- .../resources/zh/TimeZoneNames_zh_CN.java | 77 +++++----- .../resources/zh/TimeZoneNames_zh_TW.java | 77 +++++----- jdk/test/sun/util/calendar/zi/tzdata/VERSION | 2 +- jdk/test/sun/util/calendar/zi/tzdata/africa | 52 +++++-- .../sun/util/calendar/zi/tzdata/antarctica | 27 ++-- jdk/test/sun/util/calendar/zi/tzdata/asia | 91 +++++++---- .../sun/util/calendar/zi/tzdata/australasia | 31 +++- jdk/test/sun/util/calendar/zi/tzdata/backward | 14 +- jdk/test/sun/util/calendar/zi/tzdata/etcetera | 4 +- jdk/test/sun/util/calendar/zi/tzdata/europe | 126 +++++++++++----- .../sun/util/calendar/zi/tzdata/iso3166.tab | 6 +- .../sun/util/calendar/zi/tzdata/leapseconds | 70 ++------- .../sun/util/calendar/zi/tzdata/northamerica | 142 +++++++----------- .../sun/util/calendar/zi/tzdata/southamerica | 57 +++++-- jdk/test/sun/util/calendar/zi/tzdata/zone.tab | 32 ++-- 37 files changed, 1078 insertions(+), 946 deletions(-) diff --git a/jdk/make/sun/javazic/tzdata/VERSION b/jdk/make/sun/javazic/tzdata/VERSION index e50b6f37dcc..ea1c49a6f83 100644 --- a/jdk/make/sun/javazic/tzdata/VERSION +++ b/jdk/make/sun/javazic/tzdata/VERSION @@ -21,4 +21,4 @@ # or visit www.oracle.com if you need additional information or have any # questions. # -tzdata2013d +tzdata2013g diff --git a/jdk/make/sun/javazic/tzdata/africa b/jdk/make/sun/javazic/tzdata/africa index 6b19b982c6b..19bc98afe16 100644 --- a/jdk/make/sun/javazic/tzdata/africa +++ b/jdk/make/sun/javazic/tzdata/africa @@ -881,13 +881,23 @@ Zone Indian/Mayotte 3:00:56 - LMT 1911 Jul # Mamoutzou # transitions would be 2013-07-07 and 2013-08-10; see: # http://www.maroc.ma/en/news/morocco-suspends-daylight-saving-time-july-7-aug10 -# From Paul Eggert (2013-07-03): +# From Steffen Thorsen (2013-09-28): +# Morocco extends DST by one month, on very short notice, just 1 day +# before it was going to end. There is a new decree (2.13.781) for +# this, where DST from now on goes from last Sunday of March at 02:00 +# to last Sunday of October at 03:00, similar to EU rules. Official +# source (French): +# http://www.maroc.gov.ma/fr/actualites/lhoraire-dete-gmt1-maintenu-jusquau-27-octobre-2013 +# Another source (specifying the time for start and end in the decree): +# http://www.lemag.ma/Heure-d-ete-au-Maroc-jusqu-au-27-octobre_a75620.html + +# From Paul Eggert (2013-09-30): # To estimate what the Moroccan government will do in future years, -# transition dates for 2014 through 2021 were determined by running +# transition dates for 2014 through 2037 were determined by running # the following program under GNU Emacs 24.3: # # (let ((islamic-year 1435)) -# (while (< islamic-year 1444) +# (while (< islamic-year 1460) # (let ((a # (calendar-gregorian-from-absolute # (calendar-islamic-to-absolute (list 9 1 islamic-year)))) @@ -902,13 +912,14 @@ Zone Indian/Mayotte 3:00:56 - LMT 1911 Jul # Mamoutzou # (car (cdr (cdr b))) (calendar-month-name (car b) t) (car (cdr b))))) # (setq islamic-year (+ 1 islamic-year)))) # -# with the results hand-edited for 2020-2022, when the normal spring-forward -# date falls during the estimated Ramadan. -# -# From 2023 through 2038 Ramadan is not predicted to overlap with -# daylight saving time. Starting in 2039 there will be overlap again, +# with spring-forward transitions removed for 2023-2025, when the +# normal spring-forward date falls during the estimated Ramadan; with +# all transitions removed for 2026-2035, where the estimated Ramadan +# falls entirely outside daylight-saving time; and with fall-back +# transitions removed for 2036-2037, where the normal fall-back +# date falls during the estimated Ramadan. Problems continue after that, # but 32-bit time_t values roll around in 2038 so for now do not worry -# about dates after 2038. +# about dates after 2037. # RULE NAME FROM TO TYPE IN ON AT SAVE LETTER/S @@ -935,12 +946,14 @@ Rule Morocco 2010 only - May 2 0:00 1:00 S Rule Morocco 2010 only - Aug 8 0:00 0 - Rule Morocco 2011 only - Apr 3 0:00 1:00 S Rule Morocco 2011 only - Jul 31 0 0 - -Rule Morocco 2012 2019 - Apr lastSun 2:00 1:00 S -Rule Morocco 2012 max - Sep lastSun 3:00 0 - +Rule Morocco 2012 2013 - Apr lastSun 2:00 1:00 S +Rule Morocco 2012 only - Sep 30 3:00 0 - Rule Morocco 2012 only - Jul 20 3:00 0 - Rule Morocco 2012 only - Aug 20 2:00 1:00 S Rule Morocco 2013 only - Jul 7 3:00 0 - Rule Morocco 2013 only - Aug 10 2:00 1:00 S +Rule Morocco 2013 2035 - Oct lastSun 3:00 0 - +Rule Morocco 2014 2022 - Mar lastSun 2:00 1:00 S Rule Morocco 2014 only - Jun 29 3:00 0 - Rule Morocco 2014 only - Jul 29 2:00 1:00 S Rule Morocco 2015 only - Jun 18 3:00 0 - @@ -953,10 +966,21 @@ Rule Morocco 2018 only - May 16 3:00 0 - Rule Morocco 2018 only - Jun 15 2:00 1:00 S Rule Morocco 2019 only - May 6 3:00 0 - Rule Morocco 2019 only - Jun 5 2:00 1:00 S +Rule Morocco 2020 only - Apr 24 3:00 0 - Rule Morocco 2020 only - May 24 2:00 1:00 S +Rule Morocco 2021 only - Apr 13 3:00 0 - Rule Morocco 2021 only - May 13 2:00 1:00 S +Rule Morocco 2022 only - Apr 3 3:00 0 - Rule Morocco 2022 only - May 3 2:00 1:00 S -Rule Morocco 2023 max - Apr lastSun 2:00 1:00 S +Rule Morocco 2023 only - Apr 22 2:00 1:00 S +Rule Morocco 2024 only - Apr 10 2:00 1:00 S +Rule Morocco 2025 only - Mar 31 2:00 1:00 S +Rule Morocco 2026 max - Mar lastSun 2:00 1:00 S +Rule Morocco 2036 only - Oct 21 3:00 0 - +Rule Morocco 2037 only - Oct 11 3:00 0 - +Rule Morocco 2038 only - Sep 30 3:00 0 - +Rule Morocco 2038 only - Oct 30 2:00 1:00 S +Rule Morocco 2038 max - Oct lastSun 3:00 0 - # Zone NAME GMTOFF RULES FORMAT [UNTIL] Zone Africa/Casablanca -0:30:20 - LMT 1913 Oct 26 @@ -1123,9 +1147,7 @@ Zone Africa/Khartoum 2:10:08 - LMT 1931 3:00 - EAT # South Sudan -Zone Africa/Juba 2:06:24 - LMT 1931 - 2:00 Sudan CA%sT 2000 Jan 15 12:00 - 3:00 - EAT +Link Africa/Khartoum Africa/Juba # Swaziland # Zone NAME GMTOFF RULES FORMAT [UNTIL] diff --git a/jdk/make/sun/javazic/tzdata/antarctica b/jdk/make/sun/javazic/tzdata/antarctica index 434432611ca..f30cf747f10 100644 --- a/jdk/make/sun/javazic/tzdata/antarctica +++ b/jdk/make/sun/javazic/tzdata/antarctica @@ -39,9 +39,9 @@ # # Except for the French entries, # I made up all time zone abbreviations mentioned here; corrections welcome! -# FORMAT is `zzz' and GMTOFF is 0 for locations while uninhabited. +# FORMAT is 'zzz' and GMTOFF is 0 for locations while uninhabited. -# These rules are stolen from the `southamerica' file. +# These rules are stolen from the 'southamerica' file. # Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S Rule ArgAQ 1964 1966 - Mar 1 0:00 0 - Rule ArgAQ 1964 1966 - Oct 15 0:00 1:00 S @@ -251,9 +251,10 @@ Zone Antarctica/Syowa 0 - zzz 1957 Jan 29 # Scott Island (never inhabited) # # year-round base -# Scott, Ross Island, since 1957-01, is like Antarctica/McMurdo. +# Scott Base, Ross Island, since 1957-01. +# See Pacific/Auckland. # -# These rules for New Zealand are stolen from the `australasia' file. +# These rules for New Zealand are stolen from the 'australasia' file. # Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S Rule NZAQ 1974 only - Nov 3 2:00s 1:00 D Rule NZAQ 1975 1988 - Oct lastSun 2:00s 1:00 D @@ -291,11 +292,11 @@ Rule NZAQ 2008 max - Apr Sun>=1 2:00s 0 S # From Lee Hotz (2001-03-08): # I queried the folks at Columbia who spent the summer at Vostok and this is # what they had to say about time there: -# ``in the US Camp (East Camp) we have been on New Zealand (McMurdo) +# "in the US Camp (East Camp) we have been on New Zealand (McMurdo) # time, which is 12 hours ahead of GMT. The Russian Station Vostok was # 6 hours behind that (although only 2 miles away, i.e. 6 hours ahead # of GMT). This is a time zone I think two hours east of Moscow. The -# natural time zone is in between the two: 8 hours ahead of GMT.'' +# natural time zone is in between the two: 8 hours ahead of GMT." # # From Paul Eggert (2001-05-04): # This seems to be hopelessly confusing, so I asked Lee Hotz about it @@ -360,16 +361,8 @@ Zone Antarctica/Palmer 0 - zzz 1965 -4:00 ChileAQ CL%sT # # -# McMurdo, Ross Island, since 1955-12 -# Zone NAME GMTOFF RULES FORMAT [UNTIL] -Zone Antarctica/McMurdo 0 - zzz 1956 - 12:00 NZAQ NZ%sT -# -# Amundsen-Scott, South Pole, continuously occupied since 1956-11-20 -# -# From Paul Eggert (1996-09-03): -# Normally it wouldn't have a separate entry, since it's like the -# larger Antarctica/McMurdo since 1970, but it's too famous to omit. +# McMurdo Station, Ross Island, since 1955-12 +# Amundsen-Scott South Pole Station, continuously occupied since 1956-11-20 # # From Chris Carrier (1996-06-27): # Siple, the first commander of the South Pole station, @@ -391,4 +384,4 @@ Zone Antarctica/McMurdo 0 - zzz 1956 # we have to go around and set them back 5 minutes or so. # Maybe if we let them run fast all of the time, we'd get to leave here sooner!! # -Link Antarctica/McMurdo Antarctica/South_Pole +# See 'australasia' for Antarctica/McMurdo. diff --git a/jdk/make/sun/javazic/tzdata/asia b/jdk/make/sun/javazic/tzdata/asia index f0931b3264d..fd278e5c8a8 100644 --- a/jdk/make/sun/javazic/tzdata/asia +++ b/jdk/make/sun/javazic/tzdata/asia @@ -29,7 +29,7 @@ # go ahead and edit the file (and please send any changes to # tz@iana.org for general use in the future). -# From Paul Eggert (2013-02-21): +# From Paul Eggert (2013-08-11): # # A good source for time zone historical data outside the U.S. is # Thomas G. Shanks and Rique Pottenger, The International Atlas (6th edition), @@ -67,11 +67,11 @@ # 4:00 GST Gulf* # 5:30 IST India # 7:00 ICT Indochina* -# 7:00 WIT west Indonesia -# 8:00 CIT central Indonesia +# 7:00 WIB west Indonesia (Waktu Indonesia Barat) +# 8:00 WITA central Indonesia (Waktu Indonesia Tengah) # 8:00 CST China # 9:00 CJT Central Japanese Time (1896/1937)* -# 9:00 EIT east Indonesia +# 9:00 WIT east Indonesia (Waktu Indonesia Timur) # 9:00 JST JDT Japan # 9:00 KST KDT Korea # 9:30 CST (Australian) Central Standard Time @@ -779,7 +779,7 @@ Zone Asia/Dili 8:22:20 - LMT 1912 8:00 - TLT 1942 Feb 21 23:00 # E Timor Time 9:00 - JST 1945 Sep 23 9:00 - TLT 1976 May 3 - 8:00 - CIT 2000 Sep 17 00:00 + 8:00 - WITA 2000 Sep 17 00:00 9:00 - TLT # India @@ -816,36 +816,53 @@ Zone Asia/Kolkata 5:53:28 - LMT 1880 # Kolkata # (Hollandia). For now, assume all Indonesian locations other than Jayapura # switched on 1945-09-23. # +# From Paul Eggert (2013-08-11): +# Normally the tz database uses English-language abbreviations, but in +# Indonesia it's typical to use Indonesian-language abbreviations even +# when writing in English. For example, see the English-language +# summary published by the Time and Frequency Laboratory of the +# Research Center for Calibration, Instrumentation and Metrology, +# Indonesia, (2006-09-29). +# The abbreviations are: +# +# WIB - UTC+7 - Waktu Indonesia Barat (Indonesia western time) +# WITA - UTC+8 - Waktu Indonesia Tengah (Indonesia central time) +# WIT - UTC+9 - Waktu Indonesia Timur (Indonesia eastern time) +# # Zone NAME GMTOFF RULES FORMAT [UNTIL] +# Java, Sumatra Zone Asia/Jakarta 7:07:12 - LMT 1867 Aug 10 # Shanks & Pottenger say the next transition was at 1924 Jan 1 0:13, # but this must be a typo. - 7:07:12 - JMT 1923 Dec 31 23:47:12 # Jakarta + 7:07:12 - BMT 1923 Dec 31 23:47:12 # Batavia 7:20 - JAVT 1932 Nov # Java Time - 7:30 - WIT 1942 Mar 23 + 7:30 - WIB 1942 Mar 23 9:00 - JST 1945 Sep 23 - 7:30 - WIT 1948 May - 8:00 - WIT 1950 May - 7:30 - WIT 1964 - 7:00 - WIT + 7:30 - WIB 1948 May + 8:00 - WIB 1950 May + 7:30 - WIB 1964 + 7:00 - WIB +# west and central Borneo Zone Asia/Pontianak 7:17:20 - LMT 1908 May 7:17:20 - PMT 1932 Nov # Pontianak MT - 7:30 - WIT 1942 Jan 29 + 7:30 - WIB 1942 Jan 29 9:00 - JST 1945 Sep 23 - 7:30 - WIT 1948 May - 8:00 - WIT 1950 May - 7:30 - WIT 1964 - 8:00 - CIT 1988 Jan 1 - 7:00 - WIT + 7:30 - WIB 1948 May + 8:00 - WIB 1950 May + 7:30 - WIB 1964 + 8:00 - WITA 1988 Jan 1 + 7:00 - WIB +# Sulawesi, Lesser Sundas, east and south Borneo Zone Asia/Makassar 7:57:36 - LMT 1920 7:57:36 - MMT 1932 Nov # Macassar MT - 8:00 - CIT 1942 Feb 9 + 8:00 - WITA 1942 Feb 9 9:00 - JST 1945 Sep 23 - 8:00 - CIT + 8:00 - WITA +# Maluku Islands, West Papua, Papua Zone Asia/Jayapura 9:22:48 - LMT 1932 Nov - 9:00 - EIT 1944 Sep 1 + 9:00 - WIT 1944 Sep 1 9:30 - CST 1964 - 9:00 - EIT + 9:00 - WIT # Iran @@ -1387,9 +1404,11 @@ Zone Asia/Tokyo 9:18:59 - LMT 1887 Dec 31 15:00u # until about the same time next year (at least). # http://www.petra.gov.jo/Public_News/Nws_NewsDetails.aspx?NewsID=88950 # -# From Paul Eggert (2012-10-25): -# For now, assume this is just a one-year measure. If it becomes -# permanent, we should move Jordan from EET to AST effective tomorrow. +# From Paul Eggert (2013-09-21): +# It's looking like this change will be permanent; see +# Petra News Agency, Cancelling winter saved Jordan $7 million (2013-02-20) +# . +# So move Jordan to UTC+3 as of the abovementioned date. # Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S Rule Jordan 1973 only - Jun 6 0:00 1:00 S @@ -1415,15 +1434,15 @@ Rule Jordan 1995 1998 - Sep Fri>=15 0:00s 0 - Rule Jordan 1999 only - Jul 1 0:00s 1:00 S Rule Jordan 1999 2002 - Sep lastFri 0:00s 0 - Rule Jordan 2000 2001 - Mar lastThu 0:00s 1:00 S -Rule Jordan 2002 max - Mar lastThu 24:00 1:00 S +Rule Jordan 2002 2012 - Mar lastThu 24:00 1:00 S Rule Jordan 2003 only - Oct 24 0:00s 0 - Rule Jordan 2004 only - Oct 15 0:00s 0 - Rule Jordan 2005 only - Sep lastFri 0:00s 0 - -Rule Jordan 2006 2011 - Oct lastFri 0:00s 0 - -Rule Jordan 2013 max - Oct lastFri 0:00s 0 - +Rule Jordan 2006 2012 - Oct lastFri 0:00s 0 - # Zone NAME GMTOFF RULES FORMAT [UNTIL] Zone Asia/Amman 2:23:44 - LMT 1931 - 2:00 Jordan EE%sT + 2:00 Jordan EE%sT 2012 Oct 26 0:00s + 3:00 - AST # Kazakhstan @@ -2303,9 +2322,18 @@ Zone Asia/Karachi 4:28:12 - LMT 1907 # http://www.samanews.com/index.php?act=Show&id=154120 # http://safa.ps/details/news/99844/%D8%B1%D8%A7%D9%85-%D8%A7%D9%84%D9%84%D9%87-%D8%A8%D8%AF%D8%A1-%D8%A7%D9%84%D8%AA%D9%88%D9%82%D9%8A%D8%AA-%D8%A7%D9%84%D8%B5%D9%8A%D9%81%D9%8A-29-%D8%A7%D9%84%D8%AC%D8%A7%D8%B1%D9%8A.html -# From Paul Eggert (2013-04-15): +# From Steffen Thorsen (2013-09-24): +# The Gaza and West Bank are ending DST Thursday at midnight +# (2013-09-27 00:00:00) (one hour earlier than last year...). +# This source in English, says "that winter time will go into effect +# at midnight on Thursday in the West Bank and Gaza Strip": +# http://english.wafa.ps/index.php?action=detail&id=23246 +# official source...: +# http://www.palestinecabinet.gov.ps/ar/Views/ViewDetails.aspx?pid=1252 + +# From Paul Eggert (2013-09-24): # For future dates, guess the last Thursday in March at 24:00 through -# the first Friday on or after September 21 at 01:00. This is consistent with +# the first Friday on or after September 21 at 00:00. This is consistent with # the predictions in today's editions of the following URLs, # which are for Gaza and Hebron respectively: # http://www.timeanddate.com/worldclock/timezone.html?n=702 @@ -2336,7 +2364,8 @@ Rule Palestine 2011 only - Aug 1 0:00 0 - Rule Palestine 2011 only - Aug 30 0:00 1:00 S Rule Palestine 2011 only - Sep 30 0:00 0 - Rule Palestine 2012 max - Mar lastThu 24:00 1:00 S -Rule Palestine 2012 max - Sep Fri>=21 1:00 0 - +Rule Palestine 2012 only - Sep 21 1:00 0 - +Rule Palestine 2013 max - Sep Fri>=21 0:00 0 - # Zone NAME GMTOFF RULES FORMAT [UNTIL] Zone Asia/Gaza 2:17:52 - LMT 1900 Oct diff --git a/jdk/make/sun/javazic/tzdata/australasia b/jdk/make/sun/javazic/tzdata/australasia index 11a3cb97fee..cd6b724859d 100644 --- a/jdk/make/sun/javazic/tzdata/australasia +++ b/jdk/make/sun/javazic/tzdata/australasia @@ -375,16 +375,25 @@ Zone Indian/Cocos 6:27:40 - LMT 1900 # today confirmed that Fiji will start daylight savings at 2 am on Sunday 21st # October 2012 and end at 3 am on Sunday 20th January 2013. # http://www.fiji.gov.fj/index.php?option=com_content&view=article&id=6702&catid=71&Itemid=155 + +# From the Fijian Government Media Center (2013-08-30) via David Wheeler: +# Fiji will start daylight savings on Sunday 27th October, 2013 and end at 3am +# on Sunday 19th January, 2014.... move clocks forward by one hour from 2am +# http://www.fiji.gov.fj/Media-Center/Press-Releases/DAYLIGHT-SAVING-STARTS-ON-SUNDAY,-27th-OCTOBER-201.aspx # -# From Paul Eggert (2012-08-31): -# For now, guess a pattern of the penultimate Sundays in October and January. +# From Paul Eggert (2013-09-09): +# For now, guess that Fiji springs forward the Sunday before the fourth +# Monday in October. This matches both recent practice and +# timeanddate.com's current spring-forward prediction. +# For the January 2014 transition we guessed right while timeanddate.com +# guessed wrong, so leave the fall-back prediction alone. # Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S Rule Fiji 1998 1999 - Nov Sun>=1 2:00 1:00 S Rule Fiji 1999 2000 - Feb lastSun 3:00 0 - Rule Fiji 2009 only - Nov 29 2:00 1:00 S Rule Fiji 2010 only - Mar lastSun 3:00 0 - -Rule Fiji 2010 max - Oct Sun>=18 2:00 1:00 S +Rule Fiji 2010 max - Oct Sun>=21 2:00 1:00 S Rule Fiji 2011 only - Mar Sun>=1 3:00 0 - Rule Fiji 2012 max - Jan Sun>=18 3:00 0 - # Zone NAME GMTOFF RULES FORMAT [UNTIL] @@ -510,6 +519,7 @@ Zone Pacific/Auckland 11:39:04 - LMT 1868 Nov 2 Zone Pacific/Chatham 12:13:48 - LMT 1957 Jan 1 12:45 Chatham CHA%sT +Link Pacific/Auckland Antarctica/McMurdo # Auckland Is # uninhabited; Maori and Moriori, colonial settlers, pastoralists, sealers, @@ -759,7 +769,7 @@ Zone Pacific/Funafuti 11:56:52 - LMT 1901 # 1886-1891; Baker was similar but exact dates are not known. # Inhabited by civilians 1935-1942; U.S. military bases 1943-1944; # uninhabited thereafter. -# Howland observed Hawaii Standard Time (UTC-10:30) in 1937; +# Howland observed Hawaii Standard Time (UT-10:30) in 1937; # see page 206 of Elgen M. Long and Marie K. Long, # Amelia Earhart: the Mystery Solved, Simon & Schuster (2000). # So most likely Howland and Baker observed Hawaii Time from 1935 @@ -772,8 +782,17 @@ Zone Pacific/Funafuti 11:56:52 - LMT 1901 # no information; was probably like Pacific/Kiritimati # Johnston -# Zone NAME GMTOFF RULES FORMAT [UNTIL] -Zone Pacific/Johnston -10:00 - HST +# +# From Paul Eggert (2013-09-03): +# In his memoirs of June 6th to October 4, 1945 +# (2005), Herbert C. Bach writes, +# "We started our letdown to Kwajalein Atoll and landed there at 5:00 AM +# Johnston time, 1:30 AM Kwajalein time." This was in June 1945, and +# confirms that Johnston kept the same time as Honolulu in summer 1945. +# We have no better information, so for now, assume this has been true +# indefinitely into the past. +# +# See 'northamerica' for Pacific/Johnston. # Kingman # uninhabited diff --git a/jdk/make/sun/javazic/tzdata/backward b/jdk/make/sun/javazic/tzdata/backward index ca4c437a150..5afe9a317ff 100644 --- a/jdk/make/sun/javazic/tzdata/backward +++ b/jdk/make/sun/javazic/tzdata/backward @@ -45,15 +45,17 @@ Link America/Kentucky/Louisville America/Louisville Link America/Argentina/Mendoza America/Mendoza Link America/Rio_Branco America/Porto_Acre Link America/Argentina/Cordoba America/Rosario -Link America/St_Thomas America/Virgin +Link America/Denver America/Shiprock +Link America/Port_of_Spain America/Virgin +Link Pacific/Auckland Antarctica/South_Pole Link Asia/Ashgabat Asia/Ashkhabad +Link Asia/Kolkata Asia/Calcutta Link Asia/Chongqing Asia/Chungking Link Asia/Dhaka Asia/Dacca Link Asia/Kathmandu Asia/Katmandu -Link Asia/Kolkata Asia/Calcutta Link Asia/Macau Asia/Macao -Link Asia/Jerusalem Asia/Tel_Aviv Link Asia/Ho_Chi_Minh Asia/Saigon +Link Asia/Jerusalem Asia/Tel_Aviv Link Asia/Thimphu Asia/Thimbu Link Asia/Makassar Asia/Ujung_Pandang Link Asia/Ulaanbaatar Asia/Ulan_Bator @@ -111,10 +113,10 @@ Link Pacific/Auckland NZ Link Pacific/Chatham NZ-CHAT Link America/Denver Navajo Link Asia/Shanghai PRC -Link Pacific/Pago_Pago Pacific/Samoa -Link Pacific/Chuuk Pacific/Yap -Link Pacific/Chuuk Pacific/Truk Link Pacific/Pohnpei Pacific/Ponape +Link Pacific/Pago_Pago Pacific/Samoa +Link Pacific/Chuuk Pacific/Truk +Link Pacific/Chuuk Pacific/Yap Link Europe/Warsaw Poland Link Europe/Lisbon Portugal Link Asia/Taipei ROC diff --git a/jdk/make/sun/javazic/tzdata/etcetera b/jdk/make/sun/javazic/tzdata/etcetera index d557e3033fb..ebaa5fdfc04 100644 --- a/jdk/make/sun/javazic/tzdata/etcetera +++ b/jdk/make/sun/javazic/tzdata/etcetera @@ -54,9 +54,9 @@ Link Etc/GMT Etc/GMT0 # even though this is the opposite of what many people expect. # POSIX has positive signs west of Greenwich, but many people expect # positive signs east of Greenwich. For example, TZ='Etc/GMT+4' uses -# the abbreviation "GMT+4" and corresponds to 4 hours behind UTC +# the abbreviation "GMT+4" and corresponds to 4 hours behind UT # (i.e. west of Greenwich) even though many people would expect it to -# mean 4 hours ahead of UTC (i.e. east of Greenwich). +# mean 4 hours ahead of UT (i.e. east of Greenwich). # # In the draft 5 of POSIX 1003.1-200x, the angle bracket notation allows for # TZ='+4'; if you want time zone abbreviations conforming to diff --git a/jdk/make/sun/javazic/tzdata/europe b/jdk/make/sun/javazic/tzdata/europe index 688136c8016..9f574a3b2b6 100644 --- a/jdk/make/sun/javazic/tzdata/europe +++ b/jdk/make/sun/javazic/tzdata/europe @@ -65,7 +65,7 @@ # (1998-09-21, in Portuguese) # -# I invented the abbreviations marked `*' in the following table; +# I invented the abbreviations marked '*' in the following table; # the rest are from earlier versions of this file, or from other sources. # Corrections are welcome! # std dst 2dst @@ -119,7 +119,7 @@ # and a sketch map showing some of the sightlines involved. One paragraph # of the text said: # -# `An old stone obelisk marking a forgotten terrestrial meridian stands +# 'An old stone obelisk marking a forgotten terrestrial meridian stands # beside the river at Kew. In the 18th century, before time and longitude # was standardised by the Royal Observatory in Greenwich, scholars observed # this stone and the movement of stars from Kew Observatory nearby. They @@ -163,7 +163,7 @@ # From Paul Eggert (2003-09-27): # Summer Time was first seriously proposed by William Willett (1857-1915), # a London builder and member of the Royal Astronomical Society -# who circulated a pamphlet ``The Waste of Daylight'' (1907) +# who circulated a pamphlet "The Waste of Daylight" (1907) # that proposed advancing clocks 20 minutes on each of four Sundays in April, # and retarding them by the same amount on four Sundays in September. # A bill was drafted in 1909 and introduced in Parliament several times, @@ -188,10 +188,10 @@ # # From Paul Eggert (1996-09-03): -# The OED Supplement says that the English originally said ``Daylight Saving'' +# The OED Supplement says that the English originally said "Daylight Saving" # when they were debating the adoption of DST in 1908; but by 1916 this # term appears only in quotes taken from DST's opponents, whereas the -# proponents (who eventually won the argument) are quoted as using ``Summer''. +# proponents (who eventually won the argument) are quoted as using "Summer". # From Arthur David Olson (1989-01-19): # @@ -231,9 +231,9 @@ # which could not be said to run counter to any official description. # From Paul Eggert (2000-10-02): -# Howse writes (p 157) `DBST' too, but `BDST' seems to have been common +# Howse writes (p 157) 'DBST' too, but 'BDST' seems to have been common # and follows the more usual convention of putting the location name first, -# so we use `BDST'. +# so we use 'BDST'. # Peter Ilieve (1998-04-19) described at length # the history of summer time legislation in the United Kingdom. @@ -454,6 +454,8 @@ Rule GB-Eire 1981 1989 - Oct Sun>=23 1:00u 0 GMT Rule GB-Eire 1990 1995 - Oct Sun>=22 1:00u 0 GMT # Summer Time Order 1997 (S.I. 1997/2982) # See EU for rules starting in 1996. +# +# Use Europe/London for Jersey, Guernsey, and the Isle of Man. # Zone NAME GMTOFF RULES FORMAT [UNTIL] Zone Europe/London -0:01:15 - LMT 1847 Dec 1 0:00s @@ -820,7 +822,7 @@ Zone Europe/Brussels 0:17:30 - LMT 1880 1:00 EU CE%sT # Bosnia and Herzegovina -# see Serbia +# See Europe/Belgrade. # Bulgaria # @@ -848,10 +850,10 @@ Zone Europe/Sofia 1:33:16 - LMT 1880 2:00 EU EE%sT # Croatia -# see Serbia +# See Europe/Belgrade. # Cyprus -# Please see the `asia' file for Asia/Nicosia. +# Please see the 'asia' file for Asia/Nicosia. # Czech Republic # Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S @@ -868,6 +870,7 @@ Zone Europe/Prague 0:57:44 - LMT 1850 1:00 C-Eur CE%sT 1944 Sep 17 2:00s 1:00 Czech CE%sT 1979 1:00 EU CE%sT +# Use Europe/Prague also for Slovakia. # Denmark, Faroe Islands, and Greenland @@ -1031,12 +1034,12 @@ Zone America/Thule -4:35:08 - LMT 1916 Jul 28 # Pituffik air base # From Peter Ilieve (1996-10-28): # [IATA SSIM (1992/1996) claims that the Baltic republics switch at 01:00s, # but a relative confirms that Estonia still switches at 02:00s, writing:] -# ``I do not [know] exactly but there are some little different +# "I do not [know] exactly but there are some little different # (confusing) rules for International Air and Railway Transport Schedules # conversion in Sunday connected with end of summer time in Estonia.... # A discussion is running about the summer time efficiency and effect on # human physiology. It seems that Estonia maybe will not change to -# summer time next spring.'' +# summer time next spring." # From Peter Ilieve (1998-11-04), heavily edited: # @@ -1091,7 +1094,7 @@ Zone Europe/Tallinn 1:39:00 - LMT 1880 # Well, here in Helsinki we're just changing from summer time to regular one, # and it's supposed to change at 4am... -# From Janne Snabb (2010-0715): +# From Janne Snabb (2010-07-15): # # I noticed that the Finland data is not accurate for years 1981 and 1982. # During these two first trial years the DST adjustment was made one hour @@ -1148,7 +1151,7 @@ Link Europe/Helsinki Europe/Mariehamn # -# Shank & Pottenger seem to use `24:00' ambiguously; resolve it with Whitman. +# Shank & Pottenger seem to use '24:00' ambiguously; resolve it with Whitman. # Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S Rule France 1916 only - Jun 14 23:00s 1:00 S Rule France 1916 1919 - Oct Sun>=1 23:00s 0 - @@ -1438,7 +1441,7 @@ Zone Atlantic/Reykjavik -1:27:24 - LMT 1837 # # Day-light Saving Time in Italy (2006-02-03) # -# (`FP' below), taken from an Italian National Electrotechnical Institute +# ('FP' below), taken from an Italian National Electrotechnical Institute # publication. When the three sources disagree, guess who's right, as follows: # # year FP Shanks&P. (S) Whitman (W) Go with: @@ -1584,10 +1587,22 @@ Zone Europe/Riga 1:36:24 - LMT 1880 2:00 EU EE%sT # Liechtenstein -# Zone NAME GMTOFF RULES FORMAT [UNTIL] -Zone Europe/Vaduz 0:38:04 - LMT 1894 Jun - 1:00 - CET 1981 - 1:00 EU CE%sT + +# From Paul Eggert (2013-09-09): +# Shanks & Pottenger say Vaduz is like Zurich. + +# From Alois Treindl (2013-09-18): +# http://www.eliechtensteinensia.li/LIJ/1978/1938-1978/1941.pdf +# ... confirms on p. 6 that Liechtenstein followed Switzerland in 1941 and 1942. +# I ... translate only the last two paragraphs: +# ... during second world war, in the years 1941 and 1942, Liechtenstein +# introduced daylight saving time, adapting to Switzerland. From 1943 on +# central European time was in force throughout the year. +# From a report of the duke's government to the high council, +# regarding the introduction of a time law, of 31 May 1977. + +Link Europe/Zurich Europe/Vaduz + # Lithuania @@ -1675,7 +1690,7 @@ Zone Europe/Luxembourg 0:24:36 - LMT 1904 Jun 1:00 EU CE%sT # Macedonia -# see Serbia +# See Europe/Belgrade. # Malta # Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S @@ -1768,7 +1783,7 @@ Zone Europe/Monaco 0:29:32 - LMT 1891 Mar 15 1:00 EU CE%sT # Montenegro -# see Serbia +# See Europe/Belgrade. # Netherlands @@ -1883,7 +1898,7 @@ Zone Europe/Oslo 0:43:00 - LMT 1895 Jan 1 # before 1895, and therefore probably changed the local time somewhere # between 1895 and 1925 (inclusive). -# From Paul Eggert (2001-05-01): +# From Paul Eggert (2013-09-04): # # Actually, Jan Mayen was never occupied by Germany during World War II, # so it must have diverged from Oslo time during the war, as Oslo was @@ -1894,7 +1909,7 @@ Zone Europe/Oslo 0:43:00 - LMT 1895 Jan 1 # 1941 with a small Norwegian garrison and continued operations despite # frequent air ttacks from Germans. In 1943 the Americans established a # radiolocating station on the island, called "Atlantic City". Possibly -# the UTC offset changed during the war, but I think it unlikely that +# the UT offset changed during the war, but I think it unlikely that # Jan Mayen used German daylight-saving rules. # # Svalbard is more complicated, as it was raided in August 1941 by an @@ -1907,9 +1922,8 @@ Zone Europe/Oslo 0:43:00 - LMT 1895 Jan 1 # the German armed forces at the Svalbard weather station code-named # Haudegen did not surrender to the Allies until September 1945. # -# All these events predate our cutoff date of 1970. Unless we can -# come up with more definitive info about the timekeeping during the -# war years it's probably best just do...the following for now: +# All these events predate our cutoff date of 1970, so use Europe/Oslo +# for these regions. Link Europe/Oslo Arctic/Longyearbyen # Poland @@ -2167,7 +2181,7 @@ Zone Europe/Bucharest 1:44:24 - LMT 1891 Oct # so we (Novosibirsk) simply did not switch. # # From Andrey A. Chernov (1996-10-04): -# `MSK' and `MSD' were born and used initially on Moscow computers with +# 'MSK' and 'MSD' were born and used initially on Moscow computers with # UNIX-like OSes by several developer groups (e.g. Demos group, Kiae group).... # The next step was the UUCP network, the Relcom predecessor # (used mainly for mail), and MSK/MSD was actively used there. @@ -2466,6 +2480,9 @@ Zone Asia/Anadyr 11:49:56 - LMT 1924 May 2 11:00 Russia ANA%sT 2011 Mar 27 2:00s 12:00 - ANAT +# San Marino +# See Europe/Rome. + # Serbia # Zone NAME GMTOFF RULES FORMAT [UNTIL] Zone Europe/Belgrade 1:22:00 - LMT 1884 @@ -2488,7 +2505,7 @@ Link Europe/Belgrade Europe/Zagreb # Croatia Link Europe/Prague Europe/Bratislava # Slovenia -# see Serbia +# See Europe/Belgrade. # Spain # Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S @@ -2622,7 +2639,7 @@ Zone Europe/Stockholm 1:12:12 - LMT 1879 Jan 1 # and their performance improved enormously. Communities began to keep # mean time in preference to apparent time -- Geneva from 1780 .... # Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S -# From Whitman (who writes ``Midnight?''): +# From Whitman (who writes "Midnight?"): # Rule Swiss 1940 only - Nov 2 0:00 1:00 S # Rule Swiss 1940 only - Dec 31 0:00 0 - # From Shanks & Pottenger: @@ -2667,23 +2684,53 @@ Zone Europe/Stockholm 1:12:12 - LMT 1879 Jan 1 # The 1940 rules must be deleted. # # One further detail for Switzerland, which is probably out of scope for -# most users of tzdata: -# The zone file -# Zone Europe/Zurich 0:34:08 - LMT 1848 Sep 12 -# 0:29:44 - BMT 1894 Jun #Bern Mean Time -# 1:00 Swiss CE%sT 1981 -# 1:00 EU CE%sT +# most users of tzdata: The [Europe/Zurich zone] ... # describes all of Switzerland correctly, with the exception of # the Cantone Geneve (Geneva, Genf). Between 1848 and 1894 Geneve did not # follow Bern Mean Time but kept its own local mean time. # To represent this, an extra zone would be needed. +# +# From Alois Treindl (2013-09-11): +# The Federal regulations say +# http://www.admin.ch/opc/de/classified-compilation/20071096/index.html +# ... the meridian for Bern mean time ... is 7 degrees 26'22.50". +# Expressed in time, it is 0h29m45.5s. + +# From Pierre-Yves Berger (2013-09-11): +# the "Circulaire du conseil federal" (December 11 1893) +# ... +# clearly states that the [1894-06-01] change should be done at midnight +# but if no one is present after 11 at night, could be postponed until one +# hour before the beginning of service. + +# From Paul Eggert (2013-09-11): +# Round BMT to the nearest even second, 0:29:46. +# +# We can find no reliable source for Shanks's assertion that all of Switzerland +# except Geneva switched to Bern Mean Time at 00:00 on 1848-09-12. This book: +# +# Jakob Messerli. Gleichmassig, punktlich, schnell: Zeiteinteilung und +# Zeitgebrauch in der Schweiz im 19. Jahrhundert. Chronos, Zurich 1995, +# ISBN 3-905311-68-2, OCLC 717570797. +# +# suggests that the transition was more gradual, and that the Swiss did not +# agree about civil time during the transition. The timekeeping it gives the +# most detail for is postal and telegraph time: here, federal legislation (the +# "Bundesgesetz uber die Erstellung von elektrischen Telegraphen") passed on +# 1851-11-23, and an official implementation notice was published 1853-07-16 +# (Bundesblatt 1853, Bd. II, S. 859). On p 72 Messerli writes that in +# practice since July 1853 Bernese time was used in "all postal and telegraph +# offices in Switzerland from Geneva to St. Gallen and Basel to Chiasso" +# (Google translation). For now, model this transition as occurring on +# 1853-07-16, though it probably occurred at some other date in Zurich, and +# legal civil time probably changed at still some other transition date. # Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S Rule Swiss 1941 1942 - May Mon>=1 1:00 1:00 S Rule Swiss 1941 1942 - Oct Mon>=1 2:00 0 - # Zone NAME GMTOFF RULES FORMAT [UNTIL] -Zone Europe/Zurich 0:34:08 - LMT 1848 Sep 12 - 0:29:44 - BMT 1894 Jun # Bern Mean Time +Zone Europe/Zurich 0:34:08 - LMT 1853 Jul 16 # See above comment. + 0:29:46 - BMT 1894 Jun # Bern Mean Time 1:00 Swiss CE%sT 1981 1:00 EU CE%sT @@ -2907,7 +2954,7 @@ Zone Europe/Simferopol 2:16:24 - LMT 1880 # From Paul Eggert (2006-03-22): # The _Economist_ (1994-05-28, p 45) reports that central Crimea switched # from Kiev to Moscow time sometime after the January 1994 elections. -# Shanks (1999) says ``date of change uncertain'', but implies that it happened +# Shanks (1999) says "date of change uncertain", but implies that it happened # sometime between the 1994 DST switches. Shanks & Pottenger simply say # 1994-09-25 03:00, but that can't be right. For now, guess it # changed in May. @@ -2921,6 +2968,9 @@ Zone Europe/Simferopol 2:16:24 - LMT 1880 3:00 - MSK 1997 Mar lastSun 1:00u 2:00 EU EE%sT +# Vatican City +# See Europe/Rome. + ############################################################################### # One source shows that Bulgaria, Cyprus, Finland, and Greece observe DST from diff --git a/jdk/make/sun/javazic/tzdata/iso3166.tab b/jdk/make/sun/javazic/tzdata/iso3166.tab index c6b2d0af3f1..28fb64b647e 100644 --- a/jdk/make/sun/javazic/tzdata/iso3166.tab +++ b/jdk/make/sun/javazic/tzdata/iso3166.tab @@ -32,7 +32,7 @@ # 1. ISO 3166-1 alpha-2 country code, current as of # ISO 3166-1 Newsletter VI-15 (2013-05-10). See: Updates on ISO 3166 # http://www.iso.org/iso/home/standards/country_codes/updates_on_iso_3166.htm -# 2. The usual English name for the country, +# 2. The usual English name for the coded region, # chosen so that alphabetic sorting of subsets produces helpful lists. # This is not the same as the English name in the ISO 3166 tables. # @@ -46,7 +46,7 @@ # to take or endorse any position on legal or territorial claims. # #country- -#code country name +#code name of country, territory, area, or subdivision AD Andorra AE United Arab Emirates AF Afghanistan @@ -76,7 +76,7 @@ BL St Barthelemy BM Bermuda BN Brunei BO Bolivia -BQ Bonaire, St Eustatius & Saba +BQ Caribbean Netherlands BR Brazil BS Bahamas BT Bhutan diff --git a/jdk/make/sun/javazic/tzdata/leapseconds b/jdk/make/sun/javazic/tzdata/leapseconds index 912801227a2..faf5319d408 100644 --- a/jdk/make/sun/javazic/tzdata/leapseconds +++ b/jdk/make/sun/javazic/tzdata/leapseconds @@ -20,18 +20,24 @@ # 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. -# -#

            -# This file is in the public domain, so clarified as of
            -# 2009-05-17 by Arthur David Olson.
             
             # Allowance for leapseconds added to each timezone file.
             
            +# This file is in the public domain.
            +
            +# This file is generated automatically from the data in the public-domain
            +# leap-seconds.list file available from most NIST time servers.
            +# If the URL  does not work,
            +# you should be able to pick up leap-seconds.list from a secondary NIST server.
            +# For more about leap-seconds.list, please see
            +# The NTP Timescale and Leap Seconds
            +# .
            +
             # The International Earth Rotation Service periodically uses leap seconds
             # to keep UTC to within 0.9 s of UT1
             # (which measures the true angular orientation of the earth in space); see
             # Terry J Quinn, The BIPM and the accurate measure of time,
            -# Proc IEEE 79, 7 (July 1991), 894-905.
            +# Proc IEEE 79, 7 (July 1991), 894-905 .
             # There were no leap seconds before 1972, because the official mechanism
             # accounting for the discrepancy between atomic time and the earth's rotation
             # did not exist until the early 1970s.
            @@ -42,8 +48,8 @@
             # or
             #	Leap	YEAR	MON	DAY	23:59:59	-	R/S
             
            -# If the leapsecond is Rolling (R) the given time is local time
            -# If the leapsecond is Stationary (S) the given time is UTC
            +# If the leapsecond is Rolling (R) the given time is local time.
            +# If the leapsecond is Stationary (S) the given time is UTC.
             
             # Leap	YEAR	MONTH	DAY	HH:MM:SS	CORR	R/S
             Leap	1972	Jun	30	23:59:60	+	S
            @@ -71,53 +77,3 @@ Leap	1998	Dec	31	23:59:60	+	S
             Leap	2005	Dec	31	23:59:60	+	S
             Leap	2008	Dec	31	23:59:60	+	S
             Leap	2012	Jun	30	23:59:60	+	S
            -
            -# INTERNATIONAL EARTH ROTATION AND REFERENCE SYSTEMS SERVICE (IERS)
            -#
            -# SERVICE INTERNATIONAL DE LA ROTATION TERRESTRE ET DES SYSTEMES DE REFERENCE
            -#
            -#
            -# SERVICE DE LA ROTATION TERRESTRE
            -# OBSERVATOIRE DE PARIS
            -# 61, Av. de l'Observatoire 75014 PARIS (France)
            -# Tel.      : 33 (0) 1 40 51 22 26
            -# FAX       : 33 (0) 1 40 51 22 91
            -# e-mail    : (E-Mail Removed)
            -# http://hpiers.obspm.fr/eop-pc
            -#
            -# Paris, 5 January 2012
            -#
            -#
            -# Bulletin C 43
            -#
            -# To authorities responsible
            -# for the measurement and
            -# distribution of time
            -#
            -#
            -# UTC TIME STEP
            -# on the 1st of July 2012
            -#
            -#
            -# A positive leap second will be introduced at the end of June 2012.
            -# The sequence of dates of the UTC second markers will be:
            -#
            -#                          2012 June 30,     23h 59m 59s
            -#                          2012 June 30,     23h 59m 60s
            -#                          2012 July  1,      0h  0m  0s
            -#
            -# The difference between UTC and the International Atomic Time TAI is:
            -#
            -# from 2009 January 1, 0h UTC, to 2012 July 1  0h UTC  : UTC-TAI = - 34s
            -# from 2012 July 1,    0h UTC, until further notice    : UTC-TAI = - 35s
            -#
            -# Leap seconds can be introduced in UTC at the end of the months of December
            -# or June, depending on the evolution of UT1-TAI. Bulletin C is mailed every
            -# six months, either to announce a time step in UTC or to confirm that there
            -# will be no time step at the next possible date.
            -#
            -#
            -# Daniel GAMBIS
            -# Head
            -# Earth Orientation Center of IERS
            -# Observatoire de Paris, France
            diff --git a/jdk/make/sun/javazic/tzdata/northamerica b/jdk/make/sun/javazic/tzdata/northamerica
            index 43a0b22504b..b8caf6d019b 100644
            --- a/jdk/make/sun/javazic/tzdata/northamerica
            +++ b/jdk/make/sun/javazic/tzdata/northamerica
            @@ -43,7 +43,7 @@
             # Howse writes (pp 121-125) that time zones were invented by
             # Professor Charles Ferdinand Dowd (1825-1904),
             # Principal of Temple Grove Ladies' Seminary (Saratoga Springs, NY).
            -# His pamphlet ``A System of National Time for Railroads'' (1870)
            +# His pamphlet "A System of National Time for Railroads" (1870)
             # was the result of his proposals at the Convention of Railroad Trunk Lines
             # in New York City (1869-10).  His 1870 proposal was based on Washington, DC,
             # but in 1872-05 he moved the proposed origin to Greenwich.
            @@ -63,8 +63,8 @@
             
             # From Paul Eggert (2001-03-06):
             # Daylight Saving Time was first suggested as a joke by Benjamin Franklin
            -# in his whimsical essay ``An Economical Project for Diminishing the Cost
            -# of Light'' published in the Journal de Paris (1784-04-26).
            +# in his whimsical essay "An Economical Project for Diminishing the Cost
            +# of Light" published in the Journal de Paris (1784-04-26).
             # Not everyone is happy with the results:
             #
             #	I don't really care how time is reckoned so long as there is some
            @@ -190,8 +190,8 @@ Zone	PST8PDT		 -8:00	US	P%sT
             #    of the Aleutian islands.   No DST.
             
             # From Paul Eggert (1995-12-19):
            -# The tables below use `NST', not `NT', for Nome Standard Time.
            -# I invented `CAWT' for Central Alaska War Time.
            +# The tables below use 'NST', not 'NT', for Nome Standard Time.
            +# I invented 'CAWT' for Central Alaska War Time.
             
             # From U. S. Naval Observatory (1989-01-19):
             # USA  EASTERN       5 H  BEHIND UTC    NEW YORK, WASHINGTON
            @@ -260,9 +260,9 @@ Zone	PST8PDT		 -8:00	US	P%sT
             # H.R. 6, Energy Policy Act of 2005, SEC. 110. DAYLIGHT SAVINGS.
             #   (a) Amendment- Section 3(a) of the Uniform Time Act of 1966 (15
             #   U.S.C. 260a(a)) is amended--
            -#     (1) by striking `first Sunday of April' and inserting `second
            +#     (1) by striking 'first Sunday of April' and inserting 'second
             #     Sunday of March'; and
            -#     (2) by striking `last Sunday of October' and inserting `first
            +#     (2) by striking 'last Sunday of October' and inserting 'first
             #     Sunday of November'.
             #   (b) Effective Date- Subsection (a) shall take effect 1 year after the
             #   date of enactment of this Act or March 1, 2007, whichever is later.
            @@ -623,6 +623,8 @@ Zone Pacific/Honolulu	-10:31:26 -	LMT	1896 Jan 13 12:00 #Schmitt&Cox
             			-10:30	-	HST	1947 Jun  8 2:00 #Schmitt&Cox+2
             			-10:00	-	HST
             
            +Link Pacific/Honolulu Pacific/Johnston
            +
             # Now we turn to US areas that have diverged from the consensus since 1970.
             
             # Arizona mostly uses MST.
            @@ -659,8 +661,9 @@ Zone America/Phoenix	-7:28:18 -	LMT	1883 Nov 18 11:31:42
             # Navajo Nation participates in the Daylight Saving Time policy, due to its
             # large size and location in three states."  (The "only" means that other
             # tribal nations don't use DST.)
            -
            -Link America/Denver America/Shiprock
            +#
            +# From Paul Eggert (2013-08-26):
            +# See America/Denver for a zone appropriate for the Navajo Nation.
             
             # Southern Idaho (Ada, Adams, Bannock, Bear Lake, Bingham, Blaine,
             # Boise, Bonneville, Butte, Camas, Canyon, Caribou, Cassia, Clark,
            @@ -700,13 +703,13 @@ Zone America/Boise	-7:44:49 -	LMT	1883 Nov 18 12:15:11
             #   and Switzerland counties have their own time zone histories as noted below.
             #
             # Shanks partitioned Indiana into 345 regions, each with its own time history,
            -# and wrote ``Even newspaper reports present contradictory information.''
            +# and wrote "Even newspaper reports present contradictory information."
             # Those Hoosiers!  Such a flighty and changeable people!
             # Fortunately, most of the complexity occurred before our cutoff date of 1970.
             #
             # Other than Indianapolis, the Indiana place names are so nondescript
            -# that they would be ambiguous if we left them at the `America' level.
            -# So we reluctantly put them all in a subdirectory `America/Indiana'.
            +# that they would be ambiguous if we left them at the 'America' level.
            +# So we reluctantly put them all in a subdirectory 'America/Indiana'.
             
             # From Paul Eggert (2005-08-16):
             # http://www.mccsc.edu/time.html says that Indiana will use DST starting 2006.
            @@ -970,8 +973,8 @@ Zone America/Kentucky/Monticello -5:39:24 - LMT	1883 Nov 18 12:20:36
             # This story is too entertaining to be false, so go with Howse over Shanks.
             #
             # From Paul Eggert (2001-03-06):
            -# Garland (1927) writes ``Cleveland and Detroit advanced their clocks
            -# one hour in 1914.''  This change is not in Shanks.  We have no more
            +# Garland (1927) writes "Cleveland and Detroit advanced their clocks
            +# one hour in 1914."  This change is not in Shanks.  We have no more
             # info, so omit this for now.
             #
             # Most of Michigan observed DST from 1973 on, but was a bit late in 1975.
            @@ -1011,7 +1014,7 @@ Zone America/Menominee	-5:50:27 -	LMT	1885 Sep 18 12:00
             # occupied 1857/1900 by the Navassa Phosphate Co
             # US lighthouse 1917/1996-09
             # currently uninhabited
            -# see Mark Fineman, ``An Isle Rich in Guano and Discord'',
            +# see Mark Fineman, "An Isle Rich in Guano and Discord",
             # _Los Angeles Times_ (1998-11-10), A1, A10; it cites
             # Jimmy Skaggs, _The Great Guano Rush_ (1994).
             
            @@ -1045,7 +1048,7 @@ Zone America/Menominee	-5:50:27 -	LMT	1885 Sep 18 12:00
             #	Milne J. Civil time. Geogr J. 1899 Feb;13(2):173-94
             #	.
             #
            -# See the `europe' file for Greenland.
            +# See the 'europe' file for Greenland.
             
             # Canada
             
            @@ -1246,7 +1249,7 @@ Zone America/St_Johns	-3:30:52 -	LMT	1884
             
             # most of east Labrador
             
            -# The name `Happy Valley-Goose Bay' is too long; use `Goose Bay'.
            +# The name 'Happy Valley-Goose Bay' is too long; use 'Goose Bay'.
             # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
             Zone America/Goose_Bay	-4:01:40 -	LMT	1884 # Happy Valley-Goose Bay
             			-3:30:52 -	NST	1918
            @@ -1363,25 +1366,27 @@ Zone America/Moncton	-4:19:08 -	LMT	1883 Dec  9
             
             # Quebec
             
            -# From Paul Eggert (2006-07-09):
            -# Shanks & Pottenger write that since 1970 most of Quebec has been
            -# like Montreal.
            +# From Paul Eggert (2013-08-30):
            +# Since 1970 most of Quebec has been like Toronto.
            +# However, because earlier versions of the tz database mistakenly relied on data
            +# from Shanks & Pottenger saying that Quebec differed from Ontario after 1970,
            +# a separate entry was created for most of Quebec.  We're loath to lose
            +# its pre-1970 info, even though the tz database is normally limited to
            +# zones that differ after 1970, so keep this otherwise out-of-scope entry.
             
            -# From Paul Eggert (2006-06-27):
             # Matthews and Vincent (1998) also write that Quebec east of the -63
             # meridian is supposed to observe AST, but residents as far east as
             # Natashquan use EST/EDT, and residents east of Natashquan use AST.
            -# In "Official time in Quebec" the Quebec department of justice writes in
            -# http://www.justice.gouv.qc.ca/english/publications/generale/temps-regl-1-a.htm
            -# that "The residents of the Municipality of the
            -# Cote-Nord-du-Golfe-Saint-Laurent and the municipalities of Saint-Augustin,
            -# Bonne-Esperance and Blanc-Sablon apply the Official Time Act as it is
            -# written and use Atlantic standard time all year round. The same applies to
            -# the residents of the Native facilities along the lower North Shore."
            -# 
            +# The Quebec department of justice writes in
            +# "The situation in Minganie and Basse-Cote-Nord"
            +# http://www.justice.gouv.qc.ca/english/publications/generale/temps-minganie-a.htm
            +# that the coastal strip from just east of Natashquan to Blanc-Sablon
            +# observes Atlantic standard time all year round.
            +# http://www.assnat.qc.ca/Media/Process.aspx?MediaId=ANQ.Vigie.Bll.DocumentGenerique_8845en
             # says this common practice was codified into law as of 2007.
             # For lack of better info, guess this practice began around 1970, contra to
             # Shanks & Pottenger who have this region observing AST/ADT.
            +# for post-1970 data America/Puerto_Rico.
             
             # Rule	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER/S
             Rule	Mont	1917	only	-	Mar	25	2:00	1:00	D
            @@ -1425,7 +1430,6 @@ Zone America/Montreal	-4:54:16 -	LMT	1884
             			-5:00	Mont	E%sT	1974
             			-5:00	Canada	E%sT
             
            -
             # Ontario
             
             # From Paul Eggert (2006-07-09):
            @@ -1644,7 +1648,7 @@ Zone America/Thunder_Bay -5:57:00 -	LMT	1895
             			-6:00	-	CST	1910
             			-5:00	-	EST	1942
             			-5:00	Canada	E%sT	1970
            -			-5:00	Mont	E%sT	1973
            +			-5:00	Toronto	E%sT	1973
             			-5:00	-	EST	1974
             			-5:00	Canada	E%sT
             Zone America/Nipigon	-5:53:04 -	LMT	1895
            @@ -2231,7 +2235,7 @@ Zone America/Dawson	-9:17:40 -	LMT	1900 Aug 20
             # From Paul Eggert (1996-06-12):
             # For an English translation of the decree, see
             # 
            -# ``Diario Oficial: Time Zone Changeover'' (1996-01-04).
            +# "Diario Oficial: Time Zone Changeover" (1996-01-04).
             # 
             
             # From Rives McDow (1998-10-08):
            @@ -2568,9 +2572,7 @@ Zone America/Santa_Isabel	-7:39:28 -	LMT	1922 Jan  1  0:20:32
             ###############################################################################
             
             # Anguilla
            -# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
            -Zone America/Anguilla	-4:12:16 -	LMT	1912 Mar 2
            -			-4:00	-	AST
            +# See 'southamerica'.
             
             # Antigua and Barbuda
             # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
            @@ -2639,13 +2641,13 @@ Zone	America/Belize	-5:52:48 -	LMT	1912 Apr
             # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
             Zone Atlantic/Bermuda	-4:19:18 -	LMT	1930 Jan  1 2:00    # Hamilton
             			-4:00	-	AST	1974 Apr 28 2:00
            -			-4:00	Bahamas	A%sT	1976
            +			-4:00	Canada	A%sT	1976
             			-4:00	US	A%sT
             
             # Cayman Is
             # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
             Zone	America/Cayman	-5:25:32 -	LMT	1890		# Georgetown
            -			-5:07:12 -	KMT	1912 Feb    # Kingston Mean Time
            +			-5:07:11 -	KMT	1912 Feb    # Kingston Mean Time
             			-5:00	-	EST
             
             # Costa Rica
            @@ -2660,7 +2662,7 @@ Rule	CR	1991	1992	-	Jan	Sat>=15	0:00	1:00	D
             # go with Shanks & Pottenger.
             Rule	CR	1991	only	-	Jul	 1	0:00	0	S
             Rule	CR	1992	only	-	Mar	15	0:00	0	S
            -# There are too many San Joses elsewhere, so we'll use `Costa Rica'.
            +# There are too many San Joses elsewhere, so we'll use 'Costa Rica'.
             # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
             Zone America/Costa_Rica	-5:36:13 -	LMT	1890		# San Jose
             			-5:36:13 -	SJMT	1921 Jan 15 # San Jose Mean Time
            @@ -2892,9 +2894,7 @@ Zone	America/Havana	-5:29:28 -	LMT	1890
             			-5:00	Cuba	C%sT
             
             # Dominica
            -# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
            -Zone America/Dominica	-4:05:36 -	LMT	1911 Jul 1 0:01		# Roseau
            -			-4:00	-	AST
            +# See 'southamerica'.
             
             # Dominican Republic
             
            @@ -2943,18 +2943,10 @@ Zone America/El_Salvador -5:56:48 -	LMT	1921		# San Salvador
             			-6:00	Salv	C%sT
             
             # Grenada
            -# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
            -Zone	America/Grenada	-4:07:00 -	LMT	1911 Jul	# St George's
            -			-4:00	-	AST
            -
             # Guadeloupe
            -# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
            -Zone America/Guadeloupe	-4:06:08 -	LMT	1911 Jun 8	# Pointe a Pitre
            -			-4:00	-	AST
             # St Barthelemy
            -Link America/Guadeloupe	America/St_Barthelemy
             # St Martin (French part)
            -Link America/Guadeloupe	America/Marigot
            +# See 'southamerica'.
             
             # Guatemala
             #
            @@ -3097,17 +3089,12 @@ Zone America/Tegucigalpa -5:48:52 -	LMT	1921 Apr
             # Great Swan I ceded by US to Honduras in 1972
             
             # Jamaica
            -
            -# From Bob Devine (1988-01-28):
            -# Follows US rules.
            -
            -# From U. S. Naval Observatory (1989-01-19):
            -# JAMAICA             5 H  BEHIND UTC
            -
            -# From Shanks & Pottenger:
            +# Shanks & Pottenger give -5:07:12, but Milne records -5:07:10.41 from an
            +# unspecified official document, and says "This time is used throughout the
            +# island".  Go with Milne.  Round to the nearest second as required by zic.
             # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
            -Zone	America/Jamaica	-5:07:12 -	LMT	1890		# Kingston
            -			-5:07:12 -	KMT	1912 Feb    # Kingston Mean Time
            +Zone	America/Jamaica	-5:07:11 -	LMT	1890		# Kingston
            +			-5:07:11 -	KMT	1912 Feb    # Kingston Mean Time
             			-5:00	-	EST	1974 Apr 28 2:00
             			-5:00	US	E%sT	1984
             			-5:00	-	EST
            @@ -3121,12 +3108,7 @@ Zone America/Martinique	-4:04:20 -      LMT	1890		# Fort-de-France
             			-4:00	-	AST
             
             # Montserrat
            -# From Paul Eggert (2006-03-22):
            -# In 1995 volcanic eruptions forced evacuation of Plymouth, the capital.
            -# world.gazetteer.com says Cork Hill is the most populous location now.
            -# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
            -Zone America/Montserrat	-4:08:52 -	LMT	1911 Jul 1 0:01   # Cork Hill
            -			-4:00	-	AST
            +# See 'southamerica'.
             
             # Nicaragua
             #
            @@ -3200,7 +3182,7 @@ Zone	America/Panama	-5:18:08 -	LMT	1890
             			-5:00	-	EST
             
             # Puerto Rico
            -# There are too many San Juans elsewhere, so we'll use `Puerto_Rico'.
            +# There are too many San Juans elsewhere, so we'll use 'Puerto_Rico'.
             # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
             Zone America/Puerto_Rico -4:24:25 -	LMT	1899 Mar 28 12:00    # San Juan
             			-4:00	-	AST	1942 May  3
            @@ -3208,18 +3190,11 @@ Zone America/Puerto_Rico -4:24:25 -	LMT	1899 Mar 28 12:00    # San Juan
             			-4:00	-	AST
             
             # St Kitts-Nevis
            -# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
            -Zone America/St_Kitts	-4:10:52 -	LMT	1912 Mar 2	# Basseterre
            -			-4:00	-	AST
            -
             # St Lucia
            -# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
            -Zone America/St_Lucia	-4:04:00 -	LMT	1890		# Castries
            -			-4:04:00 -	CMT	1912	    # Castries Mean Time
            -			-4:00	-	AST
            +# See 'southamerica'.
             
             # St Pierre and Miquelon
            -# There are too many St Pierres elsewhere, so we'll use `Miquelon'.
            +# There are too many St Pierres elsewhere, so we'll use 'Miquelon'.
             # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
             Zone America/Miquelon	-3:44:40 -	LMT	1911 May 15	# St Pierre
             			-4:00	-	AST	1980 May
            @@ -3227,10 +3202,7 @@ Zone America/Miquelon	-3:44:40 -	LMT	1911 May 15	# St Pierre
             			-3:00	Canada	PM%sT
             
             # St Vincent and the Grenadines
            -# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
            -Zone America/St_Vincent	-4:04:56 -	LMT	1890		# Kingstown
            -			-4:04:56 -	KMT	1912	   # Kingstown Mean Time
            -			-4:00	-	AST
            +# See 'southamerica'.
             
             # Turks and Caicos
             #
            @@ -3260,15 +3232,9 @@ Rule	TC	2007	max	-	Mar	Sun>=8	2:00	1:00	D
             Rule	TC	2007	max	-	Nov	Sun>=1	2:00	0	S
             # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
             Zone America/Grand_Turk	-4:44:32 -	LMT	1890
            -			-5:07:12 -	KMT	1912 Feb    # Kingston Mean Time
            +			-5:07:11 -	KMT	1912 Feb    # Kingston Mean Time
             			-5:00	TC	E%sT
             
             # British Virgin Is
            -# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
            -Zone America/Tortola	-4:18:28 -	LMT	1911 Jul    # Road Town
            -			-4:00	-	AST
            -
             # Virgin Is
            -# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
            -Zone America/St_Thomas	-4:19:44 -	LMT	1911 Jul    # Charlotte Amalie
            -			-4:00	-	AST
            +# See 'southamerica'.
            diff --git a/jdk/make/sun/javazic/tzdata/southamerica b/jdk/make/sun/javazic/tzdata/southamerica
            index e7df18ad2c3..2230d066661 100644
            --- a/jdk/make/sun/javazic/tzdata/southamerica
            +++ b/jdk/make/sun/javazic/tzdata/southamerica
            @@ -474,6 +474,17 @@ Rule	Arg	2008	only	-	Oct	Sun>=15	0:00	1:00	S
             # rules...San Luis is still using "Western ARgentina Time" and it got
             # stuck on Summer daylight savings time even though the summer is over.
             
            +# From Paul Eggert (2013-09-05):
            +# Perhaps San Luis operates on the legal fiction that it is at UTC-4
            +# with perpetual summer time, but ordinary usage typically seems to
            +# just say it's at UTC-3; see, for example,
            +# .
            +# We've documented similar situations as being plain changes to
            +# standard time, so let's do that here too.  This does not change UTC
            +# offsets, only tm_isdst and the time zone abbreviations.  One minor
            +# plus is that this silences a zic complaint that there's no POSIX TZ
            +# setting for time stamps past 2038.
            +
             # From Paul Eggert (2013-02-21):
             # Milne says Cordoba time was -4:16:48.2.  Round to the nearest second.
             
            @@ -611,7 +622,7 @@ Zone America/Argentina/Mendoza -4:35:16 - LMT	1894 Oct 31
             # San Luis (SL)
             
             Rule	SanLuis	2008	2009	-	Mar	Sun>=8	0:00	0	-
            -Rule	SanLuis	2007	2009	-	Oct	Sun>=8	0:00	1:00	S
            +Rule	SanLuis	2007	2008	-	Oct	Sun>=8	0:00	1:00	S
             
             Zone America/Argentina/San_Luis -4:25:24 - LMT	1894 Oct 31
             			-4:16:48 -	CMT	1920 May
            @@ -627,7 +638,8 @@ Zone America/Argentina/San_Luis -4:25:24 - LMT	1894 Oct 31
             			-3:00	-	ART	2004 May 31
             			-4:00	-	WART	2004 Jul 25
             			-3:00	Arg	AR%sT	2008 Jan 21
            -			-4:00	SanLuis	WAR%sT
            +			-4:00	SanLuis	WAR%sT	2009 Oct 11
            +			-3:00	-	ART
             #
             # Santa Cruz (SC)
             Zone America/Argentina/Rio_Gallegos -4:36:52 - LMT 1894 Oct 31
            @@ -654,10 +666,7 @@ Zone America/Argentina/Ushuaia -4:33:12 - LMT 1894 Oct 31
             			-3:00	-	ART
             
             # Aruba
            -# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
            -Zone	America/Aruba	-4:40:24 -	LMT	1912 Feb 12	# Oranjestad
            -			-4:30	-	ANT	1965 # Netherlands Antilles Time
            -			-4:00	-	AST
            +Link America/Curacao America/Aruba
             
             # Bolivia
             # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
            @@ -859,6 +868,12 @@ Zone	America/La_Paz	-4:32:36 -	LMT	1890
             # Tocantins state will have DST.
             # http://noticias.terra.com.br/brasil/noticias/0,,OI6232536-EI306.html
             
            +# From Steffen Thorsen (2013-09-20):
            +# Tocantins in Brazil is very likely not to observe DST from October....
            +# http://conexaoto.com.br/2013/09/18/ministerio-confirma-que-tocantins-esta-fora-do-horario-de-verao-em-2013-mas-falta-publicacao-de-decreto
            +# We will keep this article updated when this is confirmed:
            +# http://www.timeanddate.com/news/time/brazil-starts-dst-2013.html
            +
             # Rule	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER/S
             # Decree 20,466 (1931-10-01)
             # Decree 21,896 (1932-01-10)
            @@ -1078,7 +1093,8 @@ Zone America/Araguaina	-3:12:48 -	LMT	1914
             			-3:00	-	BRT	1995 Sep 14
             			-3:00	Brazil	BR%sT	2003 Sep 24
             			-3:00	-	BRT	2012 Oct 21
            -			-3:00	Brazil	BR%sT
            +			-3:00	Brazil	BR%sT	2013 Sep
            +			-3:00	-	BRT
             #
             # Alagoas (AL), Sergipe (SE)
             Zone America/Maceio	-2:22:52 -	LMT	1914
            @@ -1373,12 +1389,12 @@ Zone	America/Curacao	-4:35:47 -	LMT	1912 Feb 12	# Willemstad
             			-4:00	-	AST
             
             # From Arthur David Olson (2011-06-15):
            -# At least for now, use links for places with new iso3166 codes.
            +# use links for places with new iso3166 codes.
             # The name "Lower Prince's Quarter" is both longer than fourteen charaters
             # and contains an apostrophe; use "Lower_Princes" below.
             
            -Link	America/Curacao	America/Lower_Princes # Sint Maarten
            -Link	America/Curacao	America/Kralendijk # Bonaire, Sint Estatius and Saba
            +Link	America/Curacao	America/Lower_Princes	# Sint Maarten
            +Link	America/Curacao	America/Kralendijk	# Caribbean Netherlands
             
             # Ecuador
             #
            @@ -1519,10 +1535,16 @@ Zone	America/Guyana	-3:52:40 -	LMT	1915 Mar	# Georgetown
             			-4:00	-	GYT
             
             # Paraguay
            +#
             # From Paul Eggert (2006-03-22):
             # Shanks & Pottenger say that spring transitions are from 01:00 -> 02:00,
             # and autumn transitions are from 00:00 -> 23:00.  Go with pre-1999
             # editions of Shanks, and with the IATA, who say transitions occur at 00:00.
            +#
            +# From Waldemar Villamayor-Venialbo (2013-09-20):
            +# No time of the day is established for the adjustment, so people normally
            +# adjust their clocks at 0 hour of the given dates.
            +#
             # Rule	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER/S
             Rule	Para	1975	1988	-	Oct	 1	0:00	1:00	S
             Rule	Para	1975	1978	-	Mar	 1	0:00	0	-
            @@ -1656,6 +1678,19 @@ Zone America/Paramaribo	-3:40:40 -	LMT	1911
             Zone America/Port_of_Spain -4:06:04 -	LMT	1912 Mar 2
             			-4:00	-	AST
             
            +Link America/Port_of_Spain America/Anguilla
            +Link America/Port_of_Spain America/Dominica
            +Link America/Port_of_Spain America/Grenada
            +Link America/Port_of_Spain America/Guadeloupe
            +Link America/Port_of_Spain America/Marigot
            +Link America/Port_of_Spain America/Montserrat
            +Link America/Port_of_Spain America/St_Barthelemy
            +Link America/Port_of_Spain America/St_Kitts
            +Link America/Port_of_Spain America/St_Lucia
            +Link America/Port_of_Spain America/St_Thomas
            +Link America/Port_of_Spain America/St_Vincent
            +Link America/Port_of_Spain America/Tortola
            +
             # Uruguay
             # From Paul Eggert (1993-11-18):
             # Uruguay wins the prize for the strangest peacetime manipulation of the rules.
            @@ -1673,7 +1708,7 @@ Rule	Uruguay	1937	1941	-	Mar	lastSun	 0:00	0	-
             # Whitman gives 1937 Oct 3; go with Shanks & Pottenger.
             Rule	Uruguay	1937	1940	-	Oct	lastSun	 0:00	0:30	HS
             # Whitman gives 1941 Oct 24 - 1942 Mar 27, 1942 Dec 14 - 1943 Apr 13,
            -# and 1943 Apr 13 ``to present time''; go with Shanks & Pottenger.
            +# and 1943 Apr 13 "to present time"; go with Shanks & Pottenger.
             Rule	Uruguay	1941	only	-	Aug	 1	 0:00	0:30	HS
             Rule	Uruguay	1942	only	-	Jan	 1	 0:00	0	-
             Rule	Uruguay	1942	only	-	Dec	14	 0:00	1:00	S
            diff --git a/jdk/make/sun/javazic/tzdata/zone.tab b/jdk/make/sun/javazic/tzdata/zone.tab
            index aa247c26df8..b34cdb0dc7d 100644
            --- a/jdk/make/sun/javazic/tzdata/zone.tab
            +++ b/jdk/make/sun/javazic/tzdata/zone.tab
            @@ -26,27 +26,30 @@
             # This file is in the public domain, so clarified as of
             # 2009-05-17 by Arthur David Olson.
             #
            -# From Paul Eggert (2013-05-27):
            +# From Paul Eggert (2013-08-14):
             #
            -# This file contains a table with the following columns:
            -# 1.  ISO 3166 2-character country code.  See the file `iso3166.tab'.
            -#     This identifies a country that overlaps the zone.  The country may
            -#     overlap other zones and the zone may overlap other countries.
            -# 2.  Latitude and longitude of the zone's principal location
            +# This file contains a table where each row stands for an area that is
            +# the intersection of a region identified by a country code and of a
            +# zone where civil clocks have agreed since 1970.  The columns of the
            +# table are as follows:
            +#
            +# 1.  ISO 3166 2-character country code.  See the file 'iso3166.tab'.
            +# 2.  Latitude and longitude of the area's principal location
             #     in ISO 6709 sign-degrees-minutes-seconds format,
             #     either +-DDMM+-DDDMM or +-DDMMSS+-DDDMMSS,
             #     first latitude (+ is north), then longitude (+ is east).
            -#     This location need not lie within the column-1 country.
             # 3.  Zone name used in value of TZ environment variable.
             #     Please see the 'Theory' file for how zone names are chosen.
            +#     If multiple zones overlap a country, each has a row in the
            +#     table, with column 1 being duplicated.
             # 4.  Comments; present if and only if the country has multiple rows.
             #
             # Columns are separated by a single tab.
             # The table is sorted first by country, then an order within the country that
             # (1) makes some geographical sense, and
            -# (2) puts the most populous zones first, where that does not contradict (1).
            +# (2) puts the most populous areas first, where that does not contradict (1).
             #
            -# Lines beginning with `#' are comments.
            +# Lines beginning with '#' are comments.
             #
             # This table is intended as an aid for users, to help them select time
             # zone data appropriate for their practical needs.  It is not intended
            @@ -62,8 +65,7 @@ AI	+1812-06304	America/Anguilla
             AL	+4120+01950	Europe/Tirane
             AM	+4011+04430	Asia/Yerevan
             AO	-0848+01314	Africa/Luanda
            -AQ	-7750+16636	Antarctica/McMurdo	McMurdo Station, Ross Island
            -AQ	-9000+00000	Antarctica/South_Pole	Amundsen-Scott Station, South Pole
            +AQ	-7750+16636	Antarctica/McMurdo	McMurdo, South Pole, Scott (New Zealand time)
             AQ	-6734-06808	Antarctica/Rothera	Rothera Station, Adelaide Island
             AQ	-6448-06406	Antarctica/Palmer	Palmer Station, Anvers Island
             AQ	-6736+06253	Antarctica/Mawson	Mawson Station, Holme Bay
            @@ -143,8 +145,7 @@ CA	+4612-05957	America/Glace_Bay	Atlantic Time - Nova Scotia - places that did n
             CA	+4606-06447	America/Moncton	Atlantic Time - New Brunswick
             CA	+5320-06025	America/Goose_Bay	Atlantic Time - Labrador - most locations
             CA	+5125-05707	America/Blanc-Sablon	Atlantic Standard Time - Quebec - Lower North Shore
            -CA	+4531-07334	America/Montreal	Eastern Time - Quebec - most locations
            -CA	+4339-07923	America/Toronto	Eastern Time - Ontario - most locations
            +CA	+4339-07923	America/Toronto	Eastern Time - Ontario & Quebec - most locations
             CA	+4901-08816	America/Nipigon	Eastern Time - Ontario & Quebec - places that did not observe DST 1967-1973
             CA	+4823-08915	America/Thunder_Bay	Eastern Time - Thunder Bay, Ontario
             CA	+6344-06828	America/Iqaluit	Eastern Time - east Nunavut - most locations
            @@ -255,7 +256,7 @@ IR	+3540+05126	Asia/Tehran
             IS	+6409-02151	Atlantic/Reykjavik
             IT	+4154+01229	Europe/Rome
             JE	+4912-00207	Europe/Jersey
            -JM	+1800-07648	America/Jamaica
            +JM	+175805-0764736	America/Jamaica
             JO	+3157+03556	Asia/Amman
             JP	+353916+1394441	Asia/Tokyo
             KE	-0117+03649	Africa/Nairobi
            @@ -444,8 +445,7 @@ US	+465042-1012439	America/North_Dakota/New_Salem	Central Time - North Dakota -
             US	+471551-1014640	America/North_Dakota/Beulah	Central Time - North Dakota - Mercer County
             US	+394421-1045903	America/Denver	Mountain Time
             US	+433649-1161209	America/Boise	Mountain Time - south Idaho & east Oregon
            -US	+364708-1084111	America/Shiprock	Mountain Time - Navajo
            -US	+332654-1120424	America/Phoenix	Mountain Standard Time - Arizona
            +US	+332654-1120424	America/Phoenix	Mountain Standard Time - Arizona (except Navajo)
             US	+340308-1181434	America/Los_Angeles	Pacific Time
             US	+611305-1495401	America/Anchorage	Alaska Time
             US	+581807-1342511	America/Juneau	Alaska Time - Alaska panhandle
            diff --git a/jdk/src/share/classes/sun/util/resources/TimeZoneNames.java b/jdk/src/share/classes/sun/util/resources/TimeZoneNames.java
            index 974fd26d051..81b28e79f14 100644
            --- a/jdk/src/share/classes/sun/util/resources/TimeZoneNames.java
            +++ b/jdk/src/share/classes/sun/util/resources/TimeZoneNames.java
            @@ -44,9 +44,6 @@ public final class TimeZoneNames extends TimeZoneNamesBundle {
             
                 protected final Object[][] getContents() {
                     // Note: generic names came from CLDR with some adjustments.
            -        String ACT[] = new String[] {"Acre Time", "ACT",
            -                                     "Acre Summer Time", "ACST",
            -                                     "Acre Time", "ACT"};
                     String ADELAIDE[] = new String[] {"Central Standard Time (South Australia)", "CST",
                                                       "Central Summer Time (South Australia)", "CST",
                                                       "Central Time (South Australia)", "CT"};
            @@ -95,9 +92,9 @@ public final class TimeZoneNames extends TimeZoneNamesBundle {
                     String CHUT[] = new String[] {"Chuuk Time", "CHUT",
                                                   "Chuuk Summer Time", "CHUST",
                                                   "Chuuk Time", "CHUT"};
            -        String CIT[] = new String[] {"Central Indonesia Time", "CIT",
            +        String CIT[] = new String[] {"Central Indonesia Time", "WITA",
                                                  "Central Indonesia Summer Time", "CIST",
            -                                     "Central Indonesia Time", "CIT"};
            +                                     "Central Indonesia Time", "WITA"};
                     String CLT[] = new String[] {"Chile Time", "CLT",
                                                  "Chile Summer Time", "CLST",
                                                  "Chile Time", "CLT"};
            @@ -251,9 +248,9 @@ public final class TimeZoneNames extends TimeZoneNamesBundle {
                     String WET[] = new String[] {"Western European Time", "WET",
                                                  "Western European Summer Time", "WEST",
                                                  "Western European Time", "WET"};
            -        String WIT[] = new String[] {"West Indonesia Time", "WIT",
            +        String WIT[] = new String[] {"West Indonesia Time", "WIB",
                                                  "West Indonesia Summer Time", "WIST",
            -                                     "West Indonesia Time", "WIT"};
            +                                     "West Indonesia Time", "WIB"};
                     String WST_AUS[] = new String[] {"Western Standard Time (Australia)", "WST",
                                                      "Western Summer Time (Australia)", "WST",
                                                      "Western Time (Australia)", "WT"};
            @@ -382,7 +379,7 @@ public final class TimeZoneNames extends TimeZoneNamesBundle {
                         {"America/Argentina/Rio_Gallegos", AGT},
                         {"America/Argentina/Salta", AGT},
                         {"America/Argentina/San_Juan", AGT},
            -            {"America/Argentina/San_Luis", WART},
            +            {"America/Argentina/San_Luis", AGT},
                         {"America/Argentina/Tucuman", AGT},
                         {"America/Argentina/Ushuaia", AGT},
                         {"America/Aruba", AST},
            @@ -578,7 +575,7 @@ public final class TimeZoneNames extends TimeZoneNamesBundle {
                         {"Asia/Almaty", new String[] {"Alma-Ata Time", "ALMT",
                                                       "Alma-Ata Summer Time", "ALMST",
                                                       "Alma-Ata Time", "ALMT"}},
            -            {"Asia/Amman", EET},
            +            {"Asia/Amman", ARAST},
                         {"Asia/Anadyr", new String[] {"Anadyr Time", "ANAT",
                                                       "Anadyr Summer Time", "ANAST",
                                                       "Anadyr Time", "ANAT"}},
            @@ -633,9 +630,9 @@ public final class TimeZoneNames extends TimeZoneNamesBundle {
                                                        "Irkutsk Time", "IRKT"}},
                         {"Asia/Istanbul", EET},
                         {"Asia/Jakarta", WIT},
            -            {"Asia/Jayapura", new String[] {"East Indonesia Time", "EIT",
            +            {"Asia/Jayapura", new String[] {"East Indonesia Time", "WIT",
                                                         "East Indonesia Summer Time", "EIST",
            -                                            "East Indonesia Time", "EIT"}},
            +                                            "East Indonesia Time", "WIT"}},
                         {"Asia/Kabul", new String[] {"Afghanistan Time", "AFT",
                                                      "Afghanistan Summer Time", "AFST",
                                                      "Afghanistan Time", "AFT"}},
            @@ -806,6 +803,7 @@ public final class TimeZoneNames extends TimeZoneNamesBundle {
                         {"Europe/Bratislava", CET},
                         {"Europe/Brussels", CET},
                         {"Europe/Budapest", CET},
            +            {"Europe/Busingen", CET},
                         {"Europe/Chisinau", EET},
                         {"Europe/Copenhagen", CET},
                         {"Europe/Dublin", DUBLIN},
            diff --git a/jdk/src/share/classes/sun/util/resources/de/TimeZoneNames_de.java b/jdk/src/share/classes/sun/util/resources/de/TimeZoneNames_de.java
            index 8dc71d7758f..b61fbd30719 100644
            --- a/jdk/src/share/classes/sun/util/resources/de/TimeZoneNames_de.java
            +++ b/jdk/src/share/classes/sun/util/resources/de/TimeZoneNames_de.java
            @@ -45,10 +45,8 @@ import sun.util.resources.TimeZoneNamesBundle;
             public final class TimeZoneNames_de extends TimeZoneNamesBundle {
             
                 protected final Object[][] getContents() {
            -        String ACT[] = new String[] {"Acre Normalzeit", "ACT",
            -                                     "Acre Sommerzeit", "ACST"};
            -        String ADELAIDE[] = new String[] {"Zentrale Normalzeit (S\u00fcdaustralien)", "CST",
            -                                          "Zentrale Sommerzeit (S\u00fcdaustralien)", "CST"};
            +        String ADELAIDE[] = new String[] {"Zentrale Normalzeit (S\u00FCdaustralien)", "CST",
            +                                          "Zentrale Sommerzeit (S\u00FCdaustralien)", "CST"};
                     String AGT[] = new String[] {"Argentinische Zeit", "ART",
                                                  "Argentinische Sommerzeit", "ARST"};
                     String AKST[] = new String[] {"Alaska Normalzeit", "AKST",
            @@ -63,10 +61,10 @@ public final class TimeZoneNames_de extends TimeZoneNamesBundle {
                                                  "Atlantik Sommerzeit", "ADT"};
                     String BDT[] = new String[] {"Bangladesch Zeit", "BDT",
                                                  "Bangladesch Sommerzeit", "BDST"};
            -        String BRISBANE[] = new String[] {"\u00d6stliche Normalzeit (Queensland)", "EST",
            -                                          "\u00d6stliche Sommerzeit (Queensland)", "EST"};
            -        String BROKEN_HILL[] = new String[] {"Zentrale Normalzeit (S\u00fcdaustralien/New South Wales)", "CST",
            -                                             "Zentrale Sommerzeit (S\u00fcdaustralien/New South Wales)", "CST"};
            +        String BRISBANE[] = new String[] {"\u00D6stliche Normalzeit (Queensland)", "EST",
            +                                          "\u00D6stliche Sommerzeit (Queensland)", "EST"};
            +        String BROKEN_HILL[] = new String[] {"Zentrale Normalzeit (S\u00FCdaustralien/New South Wales)", "CST",
            +                                             "Zentrale Sommerzeit (S\u00FCdaustralien/New South Wales)", "CST"};
                     String BRT[] = new String[] {"Brasilianische Zeit", "BRT",
                                                  "Brasilianische Sommerzeit", "BRST"};
                     String BTT[] = new String[] {"Bhutanische Zeit", "BTT",
            @@ -77,9 +75,9 @@ public final class TimeZoneNames_de extends TimeZoneNamesBundle {
                                                  "Mitteleurop\u00e4ische Sommerzeit", "MESZ"};
                     String CHAST[] = new String[] {"Chatham Normalzeit", "CHAST",
                                                    "Chatham Sommerzeit", "CHADT"};
            -        String CHUT[] = new String[] {"Chuuk Time", "CHUT",
            -                                      "Chuuk Summer Time", "CHUST"};
            -        String CIT[] = new String[] {"Zentralindonesische Zeit", "CIT",
            +        String CHUT[] = new String[] {"Chuuk Zeit", "CHUT",
            +                                      "Chuuk Sommerzeit", "CHUST"};
            +        String CIT[] = new String[] {"Zentralindonesische Zeit", "WITA",
                                                  "Zentralindonesische Sommerzeit", "CIST"};
                     String CLT[] = new String[] {"Chilenische Zeit", "CLT",
                                                  "Chilenische Sommerzeit", "CLST"};
            @@ -89,7 +87,7 @@ public final class TimeZoneNames_de extends TimeZoneNamesBundle {
                                                  "Chinesische Sommerzeit", "CDT"};
                     String CUBA[] = new String[] {"Kubanische Normalzeit", "CST",
                                                   "Kubanische Sommerzeit", "CDT"};
            -        String DARWIN[] = new String[] {"Zentrale Normalzeit (Northern Territory)", "CST",
            +        String DARWIN[] = new String[] {"Central Normalzeit (Northern Territory)", "CST",
                                                     "Zentrale Sommerzeit (Northern Territory)", "CST"};
                     String DUBLIN[] = new String[] {"Greenwich Zeit", "GMT",
                                                     "Irische Sommerzeit", "IST"};
            @@ -103,10 +101,10 @@ public final class TimeZoneNames_de extends TimeZoneNamesBundle {
                                                  "Ostgr\u00f6nl\u00e4ndische Sommerzeit", "EGST"};
                     String EST[] = new String[] {"\u00d6stliche Normalzeit", "EST",
                                                  "\u00d6stliche Sommerzeit", "EDT"};
            -        String EST_NSW[] = new String[] {"\u00d6stliche Normalzeit (New South Wales)", "EST",
            -                                         "\u00d6stliche Sommerzeit (New South Wales)", "EST"};
            -        String FET[] = new String[] {"Further-eastern European Time", "FET",
            -                                     "Further-eastern European Summer Time", "FEST"};
            +        String EST_NSW[] = new String[] {"Eastern Normalzeit (Neus\u00FCdwales)", "EST",
            +                                         "\u00D6stliche Sommerzeit (New South Wales)", "EST"};
            +        String FET[] = new String[] {"Kaliningrader Zeit", "FET",
            +                                     "Kaliningrader Sommerzeit", "FEST"};
                     String GHMT[] = new String[] {"Ghanaische Normalzeit", "GMT",
                                                   "Ghanaische Sommerzeit", "GHST"};
                     String GAMBIER[] =  new String[] {"Gambier Zeit", "GAMT",
            @@ -159,8 +157,8 @@ public final class TimeZoneNames_de extends TimeZoneNamesBundle {
                                                       "Pitcairn Sommerzeit", "PDT"};
                     String PKT[] = new String[] {"Pakistanische Zeit", "PKT",
                                                  "Pakistanische Sommerzeit", "PKST"};
            -        String PONT[] = new String[] {"Pohnpei Time", "PONT",
            -                                      "Pohnpei Summer Time", "PONST"};
            +        String PONT[] = new String[] {"Pohnpei Zeit", "PONT",
            +                                      "Pohnpei Sommerzeit", "PONST"};
                     String PST[] = new String[] {"Pazifische Normalzeit", "PST",
                                                  "Pazifische Sommerzeit", "PDT"};
                     String SAST[] = new String[] {"S\u00fcdafrikanische Normalzeit", "SAST",
            @@ -171,8 +169,8 @@ public final class TimeZoneNames_de extends TimeZoneNamesBundle {
                                                  "Singapur Sommerzeit", "SGST"};
                     String SLST[] = new String[] {"Greenwich Normalzeit", "GMT",
                                                   "Sierra Leone Sommerzeit", "SLST"};
            -        String TASMANIA[] = new String[] {"\u00d6stliche Normalzeit (Tasmanien)", "EST",
            -                                          "\u00d6stliche Sommerzeit (Tasmanien)", "EST"};
            +        String TASMANIA[] = new String[] {"\u00D6stliche Normalzeit (Tasmanien)", "EST",
            +                                          "\u00D6stliche Sommerzeit (Tasmanien)", "EST"};
                     String TMT[] = new String[] {"Turkmenische Zeit", "TMT",
                                                  "Turkmenische Sommerzeit", "TMST"};
                     String ULAT[]= new String[] {"Ulaanbaatar Zeit", "ULAT",
            @@ -183,7 +181,7 @@ public final class TimeZoneNames_de extends TimeZoneNamesBundle {
                                                  "Westafrikanische Sommerzeit", "WAST"};
                     String WET[] = new String[] {"Westeurop\u00e4ische Zeit", "WEZ",
                                                  "Westeurop\u00e4ische Sommerzeit", "WESZ"};
            -        String WIT[] = new String[] {"Westindonesische Zeit", "WIT",
            +        String WIT[] = new String[] {"Westindonesische Zeit", "WIB",
                                                  "Westindonesische Sommerzeit", "WIST"};
                     String WST_AUS[] = new String[] {"Westliche Normalzeit (Australien)", "WST",
                                                      "Westliche Sommerzeit (Australien)", "WST"};
            @@ -193,8 +191,8 @@ public final class TimeZoneNames_de extends TimeZoneNamesBundle {
                                                        "West Samoa Sommerzeit", "WSDT"};
                     String ChST[] = new String[] {"Chamorro Normalzeit", "ChST",
                                   "Chamorro Sommerzeit", "ChDT"};
            -        String VICTORIA[] = new String[] {"\u00d6stliche Normalzeit (Victoria)", "EST",
            -                                          "\u00d6stliche Sommerzeit (Victoria)", "EST"};
            +        String VICTORIA[] = new String[] {"\u00D6stliche Normalzeit (Victoria)", "EST",
            +                                          "\u00D6stliche Sommerzeit (Victoria)", "EST"};
                     String UTC[] = new String[] {"Koordinierte Universalzeit", "UTC",
                                                  "Koordinierte Universalzeit", "UTC"};
                     String UZT[] = new String[] {"Usbekistan Zeit", "UZT",
            @@ -306,7 +304,7 @@ public final class TimeZoneNames_de extends TimeZoneNamesBundle {
                         {"America/Argentina/Rio_Gallegos", AGT},
                         {"America/Argentina/Salta", AGT},
                         {"America/Argentina/San_Juan", AGT},
            -            {"America/Argentina/San_Luis", WART},
            +            {"America/Argentina/San_Luis", AGT},
                         {"America/Argentina/Tucuman", AGT},
                         {"America/Argentina/Ushuaia", AGT},
                         {"America/Aruba", AST},
            @@ -399,8 +397,8 @@ public final class TimeZoneNames_de extends TimeZoneNamesBundle {
                         {"America/Mendoza", AGT},
                         {"America/Menominee", CST},
                         {"America/Merida", CST},
            -            {"America/Metlakatla", new String[] {"Metlakatla Standard Time", "MeST",
            -                                                 "Metlakatla Daylight Time", "MeDT"}},
            +            {"America/Metlakatla", new String[] {"Metlakatla Normalzeit", "MeST",
            +                                                 "Metlakatla Sommerzeit", "MeDT"}},
                         {"America/Mexico_City", CST},
                         {"America/Miquelon", new String[] {"Pierre & Miquelon Normalzeit", "PMST",
                                                            "Pierre & Miquelon Sommerzeit", "PMDT"}},
            @@ -464,8 +462,8 @@ public final class TimeZoneNames_de extends TimeZoneNamesBundle {
                                                            "Davis Sommerzeit", "DAVST"}},
                         {"Antarctica/DumontDUrville", new String[] {"Dumont-d'Urville Zeit", "DDUT",
                                                                     "Dumont-d'Urville Sommerzeit", "DDUST"}},
            -            {"Antarctica/Macquarie", new String[] {"Macquarie Island Time", "MIST",
            -                                                   "Macquarie Island Summer Time", "MIST"}},
            +            {"Antarctica/Macquarie", new String[] {"Macquarieinsel Zeit", "MIST",
            +                                                   "Macquarieinsel Sommerzeit", "MIST"}},
                         {"Antarctica/Mawson", new String[] {"Mawson Zeit", "MAWT",
                                                             "Mawson Sommerzeit", "MAWST"}},
                         {"Antarctica/McMurdo", NZST},
            @@ -481,7 +479,7 @@ public final class TimeZoneNames_de extends TimeZoneNamesBundle {
                         {"Asia/Aden", ARAST},
                         {"Asia/Almaty", new String[] {"Alma Ata Zeit", "ALMT",
                                                       "Alma-Ata Sommerzeit", "ALMST"}},
            -            {"Asia/Amman", EET},
            +            {"Asia/Amman", ARAST},
                         {"Asia/Anadyr", new String[] {"Anadyr Zeit", "ANAT",
                                                       "Anadyr Sommerzeit", "ANAST"}},
                         {"Asia/Aqtau", new String[] {"Aqtau Zeit", "AQTT",
            @@ -525,7 +523,7 @@ public final class TimeZoneNames_de extends TimeZoneNamesBundle {
                                                        "Irkutsk Sommerzeit", "IRKST"}},
                         {"Asia/Istanbul", EET},
                         {"Asia/Jakarta", WIT},
            -            {"Asia/Jayapura", new String[] {"Ostindonesische Zeit", "EIT",
            +            {"Asia/Jayapura", new String[] {"Ostindonesische Zeit", "WIT",
                                                         "Ostindonesische Sommerzeit", "EIST"}},
                         {"Asia/Kabul", new String[] {"Afghanistanische Zeit", "AFT",
                                                      "Afghanistanische Sommerzeit", "AFST"}},
            @@ -535,8 +533,8 @@ public final class TimeZoneNames_de extends TimeZoneNamesBundle {
                         {"Asia/Kashgar", CTT},
                         {"Asia/Kathmandu", NPT},
                         {"Asia/Katmandu", NPT},
            -            {"Asia/Khandyga", new String[] {"Khandyga Time", "YAKT",
            -                                            "Khandyga Summer Time", "YAKST"}},
            +            {"Asia/Khandyga", new String[] {"Chandyga Zeit", "YAKT",
            +                                            "Chandyga Sommerzeit", "YAKST"}},
                         {"Asia/Kolkata", IST},
                         {"Asia/Krasnoyarsk", new String[] {"Krasnojarsker Zeit", "KRAT",
                                                            "Krasnojarsker Sommerzeit", "KRAST"}},
            @@ -585,8 +583,8 @@ public final class TimeZoneNames_de extends TimeZoneNamesBundle {
                         {"Asia/Ulaanbaatar", ULAT},
                         {"Asia/Ulan_Bator", ULAT},
                         {"Asia/Urumqi", CTT},
            -            {"Asia/Ust-Nera", new String[] {"Ust-Nera Time", "VLAT",
            -                                            "Ust-Nera Summer Time", "VLAST"}},
            +            {"Asia/Ust-Nera", new String[] {"Ust-Nera Zeit", "VLAT",
            +                                            "Ust-Nera Sommerzeit", "VLAST"}},
                         {"Asia/Vientiane", ICT},
                         {"Asia/Vladivostok", new String[] {"Wladiwostok Zeit", "VLAT",
                                                            "Wladiwostok Sommerzeit", "VLAST"}},
            @@ -675,6 +673,7 @@ public final class TimeZoneNames_de extends TimeZoneNamesBundle {
                         {"Europe/Bratislava", CET},
                         {"Europe/Brussels", CET},
                         {"Europe/Budapest", CET},
            +            {"Europe/Busingen", CET},
                         {"Europe/Chisinau", EET},
                         {"Europe/Copenhagen", CET},
                         {"Europe/Dublin", DUBLIN},
            diff --git a/jdk/src/share/classes/sun/util/resources/es/TimeZoneNames_es.java b/jdk/src/share/classes/sun/util/resources/es/TimeZoneNames_es.java
            index 66e3e02acb2..822ba2d41c0 100644
            --- a/jdk/src/share/classes/sun/util/resources/es/TimeZoneNames_es.java
            +++ b/jdk/src/share/classes/sun/util/resources/es/TimeZoneNames_es.java
            @@ -45,9 +45,7 @@ import sun.util.resources.TimeZoneNamesBundle;
             public final class TimeZoneNames_es extends TimeZoneNamesBundle {
             
                 protected final Object[][] getContents() {
            -        String ACT[] = new String[] {"Hora de Acre", "ACT",
            -                                     "Hora de verano de Acre", "ACST"};
            -        String ADELAIDE[] = new String[] {"Hora est\u00e1ndar Central (Sur de Australia)", "CST",
            +        String ADELAIDE[] = new String[] {"Hora est\u00E1ndar Central (Sur de Australia)", "CST",
                                                       "Hora de verano Central (Sur de Australia)", "CST"};
                     String AGT[] = new String[] {"Hora de Argentina", "ART",
                                                  "Hora de verano de Argentina", "ARST"};
            @@ -63,9 +61,9 @@ public final class TimeZoneNames_es extends TimeZoneNamesBundle {
                                                  "Hora de verano Atl\u00e1ntico", "ADT"};
                     String BDT[] = new String[] {"Hora de Bangladesh", "BDT",
                                                  "Hora de verano de Bangladesh", "BDST"};
            -        String BRISBANE[] = new String[] {"Hora est\u00e1ndar del Este (Queensland)", "EST",
            -                                          "Hora de verano del Este (Queensland)", "EST"};
            -        String BROKEN_HILL[] = new String[] {"Hora est\u00e1ndar Central (Sur de Australia/Nueva Gales del Sur)", "CST",
            +        String BRISBANE[] = new String[] {"Hora est\u00E1ndar del Este (Queensland)", "EST",
            +                                          "Hora est\u00E1ndar de verano del Este (Queensland)", "EST"};
            +        String BROKEN_HILL[] = new String[] {"Hora est\u00E1ndar Central (Sur de Australia/Nueva Gales del Sur)", "CST",
                                                          "Hora de verano Central (Sur de Australia/Nueva Gales del Sur)", "CST"};
                     String BRT[] = new String[] {"Hora de Brasil", "BRT",
                                                  "Hora de verano de Brasil", "BRST"};
            @@ -79,7 +77,7 @@ public final class TimeZoneNames_es extends TimeZoneNamesBundle {
                                                    "Hora de verano de Chatham", "CHADT"};
                     String CHUT[] = new String[] {"Chuuk Time", "CHUT",
                                                   "Chuuk Summer Time", "CHUST"};
            -        String CIT[] = new String[] {"Hora de Indonesia Central", "CIT",
            +        String CIT[] = new String[] {"Hora de Indonesia Central", "WITA",
                                                  "Hora de verano de Indonesia Central", "CIST"};
                     String CLT[] = new String[] {"Hora de Chile", "CLT",
                                                  "Hora de verano de Chile", "CLST"};
            @@ -89,7 +87,7 @@ public final class TimeZoneNames_es extends TimeZoneNamesBundle {
                                                  "Hora de verano de China", "CDT"};
                     String CUBA[] = new String[] {"Hora est\u00e1ndar de Cuba", "CST",
                                                   "Hora de verano de Cuba", "CDT"};
            -        String DARWIN[] = new String[] {"Hora est\u00e1ndar Central (territorio del Norte)", "CST",
            +        String DARWIN[] = new String[] {"Hora est\u00E1ndar Central (territorio del Norte)", "CST",
                                                     "Hora de verano Central (territorio del Norte)", "CST"};
                     String DUBLIN[] = new String[] {"Hora del Meridiano de Greenwich", "GMT",
                                                     "Hora de verano de Irlanda", "IST"};
            @@ -103,10 +101,10 @@ public final class TimeZoneNames_es extends TimeZoneNamesBundle {
                                                  "Hora de verano de Groenlandia Oriental", "EGST"};
                     String EST[] = new String[] {"Hora est\u00e1ndar Oriental", "EST",
                                                  "Hora de verano Oriental", "EDT"};
            -        String EST_NSW[] = new String[] {"Hora est\u00e1ndar Oriental (Nueva Gales del Sur)", "EST",
            +        String EST_NSW[] = new String[] {"Hora est\u00E1ndar Oriental (Nueva Gales del Sur)", "EST",
                                                      "Hora de verano Oriental (Nueva Gales del Sur)", "EST"};
            -        String FET[] = new String[] {"Further-eastern European Time", "FET",
            -                                     "Further-eastern European Summer Time", "FEST"};
            +        String FET[] = new String[] {"Hora de Europa m\u00E1s Oriental", "FET",
            +                                     "Hora de verano de Europa m\u00E1s Oriental", "FEST"};
                     String GHMT[] = new String[] {"Hora central de Ghana", "GMT",
                                                   "Hora de verano de Ghana", "GHST"};
                     String GAMBIER[] =  new String[] {"Hora de Gambier", "GAMT",
            @@ -171,7 +169,7 @@ public final class TimeZoneNames_es extends TimeZoneNamesBundle {
                                                  "Hora de verano de  Singapur", "SGST"};
                     String SLST[] = new String[] {"Hora del Meridiano de Greenwich", "GMT",
                                                   "Hora de verano de Sierra Leona", "SLST"};
            -        String TASMANIA[] = new String[] {"Hora est\u00e1ndar del Este (Tasmania)", "EST",
            +        String TASMANIA[] = new String[] {"Hora est\u00E1ndar del Este (Tasmania)", "EST",
                                                       "Hora de verano del Este (Tasmania)", "EST"};
                     String TMT[] = new String[] {"Hora de Turkmenist\u00e1n", "TMT",
                                                  "Hora de verano de Turkmenist\u00e1n", "TMST"};
            @@ -183,9 +181,9 @@ public final class TimeZoneNames_es extends TimeZoneNamesBundle {
                                                  "Hora de verano de \u00c1frica Occidental", "WAST"};
                     String WET[] = new String[] {"Hora de Europa Occidental", "WET",
                                                  "Hora de verano de Europa Occidental", "WEST"};
            -        String WIT[] = new String[] {"Hora de Indonesia Occidental", "WIT",
            +        String WIT[] = new String[] {"Hora de Indonesia Occidental", "WIB",
                                                  "Indonesia Hora de verano de Indonesia Occidental", "WIST"};
            -        String WST_AUS[] = new String[] {"Hora est\u00e1ndar Occidental (Australia)", "WST",
            +        String WST_AUS[] = new String[] {"Hora est\u00E1ndar Occidental (Australia)", "WST",
                                                      "Hora de verano Occidental (Australia)", "WST"};
                     String SAMOA[] = new String[] {"Hora est\u00e1ndar de Samoa", "SST",
                                                    "Hora de verano de Samoa", "SDT"};
            @@ -193,7 +191,7 @@ public final class TimeZoneNames_es extends TimeZoneNamesBundle {
                                                        "Hora de verano de Samoa Occidental", "WSDT"};
                     String ChST[] = new String[] {"Hora est\u00e1ndar de Chamorro", "ChST",
                                                   "Hora de verano de Chamorro", "ChDT"};
            -        String VICTORIA[] = new String[] {"Hora est\u00e1ndar del Este (Victoria)", "EST",
            +        String VICTORIA[] = new String[] {"Hora est\u00E1ndar del Este (Victoria)", "EST",
                                                       "Hora de verano del Este (Victoria)", "EST"};
                     String UTC[] = new String[] {"Hora Universal Coordinada", "UTC",
                                                  "Hora Universal Coordinada", "UTC"};
            @@ -306,7 +304,7 @@ public final class TimeZoneNames_es extends TimeZoneNamesBundle {
                         {"America/Argentina/Rio_Gallegos", AGT},
                         {"America/Argentina/Salta", AGT},
                         {"America/Argentina/San_Juan", AGT},
            -            {"America/Argentina/San_Luis", WART},
            +            {"America/Argentina/San_Luis", AGT},
                         {"America/Argentina/Tucuman", AGT},
                         {"America/Argentina/Ushuaia", AGT},
                         {"America/Aruba", AST},
            @@ -481,7 +479,7 @@ public final class TimeZoneNames_es extends TimeZoneNamesBundle {
                         {"Asia/Aden", ARAST},
                         {"Asia/Almaty", new String[] {"Hora de Alma-Ata", "ALMT",
                                                       "Hora de verano de Alma-Ata", "ALMST"}},
            -            {"Asia/Amman", EET},
            +            {"Asia/Amman", ARAST},
                         {"Asia/Anadyr", new String[] {"Hora de Anadyr", "ANAT",
                                                       "Hora de verano de Anadyr", "ANAST"}},
                         {"Asia/Aqtau", new String[] {"Hora de Aqtau", "AQTT",
            @@ -525,7 +523,7 @@ public final class TimeZoneNames_es extends TimeZoneNamesBundle {
                                                        "Hora de verano de Irkutsk", "IRKST"}},
                         {"Asia/Istanbul", EET},
                         {"Asia/Jakarta", WIT},
            -            {"Asia/Jayapura", new String[] {"Hora de Indonesia Oriental", "EIT",
            +            {"Asia/Jayapura", new String[] {"Hora de Indonesia Oriental", "WIT",
                                                         "Hora de verano de Indonesia Oriental", "EIST"}},
                         {"Asia/Kabul", new String[] {"Hora de Afganist\u00e1n", "AFT",
                                                      "Hora de verano de Afganist\u00e1n", "AFST"}},
            @@ -535,8 +533,8 @@ public final class TimeZoneNames_es extends TimeZoneNamesBundle {
                         {"Asia/Kashgar", CTT},
                         {"Asia/Kathmandu", NPT},
                         {"Asia/Katmandu", NPT},
            -            {"Asia/Khandyga", new String[] {"Khandyga Time", "YAKT",
            -                                            "Khandyga Summer Time", "YAKST"}},
            +            {"Asia/Khandyga", new String[] {"Hora de Khandyga", "YAKT",
            +                                            "Hora de verano de Khandyga", "YAKST"}},
                         {"Asia/Kolkata", IST},
                         {"Asia/Krasnoyarsk", new String[] {"Hora de Krasnoyarsk", "KRAT",
                                                            "Hora de verano de Krasnoyarsk", "KRAST"}},
            @@ -585,8 +583,8 @@ public final class TimeZoneNames_es extends TimeZoneNamesBundle {
                         {"Asia/Ulaanbaatar", ULAT},
                         {"Asia/Ulan_Bator", ULAT},
                         {"Asia/Urumqi", CTT},
            -            {"Asia/Ust-Nera", new String[] {"Ust-Nera Time", "VLAT",
            -                                            "Ust-Nera Summer Time", "VLAST"}},
            +            {"Asia/Ust-Nera", new String[] {"Hora de Ust-Nera", "VLAT",
            +                                            "Hora de verano de Ust-Nera", "VLAST"}},
                         {"Asia/Vientiane", ICT},
                         {"Asia/Vladivostok", new String[] {"Hora de Vladivostok", "VLAT",
                                                            "Hora de verano de Vladivostok", "VLAST"}},
            @@ -618,8 +616,8 @@ public final class TimeZoneNames_es extends TimeZoneNamesBundle {
                         {"Australia/Canberra", EST_NSW},
                         {"Australia/Currie", EST_NSW},
                         {"Australia/Darwin", DARWIN},
            -            {"Australia/Eucla", new String[] {"Hora est\u00e1ndar de Australia Central y Occidental", "CWST",
            -                                              "Hora de verano de Australia Central y Occidental", "CWST"}},
            +            {"Australia/Eucla", new String[] {"Hora est\u00E1ndar de Australia Central y Occidental", "CWST",
            +                                              "Hora est\u00E1ndar de verano de Australia Central y Occidental", "CWST"}},
                         {"Australia/Hobart", TASMANIA},
                         {"Australia/LHI", LORD_HOWE},
                         {"Australia/Lindeman", BRISBANE},
            @@ -675,6 +673,7 @@ public final class TimeZoneNames_es extends TimeZoneNamesBundle {
                         {"Europe/Bratislava", CET},
                         {"Europe/Brussels", CET},
                         {"Europe/Budapest", CET},
            +            {"Europe/Busingen", CET},
                         {"Europe/Chisinau", EET},
                         {"Europe/Copenhagen", CET},
                         {"Europe/Dublin", DUBLIN},
            diff --git a/jdk/src/share/classes/sun/util/resources/fr/TimeZoneNames_fr.java b/jdk/src/share/classes/sun/util/resources/fr/TimeZoneNames_fr.java
            index 2d960819cd7..fd487e20928 100644
            --- a/jdk/src/share/classes/sun/util/resources/fr/TimeZoneNames_fr.java
            +++ b/jdk/src/share/classes/sun/util/resources/fr/TimeZoneNames_fr.java
            @@ -45,10 +45,8 @@ import sun.util.resources.TimeZoneNamesBundle;
             public final class TimeZoneNames_fr extends TimeZoneNamesBundle {
             
                 protected final Object[][] getContents() {
            -        String ACT[] = new String[] {"Heure de l'Acre", "ACT",
            -                                     "Heure d'\u00e9t\u00e9 de l'Acre", "ACST"};
                     String ADELAIDE[] = new String[] {"Heure standard d'Australie centrale (Australie du sud)", "CST",
            -                                          "Heure d'\u00e9t\u00e9 d'Australie centrale (Australie du sud)", "CST"};
            +                                          "Heure d'\u00E9t\u00E9 d'Australie centrale (Australie du sud)", "CST"};
                     String AGT[] = new String[] {"Heure D'Argentine", "ART",
                                                  "Heure d'\u00e9t\u00e9 D'Argentine", "ARST"} ;
                     String AKST[] = new String[] {"Heure normale d'Alaska", "AKST",
            @@ -64,9 +62,9 @@ public final class TimeZoneNames_fr extends TimeZoneNamesBundle {
                     String BDT[] = new String[] {"Heure du Bangladesh", "BDT",
                                                  "Heure d'\u00e9t\u00e9 du Bangladesh", "BDST"} ;
                     String BRISBANE[] = new String[] {"Heure standard d'Australie orientale (Queensland)", "EST",
            -                                          "Heure d'\u00e9t\u00e9 d'Australie orientale (Queensland)", "EST"};
            +                                          "Heure d'\u00E9t\u00E9 d'Australie orientale (Queensland)", "EST"};
                     String BROKEN_HILL[] = new String[] {"Heure standard d'Australie centrale (Australie du sud/Nouvelle-Galles du sud)", "CST",
            -                                             "Heure d'\u00e9t\u00e9 d'Australie centrale(Australie du sud/Nouvelle-Galles du sud)", "CST"};
            +                                             "Heure d'\u00E9t\u00E9 d'Australie centrale (Australie du sud/Nouvelle-Galles du sud)", "CST"};
                     String BRT[] = new String[] {"Heure du Br\u00e9sil", "BRT",
                                                  "Heure d'\u00e9t\u00e9 du Br\u00e9sil", "BRST"} ;
                     String BTT[] = new String[] {"Heure du Bhoutan", "BTT",
            @@ -77,9 +75,9 @@ public final class TimeZoneNames_fr extends TimeZoneNamesBundle {
                                                  "Heure d'\u00e9t\u00e9 d'Europe centrale", "CEST"} ;
                     String CHAST[] = new String[] {"Heure standard de Chatham", "CHAST",
                                                    "Heure avanc\u00e9e de Chatham", "CHADT"};
            -        String CHUT[] = new String[] {"Chuuk Time", "CHUT",
            -                                      "Chuuk Summer Time", "CHUST"};
            -        String CIT[] = new String[] {"Heure d'Indon\u00e9sie centrale", "CIT",
            +        String CHUT[] = new String[] {"Heure de Chuuk", "CHUT",
            +                                      "Heure d'\u00E9t\u00E9 de Chuuk", "CHUST"};
            +        String CIT[] = new String[] {"Heure d'Indon\u00e9sie centrale", "WITA",
                                                  "Heure d'\u00e9t\u00e9 d'Indon\u00e9sie centrale", "CIST"};
                     String CLT[] = new String[] {"Heure du Chili", "CLT",
                                                  "Heure d'\u00e9t\u00e9 du Chili", "CLST"} ;
            @@ -90,7 +88,7 @@ public final class TimeZoneNames_fr extends TimeZoneNamesBundle {
                     String CUBA[] = new String[] {"Heure standard de Cuba", "CST",
                                                   "Heure d'\u00e9t\u00e9 de Cuba", "CDT"};
                     String DARWIN[] = new String[] {"Heure standard d'Australie centrale (Territoire du Nord)", "CST",
            -                                        "Heure d'\u00e9t\u00e9 d'Australie centrale (Territoire du Nord)", "CST"};
            +                                        "Heure d'\u00E9t\u00E9 d'Australie centrale (Territoire du Nord)", "CST"};
                     String DUBLIN[] = new String[] {"Heure du m\u00e9ridien de Greenwich", "GMT",
                                                     "Heure d'\u00e9t\u00e9 irlandaise", "IST"};
                     String EAT[] = new String[] {"Heure d'Afrique de l'Est", "EAT",
            @@ -104,9 +102,9 @@ public final class TimeZoneNames_fr extends TimeZoneNamesBundle {
                     String EST[] = new String[] {"Heure normale de l'Est", "EST",
                                                  "Heure avanc\u00e9e de l'Est", "EDT"} ;
                     String EST_NSW[] = new String[] {"Heure normale de l'Est (Nouvelle-Galles du Sud)", "EST",
            -                                         "Heure d'\u00e9t\u00e9 de l'Est (Nouvelle-Galles du Sud)", "EST"} ;
            -        String FET[] = new String[] {"Further-eastern European Time", "FET",
            -                                     "Further-eastern European Summer Time", "FEST"};
            +                                         "Heure d'\u00E9t\u00E9 de l'Est (Nouvelle-Galles du Sud)", "EST"} ;
            +        String FET[] = new String[] {"Heure d'Europe de l'Est UTC+3", "FET",
            +                                     "Heure d'\u00E9t\u00E9 d'Europe de l'Est UTC+3", "FEST"};
                     String GHMT[] = new String[] {"Heure du Ghana", "GMT",
                                                   "Heure d'\u00e9t\u00e9 du Ghana", "GHST"};
                     String GAMBIER[] =  new String[] {"Heure de Gambi", "GAMT",
            @@ -159,8 +157,8 @@ public final class TimeZoneNames_fr extends TimeZoneNamesBundle {
                                                       "heure avanc\u00e9e des Pitcairn", "PDT"};
                     String PKT[] = new String[] {"Heure du Pakistan", "PKT",
                                                  "Heure d'\u00e9t\u00e9 du Pakistan", "PKST"} ;
            -        String PONT[] = new String[] {"Pohnpei Time", "PONT",
            -                                      "Pohnpei Summer Time", "PONST"};
            +        String PONT[] = new String[] {"Heure de Pohnpei", "PONT",
            +                                      "Heure d'\u00E9t\u00E9 de Pohnpei", "PONST"};
                     String PST[] = new String[] {"Heure normale du Pacifique", "PST",
                                                  "Heure avanc\u00e9e du Pacifique", "PDT"} ;
                     String SAST[] = new String[] {"Heure normale d'Afrique du Sud", "SAST",
            @@ -172,7 +170,7 @@ public final class TimeZoneNames_fr extends TimeZoneNamesBundle {
                     String SLST[] = new String[] {"Heure du m\u00e9ridien de Greenwich", "GMT",
                                                   "Heure d'\u00e9t\u00e9 de Sierra Leone", "SLST"};
                     String TASMANIA[] = new String[] {"Heure standard d'Australie orientale (Tasmanie)", "EST",
            -                                          "Heure d'\u00e9t\u00e9 d'Australie orientale (Tasmanie)", "EST"};
            +                                          "Heure d'\u00E9t\u00E9 d'Australie orientale (Tasmanie)", "EST"};
                     String TMT[] = new String[] {"Heure du Turkm\u00e9nistan", "TMT",
                                                  "Heure d'\u00e9t\u00e9 du Turkm\u00e9nistan", "TMST"} ;
                     String ULAT[]= new String[] {"Heure de l'Ulaanbaatar", "ULAT",
            @@ -183,10 +181,10 @@ public final class TimeZoneNames_fr extends TimeZoneNamesBundle {
                                                  "Heure d'\u00e9t\u00e9 d'Afrique de l'Ouest", "WAST"} ;
                     String WET[] = new String[] {"Heure d'Europe de l'Ouest", "WET",
                                                  "Heure d'\u00e9t\u00e9 d'Europe de l'Ouest", "WEST"} ;
            -        String WIT[] = new String[] {"Heure de l'Indon\u00e9sie occidentale", "WIT",
            +        String WIT[] = new String[] {"Heure de l'Indon\u00e9sie occidentale", "WIB",
                                                  "Heure d'\u00e9t\u00e9 de l'Indon\u00e9sie occidentale", "WIST"};
                     String WST_AUS[] = new String[] {"Heure normale de l'Ouest (Australie)", "WST",
            -                                         "Heure d'\u00e9t\u00e9 de l'Ouest (Australie)", "WST"} ;
            +                                         "Heure d'\u00E9t\u00E9 de l'Ouest (Australie)", "WST"} ;
                     String SAMOA[] = new String[] {"Heure standard de Samoa", "SST",
                                                    "Heure avanc\u00e9e de Samoa", "SDT"};
                     String WST_SAMOA[] = new String[] {"Heure des Samoas occidentales", "WST",
            @@ -194,7 +192,7 @@ public final class TimeZoneNames_fr extends TimeZoneNamesBundle {
                     String ChST[] = new String[] {"Heure normale des \u00eeles Mariannes", "ChST",
                                   "Heure d'\u00e9t\u00e9 des \u00eeles Mariannes", "ChDT"};
                     String VICTORIA[] = new String[] {"Heure standard d'Australie orientale (Victoria)", "EST",
            -                                          "Heure d'\u00e9t\u00e9 d'Australie orientale (Victoria)", "EST"};
            +                                          "Heure d'\u00E9t\u00E9 d'Australie orientale (Victoria)", "EST"};
                     String UTC[] = new String[] {"Temps universel coordonn\u00e9", "UTC",
                                                  "Temps universel coordonn\u00e9", "UTC"};
                     String UZT[] = new String[] {"Heure de l'Ouzb\u00e9kistan", "UZT",
            @@ -306,7 +304,7 @@ public final class TimeZoneNames_fr extends TimeZoneNamesBundle {
                         {"America/Argentina/Rio_Gallegos", AGT},
                         {"America/Argentina/Salta", AGT},
                         {"America/Argentina/San_Juan", AGT},
            -            {"America/Argentina/San_Luis", WART},
            +            {"America/Argentina/San_Luis", AGT},
                         {"America/Argentina/Tucuman", AGT},
                         {"America/Argentina/Ushuaia", AGT},
                         {"America/Aruba", AST},
            @@ -399,8 +397,8 @@ public final class TimeZoneNames_fr extends TimeZoneNamesBundle {
                         {"America/Mendoza", AGT},
                         {"America/Menominee", CST},
                         {"America/Merida", CST},
            -            {"America/Metlakatla", new String[] {"Metlakatla Standard Time", "MeST",
            -                                                 "Metlakatla Daylight Time", "MeDT"}},
            +            {"America/Metlakatla", new String[] {"Heure normale de Metlakatla", "MeST",
            +                                                 "Heure avanc\u00E9e de Metlakatla", "MeDT"}},
                         {"America/Mexico_City", CST},
                         {"America/Miquelon", new String[] {"Heure normale de Saint-Pierre et Miquelon", "PMST",
                                                            "Heure avanc\u00e9e de Saint-Pierre et Miquelon", "PMDT"}},
            @@ -464,8 +462,8 @@ public final class TimeZoneNames_fr extends TimeZoneNamesBundle {
                                                            "Heure d'\u00e9t\u00e9 de Davis", "DAVST"}},
                         {"Antarctica/DumontDUrville", new String[] {"Heure de Dumont-d'Urville", "DDUT",
                                                                     "Heure d'\u00e9t\u00e9 de Dumont-d'Urville", "DDUST"}},
            -            {"Antarctica/Macquarie", new String[] {"Macquarie Island Time", "MIST",
            -                                                   "Macquarie Island Summer Time", "MIST"}},
            +            {"Antarctica/Macquarie", new String[] {"Heure de l'Ile Macquarie", "MIST",
            +                                                   "Heure d'\u00E9t\u00E9 de l'Ile Macquarie", "MIST"}},
                         {"Antarctica/Mawson", new String[] {"Heure de Mawson", "MAWT",
                                                             "Heure d'\u00e9t\u00e9 de Mawson", "MAWST"}},
                         {"Antarctica/McMurdo", NZST},
            @@ -481,7 +479,7 @@ public final class TimeZoneNames_fr extends TimeZoneNamesBundle {
                         {"Asia/Aden", ARAST},
                         {"Asia/Almaty", new String[] {"Heure d'Alma-Ata", "ALMT",
                                                       "Heure d'\u00e9t\u00e9 d'Alma-Ata", "ALMST"}},
            -            {"Asia/Amman", EET},
            +            {"Asia/Amman", ARAST},
                         {"Asia/Anadyr", new String[] {"Heure d'Anadyr", "ANAT",
                                                       "Heure d'\u00e9t\u00e9 d'Anadyr", "ANAST"}},
                         {"Asia/Aqtau", new String[] {"Heure d'Aqtau", "AQTT",
            @@ -525,7 +523,7 @@ public final class TimeZoneNames_fr extends TimeZoneNamesBundle {
                                                        "Heure d'\u00e9t\u00e9 d'Irkutsk", "IRKST"}},
                         {"Asia/Istanbul", EET},
                         {"Asia/Jakarta", WIT},
            -            {"Asia/Jayapura", new String[] {"Heure d'Indon\u00e9sie orientale", "EIT",
            +            {"Asia/Jayapura", new String[] {"Heure d'Indon\u00e9sie orientale", "WIT",
                                                         "Heure d'\u00e9t\u00e9 d'Indon\u00e9sie orientale", "EIST"}},
                         {"Asia/Kabul", new String[] {"Heure d'Afghanistan", "AFT",
                                                      "Heure d'\u00e9t\u00e9 d'Afghanistan", "AFST"}},
            @@ -535,8 +533,8 @@ public final class TimeZoneNames_fr extends TimeZoneNamesBundle {
                         {"Asia/Kashgar", CTT},
                         {"Asia/Kathmandu", NPT},
                         {"Asia/Katmandu", NPT},
            -            {"Asia/Khandyga", new String[] {"Khandyga Time", "YAKT",
            -                                            "Khandyga Summer Time", "YAKST"}},
            +            {"Asia/Khandyga", new String[] {"Heure de Khandyga", "YAKT",
            +                                            "Heure d'\u00E9t\u00E9 de Khandyga", "YAKST"}},
                         {"Asia/Kolkata", IST},
                         {"Asia/Krasnoyarsk", new String[] {"Heure de Krasno\u00efarsk", "KRAT",
                                                            "Heure d'\u00e9t\u00e9 de Krasno\u00efarsk", "KRAST"}},
            @@ -585,8 +583,8 @@ public final class TimeZoneNames_fr extends TimeZoneNamesBundle {
                         {"Asia/Ulaanbaatar", ULAT},
                         {"Asia/Ulan_Bator", ULAT},
                         {"Asia/Urumqi", CTT},
            -            {"Asia/Ust-Nera", new String[] {"Ust-Nera Time", "VLAT",
            -                                            "Ust-Nera Summer Time", "VLAST"}},
            +            {"Asia/Ust-Nera", new String[] {"Heure d'Ust-Nera", "VLAT",
            +                                            "Heure d'\u00E9t\u00E9 d'Ust-Nera", "VLAST"}},
                         {"Asia/Vientiane", ICT},
                         {"Asia/Vladivostok", new String[] {"Heure de Vladivostok", "VLAT",
                                                            "Heure d'\u00e9t\u00e9 de Vladivostok", "VLAST"}},
            @@ -619,7 +617,7 @@ public final class TimeZoneNames_fr extends TimeZoneNamesBundle {
                         {"Australia/Currie", EST_NSW},
                         {"Australia/Darwin", DARWIN},
                         {"Australia/Eucla", new String[] {"Heure standard de l'Australie occidentale (centre)", "CWST",
            -                                              "Heure d'\u00e9t\u00e9 de l'Australie occidentale (centre)", "CWST"}},
            +                                              "Heure d'\u00E9t\u00E9 de l'Australie occidentale (centre)", "CWST"}},
                         {"Australia/Hobart", TASMANIA},
                         {"Australia/LHI", LORD_HOWE},
                         {"Australia/Lindeman", BRISBANE},
            @@ -675,6 +673,7 @@ public final class TimeZoneNames_fr extends TimeZoneNamesBundle {
                         {"Europe/Bratislava", CET},
                         {"Europe/Brussels", CET},
                         {"Europe/Budapest", CET},
            +            {"Europe/Busingen", CET},
                         {"Europe/Chisinau", EET},
                         {"Europe/Copenhagen", CET},
                         {"Europe/Dublin", DUBLIN},
            diff --git a/jdk/src/share/classes/sun/util/resources/it/TimeZoneNames_it.java b/jdk/src/share/classes/sun/util/resources/it/TimeZoneNames_it.java
            index 18b434413b4..0b51765e038 100644
            --- a/jdk/src/share/classes/sun/util/resources/it/TimeZoneNames_it.java
            +++ b/jdk/src/share/classes/sun/util/resources/it/TimeZoneNames_it.java
            @@ -45,10 +45,8 @@ import sun.util.resources.TimeZoneNamesBundle;
             public final class TimeZoneNames_it extends TimeZoneNamesBundle {
             
                 protected final Object[][] getContents() {
            -        String ACT[] = new String[] {"Ora di Acre", "ACT",
            -                                     "Ora estiva di Acre", "ACST"};
            -        String ADELAIDE[] = new String[] {"Ora centrale standard (Australia del Sud)", "CST",
            -                                          "Ora estiva standard (Australia del Sud)", "CST"};
            +        String ADELAIDE[] = new String[] {"Ora standard centrale (Australia del Sud)", "CST",
            +                                          "Ora estiva centrale (Australia del Sud)", "CST"};
                     String AGT[] = new String[] {"Ora dell'Argentina", "ART",
                                                  "Ora estiva dell'Argentina", "ARST"};
                     String AKST[] = new String[] {"Ora solare dell'Alaska", "AKST",
            @@ -63,9 +61,9 @@ public final class TimeZoneNames_it extends TimeZoneNamesBundle {
                                                  "Ora legale dell'Atlantico occidentale", "ADT"};
                     String BDT[] = new String[] {"Ora del Bangladesh", "BDT",
                                                  "Ora estiva del Bangladesh", "BDST"};
            -        String BRISBANE[] = new String[] {"Ora orientale standard (Queensland)", "EST",
            +        String BRISBANE[] = new String[] {"Ora standard orientale (Queensland)", "EST",
                                                       "Ora estiva orientale (Queensland)", "EST"};
            -        String BROKEN_HILL[] = new String[] {"Ora centrale standard (Australia del Sud/Nuovo Galles del Sud)", "CST",
            +        String BROKEN_HILL[] = new String[] {"Ora standard centrale (Australia del Sud/Nuovo Galles del Sud)", "CST",
                                                          "Ora estiva centrale (Australia del Sud/Nuovo Galles del Sud)", "CST"};
                     String BRT[] = new String[] {"Ora del Brasile", "BRT",
                                                  "Ora estiva del Brasile", "BRST"};
            @@ -77,9 +75,9 @@ public final class TimeZoneNames_it extends TimeZoneNamesBundle {
                                                  "Ora estiva dell'Europa centrale", "CEST"};
                     String CHAST[] = new String[] {"Ora di Chatham standard", "CHAST",
                                                    "Ora legale di Chatham", "CHADT"};
            -        String CHUT[] = new String[] {"Chuuk Time", "CHUT",
            -                                      "Chuuk Summer Time", "CHUST"};
            -        String CIT[] = new String[] {"Ora dell'Indonesia centrale", "CIT",
            +        String CHUT[] = new String[] {"Ora di Chuuk", "CHUT",
            +                                      "Ora estiva di Chuuk", "CHUST"};
            +        String CIT[] = new String[] {"Ora dell'Indonesia centrale", "WITA",
                                                  "Ora estiva dell'Indonesia centrale", "CIST"};
                     String CLT[] = new String[] {"Ora del Cile", "CLT",
                                                  "Ora estiva del Cile", "CLST"};
            @@ -89,7 +87,7 @@ public final class TimeZoneNames_it extends TimeZoneNamesBundle {
                                                  "Ora legale della Cina", "CDT"};
                     String CUBA[] = new String[] {"Ora solare Cuba", "CST",
                                                   "Ora legale Cuba", "CDT"};
            -        String DARWIN[] = new String[] {"Ora centrale standard (Territori del Nord)", "CST",
            +        String DARWIN[] = new String[] {"Ora standard centrale (Territori del Nord)", "CST",
                                                     "Ora estiva centrale (Territori del Nord)", "CST"};
                     String DUBLIN[] = new String[] {"Ora media di Greenwich", "GMT",
                                                     "Ora estiva irlandese", "IST"};
            @@ -103,10 +101,10 @@ public final class TimeZoneNames_it extends TimeZoneNamesBundle {
                                                  "Ora estiva della Groenlandia orientale", "EGST"};
                     String EST[] = new String[] {"Ora solare USA orientale", "EST",
                                                  "Ora legale USA orientale", "EDT"};
            -        String EST_NSW[] = new String[] {"Ora solare dell'Australia orientale (Nuovo Galles del Sud)", "EST",
            +        String EST_NSW[] = new String[] {"Ora standard dell'Australia orientale (Nuovo Galles del Sud)", "EST",
                                                      "Ora estiva dell'Australia orientale (Nuovo Galles del Sud)", "EST"};
            -        String FET[] = new String[] {"Further-eastern European Time", "FET",
            -                                     "Further-eastern European Summer Time", "FEST"};
            +        String FET[] = new String[] {"Ora dei paesi europei pi\u00F9 orientali", "FET",
            +                                     "Ora estiva dei paesi europei pi\u00F9 orientali", "FEST"};
                     String GHMT[] = new String[] {"Ora media del Ghana", "GMT",
                                                   "Ora legale del Ghana", "GHST"};
                     String GAMBIER[] =  new String[] {"Ora di Gambier", "GAMT",
            @@ -159,8 +157,8 @@ public final class TimeZoneNames_it extends TimeZoneNamesBundle {
                                                       "Ora legale di Pitcairn", "PDT"};
                     String PKT[] = new String[] {"Ora del Pakistan", "PKT",
                                                  "Ora estiva del Pakistan", "PKST"};
            -        String PONT[] = new String[] {"Pohnpei Time", "PONT",
            -                                      "Pohnpei Summer Time", "PONST"};
            +        String PONT[] = new String[] {"Ora di Pohnpei", "PONT",
            +                                      "Ora estiva di Pohnpei", "PONST"};
                     String PST[] = new String[] {"Ora solare della costa occidentale USA", "PST",
                                                  "Ora legale della costa occidentale USA", "PDT"};
                     String SAST[] = new String[] {"Ora solare del Sudafrica", "SAST",
            @@ -171,7 +169,7 @@ public final class TimeZoneNames_it extends TimeZoneNamesBundle {
                                                  "Ora estiva di Singapore", "SGST"};
                     String SLST[] = new String[] {"Ora media di Greenwich", "GMT",
                                                   "Ora legale della Sierra Leone", "SLST"};
            -        String TASMANIA[] = new String[] {"Ora orientale standard (Tasmania)", "EST",
            +        String TASMANIA[] = new String[] {"Ora standard orientale (Tasmania)", "EST",
                                                       "Ora estiva orientale (Tasmania)", "EST"};
                     String TMT[] = new String[] {"Ora del Turkmenistan", "TMT",
                                                  "Ora estiva del Turkmenistan", "TMST"};
            @@ -183,9 +181,9 @@ public final class TimeZoneNames_it extends TimeZoneNamesBundle {
                                                  "Ora estiva dell'Africa occidentale", "WAST"};
                     String WET[] = new String[] {"Ora dell'Europa occidentale", "WET",
                                                  "Ora estiva dell'Europa occidentale", "WEST"};
            -        String WIT[] = new String[] {"Ora dell'Indonesia occidentale", "WIT",
            +        String WIT[] = new String[] {"Ora dell'Indonesia occidentale", "WIB",
                                                  "Ora estiva dell'Indonesia occidentale", "WIST"};
            -        String WST_AUS[] = new String[] {"Ora solare dell'Australia occidentale", "WST",
            +        String WST_AUS[] = new String[] {"Ora standard dell'Australia occidentale", "WST",
                                                      "Ora estiva dell'Australia occidentale", "WST"};
                     String SAMOA[] = new String[] {"Ora standard di Samoa", "SST",
                                                    "Ora legale di Samoa", "SDT"};
            @@ -193,7 +191,7 @@ public final class TimeZoneNames_it extends TimeZoneNamesBundle {
                                                        "Ora estiva di Samoa", "WSDT"};
                     String ChST[] = new String[] {"Ora standard di Chamorro", "ChST",
                                           "Ora legale di Chamorro", "ChDT"};
            -        String VICTORIA[] = new String[] {"Ora orientale standard (Victoria)", "EST",
            +        String VICTORIA[] = new String[] {"Ora standard orientale (Victoria)", "EST",
                                                       "Ora estiva orientale (Victoria)", "EST"};
                     String UTC[] = new String[] {"Tempo universale coordinato", "UTC",
                                                  "Tempo universale coordinato", "UTC"};
            @@ -306,7 +304,7 @@ public final class TimeZoneNames_it extends TimeZoneNamesBundle {
                         {"America/Argentina/Rio_Gallegos", AGT},
                         {"America/Argentina/Salta", AGT},
                         {"America/Argentina/San_Juan", AGT},
            -            {"America/Argentina/San_Luis", WART},
            +            {"America/Argentina/San_Luis", AGT},
                         {"America/Argentina/Tucuman", AGT},
                         {"America/Argentina/Ushuaia", AGT},
                         {"America/Aruba", AST},
            @@ -399,8 +397,8 @@ public final class TimeZoneNames_it extends TimeZoneNamesBundle {
                         {"America/Mendoza", AGT},
                         {"America/Menominee", CST},
                         {"America/Merida", CST},
            -            {"America/Metlakatla", new String[] {"Metlakatla Standard Time", "MeST",
            -                                                 "Metlakatla Daylight Time", "MeDT"}},
            +            {"America/Metlakatla", new String[] {"Ora standard di Metlakatla", "MeST",
            +                                                 "Ora legale di Metlakatla", "MeDT"}},
                         {"America/Mexico_City", CST},
                         {"America/Miquelon", new String[] {"Ora solare di Saint-Pierre e Miquelon", "PMST",
                                                            "Ora legale di Saint-Pierre e Miquelon", "PMDT"}},
            @@ -464,8 +462,8 @@ public final class TimeZoneNames_it extends TimeZoneNamesBundle {
                                                            "Ora estiva di Davis", "DAVST"}},
                         {"Antarctica/DumontDUrville", new String[] {"Ora di Dumont-d'Urville", "DDUT",
                                                                     "Ora estiva di Dumont-d'Urville", "DDUST"}},
            -            {"Antarctica/Macquarie", new String[] {"Macquarie Island Time", "MIST",
            -                                                   "Macquarie Island Summer Time", "MIST"}},
            +            {"Antarctica/Macquarie", new String[] {"Ora dell'Isola Macquarie", "MIST",
            +                                                   "Ora estiva dell'Isola Macquarie", "MIST"}},
                         {"Antarctica/Mawson", new String[] {"Ora di Mawson", "MAWT",
                                                             "Ora estiva di Mawson", "MAWST"}},
                         {"Antarctica/McMurdo", NZST},
            @@ -481,7 +479,7 @@ public final class TimeZoneNames_it extends TimeZoneNamesBundle {
                         {"Asia/Aden", ARAST},
                         {"Asia/Almaty", new String[] {"Ora di Alma-Ata", "ALMT",
                                                       "Ora estiva di Alma-Ata", "ALMST"}},
            -            {"Asia/Amman", EET},
            +            {"Asia/Amman", ARAST},
                         {"Asia/Anadyr", new String[] {"Ora di Anadyr", "ANAT",
                                                       "Ora estiva di Anadyr", "ANAST"}},
                         {"Asia/Aqtau", new String[] {"Ora di Aqtau", "AQTT",
            @@ -525,7 +523,7 @@ public final class TimeZoneNames_it extends TimeZoneNamesBundle {
                                                        "Ora estiva di Irkutsk", "IRKST"}},
                         {"Asia/Istanbul", EET},
                         {"Asia/Jakarta", WIT},
            -            {"Asia/Jayapura", new String[] {"Ora dell'Indonesia orientale", "EIT",
            +            {"Asia/Jayapura", new String[] {"Ora dell'Indonesia orientale", "WIT",
                                                         "Ora estiva dell'Indonesia orientale", "EIST"}},
                         {"Asia/Kabul", new String[] {"Ora dell'Afghanistan", "AFT",
                                                      "Ora estiva dell'Afghanistan", "AFST"}},
            @@ -536,8 +534,8 @@ public final class TimeZoneNames_it extends TimeZoneNamesBundle {
                         {"Asia/Kathmandu", NPT},
                         {"Asia/Katmandu", NPT},
                         {"Asia/Kolkata", IST},
            -            {"Asia/Khandyga", new String[] {"Khandyga Time", "YAKT",
            -                                            "Khandyga Summer Time", "YAKST"}},
            +            {"Asia/Khandyga", new String[] {"Ora di Khandyga", "YAKT",
            +                                            "Ora estiva di Khandyga", "YAKST"}},
                         {"Asia/Krasnoyarsk", new String[] {"Ora di Krasnojarsk", "KRAT",
                                                            "Ora estiva di Krasnojarsk", "KRAST"}},
                         {"Asia/Kuala_Lumpur", MYT},
            @@ -585,8 +583,8 @@ public final class TimeZoneNames_it extends TimeZoneNamesBundle {
                         {"Asia/Ulaanbaatar", ULAT},
                         {"Asia/Ulan_Bator", ULAT},
                         {"Asia/Urumqi", CTT},
            -            {"Asia/Ust-Nera", new String[] {"Ust-Nera Time", "VLAT",
            -                                            "Ust-Nera Summer Time", "VLAST"}},
            +            {"Asia/Ust-Nera", new String[] {"Ora di Ust-Nera", "VLAT",
            +                                            "Ora estiva di Ust-Nera", "VLAST"}},
                         {"Asia/Vientiane", ICT},
                         {"Asia/Vladivostok", new String[] {"Ora di Vladivostok", "VLAT",
                                                            "Ora estiva di Vladivostok", "VLAST"}},
            @@ -618,8 +616,8 @@ public final class TimeZoneNames_it extends TimeZoneNamesBundle {
                         {"Australia/Canberra", EST_NSW},
                         {"Australia/Currie", EST_NSW},
                         {"Australia/Darwin", DARWIN},
            -            {"Australia/Eucla", new String[] {"Ora solare Australia centrorientale", "CWST",
            -                                              "Ora estiva Australia centrorientale", "CWST"}},
            +            {"Australia/Eucla", new String[] {"Ora standard Australia centro-occidentale", "CWST",
            +                                              "Ora estiva Australia centro-occidentale", "CWST"}},
                         {"Australia/Hobart", TASMANIA},
                         {"Australia/LHI", LORD_HOWE},
                         {"Australia/Lindeman", BRISBANE},
            @@ -675,6 +673,7 @@ public final class TimeZoneNames_it extends TimeZoneNamesBundle {
                         {"Europe/Bratislava", CET},
                         {"Europe/Brussels", CET},
                         {"Europe/Budapest", CET},
            +            {"Europe/Busingen", CET},
                         {"Europe/Chisinau", EET},
                         {"Europe/Copenhagen", CET},
                         {"Europe/Dublin", DUBLIN},
            diff --git a/jdk/src/share/classes/sun/util/resources/ja/TimeZoneNames_ja.java b/jdk/src/share/classes/sun/util/resources/ja/TimeZoneNames_ja.java
            index 5001fd28f04..2c8734c73ee 100644
            --- a/jdk/src/share/classes/sun/util/resources/ja/TimeZoneNames_ja.java
            +++ b/jdk/src/share/classes/sun/util/resources/ja/TimeZoneNames_ja.java
            @@ -45,10 +45,8 @@ import sun.util.resources.TimeZoneNamesBundle;
             public final class TimeZoneNames_ja extends TimeZoneNamesBundle {
             
                 protected final Object[][] getContents() {
            -        String ACT[] = new String[] {"\u30a2\u30af\u30ec\u6642\u9593", "ACT",
            -                                     "\u30a2\u30af\u30ec\u590f\u6642\u9593", "ACST"};
            -        String ADELAIDE[] = new String[] {"\u4e2d\u90e8\u6a19\u6e96\u6642 (\u5357\u30aa\u30fc\u30b9\u30c8\u30e9\u30ea\u30a2)", "CST",
            -                                          "\u4e2d\u90e8\u590f\u6642\u9593 (\u5357\u30aa\u30fc\u30b9\u30c8\u30e9\u30ea\u30a2)", "CST"};
            +        String ADELAIDE[] = new String[] {"\u4E2D\u90E8\u6A19\u6E96\u6642(\u5357\u30AA\u30FC\u30B9\u30C8\u30E9\u30EA\u30A2)", "CST",
            +                                          "\u4E2D\u90E8\u590F\u6642\u9593(\u5357\u30AA\u30FC\u30B9\u30C8\u30E9\u30EA\u30A2)", "CST"};
                     String AGT[] = new String[] {"\u30a2\u30eb\u30bc\u30f3\u30c1\u30f3\u6642\u9593", "ART",
                                                  "\u30a2\u30eb\u30bc\u30f3\u30c1\u30f3\u590f\u6642\u9593", "ARST"};
                     String AKST[] = new String[] {"\u30a2\u30e9\u30b9\u30ab\u6a19\u6e96\u6642", "AKST",
            @@ -63,10 +61,10 @@ public final class TimeZoneNames_ja extends TimeZoneNamesBundle {
                                                  "\u5927\u897f\u6d0b\u590f\u6642\u9593", "ADT"};
                     String BDT[] = new String[] {"\u30d0\u30f3\u30b0\u30e9\u30c7\u30b7\u30e5\u6642\u9593", "BDT",
                                                  "\u30d0\u30f3\u30b0\u30e9\u30c7\u30b7\u30e5\u590f\u6642\u9593", "BDST"};
            -        String BRISBANE[] = new String[] {"\u6771\u90e8\u6a19\u6e96\u6642 (\u30af\u30a4\u30fc\u30f3\u30ba\u30e9\u30f3\u30c9)", "EST",
            -                                          "\u6771\u90e8\u590f\u6642\u9593 (\u30af\u30a4\u30fc\u30f3\u30ba\u30e9\u30f3\u30c9)", "EST"};
            -        String BROKEN_HILL[] = new String[] {"\u4e2d\u90e8\u6a19\u6e96\u6642 (\u5357\u30aa\u30fc\u30b9\u30c8\u30e9\u30ea\u30a2/\u30cb\u30e5\u30fc\u30b5\u30a6\u30b9\u30a6\u30a7\u30fc\u30eb\u30ba)", "CST",
            -                                             "\u4e2d\u90e8\u590f\u6642\u9593 (\u5357\u30aa\u30fc\u30b9\u30c8\u30e9\u30ea\u30a2/\u30cb\u30e5\u30fc\u30b5\u30a6\u30b9\u30a6\u30a7\u30fc\u30eb\u30ba)", "CST"};
            +        String BRISBANE[] = new String[] {"\u6771\u90E8\u6A19\u6E96\u6642(\u30AF\u30A4\u30FC\u30F3\u30BA\u30E9\u30F3\u30C9)", "EST",
            +                                          "\u6771\u90E8\u590F\u6642\u9593(\u30AF\u30A4\u30FC\u30F3\u30BA\u30E9\u30F3\u30C9)", "EST"};
            +        String BROKEN_HILL[] = new String[] {"\u4E2D\u90E8\u6A19\u6E96\u6642(\u5357\u30AA\u30FC\u30B9\u30C8\u30E9\u30EA\u30A2/\u30CB\u30E5\u30FC\u30B5\u30A6\u30B9\u30A6\u30A7\u30FC\u30EB\u30BA)", "CST",
            +                                             "\u4E2D\u90E8\u590F\u6642\u9593(\u5357\u30AA\u30FC\u30B9\u30C8\u30E9\u30EA\u30A2/\u30CB\u30E5\u30FC\u30B5\u30A6\u30B9\u30A6\u30A7\u30FC\u30EB\u30BA)", "CST"};
                     String BRT[] = new String[] {"\u30d6\u30e9\u30b8\u30eb\u6642\u9593", "BRT",
                                                  "\u30d6\u30e9\u30b8\u30eb\u590f\u6642\u9593", "BRST"};
                     String BTT[] = new String[] {"\u30d6\u30fc\u30bf\u30f3\u6642\u9593", "BTT",
            @@ -77,9 +75,9 @@ public final class TimeZoneNames_ja extends TimeZoneNamesBundle {
                                                  "\u4e2d\u90e8\u30e8\u30fc\u30ed\u30c3\u30d1\u590f\u6642\u9593", "CEST"};
                     String CHAST[] = new String[] {"\u30c1\u30e3\u30bf\u30e0\u6a19\u6e96\u6642", "CHAST",
                                                    "\u30c1\u30e3\u30bf\u30e0\u590f\u6642\u9593", "CHADT"};
            -        String CHUT[] = new String[] {"Chuuk Time", "CHUT",
            -                                      "Chuuk Summer Time", "CHUST"};
            -        String CIT[] = new String[] {"\u4e2d\u592e\u30a4\u30f3\u30c9\u30cd\u30b7\u30a2\u6642\u9593", "CIT",
            +        String CHUT[] = new String[] {"\u30C1\u30E5\u30FC\u30AF\u6642\u9593", "CHUT",
            +                                      "Chuuk Time", "CHUST"};
            +        String CIT[] = new String[] {"\u4e2d\u592e\u30a4\u30f3\u30c9\u30cd\u30b7\u30a2\u6642\u9593", "WITA",
                                                  "\u4e2d\u592e\u30a4\u30f3\u30c9\u30cd\u30b7\u30a2\u590f\u6642\u9593", "CIST"};
                     String CLT[] = new String[] {"\u30c1\u30ea\u6642\u9593", "CLT",
                                                  "\u30c1\u30ea\u590f\u6642\u9593", "CLST"};
            @@ -89,8 +87,8 @@ public final class TimeZoneNames_ja extends TimeZoneNamesBundle {
                                                  "\u4e2d\u56fd\u590f\u6642\u9593", "CDT"};
                     String CUBA[] = new String[] {"\u30ad\u30e5\u30fc\u30d0\u6a19\u6e96\u6642", "CST",
                                                   "\u30ad\u30e5\u30fc\u30d0\u590f\u6642\u9593", "CDT"};
            -        String DARWIN[] = new String[] {"\u4e2d\u90e8\u6a19\u6e96\u6642 (\u30ce\u30fc\u30b6\u30f3\u30c6\u30ea\u30c8\u30ea\u30fc)", "CST",
            -                                        "\u4e2d\u90e8\u590f\u6642\u9593 (\u30ce\u30fc\u30b6\u30f3\u30c6\u30ea\u30c8\u30ea\u30fc)", "CST"};
            +        String DARWIN[] = new String[] {"\u4E2D\u90E8\u6A19\u6E96\u6642(\u30CE\u30FC\u30B6\u30F3\u30C6\u30EA\u30C8\u30EA\u30FC)", "CST",
            +                                        "\u4E2D\u90E8\u590F\u6642\u9593(\u30CE\u30FC\u30B6\u30F3\u30C6\u30EA\u30C8\u30EA\u30FC)", "CST"};
                     String DUBLIN[] = new String[] {"\u30b0\u30ea\u30cb\u30c3\u30b8\u6a19\u6e96\u6642", "GMT",
                                                     "\u30a2\u30a4\u30eb\u30e9\u30f3\u30c9\u590f\u6642\u9593", "IST"};
                     String EAT[] = new String[] {"\u6771\u30a2\u30d5\u30ea\u30ab\u6642\u9593", "EAT",
            @@ -103,10 +101,10 @@ public final class TimeZoneNames_ja extends TimeZoneNamesBundle {
                                                  "\u6771\u30b0\u30ea\u30fc\u30f3\u30e9\u30f3\u30c9\u590f\u6642\u9593", "EGST"};
                     String EST[] = new String[] {"\u6771\u90e8\u6a19\u6e96\u6642", "EST",
                                                  "\u6771\u90e8\u590f\u6642\u9593", "EDT"};
            -        String EST_NSW[] = new String[] {"\u6771\u90e8\u6a19\u6e96\u6642 (\u30cb\u30e5\u30fc\u30b5\u30a6\u30b9\u30a6\u30a7\u30fc\u30eb\u30ba)", "EST",
            -                                         "\u6771\u90e8\u590f\u6642\u9593 (\u30cb\u30e5\u30fc\u30b5\u30a6\u30b9\u30a6\u30a7\u30fc\u30eb\u30ba)", "EST"};
            -        String FET[] = new String[] {"Further-eastern European Time", "FET",
            -                                     "Further-eastern European Summer Time", "FEST"};
            +        String EST_NSW[] = new String[] {"\u6771\u90E8\u6A19\u6E96\u6642(\u30CB\u30E5\u30FC\u30B5\u30A6\u30B9\u30A6\u30A7\u30FC\u30EB\u30BA)", "EST",
            +                                         "\u6771\u90E8\u590F\u6642\u9593(\u30CB\u30E5\u30FC\u30B5\u30A6\u30B9\u30A6\u30A7\u30FC\u30EB\u30BA)", "EST"};
            +        String FET[] = new String[] {"\u6975\u6771\u30E8\u30FC\u30ED\u30C3\u30D1\u6642\u9593", "FET",
            +                                     "\u6975\u6771\u30E8\u30FC\u30ED\u30C3\u30D1\u590F\u6642\u9593", "FEST"};
                     String GHMT[] = new String[] {"\u30ac\u30fc\u30ca\u6a19\u6e96\u6642", "GMT",
                                                  "\u30ac\u30fc\u30ca\u590f\u6642\u9593", "GHST"};
                     String GAMBIER[] =  new String[] {"\u30ac\u30f3\u30d3\u30a2\u6642\u9593", "GAMT",
            @@ -159,8 +157,8 @@ public final class TimeZoneNames_ja extends TimeZoneNamesBundle {
                                                       "\u30d4\u30c8\u30b1\u30eb\u30f3\u5cf6\u590f\u6642\u9593", "PDT"};
                     String PKT[] = new String[] {"\u30d1\u30ad\u30b9\u30bf\u30f3\u6642\u9593", "PKT",
                                                  "\u30d1\u30ad\u30b9\u30bf\u30f3\u590f\u6642\u9593", "PKST"};
            -        String PONT[] = new String[] {"Pohnpei Time", "PONT",
            -                                      "Pohnpei Summer Time", "PONST"};
            +        String PONT[] = new String[] {"\u30DD\u30F3\u30DA\u30A4\u6642\u9593", "PONT",
            +                                      "\u30DD\u30F3\u30DA\u30A4\u590F\u6642\u9593", "PONST"};
                     String PST[] = new String[] {"\u592a\u5e73\u6d0b\u6a19\u6e96\u6642", "PST",
                                                  "\u592a\u5e73\u6d0b\u590f\u6642\u9593", "PDT"};
                     String SAST[] = new String[] {"\u5357\u30a2\u30d5\u30ea\u30ab\u6a19\u6e96\u6642", "SAST",
            @@ -171,8 +169,8 @@ public final class TimeZoneNames_ja extends TimeZoneNamesBundle {
                                                  "\u30b7\u30f3\u30ac\u30dd\u30fc\u30eb\u590f\u6642\u9593", "SGST"};
                     String SLST[] = new String[] {"\u30b0\u30ea\u30cb\u30c3\u30b8\u6a19\u6e96\u6642", "GMT",
                                                   "\u30b7\u30a8\u30e9\u30ec\u30aa\u30cd\u590f\u6642\u9593", "SLST"};
            -        String TASMANIA[] = new String[] {"\u6771\u90e8\u6a19\u6e96\u6642 (\u30bf\u30b9\u30de\u30cb\u30a2)", "EST",
            -                                          "\u6771\u90e8\u590f\u6642\u9593 (\u30bf\u30b9\u30de\u30cb\u30a2)", "EST"};
            +        String TASMANIA[] = new String[] {"\u6771\u90E8\u6A19\u6E96\u6642(\u30BF\u30B9\u30DE\u30CB\u30A2)", "EST",
            +                                          "\u6771\u90E8\u590F\u6642\u9593(\u30BF\u30B9\u30DE\u30CB\u30A2)", "EST"};
                     String TMT[] = new String[] {"\u30c8\u30eb\u30af\u30e1\u30cb\u30b9\u30bf\u30f3\u6642\u9593", "TMT",
                                                  "\u30c8\u30eb\u30af\u30e1\u30cb\u30b9\u30bf\u30f3\u590f\u6642\u9593", "TMST"};
                     String ULAT[]= new String[] {"\u30a6\u30e9\u30fc\u30f3\u30d0\u30fc\u30c8\u30eb\u6642\u9593", "ULAT",
            @@ -183,18 +181,18 @@ public final class TimeZoneNames_ja extends TimeZoneNamesBundle {
                                                  "\u897f\u30a2\u30d5\u30ea\u30ab\u590f\u6642\u9593", "WAST"};
                     String WET[] = new String[] {"\u897f\u30e8\u30fc\u30ed\u30c3\u30d1\u6642\u9593", "WET",
                                                  "\u897f\u30e8\u30fc\u30ed\u30c3\u30d1\u590f\u6642\u9593", "WEST"};
            -        String WIT[] = new String[] {"\u897f\u30a4\u30f3\u30c9\u30cd\u30b7\u30a2\u6642\u9593", "WIT",
            +        String WIT[] = new String[] {"\u897f\u30a4\u30f3\u30c9\u30cd\u30b7\u30a2\u6642\u9593", "WIB",
                                                  "\u897f\u30a4\u30f3\u30c9\u30cd\u30b7\u30a2\u590f\u6642\u9593", "WIST"};
            -        String WST_AUS[] = new String[] {"\u897f\u90e8\u6a19\u6e96\u6642 (\u30aa\u30fc\u30b9\u30c8\u30e9\u30ea\u30a2)", "WST",
            -                                         "\u897f\u90e8\u590f\u6642\u9593 (\u30aa\u30fc\u30b9\u30c8\u30e9\u30ea\u30a2)", "WST"};
            +        String WST_AUS[] = new String[] {"\u897F\u90E8\u6A19\u6E96\u6642(\u30AA\u30FC\u30B9\u30C8\u30E9\u30EA\u30A2)", "WST",
            +                                         "\u897F\u90E8\u590F\u6642\u9593(\u30AA\u30FC\u30B9\u30C8\u30E9\u30EA\u30A2)", "WST"};
                     String SAMOA[] = new String[] {"\u30b5\u30e2\u30a2\u6a19\u6e96\u6642", "SST",
                                                    "\u30b5\u30e2\u30a2\u590f\u6642\u9593", "SDT"};
                     String WST_SAMOA[] = new String[] {"\u897f\u30b5\u30e2\u30a2\u6642\u9593", "WST",
                                                        "\u897f\u30b5\u30e2\u30a2\u590f\u6642\u9593", "WSDT"};
                     String ChST[] = new String[] {"\u30b0\u30a2\u30e0\u6a19\u6e96\u6642", "ChST",
                                                   "\u30b0\u30a2\u30e0\u590f\u6642\u9593", "ChDT"};
            -        String VICTORIA[] = new String[] {"\u6771\u90e8\u6a19\u6e96\u6642 (\u30d3\u30af\u30c8\u30ea\u30a2)", "EST",
            -                                          "\u6771\u90e8\u590f\u6642\u9593 (\u30d3\u30af\u30c8\u30ea\u30a2)", "EST"};
            +        String VICTORIA[] = new String[] {"\u6771\u90E8\u6A19\u6E96\u6642(\u30D3\u30AF\u30C8\u30EA\u30A2)", "EST",
            +                                          "\u6771\u90E8\u590F\u6642\u9593(\u30D3\u30AF\u30C8\u30EA\u30A2)", "EST"};
                     String UTC[] = new String[] {"\u5354\u5b9a\u4e16\u754c\u6642", "UTC",
                                                  "\u5354\u5b9a\u4e16\u754c\u6642", "UTC"};
                     String UZT[] = new String[] {"\u30a6\u30ba\u30d9\u30ad\u30b9\u30bf\u30f3\u6642\u9593", "UZT",
            @@ -306,7 +304,7 @@ public final class TimeZoneNames_ja extends TimeZoneNamesBundle {
                         {"America/Argentina/Rio_Gallegos", AGT},
                         {"America/Argentina/Salta", AGT},
                         {"America/Argentina/San_Juan", AGT},
            -            {"America/Argentina/San_Luis", WART},
            +            {"America/Argentina/San_Luis", AGT},
                         {"America/Argentina/Tucuman", AGT},
                         {"America/Argentina/Ushuaia", AGT},
                         {"America/Aruba", AST},
            @@ -399,8 +397,8 @@ public final class TimeZoneNames_ja extends TimeZoneNamesBundle {
                         {"America/Mendoza", AGT},
                         {"America/Menominee", CST},
                         {"America/Merida", CST},
            -            {"America/Metlakatla", new String[] {"Metlakatla Standard Time", "MeST",
            -                                                 "Metlakatla Daylight Time", "MeDT"}},
            +            {"America/Metlakatla", new String[] {"\u30E1\u30C8\u30E9\u30AB\u30C8\u30E9\u6A19\u6E96\u6642\u9593", "MeST",
            +                                                 "\u30E1\u30C8\u30E9\u30AB\u30C8\u30E9\u590F\u6642\u9593", "MeDT"}},
                         {"America/Mexico_City", CST},
                         {"America/Miquelon", new String[] {"\u30b5\u30f3\u30d4\u30a8\u30fc\u30eb\u30fb\u30df\u30af\u30ed\u30f3\u8af8\u5cf6\u6a19\u6e96\u6642", "PMST",
                                                            "\u30b5\u30f3\u30d4\u30a8\u30fc\u30eb\u30fb\u30df\u30af\u30ed\u30f3\u8af8\u5cf6\u590f\u6642\u9593", "PMDT"}},
            @@ -464,8 +462,8 @@ public final class TimeZoneNames_ja extends TimeZoneNamesBundle {
                                                            "\u30c7\u30a4\u30d3\u30b9\u590f\u6642\u9593", "DAVST"}},
                         {"Antarctica/DumontDUrville", new String[] {"\u30c7\u30e5\u30e2\u30f3\u30c7\u30e5\u30eb\u30f4\u30a3\u30eb\u6642\u9593", "DDUT",
                                                                     "\u30c7\u30e5\u30e2\u30f3\u30c7\u30e5\u30eb\u30f4\u30a3\u30eb\u590f\u6642\u9593", "DDUST"}},
            -            {"Antarctica/Macquarie", new String[] {"Macquarie Island Time", "MIST",
            -                                                   "Macquarie Island Summer Time", "MIST"}},
            +            {"Antarctica/Macquarie", new String[] {"\u30DE\u30C3\u30B3\u30FC\u30EA\u30FC\u5CF6\u6642\u9593", "MIST",
            +                                                   "\u30DE\u30C3\u30B3\u30FC\u30EA\u30FC\u5CF6\u590F\u6642\u9593", "MIST"}},
                         {"Antarctica/Mawson", new String[] {"\u30e2\u30fc\u30bd\u30f3\u6642\u9593", "MAWT",
                                                             "\u30e2\u30fc\u30bd\u30f3\u590f\u6642\u9593", "MAWST"}},
                         {"Antarctica/McMurdo", NZST},
            @@ -481,7 +479,7 @@ public final class TimeZoneNames_ja extends TimeZoneNamesBundle {
                         {"Asia/Aden", ARAST},
                         {"Asia/Almaty", new String[] {"\u30a2\u30eb\u30de\u30a2\u30bf\u6642\u9593", "ALMT",
                                                       "\u30a2\u30eb\u30de\u30a2\u30bf\u590f\u6642\u9593", "ALMST"}},
            -            {"Asia/Amman", EET},
            +            {"Asia/Amman", ARAST},
                         {"Asia/Anadyr", new String[] {"\u30a2\u30ca\u30c9\u30a5\u30a4\u30ea\u6642\u9593", "ANAT",
                                                       "\u30a2\u30ca\u30c9\u30a5\u30a4\u30ea\u590f\u6642\u9593", "ANAST"}},
                         {"Asia/Aqtau", new String[] {"\u30a2\u30af\u30bf\u30a6\u6642\u9593", "AQTT",
            @@ -525,7 +523,7 @@ public final class TimeZoneNames_ja extends TimeZoneNamesBundle {
                                                        "\u30a4\u30eb\u30af\u30fc\u30c4\u30af\u590f\u6642\u9593", "IRKST"}},
                         {"Asia/Istanbul", EET},
                         {"Asia/Jakarta", WIT},
            -            {"Asia/Jayapura", new String[] {"\u6771\u30a4\u30f3\u30c9\u30cd\u30b7\u30a2\u6642\u9593", "EIT",
            +            {"Asia/Jayapura", new String[] {"\u6771\u30a4\u30f3\u30c9\u30cd\u30b7\u30a2\u6642\u9593", "WIT",
                                                         "\u6771\u30a4\u30f3\u30c9\u30cd\u30b7\u30a2\u590f\u6642\u9593", "EIST" }},
                         {"Asia/Kabul", new String[] {"\u30a2\u30d5\u30ac\u30cb\u30b9\u30bf\u30f3\u6642\u9593", "AFT",
                                                      "\u30a2\u30d5\u30ac\u30cb\u30b9\u30bf\u30f3\u590f\u6642\u9593", "AFST"}},
            @@ -535,8 +533,8 @@ public final class TimeZoneNames_ja extends TimeZoneNamesBundle {
                         {"Asia/Kashgar", CTT},
                         {"Asia/Kathmandu", NPT},
                         {"Asia/Katmandu", NPT},
            -            {"Asia/Khandyga", new String[] {"Khandyga Time", "YAKT",
            -                                            "Khandyga Summer Time", "YAKST"}},
            +            {"Asia/Khandyga", new String[] {"\u30CF\u30F3\u30C9\u30A5\u30A4\u30AC\u6642\u9593", "YAKT",
            +                                            "\u30CF\u30F3\u30C9\u30A5\u30A4\u30AC\u590F\u6642\u9593", "YAKST"}},
                         {"Asia/Kolkata", IST},
                         {"Asia/Krasnoyarsk", new String[] {"\u30af\u30e9\u30b9\u30ce\u30e4\u30eb\u30b9\u30af\u6642\u9593", "KRAT",
                                                            "\u30af\u30e9\u30b9\u30ce\u30e4\u30eb\u30b9\u30af\u590f\u6642\u9593", "KRAST"}},
            @@ -585,8 +583,8 @@ public final class TimeZoneNames_ja extends TimeZoneNamesBundle {
                         {"Asia/Ulaanbaatar", ULAT},
                         {"Asia/Ulan_Bator", ULAT},
                         {"Asia/Urumqi", CTT},
            -            {"Asia/Ust-Nera", new String[] {"Ust-Nera Time", "VLAT",
            -                                            "Ust-Nera Summer Time", "VLAST"}},
            +            {"Asia/Ust-Nera", new String[] {"\u30A6\u30B9\u30C1\u30CD\u30E9\u6642\u9593", "VLAT",
            +                                            "\u30A6\u30B9\u30C1\u30CD\u30E9\u590F\u6642\u9593", "VLAST"}},
                         {"Asia/Vientiane", ICT},
                         {"Asia/Vladivostok", new String[] {"\u30a6\u30e9\u30b8\u30aa\u30b9\u30c8\u30af\u6642\u9593", "VLAT",
                                                            "\u30a6\u30e9\u30b8\u30aa\u30b9\u30c8\u30af\u590f\u6642\u9593", "VLAST"}},
            @@ -618,8 +616,8 @@ public final class TimeZoneNames_ja extends TimeZoneNamesBundle {
                         {"Australia/Canberra", EST_NSW},
                         {"Australia/Currie", EST_NSW},
                         {"Australia/Darwin", DARWIN},
            -            {"Australia/Eucla", new String[] {"\u4e2d\u897f\u90e8\u6a19\u6e96\u6642 (\u30aa\u30fc\u30b9\u30c8\u30e9\u30ea\u30a2)", "CWST",
            -                                              "\u4e2d\u897f\u90e8\u590f\u6642\u9593 (\u30aa\u30fc\u30b9\u30c8\u30e9\u30ea\u30a2)", "CWST"}},
            +            {"Australia/Eucla", new String[] {"\u4E2D\u897F\u90E8\u6A19\u6E96\u6642(\u30AA\u30FC\u30B9\u30C8\u30E9\u30EA\u30A2)", "CWST",
            +                                              "\u4E2D\u897F\u90E8\u590F\u6642\u9593(\u30AA\u30FC\u30B9\u30C8\u30E9\u30EA\u30A2)", "CWST"}},
                         {"Australia/Hobart", TASMANIA},
                         {"Australia/LHI", LORD_HOWE},
                         {"Australia/Lindeman", BRISBANE},
            @@ -675,6 +673,7 @@ public final class TimeZoneNames_ja extends TimeZoneNamesBundle {
                         {"Europe/Bratislava", CET},
                         {"Europe/Brussels", CET},
                         {"Europe/Budapest", CET},
            +            {"Europe/Busingen", CET},
                         {"Europe/Chisinau", EET},
                         {"Europe/Copenhagen", CET},
                         {"Europe/Dublin", DUBLIN},
            diff --git a/jdk/src/share/classes/sun/util/resources/ko/TimeZoneNames_ko.java b/jdk/src/share/classes/sun/util/resources/ko/TimeZoneNames_ko.java
            index 416a2c51214..79542f7a3f7 100644
            --- a/jdk/src/share/classes/sun/util/resources/ko/TimeZoneNames_ko.java
            +++ b/jdk/src/share/classes/sun/util/resources/ko/TimeZoneNames_ko.java
            @@ -45,10 +45,8 @@ import sun.util.resources.TimeZoneNamesBundle;
             public final class TimeZoneNames_ko extends TimeZoneNamesBundle {
             
                 protected final Object[][] getContents() {
            -        String ACT[] = new String[] {"\uc5d0\uc774\ucee4 \uc2dc\uac04", "ACT",
            -                                     "\uc5d0\uc774\ucee4 \uc77c\uad11\uc808\uc57d\uc2dc\uac04", "ACST"};
            -        String ADELAIDE[] = new String[] {"\uc911\ubd80 \ud45c\uc900\uc2dc(\uc0ac\uc6b0\uc2a4 \uc624\uc2a4\ud2b8\ub808\uc77c\ub9ac\uc544)", "CST",
            -                                          "\uc911\ubd80 \uc77c\uad11\uc808\uc57d\uc2dc\uac04(\uc0ac\uc6b0\uc2a4 \uc624\uc2a4\ud2b8\ub808\uc77c\ub9ac\uc544)", "CST"};
            +        String ADELAIDE[] = new String[] {"\uC911\uBD80 \uD45C\uC900\uC2DC(\uB0A8\uBD80 \uC624\uC2A4\uD2B8\uB808\uC77C\uB9AC\uC544)", "CST",
            +                                          "\uC911\uBD80 \uC77C\uAD11 \uC808\uC57D \uC2DC\uAC04(\uB0A8\uBD80 \uC624\uC2A4\uD2B8\uB808\uC77C\uB9AC\uC544)", "CST"};
                     String AGT[] = new String[] {"\uc544\ub974\ud5e8\ud2f0\ub098 \uc2dc\uac04", "ART",
                                                  "\uc544\ub974\ud5e8\ud2f0\ub098 \uc77c\uad11\uc808\uc57d\uc2dc\uac04", "ARST"};
                     String AKST[] = new String[] {"\uc54c\ub798\uc2a4\uce74 \ud45c\uc900\uc2dc", "AKST",
            @@ -63,10 +61,10 @@ public final class TimeZoneNames_ko extends TimeZoneNamesBundle {
                                                  "\ub300\uc11c\uc591 \uc77c\uad11\uc808\uc57d\uc2dc\uac04", "ADT"};
                     String BDT[] = new String[] {"\ubc29\uae00\ub77c\ub370\uc2dc \uc2dc\uac04", "BDT",
                                                  "\ubc29\uae00\ub77c\ub370\uc2dc \uc77c\uad11\uc808\uc57d\uc2dc\uac04", "BDST"};
            -        String BRISBANE[] = new String[] {"\ub3d9\ubd80 \ud45c\uc900\uc2dc(\ud038\uc990\ub79c\ub4dc)", "EST",
            -                                          "\ub3d9\ubd80 \uc77c\uad11\uc808\uc57d\uc2dc\uac04(\ud038\uc990\ub79c\ub4dc)", "EST"};
            -        String BROKEN_HILL[] = new String[] {"\uc911\ubd80 \ud45c\uc900\uc2dc(\uc0ac\uc6b0\uc2a4 \uc624\uc2a4\ud2b8\ub808\uc77c\ub9ac\uc544/\ub274 \uc0ac\uc6b0\uc2a4 \uc6e8\uc77c\uc988)", "CST",
            -                                             "\uc911\ubd80 \uc77c\uad11\uc808\uc57d\uc2dc\uac04(\uc0ac\uc6b0\uc2a4 \uc624\uc2a4\ud2b8\ub808\uc77c\ub9ac\uc544/\ub274 \uc0ac\uc6b0\uc2a4 \uc6e8\uc77c\uc988)", "CST"};
            +        String BRISBANE[] = new String[] {"\uB3D9\uBD80 \uD45C\uC900\uC2DC(\uD038\uC990\uB79C\uB4DC)", "EST",
            +                                          "\uB3D9\uBD80 \uC77C\uAD11 \uC808\uC57D \uC2DC\uAC04(\uD038\uC990\uB79C\uB4DC)", "EST"};
            +        String BROKEN_HILL[] = new String[] {"\uC911\uBD80 \uD45C\uC900\uC2DC(\uB0A8\uBD80 \uC624\uC2A4\uD2B8\uB808\uC77C\uB9AC\uC544/\uB274\uC0AC\uC6B0\uC2A4\uC6E8\uC77C\uC988)", "CST",
            +                                             "\uC911\uBD80 \uC77C\uAD11 \uC808\uC57D \uC2DC\uAC04(\uB0A8\uBD80 \uC624\uC2A4\uD2B8\uB808\uC77C\uB9AC\uC544/\uB274\uC0AC\uC6B0\uC2A4\uC6E8\uC77C\uC988)", "CST"};
                     String BRT[] = new String[] {"\ube0c\ub77c\uc9c8\ub9ac\uc544 \uc2dc\uac04", "BRT",
                                                  "\ube0c\ub77c\uc9c8\ub9ac\uc544 \uc77c\uad11\uc808\uc57d\uc2dc\uac04", "BRST"};
                     String BTT[] = new String[] {"\ubd80\ud0c4 \uc2dc\uac04", "BTT",
            @@ -77,9 +75,9 @@ public final class TimeZoneNames_ko extends TimeZoneNamesBundle {
                                                  "\uc911\uc559 \uc720\ub7fd \uc77c\uad11\uc808\uc57d\uc2dc\uac04", "CEST"};
                     String CHAST[] = new String[] {"Chatham \ud45c\uc900\uc2dc", "CHAST",
                                                    "Chatham \uc77c\uad11\uc808\uc57d\uc2dc\uac04", "CHADT"};
            -        String CHUT[] = new String[] {"Chuuk Time", "CHUT",
            -                                      "Chuuk Summer Time", "CHUST"};
            -        String CIT[] = new String[] {"\uc911\uc559 \uc778\ub3c4\ub124\uc2dc\uc544 \uc2dc\uac04", "CIT",
            +        String CHUT[] = new String[] {"\uCD94\uD06C \uD45C\uC900\uC2DC", "CHUT",
            +                                      "\uCD94\uD06C \uC77C\uAD11 \uC808\uC57D \uC2DC\uAC04", "CHUST"};
            +        String CIT[] = new String[] {"\uc911\uc559 \uc778\ub3c4\ub124\uc2dc\uc544 \uc2dc\uac04", "WITA",
                                                  "\uc911\uc559 \uc778\ub3c4\ub124\uc2dc\uc544 \uc77c\uad11\uc808\uc57d\uc2dc\uac04", "CIST"};
                     String CLT[] = new String[] {"\uce60\ub808 \uc2dc\uac04", "CLT",
                                                  "\uce60\ub808 \uc77c\uad11\uc808\uc57d\uc2dc\uac04", "CLST"};
            @@ -89,8 +87,8 @@ public final class TimeZoneNames_ko extends TimeZoneNamesBundle {
                                                  "\uc911\uad6d \uc77c\uad11\uc808\uc57d\uc2dc\uac04", "CDT"};
                     String CUBA[] = new String[] {"\ucfe0\ubc14 \ud45c\uc900\uc2dc", "CST",
                                                   "\ucfe0\ubc14 \uc77c\uad11\uc808\uc57d\uc2dc\uac04", "CDT"};
            -        String DARWIN[] = new String[] {"\uc911\ubd80 \ud45c\uc900\uc2dc(\ub178\ub358 \uc9c0\uc5ed)", "CST",
            -                                        "\uc911\ubd80 \uc77c\uad11\uc808\uc57d\uc2dc\uac04(\ub178\ub358 \uc9c0\uc5ed)", "CST"};
            +        String DARWIN[] = new String[] {"\uC911\uBD80 \uD45C\uC900\uC2DC(\uBD81\uBD80 \uC9C0\uC5ED)", "CST",
            +                                        "\uC911\uBD80 \uC77C\uAD11 \uC808\uC57D \uC2DC\uAC04(\uBD81\uBD80 \uC9C0\uC5ED)", "CST"};
                     String DUBLIN[] = new String[] {"\uadf8\ub9ac\ub2c8\uce58 \ud45c\uc900\uc2dc", "GMT",
                                                     "\uc544\uc77c\ub79c\ub4dc \uc77c\uad11\uc808\uc57d\uc2dc\uac04", "IST"};
                     String EAT[] = new String[] {"\ub3d9\ubd80 \uc544\ud504\ub9ac\uce74 \uc2dc\uac04", "EAT",
            @@ -103,10 +101,10 @@ public final class TimeZoneNames_ko extends TimeZoneNamesBundle {
                                                  "\ub3d9\ubd80 \uadf8\ub9b0\ub79c\ub4dc \uc77c\uad11\uc808\uc57d\uc2dc\uac04", "EGST"};
                     String EST[] = new String[] {"\ub3d9\ubd80 \ud45c\uc900\uc2dc", "EST",
                                                  "\ub3d9\ubd80 \uc77c\uad11\uc808\uc57d\uc2dc\uac04", "EDT"};
            -        String EST_NSW[] = new String[] {"\ub3d9\ubd80 \ud45c\uc900\uc2dc(\ub274 \uc0ac\uc6b0\uc2a4 \uc6e8\uc77c\uc988)", "EST",
            -                                         "\ub3d9\ubd80 \uc77c\uad11\uc808\uc57d\uc2dc\uac04(\ub274 \uc0ac\uc6b0\uc2a4 \uc6e8\uc77c\uc988)", "EST"};
            -        String FET[] = new String[] {"Further-eastern European Time", "FET",
            -                                     "Further-eastern European Summer Time", "FEST"};
            +        String EST_NSW[] = new String[] {"\uB3D9\uBD80 \uD45C\uC900\uC2DC(\uB274\uC0AC\uC6B0\uC2A4\uC6E8\uC77C\uC988)", "EST",
            +                                         "\uB3D9\uBD80 \uC77C\uAD11 \uC808\uC57D \uC2DC\uAC04(\uB274\uC0AC\uC6B0\uC2A4\uC6E8\uC77C\uC988)", "EST"};
            +        String FET[] = new String[] {"\uADF9\uB3D9 \uC720\uB7FD \uD45C\uC900\uC2DC", "FET",
            +                                     "\uADF9\uB3D9 \uC720\uB7FD \uC77C\uAD11 \uC808\uC57D \uC2DC\uAC04", "FEST"};
                     String GHMT[] = new String[] {"\uac00\ub098 \ud45c\uc900\uc2dc", "GMT",
                                                  "\uac00\ub098 \uc77c\uad11\uc808\uc57d\uc2dc\uac04", "GHST"};
                     String GAMBIER[] =  new String[] {"\uac10\ube44\uc544 \uc2dc\uac04", "GAMT",
            @@ -159,8 +157,8 @@ public final class TimeZoneNames_ko extends TimeZoneNamesBundle {
                                                       "Pitcairn \uc77c\uad11\uc808\uc57d\uc2dc\uac04", "PDT"};
                     String PKT[] = new String[] {"\ud30c\ud0a4\uc2a4\ud0c4 \uc2dc\uac04", "PKT",
                                                  "\ud30c\ud0a4\uc2a4\ud0c4 \uc77c\uad11\uc808\uc57d\uc2dc\uac04", "PKST"};
            -        String PONT[] = new String[] {"Pohnpei Time", "PONT",
            -                                      "Pohnpei Summer Time", "PONST"};
            +        String PONT[] = new String[] {"\uD3F0\uD398\uC774 \uD45C\uC900\uC2DC", "PONT",
            +                                      "\uD3F0\uD398\uC774 \uC77C\uAD11 \uC808\uC57D \uC2DC\uAC04", "PONST"};
                     String PST[] = new String[] {"\ud0dc\ud3c9\uc591 \ud45c\uc900\uc2dc", "PST",
                                                  "\ud0dc\ud3c9\uc591 \uc77c\uad11\uc808\uc57d\uc2dc\uac04", "PDT"};
                     String SAST[] = new String[] {"\ub0a8\uc544\ud504\ub9ac\uce74 \ud45c\uc900\uc2dc", "SAST",
            @@ -171,8 +169,8 @@ public final class TimeZoneNames_ko extends TimeZoneNamesBundle {
                                                  "\uc2f1\uac00\ud3ec\ub974 \uc77c\uad11\uc808\uc57d\uc2dc\uac04", "SGST"};
                     String SLST[] = new String[] {"\uadf8\ub9ac\ub2c8\uce58 \ud45c\uc900\uc2dc", "GMT",
                                                   "\uc2dc\uc5d0\ub77c\ub9ac\uc628 \uc77c\uad11\uc808\uc57d\uc2dc\uac04", "SLST"};
            -        String TASMANIA[] = new String[] {"\ub3d9\ubd80 \ud45c\uc900\uc2dc(\ud0dc\uc988\uba54\uc774\ub2c8\uc544)", "EST",
            -                                          "\ub3d9\ubd80 \uc77c\uad11\uc808\uc57d\uc2dc\uac04(\ud0dc\uc988\uba54\uc774\ub2c8\uc544)", "EST"};
            +        String TASMANIA[] = new String[] {"\uB3D9\uBD80 \uD45C\uC900\uC2DC(\uD0DC\uC988\uBA54\uC774\uB2C8\uC544)", "EST",
            +                                          "\uB3D9\uBD80 \uC77C\uAD11 \uC808\uC57D \uC2DC\uAC04(\uD0DC\uC988\uBA54\uC774\uB2C8\uC544)", "EST"};
                     String TMT[] = new String[] {"\ud22c\ub974\ud06c\uba54\ub2c8\uc2a4\ud0c4 \uc2dc\uac04", "TMT",
                                                  "\ud22c\ub974\ud06c\uba54\ub2c8\uc2a4\ud0c4 \uc77c\uad11\uc808\uc57d\uc2dc\uac04", "TMST"};
                     String ULAT[]= new String[] {"\uc6b8\ub780\ubc14\ud0c0\ub974 \uc2dc\uac04", "ULAT",
            @@ -183,18 +181,18 @@ public final class TimeZoneNames_ko extends TimeZoneNamesBundle {
                                                  "\uc11c\ubd80 \uc544\ud504\ub9ac\uce74 \uc77c\uad11\uc808\uc57d\uc2dc\uac04", "WAST"};
                     String WET[] = new String[] {"\uc11c\uc720\ub7fd \uc2dc\uac04", "WET",
                                                  "\uc11c\uc720\ub7fd \uc77c\uad11\uc808\uc57d\uc2dc\uac04", "WEST"};
            -        String WIT[] = new String[] {"\uc11c\uc778\ub3c4\ub124\uc2dc\uc544 \uc2dc\uac04", "WIT",
            +        String WIT[] = new String[] {"\uc11c\uc778\ub3c4\ub124\uc2dc\uc544 \uc2dc\uac04", "WIB",
                                                  "\uc11c\uc778\ub3c4\ub124\uc2dc\uc544 \uc77c\uad11\uc808\uc57d\uc2dc\uac04", "WIST"};
            -        String WST_AUS[] = new String[] {"\uc11c\ubd80 \ud45c\uc900\uc2dc(\ud638\uc8fc)", "WST",
            -                                         "\uc11c\ubd80 \uc77c\uad11\uc808\uc57d\uc2dc\uac04(\ud638\uc8fc)", "WST"};
            +        String WST_AUS[] = new String[] {"\uC11C\uBD80 \uD45C\uC900\uC2DC(\uC624\uC2A4\uD2B8\uB808\uC77C\uB9AC\uC544)", "WST",
            +                                         "\uC11C\uBD80 \uC77C\uAD11 \uC808\uC57D \uC2DC\uAC04(\uC624\uC2A4\uD2B8\uB808\uC77C\uB9AC\uC544)", "WST"};
                     String SAMOA[] = new String[] {"\uc0ac\ubaa8\uc544 \ud45c\uc900\uc2dc", "SST",
                                                    "\uc0ac\ubaa8\uc544 \uc77c\uad11\uc808\uc57d\uc2dc\uac04", "SDT"};
                     String WST_SAMOA[] = new String[] {"\uc11c\uc0ac\ubaa8\uc544 \uc2dc\uac04", "WST",
                                                        "\uc11c\uc0ac\ubaa8\uc544 \uc77c\uad11\uc808\uc57d\uc2dc\uac04", "WSDT"};
                     String ChST[] = new String[] {"\ucc28\ubaa8\ub85c \ud45c\uc900\uc2dc", "ChST",
                                                   "\ucc28\ubaa8\ub85c \uc77c\uad11\uc808\uc57d\uc2dc\uac04", "ChDT"};
            -        String VICTORIA[] = new String[] {"\ub3d9\ubd80 \ud45c\uc900\uc2dc(\ube45\ud1a0\ub9ac\uc544)", "EST",
            -                                          "\ub3d9\ubd80 \uc77c\uad11\uc808\uc57d\uc2dc\uac04(\ube45\ud1a0\ub9ac\uc544)", "EST"};
            +        String VICTORIA[] = new String[] {"\uB3D9\uBD80 \uD45C\uC900\uC2DC(\uBE45\uD1A0\uB9AC\uC544)", "EST",
            +                                          "\uB3D9\uBD80 \uC77C\uAD11 \uC808\uC57D \uC2DC\uAC04(\uBE45\uD1A0\uB9AC\uC544)", "EST"};
                     String UTC[] = new String[] {"\uc138\uacc4 \ud45c\uc900\uc2dc", "UTC",
                                                  "\uc138\uacc4 \ud45c\uc900\uc2dc", "UTC"};
                     String UZT[] = new String[] {"\uc6b0\uc988\ubca0\ud0a4\uc2a4\ud0c4 \uc2dc\uac04", "UZT",
            @@ -306,7 +304,7 @@ public final class TimeZoneNames_ko extends TimeZoneNamesBundle {
                         {"America/Argentina/Rio_Gallegos", AGT},
                         {"America/Argentina/Salta", AGT},
                         {"America/Argentina/San_Juan", AGT},
            -            {"America/Argentina/San_Luis", WART},
            +            {"America/Argentina/San_Luis", AGT},
                         {"America/Argentina/Tucuman", AGT},
                         {"America/Argentina/Ushuaia", AGT},
                         {"America/Aruba", AST},
            @@ -399,8 +397,8 @@ public final class TimeZoneNames_ko extends TimeZoneNamesBundle {
                         {"America/Mendoza", AGT},
                         {"America/Menominee", CST},
                         {"America/Merida", CST},
            -            {"America/Metlakatla", new String[] {"Metlakatla Standard Time", "MeST",
            -                                                 "Metlakatla Daylight Time", "MeDT"}},
            +            {"America/Metlakatla", new String[] {"\uBA54\uD2B8\uB77C\uCE74\uD2B8\uB77C \uD45C\uC900\uC2DC", "MeST",
            +                                                 "\uBA54\uD2B8\uB77C\uCE74\uD2B8\uB77C \uC77C\uAD11 \uC808\uC57D \uC2DC\uAC04", "MeDT"}},
                         {"America/Mexico_City", CST},
                         {"America/Miquelon", new String[] {"\ud53c\uc5d0\ub974 \ubbf8\ud06c\ub860 \ud45c\uc900\uc2dc", "PMST",
                                                            "\ud53c\uc5d0\ub974 \ubbf8\ud06c\ub860 \uc77c\uad11\uc808\uc57d\uc2dc\uac04", "PMDT"}},
            @@ -464,8 +462,8 @@ public final class TimeZoneNames_ko extends TimeZoneNamesBundle {
                                                            "Davis \uc77c\uad11\uc808\uc57d\uc2dc\uac04", "DAVST"}},
                         {"Antarctica/DumontDUrville", new String[] {"\ub4a4\ubabd \ub4a4\ub974\ube4c \uc2dc\uac04", "DDUT",
                                                                     "\ub4a4\ubabd \ub4a4\ub974\ube4c \uc77c\uad11\uc808\uc57d\uc2dc\uac04", "DDUST"}},
            -            {"Antarctica/Macquarie", new String[] {"Macquarie Island Time", "MIST",
            -                                                   "Macquarie Island Summer Time", "MIST"}},
            +            {"Antarctica/Macquarie", new String[] {"\uB9E4\uCF70\uB9AC \uC12C \uD45C\uC900\uC2DC", "MIST",
            +                                                   "\uB9E4\uCF70\uB9AC \uC12C \uC77C\uAD11 \uC808\uC57D \uC2DC\uAC04", "MIST"}},
                         {"Antarctica/Mawson", new String[] {"\ubaa8\uc2a8 \uc2dc\uac04", "MAWT",
                                                             "\ubaa8\uc2a8 \uc77c\uad11\uc808\uc57d\uc2dc\uac04", "MAWST"}},
                         {"Antarctica/McMurdo", NZST},
            @@ -481,7 +479,7 @@ public final class TimeZoneNames_ko extends TimeZoneNamesBundle {
                         {"Asia/Aden", ARAST},
                         {"Asia/Almaty", new String[] {"\uc54c\ub9c8\uc544\ud0c0 \uc2dc\uac04", "ALMT",
                                                       "\uc54c\ub9c8\uc544\ud0c0 \uc77c\uad11\uc808\uc57d\uc2dc\uac04", "ALMST"}},
            -            {"Asia/Amman", EET},
            +            {"Asia/Amman", ARAST},
                         {"Asia/Anadyr", new String[] {"\uc544\ub098\ub514\ub974 \uc2dc\uac04", "ANAT",
                                                       "\uc544\ub098\ub514\ub974 \uc77c\uad11\uc808\uc57d\uc2dc\uac04", "ANAST"}},
                         {"Asia/Aqtau", new String[] {"\uc545\ud0c0\uc6b0 \uc2dc\uac04", "AQTT",
            @@ -525,7 +523,7 @@ public final class TimeZoneNames_ko extends TimeZoneNamesBundle {
                                                         "\uc774\ub974\ucfe0\uce20\ud06c \uc77c\uad11\uc808\uc57d\uc2dc\uac04", "IRKST"}},
                         {"Asia/Istanbul", EET},
                         {"Asia/Jakarta", WIT},
            -            {"Asia/Jayapura", new String[] {"\ub3d9\ubd80 \uc778\ub3c4\ub124\uc2dc\uc544 \uc2dc\uac04", "EIT",
            +            {"Asia/Jayapura", new String[] {"\ub3d9\ubd80 \uc778\ub3c4\ub124\uc2dc\uc544 \uc2dc\uac04", "WIT",
                                                         "\ub3d9\ubd80 \uc778\ub3c4\ub124\uc2dc\uc544 \uc77c\uad11\uc808\uc57d\uc2dc\uac04", "EIST"}},
                         {"Asia/Kabul", new String[] {"\uc544\ud504\uac00\ub2c8\uc2a4\ud0c4 \uc2dc\uac04", "AFT",
                                                      "\uc544\ud504\uac00\ub2c8\uc2a4\ud0c4 \uc77c\uad11\uc808\uc57d\uc2dc\uac04", "AFST"}},
            @@ -535,8 +533,8 @@ public final class TimeZoneNames_ko extends TimeZoneNamesBundle {
                         {"Asia/Kashgar", CTT},
                         {"Asia/Kathmandu", NPT},
                         {"Asia/Katmandu", NPT},
            -            {"Asia/Khandyga", new String[] {"Khandyga Time", "YAKT",
            -                                            "Khandyga Summer Time", "YAKST"}},
            +            {"Asia/Khandyga", new String[] {"\uD55C\uB514\uAC00 \uD45C\uC900\uC2DC", "YAKT",
            +                                            "\uD55C\uB514\uAC00 \uC77C\uAD11 \uC808\uC57D \uC2DC\uAC04", "YAKST"}},
                         {"Asia/Kolkata", IST},
                         {"Asia/Krasnoyarsk", new String[] {"\ud06c\ub77c\uc2a4\ub178\uc57c\ub974\uc2a4\ud06c \uc2dc\uac04", "KRAT",
                                                            "\ud06c\ub77c\uc2a4\ub178\uc57c\ub974\uc2a4\ud06c \uc77c\uad11\uc808\uc57d\uc2dc\uac04", "KRAST"}},
            @@ -585,8 +583,8 @@ public final class TimeZoneNames_ko extends TimeZoneNamesBundle {
                         {"Asia/Ulaanbaatar", ULAT},
                         {"Asia/Ulan_Bator", ULAT},
                         {"Asia/Urumqi", CTT},
            -            {"Asia/Ust-Nera", new String[] {"Ust-Nera Time", "VLAT",
            -                                            "Ust-Nera Summer Time", "VLAST" }},
            +            {"Asia/Ust-Nera", new String[] {"\uC6B0\uC2A4\uD2F0\uB124\uB77C \uD45C\uC900\uC2DC", "VLAT",
            +                                            "\uC6B0\uC2A4\uD2F0\uB124\uB77C \uC77C\uAD11 \uC808\uC57D \uC2DC\uAC04", "VLAST" }},
                         {"Asia/Vientiane", ICT},
                         {"Asia/Vladivostok", new String[] {"\ube14\ub77c\ub514\ubcf4\uc2a4\ud1a1 \uc2dc\uac04", "VLAT",
                                                            "\ube14\ub77c\ub514\ubcf4\uc2a4\ud1a1 \uc77c\uad11\uc808\uc57d\uc2dc\uac04", "VLAST"}},
            @@ -618,8 +616,8 @@ public final class TimeZoneNames_ko extends TimeZoneNamesBundle {
                         {"Australia/Canberra", EST_NSW},
                         {"Australia/Currie", EST_NSW},
                         {"Australia/Darwin", DARWIN},
            -            {"Australia/Eucla", new String[] {"\uc911\uc11c\ubd80 \ud45c\uc900\uc2dc(\uc624\uc2a4\ud2b8\ub808\uc77c\ub9ac\uc544)", "CWST",
            -                                              "\uc911\uc11c\ubd80 \uc77c\uad11\uc808\uc57d\uc2dc\uac04(\uc624\uc2a4\ud2b8\ub808\uc77c\ub9ac\uc544)", "CWST"}},
            +            {"Australia/Eucla", new String[] {"\uC911\uC559 \uC11C\uBD80 \uD45C\uC900\uC2DC(\uC624\uC2A4\uD2B8\uB808\uC77C\uB9AC\uC544)", "CWST",
            +                                              "\uC911\uC559 \uC11C\uBD80 \uC77C\uAD11 \uC808\uC57D \uC2DC\uAC04(\uC624\uC2A4\uD2B8\uB808\uC77C\uB9AC\uC544)", "CWST"}},
                         {"Australia/Hobart", TASMANIA},
                         {"Australia/LHI", LORD_HOWE},
                         {"Australia/Lindeman", BRISBANE},
            @@ -675,6 +673,7 @@ public final class TimeZoneNames_ko extends TimeZoneNamesBundle {
                         {"Europe/Bratislava", CET},
                         {"Europe/Brussels", CET},
                         {"Europe/Budapest", CET},
            +            {"Europe/Busingen", CET},
                         {"Europe/Chisinau", EET},
                         {"Europe/Copenhagen", CET},
                         {"Europe/Dublin", DUBLIN},
            diff --git a/jdk/src/share/classes/sun/util/resources/pt/TimeZoneNames_pt_BR.java b/jdk/src/share/classes/sun/util/resources/pt/TimeZoneNames_pt_BR.java
            index 124b8eb0c2d..d549c10d5f8 100644
            --- a/jdk/src/share/classes/sun/util/resources/pt/TimeZoneNames_pt_BR.java
            +++ b/jdk/src/share/classes/sun/util/resources/pt/TimeZoneNames_pt_BR.java
            @@ -45,10 +45,8 @@ import sun.util.resources.TimeZoneNamesBundle;
             public final class TimeZoneNames_pt_BR extends TimeZoneNamesBundle {
             
                 protected final Object[][] getContents() {
            -        String ACT[] = new String[] {"Fuso hor\u00e1rio do Acre", "ACT",
            -                                     "Fuso hor\u00e1rio de ver\u00e3o do Acre", "ACST"};
            -        String ADELAIDE[] = new String[] {"Fuso hor\u00e1rio padr\u00e3o central (Austr\u00e1lia do Sul)", "CST",
            -                                          "Fuso hor\u00e1rio de ver\u00e3o central (Austr\u00e1lia do Sul)", "CST"};
            +        String ADELAIDE[] = new String[] {"Hor\u00E1rio-Padr\u00E3o Central (Austr\u00E1lia do Sul)", "CST",
            +                                          "Fuso Hor\u00E1rio de Ver\u00E3o Central (Austr\u00E1lia do Sul)", "CST"};
                     String AGT[] = new String[] {"Fuso hor\u00e1rio da Argentina", "ART",
                                                  "Fuso hor\u00e1rio de ver\u00e3o da Argentina", "ARST"};
                     String AKST[] = new String[] {"Fuso hor\u00e1rio padr\u00e3o do Alaska", "AKST",
            @@ -63,10 +61,10 @@ public final class TimeZoneNames_pt_BR extends TimeZoneNamesBundle {
                                                  "Hor\u00e1rio de luz natural do Atl\u00e2ntico", "ADT"};
                     String BDT[] = new String[] {"Fuso hor\u00e1rio de Bangladesh", "BDT",
                                                  "Fuso hor\u00e1rio de ver\u00e3o de Bangladesh", "BDST"};
            -        String BRISBANE[] = new String[] {"Fuso hor\u00e1rio padr\u00e3o oriental (Queensland)", "EST",
            -                                          "Fuso hor\u00e1rio de ver\u00e3o oriental (Queensland)", "EST"};
            -        String BROKEN_HILL[] = new String[] {"Fuso hor\u00e1rio padr\u00e3o central (Austr\u00e1lia do Sul/Nova Gales do Sul)", "CST",
            -                                             "Fuso hor\u00e1rio de ver\u00e3o central (Austr\u00e1lia do Sul/Nova Gales do Sul)", "CST"};
            +        String BRISBANE[] = new String[] {"Hor\u00E1rio-Padr\u00E3o do Leste (Queensland)", "EST",
            +                                          "Fuso Hor\u00E1rio de Ver\u00E3o Oriental (Queensland)", "EST"};
            +        String BROKEN_HILL[] = new String[] {"Hor\u00E1rio-Padr\u00E3o Central (Austr\u00E1lia do Sul/Nova Gales do Sul)", "CST",
            +                                             "Fuso Hor\u00E1rio de Ver\u00E3o Central (Austr\u00E1lia do Sul/Nova Gales do Sul)", "CST"};
                     String BRT[] = new String[] {"Fuso hor\u00e1rio de Bras\u00edlia", "BRT",
                                                  "Fuso hor\u00e1rio de ver\u00e3o de Bras\u00edlia", "BRST"};
                     String BTT[] = new String[] {"Fuso hor\u00e1rio de But\u00e3o", "BTT",
            @@ -77,7 +75,7 @@ public final class TimeZoneNames_pt_BR extends TimeZoneNamesBundle {
                                                  "Fuso hor\u00e1rio de ver\u00e3o da Europa Central", "CEST"};
                     String CHAST[] = new String[] {"Fuso hor\u00e1rio padr\u00e3o de Chatham", "CHAST",
                                                    "Hor\u00e1rio de luz natural de Chatham", "CHADT"};
            -        String CIT[] = new String[] {"Fuso hor\u00e1rio da Indon\u00e9sia Central", "CIT",
            +        String CIT[] = new String[] {"Fuso hor\u00e1rio da Indon\u00e9sia Central", "WITA",
                                                  "Fuso hor\u00e1rio de ver\u00e3o da Indon\u00e9sia Central", "CIST"};
                     String CLT[] = new String[] {"Fuso hor\u00e1rio do Chile", "CLT",
                                                  "Fuso hor\u00e1rio de ver\u00e3o do Chile", "CLST"};
            @@ -87,8 +85,8 @@ public final class TimeZoneNames_pt_BR extends TimeZoneNamesBundle {
                                                  "Hor\u00e1rio de luz natural da China", "CDT"};
                     String CUBA[] = new String[] {"Fuso hor\u00e1rio padr\u00e3o de Cuba", "CST",
                                                   "Hor\u00e1rio de luz natural de Cuba", "CDT"};
            -        String DARWIN[] = new String[] {"Fuso hor\u00e1rio padr\u00e3o central (Territ\u00f3rio do Norte)", "CST",
            -                                        "Fuso hor\u00e1rio de ver\u00e3o central (Territ\u00f3rio do Norte)", "CST"};
            +        String DARWIN[] = new String[] {"Hor\u00E1rio-Padr\u00E3o Central (Territ\u00F3rio do Norte)", "CST",
            +                                        "Fuso Hor\u00E1rio de Ver\u00E3o Central (Territ\u00F3rio do Norte)", "CST"};
                     String DUBLIN[] = new String[] {"Fuso hor\u00e1rio do meridiano de Greenwich", "GMT",
                                                     "Fuso hor\u00e1rio de ver\u00e3o da Irlanda", "IST"};
                     String EAT[] = new String[] {"Fuso hor\u00e1rio da \u00c1frica Oriental", "EAT",
            @@ -101,10 +99,10 @@ public final class TimeZoneNames_pt_BR extends TimeZoneNamesBundle {
                                                  "Fuso hor\u00e1rio de ver\u00e3o da Groenl\u00e2ndia Oriental", "EGST"};
                     String EST[] = new String[] {"Fuso hor\u00e1rio padr\u00e3o oriental", "EST",
                                                  "Hor\u00e1rio de luz natural oriental", "EDT"};
            -        String EST_NSW[] = new String[] {"Fuso hor\u00e1rio padr\u00e3o oriental (Nova Gales do Sul)", "EST",
            -                                         "Fuso hor\u00e1rio de ver\u00e3o oriental (Nova Gales do Sul)", "EST"};
            -        String FET[] = new String[] {"Further-eastern European Time", "FET",
            -                                     "Further-eastern European Summer Time", "FEST"};
            +        String EST_NSW[] = new String[] {"Hor\u00E1rio-Padr\u00E3o Oriental (Nova Gales do Sul)", "EST",
            +                                         "Fuso Hor\u00E1rio de Ver\u00E3o Oriental (Nova Gales do Sul)", "EST"};
            +        String FET[] = new String[] {"Hor\u00E1rio do Extremo Leste Europeu (FET)", "FET",
            +                                     "Fuso Hor\u00E1rio de Ver\u00E3o do Extremo Leste Europeu", "FEST"};
                     String GHMT[] = new String[] {"Fuso hor\u00e1rio do meridiano de Gana", "GMT",
                                                   "Fuso hor\u00e1rio de ver\u00e3o de Gana", "GHST"};
                     String GAMBIER[] =  new String[] {"Fuso hor\u00e1rio de Gambier", "GAMT",
            @@ -157,8 +155,8 @@ public final class TimeZoneNames_pt_BR extends TimeZoneNamesBundle {
                                                       "Hor\u00e1rio de luz natural de Pitcairn", "PDT"};
                     String PKT[] = new String[] {"Fuso hor\u00e1rio do Paquist\u00e3o", "PKT",
                                                  "Fuso hor\u00e1rio de ver\u00e3o do Paquist\u00e3o", "PKST"};
            -        String PONT[] = new String[] {"Fuso hor\u00e1rio de Pohnpei", "PONT",
            -                                      "Fuso hor\u00e1rio de ver\u00e3o de Pohnpei", "PONST"};
            +        String PONT[] = new String[] {"Fuso Hor\u00E1rio de Pohnpei", "PONT",
            +                                      "Fuso Hor\u00E1rio de Ver\u00E3o de Pohnpei", "PONST"};
                     String PST[] = new String[] {"Fuso hor\u00e1rio padr\u00e3o do Pac\u00edfico", "PST",
                                                  "Hor\u00e1rio de luz natural do Pac\u00edfico", "PDT"};
                     String SAST[] = new String[] {"Fuso hor\u00e1rio padr\u00e3o da \u00c1frica do Sul", "SAST",
            @@ -169,30 +167,30 @@ public final class TimeZoneNames_pt_BR extends TimeZoneNamesBundle {
                                                  "Fuso hor\u00e1rio de ver\u00e1 de Cingapura", "SGST"};
                     String SLST[] = new String[] {"Fuso hor\u00e1rio do meridiano de Greenwich", "GMT",
                                                   "Fuso hor\u00e1rio de ver\u00e3o de Serra Leoa", "SLST"};
            -        String TASMANIA[] = new String[] {"Fuso hor\u00e1rio padr\u00e3o oriental (Tasm\u00e2nia)", "EST",
            -                                          "Fuso hor\u00e1rio de ver\u00e3o oriental (Tasm\u00e2nia)", "EST"};
            +        String TASMANIA[] = new String[] {"Hor\u00E1rio-Padr\u00E3o do Leste (Tasm\u00E2nia)", "EST",
            +                                          "Fuso Hor\u00E1rio de Ver\u00E3o Oriental (Tasm\u00E2nia)", "EST"};
                     String TMT[] = new String[] {"Fuso hor\u00e1rio do Turcomenist\u00e3o", "TMT",
                                                  "Fuso hor\u00e1rio de ver\u00e3o do Turcomenist\u00e3o", "TMST"};
            -        String TRUT[] = new String[] {"Fuso hor\u00e1rio de Chuuk", "CHUT",
            -                                      "Fuso hor\u00e1rio de ver\u00e3o de Chuuk", "CHUST"};
            +        String TRUT[] = new String[] {"Fuso Hor\u00E1rio de Chuuk", "CHUT",
            +                                      "Fuso Hor\u00E1rio de Ver\u00E3o de Chuuk", "CHUST"};
                     String ULAT[]= new String[] {"Fuso hor\u00e1rio de Ulan Bator", "ULAT",
                                                  "Fuso hor\u00e1rio de ver\u00e3o de Ulan Bator", "ULAST"};
                     String WAT[] = new String[] {"Fuso hor\u00e1rio da \u00c1frica Ocidental", "WAT",
                                                  "Fuso hor\u00e1rio de ver\u00e3o da \u00c1frica Ocidental", "WAST"};
                     String WET[] = new String[] {"Fuso hor\u00e1rio da Europa Ocidental", "WET",
                                                  "Fuso hor\u00e1rio de ver\u00e3o da Europa Ocidental", "WEST"};
            -        String WIT[] = new String[] {"Fuso hor\u00e1rio da Indon\u00e9sia Ocidental", "WIT",
            +        String WIT[] = new String[] {"Fuso hor\u00e1rio da Indon\u00e9sia Ocidental", "WIB",
                                                  "Fuso hor\u00e1rio de ver\u00e3o da Indon\u00e9sia Ocidental", "WIST"};
            -        String WST_AUS[] = new String[] {"Fuso hor\u00e1rio padr\u00e3o ocidental (Austr\u00e1lia)", "WST",
            -                                         "Fuso hor\u00e1rio de ver\u00e3o ocidental (Austr\u00e1lia)", "WST"};
            +        String WST_AUS[] = new String[] {"Hor\u00E1rio-Padr\u00E3o Ocidental (Austr\u00E1lia)", "WST",
            +                                         "Fuso Hor\u00E1rio de Ver\u00E3o Ocidental (Austr\u00E1lia)", "WST"};
                     String SAMOA[] = new String[] {"Fuso hor\u00e1rio padr\u00e3o de Samoa", "SST",
                                                    "Hor\u00e1rio de luz natural de Samoa", "SDT"};
                     String WST_SAMOA[] = new String[] {"Fuso hor\u00e1rio de Samoa Ocidental", "WST",
                                                        "Fuso hor\u00e1rio de ver\u00e3o de Samoa Ocidental", "WSDT"};
                     String ChST[] = new String[] {"Fuso hor\u00e1rio padr\u00e3o de Chamorro", "ChST",
                                                   "Hor\u00e1rio de luz natural de Chamorro", "ChDT"};
            -        String VICTORIA[] = new String[] {"Fuso hor\u00e1rio padr\u00e3o oriental (Victoria)", "EST",
            -                                          "Fuso hor\u00e1rio de ver\u00e3o oriental (Victoria)", "EST"};
            +        String VICTORIA[] = new String[] {"Hor\u00E1rio-Padr\u00E3o do Leste (Victoria)", "EST",
            +                                          "Fuso Hor\u00E1rio de Ver\u00E3o Oriental (Victoria)", "EST"};
                     String UTC[] = new String[] {"Tempo universal coordenado", "UTC",
                                                  "Tempo universal coordenado", "UTC"};
                     String UZT[] = new String[] {"Fuso hor\u00e1rio do Uzbequist\u00e3o", "UZT",
            @@ -306,7 +304,7 @@ public final class TimeZoneNames_pt_BR extends TimeZoneNamesBundle {
                         {"America/Argentina/Rio_Gallegos", AGT},
                         {"America/Argentina/Salta", AGT},
                         {"America/Argentina/San_Juan", AGT},
            -            {"America/Argentina/San_Luis", WART},
            +            {"America/Argentina/San_Luis", AGT},
                         {"America/Argentina/Tucuman", AGT},
                         {"America/Argentina/Ushuaia", AGT},
                         {"America/Aruba", AST},
            @@ -399,8 +397,8 @@ public final class TimeZoneNames_pt_BR extends TimeZoneNamesBundle {
                         {"America/Mendoza", AGT},
                         {"America/Menominee", CST},
                         {"America/Merida", CST},
            -            {"America/Metlakatla", new String[] {"Metlakatla Standard Time", "MeST",
            -                                                 "Metlakatla Daylight Time", "MeDT"}},
            +            {"America/Metlakatla", new String[] {"Hor\u00E1rio Padr\u00E3o de Metlakatla", "MeST",
            +                                                 "Hor\u00E1rio de Luz Natural de Metlakatla", "MeDT"}},
                         {"America/Mexico_City", CST},
                         {"America/Miquelon", new String[] {"Fuso hor\u00e1rio padr\u00e3o de S\u00e3o Pedro e Miquelon", "PMST",
                                                            "Hor\u00e1rio de luz natural de S\u00e3o Pedro e Miquelon", "PMDT"}},
            @@ -464,8 +462,8 @@ public final class TimeZoneNames_pt_BR extends TimeZoneNamesBundle {
                                                            "Fuso hor\u00e1rio de ver\u00e3o de Davis", "DAVST"}},
                         {"Antarctica/DumontDUrville", new String[] {"Fuso hor\u00e1rio de Dumont-d'Urville", "DDUT",
                                                                     "Fuso hor\u00e1rio de ver\u00e3o de Dumont-d'Urville", "DDUST"}},
            -            {"Antarctica/Macquarie", new String[] {"Macquarie Island Time", "MIST",
            -                                                   "Macquarie Island Summer Time", "MIST"}},
            +            {"Antarctica/Macquarie", new String[] {"Fuso Hor\u00E1rio da Ilha de Macquarie", "MIST",
            +                                                   "Fuso Hor\u00E1rio de Ver\u00E3o da Ilha de Macquarie", "MIST"}},
                         {"Antarctica/Mawson", new String[] {"Fuso hor\u00e1rio de Mawson", "MAWT",
                                                             "Fuso hor\u00e1rio de ver\u00e3o de Mawson", "MAWST"}},
                         {"Antarctica/McMurdo", NZST},
            @@ -481,7 +479,7 @@ public final class TimeZoneNames_pt_BR extends TimeZoneNamesBundle {
                         {"Asia/Aden", ARAST},
                         {"Asia/Almaty", new String[] {"Fuso hor\u00e1rio de Alma-Ata", "ALMT",
                                                       "Fuso hor\u00e1rio de ver\u00e3o de Alma-Ata", "ALMST"}},
            -            {"Asia/Amman", EET},
            +            {"Asia/Amman", ARAST},
                         {"Asia/Anadyr", new String[] {"Fuso hor\u00e1rio de Anadyr", "ANAT",
                                                       "Fuso hor\u00e1rio de ver\u00e3o de Anadyr", "ANAST"}},
                         {"Asia/Aqtau", new String[] {"Fuso hor\u00e1rio de Aqtau", "AQTT",
            @@ -525,7 +523,7 @@ public final class TimeZoneNames_pt_BR extends TimeZoneNamesBundle {
                                                        "Fuso hor\u00e1rio de ver\u00e3o de Irkutsk", "IRKST"}},
                         {"Asia/Istanbul", EET},
                         {"Asia/Jakarta", WIT},
            -            {"Asia/Jayapura", new String[] {"Fuso hor\u00e1rio da Indon\u00e9sia Oriental", "EIT",
            +            {"Asia/Jayapura", new String[] {"Fuso hor\u00e1rio da Indon\u00e9sia Oriental", "WIT",
                                                         "Fuso hor\u00e1rio de ver\u00e3o da Indon\u00e9sia Oriental", "EIST"}},
                         {"Asia/Kabul", new String[] {"Fuso hor\u00e1rio do Afeganist\u00e3o", "AFT",
                                                      "Fuso hor\u00e1rio de ver\u00e3o do Afeganist\u00e3o", "AFST"}},
            @@ -535,8 +533,8 @@ public final class TimeZoneNames_pt_BR extends TimeZoneNamesBundle {
                         {"Asia/Kashgar", CTT},
                         {"Asia/Kathmandu", NPT},
                         {"Asia/Katmandu", NPT},
            -            {"Asia/Khandyga", new String[] {"Khandyga Time", "YAKT",
            -                                            "Khandyga Summer Time", "YAKST"}},
            +            {"Asia/Khandyga", new String[] {"Hor\u00E1rio de Khandyga", "YAKT",
            +                                            "Hor\u00E1rio de Ver\u00E3o de Khandyga", "YAKST"}},
                         {"Asia/Kolkata", IST},
                         {"Asia/Krasnoyarsk", new String[] {"Fuso hor\u00e1rio de Krasnoyarsk", "KRAT",
                                                            "Fuso hor\u00e1rio de ver\u00e3o de Krasnoyarsk", "KRAST"}},
            @@ -585,8 +583,8 @@ public final class TimeZoneNames_pt_BR extends TimeZoneNamesBundle {
                         {"Asia/Ulaanbaatar", ULAT},
                         {"Asia/Ulan_Bator", ULAT},
                         {"Asia/Urumqi", CTT},
            -            {"Asia/Ust-Nera", new String[] {"Ust-Nera Time", "VLAT",
            -                                            "Ust-Nera Summer Time", "VLAST"}},
            +            {"Asia/Ust-Nera", new String[] {"Hor\u00E1rio de Ust-Nera", "VLAT",
            +                                            "Hor\u00E1rio de Ver\u00E3o de Ust-Nera", "VLAST"}},
                         {"Asia/Vientiane", ICT},
                         {"Asia/Vladivostok", new String[] {"Fuso hor\u00e1rio de Vladivostok", "VLAT",
                                                            "Fuso hor\u00e1rio de ver\u00e3o de Vladivostok", "VLAST"}},
            @@ -618,8 +616,8 @@ public final class TimeZoneNames_pt_BR extends TimeZoneNamesBundle {
                         {"Australia/Canberra", EST_NSW},
                         {"Australia/Currie", EST_NSW},
                         {"Australia/Darwin", DARWIN},
            -            {"Australia/Eucla", new String[] {"Fuso hor\u00e1rio ocidental central (Austr\u00e1lia)", "CWST",
            -                                              "Fuso hor\u00e1rio de ver\u00e3o ocidental central (Austr\u00e1lia)", "CWST"}},
            +            {"Australia/Eucla", new String[] {"Fuso Hor\u00E1rio Ocidental Central (Austr\u00E1lia)", "CWST",
            +                                              "Fuso Hor\u00E1rio de Ver\u00E3o Ocidental Central (Austr\u00E1lia)", "CWST"}},
                         {"Australia/Hobart", TASMANIA},
                         {"Australia/LHI", LORD_HOWE},
                         {"Australia/Lindeman", BRISBANE},
            @@ -675,6 +673,7 @@ public final class TimeZoneNames_pt_BR extends TimeZoneNamesBundle {
                         {"Europe/Bratislava", CET},
                         {"Europe/Brussels", CET},
                         {"Europe/Budapest", CET},
            +            {"Europe/Busingen", CET},
                         {"Europe/Chisinau", EET},
                         {"Europe/Copenhagen", CET},
                         {"Europe/Dublin", DUBLIN},
            diff --git a/jdk/src/share/classes/sun/util/resources/sv/TimeZoneNames_sv.java b/jdk/src/share/classes/sun/util/resources/sv/TimeZoneNames_sv.java
            index 0e54cea9116..667b103cc89 100644
            --- a/jdk/src/share/classes/sun/util/resources/sv/TimeZoneNames_sv.java
            +++ b/jdk/src/share/classes/sun/util/resources/sv/TimeZoneNames_sv.java
            @@ -45,10 +45,8 @@ import sun.util.resources.TimeZoneNamesBundle;
             public final class TimeZoneNames_sv extends TimeZoneNamesBundle {
             
                 protected final Object[][] getContents() {
            -        String ACT[] = new String[] {"Acre, normaltid", "ACT",
            -                                     "Acre, sommartid", "ACST"};
            -        String ADELAIDE[] = new String[] {"Central normaltid (S\u00f6dra Australien)", "CST",
            -                                          "Central sommartid (S\u00f6dra Australien)", "CST"};
            +        String ADELAIDE[] = new String[] {"Central standardtid (Sydaustralien)", "CST",
            +                                          "Central sommartid (South Australia)", "CST"};
                     String AGT[] = new String[] {"Argentina, normaltid", "ART",
                                                  "Argentina, sommartid", "ARST"};
                     String AKST[] = new String[] {"Alaska, normaltid", "AKST",
            @@ -63,10 +61,10 @@ public final class TimeZoneNames_sv extends TimeZoneNamesBundle {
                                                  "Atlantisk sommartid", "ADT"};
                     String BDT[] = new String[] {"Bangladesh, normaltid", "BDT",
                                                  "Bangladesh, sommartid", "BDST"};
            -        String BRISBANE[] = new String[] {"\u00d6stlig normaltid (Queensland)", "EST",
            -                                          "\u00d6stlig sommartid (Queensland)", "EST"};
            -        String BROKEN_HILL[] = new String[] {"Central normaltid (S\u00f6dra Australien/Nya Sydwales)", "CST",
            -                                             "Central sommartid (S\u00f6dra Australien/Nya Sydwales)", "CST"};
            +        String BRISBANE[] = new String[] {"\u00D6stlig standardtid (Queensland)", "EST",
            +                                          "\u00D6stlig sommartid (Queensland)", "EST"};
            +        String BROKEN_HILL[] = new String[] {"Central standardtid (Sydaustralien)/New South Wales)", "CST",
            +                                             "Central sommartid (South Australia/New South Wales)", "CST"};
                     String BRT[] = new String[] {"Brasilien, normaltid", "BRT",
                                                  "Brasilien, sommartid", "BRST"};
                     String BTT[] = new String[] {"Bhutan, normaltid", "BTT",
            @@ -77,9 +75,9 @@ public final class TimeZoneNames_sv extends TimeZoneNamesBundle {
                                                  "Centraleuropeisk sommartid", "CEST"};
                     String CHAST[] = new String[] {"Chatham, normaltid", "CHAST",
                                                    "Chatham, sommartid", "CHADT"};
            -        String CHUT[] = new String[] {"Chuuk Time", "CHUT",
            -                                      "Chuuk Summer Time", "CHUST"};
            -        String CIT[] = new String[] {"Centralindonesisk tid", "CIT",
            +        String CHUT[] = new String[] {"Chuuk, normaltid", "CHUT",
            +                                      "Chuuk, sommartid", "CHUST"};
            +        String CIT[] = new String[] {"Centralindonesisk tid", "WITA",
                                                  "Centralindonesisk sommartid", "CIST"};
                     String CLT[] = new String[] {"Chile, normaltid", "CLT",
                                                  "Chile, sommartid", "CLST"};
            @@ -89,7 +87,7 @@ public final class TimeZoneNames_sv extends TimeZoneNamesBundle {
                                                  "Kina, sommartid", "CDT"};
                     String CUBA[] = new String[] {"Kuba, normaltid", "CST",
                                                   "Kuba, sommartid", "CDT"};
            -        String DARWIN[] = new String[] {"Central normaltid (Nordterritoriet)", "CST",
            +        String DARWIN[] = new String[] {"Central standardtid (Nordterritoriet)", "CST",
                                                     "Central sommartid (Nordterritoriet)", "CST"};
                     String DUBLIN[] = new String[] {"Greenwichtid", "GMT",
                                                     "Irland, sommartid", "IST"};
            @@ -103,10 +101,10 @@ public final class TimeZoneNames_sv extends TimeZoneNamesBundle {
                                                  "\u00d6stgr\u00f6nl\u00e4ndsk sommartid", "EGST"};
                     String EST[] = new String[] {"Eastern, normaltid", "EST",
                                                  "Eastern, sommartid", "EDT"};
            -        String EST_NSW[] = new String[] {"Eastern, normaltid (Nya Sydwales)", "EST",
            -                                         "Eastern, sommartid (Nya Sydwales)", "EST"};
            -        String FET[] = new String[] {"Further-eastern European Time", "FET",
            -                                     "Further-eastern European Summer Time", "FEST"};
            +        String EST_NSW[] = new String[] {"\u00D6stlig standardtid (New South Wales)", "EST",
            +                                         "\u00D6stlig sommartid (New South Wales)", "EST"};
            +        String FET[] = new String[] {"Kaliningradtid", "FET",
            +                                     "\u00D6steuropeisk sommartid", "FEST"};
                     String GHMT[] = new String[] {"Ghana, normaltid", "GMT",
                                                   "Ghana, sommartid", "GHST"};
                     String GAMBIER[] =  new String[] {"Gambier, normaltid", "GAMT",
            @@ -159,8 +157,8 @@ public final class TimeZoneNames_sv extends TimeZoneNamesBundle {
                                                       "Pitcairn, sommartid", "PDT"};
                     String PKT[] = new String[] {"Pakistan, normaltid", "PKT",
                                                  "Pakistan, sommartid", "PKST"};
            -        String PONT[] = new String[] {"Pohnpei Time", "PONT",
            -                                      "Pohnpei Summer Time", "PONST"};
            +        String PONT[] = new String[] {"Pohnpei, normaltid", "PONT",
            +                                      "Pohnpei, sommartid", "PONST"};
                     String PST[] = new String[] {"Stilla havet, normaltid", "PST",
                                                  "Stilla havet, sommartid", "PDT"};
                     String SAST[] = new String[] {"Sydafrika, normaltid", "SAST",
            @@ -171,8 +169,8 @@ public final class TimeZoneNames_sv extends TimeZoneNamesBundle {
                                                  "Singapore, sommartid", "SGST"};
                     String SLST[] = new String[] {"Greenwichtid", "GMT",
                                                   "Sierra Leone, sommartid", "SLST"};
            -        String TASMANIA[] = new String[] {"Eastern, normaltid (Tasmanien)", "EST",
            -                                          "Eastern, sommartid (Tasmanien)", "EST"};
            +        String TASMANIA[] = new String[] {"\u00D6stlig standardtid (Tasmania)", "EST",
            +                                          "\u00D6stlig sommartid (Tasmanien)", "EST"};
                     String TMT[] = new String[] {"Turkmenistan, normaltid", "TMT",
                                                  "Turkmenistan, sommartid", "TMST"};
                     String ULAT[]= new String[] {"Ulaanbaatar, normaltid", "ULAT",
            @@ -183,18 +181,18 @@ public final class TimeZoneNames_sv extends TimeZoneNamesBundle {
                                                  "V\u00e4stafrikansk sommartid", "WAST"};
                     String WET[] = new String[] {"V\u00e4steuropeisk tid", "WET",
                                                  "V\u00e4steuropeisk sommartid", "WEST"};
            -        String WIT[] = new String[] {"V\u00e4stindonesisk tid", "WIT",
            +        String WIT[] = new String[] {"V\u00e4stindonesisk tid", "WIB",
                                                  "V\u00e4stindonesisk sommartid", "WIST"};
            -        String WST_AUS[] = new String[] {"V\u00e4stlig normaltid (Australien)", "WST",
            -                                         "V\u00e4stlig sommartid (Australien)", "WST"};
            +        String WST_AUS[] = new String[] {"Western Standard Time (Australien)", "WST",
            +                                         "V\u00E4stlig sommartid (Australien)", "WST"};
                     String SAMOA[] = new String[] {"Samoa, normaltid", "SST",
                                                    "Samoa, sommartid", "SDT"};
                     String WST_SAMOA[] = new String[] {"V\u00e4stsamoansk tid", "WST",
                                                        "V\u00e4stsamoansk sommartid", "WSDT"};
                     String ChST[] = new String[] {"Chamorro, normaltid", "ChST",
                                                   "Chamorro, sommartid", "ChDT"};
            -        String VICTORIA[] = new String[] {"\u00d6stlig normaltid (Victoria)", "EST",
            -                                          "\u00d6stlig sommartid (Victoria)", "EST"};
            +        String VICTORIA[] = new String[] {"\u00D6stlig standardtid (Victoria)", "EST",
            +                                          "\u00D6stlig sommartid (Victoria)", "EST"};
                     String UTC[] = new String[] {"Koordinerad universell tid", "UTC",
                                                  "Koordinerad universell tid", "UTC"};
                     String UZT[] = new String[] {"Uzbekistan, normaltid", "UZT",
            @@ -306,7 +304,7 @@ public final class TimeZoneNames_sv extends TimeZoneNamesBundle {
                         {"America/Argentina/Rio_Gallegos", AGT},
                         {"America/Argentina/Salta", AGT},
                         {"America/Argentina/San_Juan", AGT},
            -            {"America/Argentina/San_Luis", WART},
            +            {"America/Argentina/San_Luis", AGT},
                         {"America/Argentina/Tucuman", AGT},
                         {"America/Argentina/Ushuaia", AGT},
                         {"America/Aruba", AST},
            @@ -399,8 +397,8 @@ public final class TimeZoneNames_sv extends TimeZoneNamesBundle {
                         {"America/Mendoza", AGT},
                         {"America/Menominee", CST},
                         {"America/Merida", CST},
            -            {"America/Metlakatla", new String[] {"Metlakatla Standard Time", "MeST",
            -                                                 "Metlakatla Daylight Time", "MeDT"}},
            +            {"America/Metlakatla", new String[] {"Metlakatla, normaltid", "MeST",
            +                                                 "Metlakatla, sommartid", "MeDT"}},
                         {"America/Mexico_City", CST},
                         {"America/Miquelon", new String[] {"Saint-Pierre-et-Miquelon, normaltid", "PMST",
                                                            "Saint-Pierre-et-Miquelon, sommartid", "PMDT"}},
            @@ -464,8 +462,8 @@ public final class TimeZoneNames_sv extends TimeZoneNamesBundle {
                                                            "Davis, sommartid", "DAVST"}},
                         {"Antarctica/DumontDUrville", new String[] {"Dumont-d'Urville, normaltid", "DDUT",
                                                                     "Dumont-d'Urville, sommartid", "DDUST"}},
            -            {"Antarctica/Macquarie", new String[] {"Macquarie Island Time", "MIST",
            -                                                   "Macquarie Island Summer Time", "MIST"}},
            +            {"Antarctica/Macquarie", new String[] {"Macquarie\u00F6n, normaltid", "MIST",
            +                                                   "Macquarie\u00F6n, sommartid", "MIST"}},
                         {"Antarctica/Mawson", new String[] {"Mawson, normaltid", "MAWT",
                                                             "Mawson, sommartid", "MAWST"}},
                         {"Antarctica/McMurdo", NZST},
            @@ -481,7 +479,7 @@ public final class TimeZoneNames_sv extends TimeZoneNamesBundle {
                         {"Asia/Aden", ARAST},
                         {"Asia/Almaty", new String[] {"Alma-Ata, normaltid", "ALMT",
                                                       "Alma-Ata, sommartid", "ALMST"}},
            -            {"Asia/Amman", EET},
            +            {"Asia/Amman", ARAST},
                         {"Asia/Anadyr", new String[] {"Anadyr, normaltid", "ANAT",
                                                       "Anadyr, sommartid", "ANAST"}},
                         {"Asia/Aqtau", new String[] {"Aqtau, normaltid", "AQTT",
            @@ -525,7 +523,7 @@ public final class TimeZoneNames_sv extends TimeZoneNamesBundle {
                                                        "Irkutsk, sommartid", "IRKST"}},
                         {"Asia/Istanbul", EET},
                         {"Asia/Jakarta", WIT},
            -            {"Asia/Jayapura", new String[] {"\u00d6stindonesisk tid", "EIT",
            +            {"Asia/Jayapura", new String[] {"\u00d6stindonesisk tid", "WIT",
                                                         "\u00d6stindonesisk sommartid", "EIST"}},
                         {"Asia/Kabul", new String[] {"Afghanistan, normaltid", "AFT",
                                                      "Afghanistan, sommartid", "AFST"}},
            @@ -535,8 +533,8 @@ public final class TimeZoneNames_sv extends TimeZoneNamesBundle {
                         {"Asia/Kashgar", CTT},
                         {"Asia/Kathmandu", NPT},
                         {"Asia/Katmandu", NPT},
            -            {"Asia/Khandyga", new String[] {"Khandyga Time", "YAKT",
            -                                            "Khandyga Summer Time", "YAKST"}},
            +            {"Asia/Khandyga", new String[] {"Khandyga, normaltid", "YAKT",
            +                                            "Khandyga, sommartid", "YAKST"}},
                         {"Asia/Kolkata", IST},
                         {"Asia/Krasnoyarsk", new String[] {"Krasnojarsk, normaltid", "KRAT",
                                                            "Krasnojarsk, sommartid", "KRAST"}},
            @@ -585,8 +583,8 @@ public final class TimeZoneNames_sv extends TimeZoneNamesBundle {
                         {"Asia/Ulaanbaatar", ULAT},
                         {"Asia/Ulan_Bator", ULAT},
                         {"Asia/Urumqi", CTT},
            -            {"Asia/Ust-Nera", new String[] {"Ust-Nera Time", "VLAT",
            -                                            "Ust-Nera Summer Time", "VLAST"}},
            +            {"Asia/Ust-Nera", new String[] {"Ust-Nera, normaltid", "VLAT",
            +                                            "Ust-Nera, sommartid", "VLAST"}},
                         {"Asia/Vientiane", ICT},
                         {"Asia/Vladivostok", new String[] {"Vladivostok, normaltid", "VLAT",
                                                            "Vladivostok, sommartid", "VLAST"}},
            @@ -618,8 +616,8 @@ public final class TimeZoneNames_sv extends TimeZoneNamesBundle {
                         {"Australia/Canberra", EST_NSW},
                         {"Australia/Currie", EST_NSW},
                         {"Australia/Darwin", DARWIN},
            -            {"Australia/Eucla", new String[] {"Central v\u00e4stlig normaltid (Australien)", "CWST",
            -                                              "Central v\u00e4stlig sommartid (Australien)", "CWST"}},
            +            {"Australia/Eucla", new String[] {"Central v\u00E4stlig normaltid (Australien)", "CWST",
            +                                              "Central v\u00E4stlig sommartid (Australien)", "CWST"}},
                         {"Australia/Hobart", TASMANIA},
                         {"Australia/LHI", LORD_HOWE},
                         {"Australia/Lindeman", BRISBANE},
            @@ -675,6 +673,7 @@ public final class TimeZoneNames_sv extends TimeZoneNamesBundle {
                         {"Europe/Bratislava", CET},
                         {"Europe/Brussels", CET},
                         {"Europe/Budapest", CET},
            +            {"Europe/Busingen", CET},
                         {"Europe/Chisinau", EET},
                         {"Europe/Copenhagen", CET},
                         {"Europe/Dublin", DUBLIN},
            diff --git a/jdk/src/share/classes/sun/util/resources/zh/TimeZoneNames_zh_CN.java b/jdk/src/share/classes/sun/util/resources/zh/TimeZoneNames_zh_CN.java
            index 74777e3619d..a3bbb3344c0 100644
            --- a/jdk/src/share/classes/sun/util/resources/zh/TimeZoneNames_zh_CN.java
            +++ b/jdk/src/share/classes/sun/util/resources/zh/TimeZoneNames_zh_CN.java
            @@ -45,10 +45,8 @@ import sun.util.resources.TimeZoneNamesBundle;
             public final class TimeZoneNames_zh_CN extends TimeZoneNamesBundle {
             
                 protected final Object[][] getContents() {
            -        String ACT[] = new String[] {"Acre \u65f6\u95f4", "ACT",
            -                                     "Acre \u590f\u4ee4\u65f6", "ACST"};
            -        String ADELAIDE[] = new String[] {"\u4e2d\u592e\u6807\u51c6\u65f6\u95f4\uff08\u5357\u6fb3\u5927\u5229\u4e9a\uff09", "CST",
            -                                          "\u4e2d\u592e\u590f\u4ee4\u65f6\uff08\u5357\u6fb3\u5927\u5229\u4e9a\uff09", "CST"};
            +        String ADELAIDE[] = new String[] {"\u4E2D\u592E\u6807\u51C6\u65F6\u95F4 (\u5357\u6FB3\u5927\u5229\u4E9A)", "CST",
            +                                          "\u4E2D\u592E\u590F\u4EE4\u65F6 (\u5357\u6FB3\u5927\u5229\u4E9A)", "CST"};
                     String AGT[] = new String[] {"\u963f\u6839\u5ef7\u65f6\u95f4", "ART",
                                                  "\u963f\u6839\u5ef7\u590f\u4ee4\u65f6", "ARST"};
                     String AKST[] = new String[] {"\u963f\u62c9\u65af\u52a0\u6807\u51c6\u65f6\u95f4", "AKST",
            @@ -63,10 +61,10 @@ public final class TimeZoneNames_zh_CN extends TimeZoneNamesBundle {
                                                  "\u5927\u897f\u6d0b\u590f\u4ee4\u65f6", "ADT"};
                     String BDT[] = new String[] {"\u5b5f\u52a0\u62c9\u65f6\u95f4", "BDT",
                                                  "\u5b5f\u52a0\u62c9\u590f\u4ee4\u65f6", "BDST"};
            -        String BRISBANE[] = new String[] {"\u4e1c\u90e8\u6807\u51c6\u65f6\u95f4\uff08\u6606\u58eb\u5170\uff09", "EST",
            -                                          "\u4e1c\u90e8\u590f\u4ee4\u65f6\uff08\u6606\u58eb\u5170\uff09", "EST"};
            -        String BROKEN_HILL[] = new String[] {"\u4e2d\u592e\u6807\u51c6\u65f6\u95f4\uff08\u5357\u6fb3\u5927\u5229\u4e9a/\u65b0\u5357\u5a01\u5c14\u65af\uff09", "CST",
            -                                             "\u4e2d\u592e\u590f\u4ee4\u65f6\uff08\u5357\u6fb3\u5927\u5229\u4e9a/\u65b0\u5357\u5a01\u5c14\u65af\uff09", "CST"};
            +        String BRISBANE[] = new String[] {"\u4E1C\u90E8\u6807\u51C6\u65F6\u95F4 (\u6606\u58EB\u5170)", "EST",
            +                                          "\u4E1C\u90E8\u590F\u4EE4\u65F6 (\u6606\u58EB\u5170)", "EST"};
            +        String BROKEN_HILL[] = new String[] {"\u4E2D\u592E\u6807\u51C6\u65F6\u95F4 (\u5357\u6FB3\u5927\u5229\u4E9A/\u65B0\u5357\u5A01\u5C14\u65AF)", "CST",
            +                                             "\u4E2D\u592E\u590F\u4EE4\u65F6 (\u5357\u6FB3\u5927\u5229\u4E9A/\u65B0\u5357\u5A01\u5C14\u65AF)", "CST"};
                     String BRT[] = new String[] {"\u5df4\u897f\u5229\u4e9a\u65f6\u95f4", "BRT",
                                                  "\u5df4\u897f\u5229\u4e9a\u590f\u4ee4\u65f6", "BRST"};
                     String BTT[] = new String[] {"\u4e0d\u4e39\u65f6\u95f4", "BTT",
            @@ -77,9 +75,9 @@ public final class TimeZoneNames_zh_CN extends TimeZoneNamesBundle {
                                                  "\u4e2d\u6b27\u590f\u4ee4\u65f6", "CEST"};
                     String CHAST[] = new String[] {"\u67e5\u8428\u59c6\u6807\u51c6\u65f6\u95f4", "CHAST",
                                                    "\u67e5\u8428\u59c6\u590f\u4ee4\u65f6", "CHADT"};
            -        String CHUT[] = new String[] {"Chuuk Time", "CHUT",
            -                                      "Chuuk Summer Time", "CHUST"};
            -        String CIT[] = new String[] {"\u4e2d\u90e8\u5370\u5ea6\u5c3c\u897f\u4e9a\u65f6\u95f4", "CIT",
            +        String CHUT[] = new String[] {"\u4E18\u514B\u65F6\u95F4", "CHUT",
            +                                      "\u4E18\u514B\u590F\u4EE4\u65F6", "CHUST"};
            +        String CIT[] = new String[] {"\u4e2d\u90e8\u5370\u5ea6\u5c3c\u897f\u4e9a\u65f6\u95f4", "WITA",
                                                  "\u4e2d\u90e8\u5370\u5ea6\u5c3c\u897f\u4e9a\u590f\u4ee4\u65f6", "CIST"};
                     String CLT[] = new String[] {"\u667a\u5229\u65f6\u95f4", "CLT",
                                                  "\u667a\u5229\u590f\u4ee4\u65f6", "CLST"};
            @@ -89,8 +87,8 @@ public final class TimeZoneNames_zh_CN extends TimeZoneNamesBundle {
                                                  "\u4e2d\u56fd\u590f\u4ee4\u65f6", "CDT"};
                     String CUBA[] = new String[] {"\u53e4\u5df4\u6807\u51c6\u65f6\u95f4", "CST",
                                                   "\u53e4\u5df4\u590f\u4ee4\u65f6", "CDT"};
            -        String DARWIN[] = new String[] {"\u4e2d\u592e\u6807\u51c6\u65f6\u95f4\uff08\u5317\u9886\u5730\uff09", "CST",
            -                                        "\u4e2d\u592e\u590f\u4ee4\u65f6\uff08\u5317\u9886\u5730\uff09", "CST"};
            +        String DARWIN[] = new String[] {"\u4E2D\u592E\u6807\u51C6\u65F6\u95F4 (\u5317\u9886\u5730)", "CST",
            +                                        "\u4E2D\u592E\u590F\u4EE4\u65F6 (\u5317\u9886\u5730)", "CST"};
                     String DUBLIN[] = new String[] {"\u683c\u6797\u5a01\u6cbb\u65f6\u95f4", "GMT",
                                                     "\u7231\u5c14\u5170\u590f\u4ee4\u65f6", "IST"};
                     String EAT[] = new String[] {"\u4e1c\u975e\u65f6\u95f4", "EAT",
            @@ -103,10 +101,10 @@ public final class TimeZoneNames_zh_CN extends TimeZoneNamesBundle {
                                                  "\u4e1c\u683c\u6797\u5c9b\u590f\u4ee4\u65f6", "EGST"};
                     String EST[] = new String[] {"\u4e1c\u90e8\u6807\u51c6\u65f6\u95f4", "EST",
                                                  "\u4e1c\u90e8\u590f\u4ee4\u65f6", "EDT"};
            -        String EST_NSW[] = new String[] {"\u4e1c\u90e8\u6807\u51c6\u65f6\u95f4\uff08\u65b0\u5357\u5a01\u5c14\u65af\uff09", "EST",
            -                                         "\u4e1c\u90e8\u590f\u4ee4\u65f6\uff08\u65b0\u5357\u5a01\u5c14\u65af\uff09", "EST"};
            -        String FET[] = new String[] {"Further-eastern European Time", "FET",
            -                                     "Further-eastern European Summer Time", "FEST"};
            +        String EST_NSW[] = new String[] {"\u4E1C\u90E8\u6807\u51C6\u65F6\u95F4 (\u65B0\u5357\u5A01\u5C14\u65AF)", "EST",
            +                                         "\u4E1C\u90E8\u590F\u4EE4\u65F6 (\u65B0\u5357\u5A01\u5C14\u65AF)", "EST"};
            +        String FET[] = new String[] {"\u8FDC\u4E1C\u6B27\u65F6\u95F4", "FET",
            +                                     "\u8FDC\u4E1C\u6B27\u590F\u4EE4\u65F6", "FEST"};
                     String GHMT[] = new String[] {"\u52a0\u7eb3\u65f6\u95f4", "GMT",
                                                  "\u52a0\u7eb3\u590f\u4ee4\u65f6", "GHST"};
                     String GAMBIER[] =  new String[] {"\u5188\u6bd4\u4e9a\u65f6\u95f4", "GAMT",
            @@ -159,8 +157,8 @@ public final class TimeZoneNames_zh_CN extends TimeZoneNamesBundle {
                                                       "\u76ae\u7279\u5eb7\u5c9b\u590f\u4ee4\u65f6", "PDT"};
                     String PKT[] = new String[] {"\u5df4\u57fa\u65af\u5766\u65f6\u95f4", "PKT",
                                                  "\u5df4\u57fa\u65af\u5766\u590f\u4ee4\u65f6", "PKST"};
            -        String PONT[] = new String[] {"Pohnpei Time", "PONT",
            -                                      "Pohnpei Summer Time", "PONST"};
            +        String PONT[] = new String[] {"\u6CE2\u7EB3\u4F69\u65F6\u95F4", "PONT",
            +                                      "\u6CE2\u7EB3\u4F69\u590F\u4EE4\u65F6", "PONST"};
                     String PST[] = new String[] {"\u592a\u5e73\u6d0b\u6807\u51c6\u65f6\u95f4", "PST",
                                                  "\u592a\u5e73\u6d0b\u590f\u4ee4\u65f6", "PDT"};
                     String SAST[] = new String[] {"\u5357\u975e\u6807\u51c6\u65f6\u95f4", "SAST",
            @@ -171,8 +169,8 @@ public final class TimeZoneNames_zh_CN extends TimeZoneNamesBundle {
                                                  "\u65b0\u52a0\u5761\u590f\u4ee4\u65f6", "SGST"};
                     String SLST[] = new String[] {"\u683c\u6797\u5a01\u6cbb\u65f6\u95f4", "GMT",
                                                   "\u585e\u62c9\u5229\u6602\u590f\u4ee4\u65f6", "SLST"};
            -        String TASMANIA[] = new String[] {"\u4e1c\u90e8\u6807\u51c6\u65f6\u95f4\uff08\u5854\u65af\u9a6c\u5c3c\u4e9a\uff09", "EST",
            -                                          "\u4e1c\u90e8\u590f\u4ee4\u65f6\uff08\u5854\u65af\u9a6c\u5c3c\u4e9a\uff09", "EST"};
            +        String TASMANIA[] = new String[] {"\u4E1C\u90E8\u6807\u51C6\u65F6\u95F4 (\u5854\u65AF\u9A6C\u5C3C\u4E9A)", "EST",
            +                                          "\u4E1C\u90E8\u590F\u4EE4\u65F6 (\u5854\u65AF\u9A6C\u5C3C\u4E9A)", "EST"};
                     String TMT[] = new String[] {"\u571f\u5e93\u66fc\u65f6\u95f4", "TMT",
                                                  "\u571f\u5e93\u66fc\u590f\u4ee4\u65f6", "TMST"};
                     String ULAT[]= new String[] {"\u5e93\u4f26\u65f6\u95f4", "ULAT",
            @@ -183,18 +181,18 @@ public final class TimeZoneNames_zh_CN extends TimeZoneNamesBundle {
                                                  "\u897f\u975e\u590f\u4ee4\u65f6", "WAST"};
                     String WET[] = new String[] {"\u897f\u6b27\u65f6\u95f4", "WET",
                                                  "\u897f\u6b27\u590f\u4ee4\u65f6", "WEST"};
            -        String WIT[] = new String[] {"\u897f\u5370\u5ea6\u5c3c\u897f\u4e9a\u65f6\u95f4", "WIT",
            +        String WIT[] = new String[] {"\u897f\u5370\u5ea6\u5c3c\u897f\u4e9a\u65f6\u95f4", "WIB",
                                                  "\u897f\u5370\u5ea6\u5c3c\u897f\u4e9a\u590f\u4ee4\u65f6", "WIST"};
            -        String WST_AUS[] = new String[] {"\u897f\u90e8\u6807\u51c6\u65f6\u95f4\uff08\u6fb3\u5927\u5229\u4e9a\uff09", "WST",
            -                                         "\u897f\u90e8\u590f\u4ee4\u65f6\uff08\u6fb3\u5927\u5229\u4e9a\uff09", "WST"};
            +        String WST_AUS[] = new String[] {"\u897F\u90E8\u6807\u51C6\u65F6\u95F4 (\u6FB3\u5927\u5229\u4E9A)", "WST",
            +                                         "\u897F\u90E8\u590F\u4EE4\u65F6 (\u6FB3\u5927\u5229\u4E9A)", "WST"};
                     String SAMOA[] = new String[] {"\u8428\u6469\u4e9a\u7fa4\u5c9b\u6807\u51c6\u65f6\u95f4", "SST",
                                                    "\u8428\u6469\u4e9a\u7fa4\u5c9b\u590f\u4ee4\u65f6", "SDT"};
                     String WST_SAMOA[] = new String[] {"\u897f\u8428\u6469\u4e9a\u65f6\u95f4", "WST",
                                                        "\u897f\u8428\u6469\u4e9a\u590f\u4ee4\u65f6", "WSDT"};
                     String ChST[] = new String[] {"Chamorro \u6807\u51c6\u65f6\u95f4", "ChST",
                                                   "Chamorro \u590f\u4ee4\u65f6", "ChDT"};
            -        String VICTORIA[] = new String[] {"\u4e1c\u90e8\u6807\u51c6\u65f6\u95f4\uff08\u7ef4\u591a\u5229\u4e9a\uff09", "EST",
            -                                          "\u4e1c\u90e8\u590f\u4ee4\u65f6\uff08\u7ef4\u591a\u5229\u4e9a\uff09", "EST"};
            +        String VICTORIA[] = new String[] {"\u4E1C\u90E8\u6807\u51C6\u65F6\u95F4 (\u7EF4\u591A\u5229\u4E9A)", "EST",
            +                                          "\u4E1C\u90E8\u590F\u4EE4\u65F6 (\u7EF4\u591A\u5229\u4E9A)", "EST"};
                     String UTC[] = new String[] {"\u534f\u8c03\u4e16\u754c\u65f6\u95f4", "UTC",
                                                  "\u534f\u8c03\u4e16\u754c\u65f6\u95f4", "UTC"};
                     String UZT[] = new String[] {"\u4e4c\u5179\u522b\u514b\u65af\u5766\u65f6\u95f4", "UZT",
            @@ -306,7 +304,7 @@ public final class TimeZoneNames_zh_CN extends TimeZoneNamesBundle {
                         {"America/Argentina/Rio_Gallegos", AGT},
                         {"America/Argentina/Salta", AGT},
                         {"America/Argentina/San_Juan", AGT},
            -            {"America/Argentina/San_Luis", WART},
            +            {"America/Argentina/San_Luis", AGT},
                         {"America/Argentina/Tucuman", AGT},
                         {"America/Argentina/Ushuaia", AGT},
                         {"America/Aruba", AST},
            @@ -399,8 +397,8 @@ public final class TimeZoneNames_zh_CN extends TimeZoneNamesBundle {
                         {"America/Mendoza", AGT},
                         {"America/Menominee", CST},
                         {"America/Merida", CST},
            -            {"America/Metlakatla", new String[] {"Metlakatla Standard Time", "MeST",
            -                                                 "Metlakatla Daylight Time", "MeDT"}},
            +            {"America/Metlakatla", new String[] {"\u6885\u7279\u62C9\u5361\u7279\u62C9\u6807\u51C6\u65F6\u95F4", "MeST",
            +                                                 "\u6885\u7279\u62C9\u5361\u7279\u62C9\u590F\u4EE4\u65F6", "MeDT"}},
                         {"America/Mexico_City", CST},
                         {"America/Miquelon", new String[] {"\u76ae\u57c3\u5c14\u5c9b\u53ca\u5bc6\u514b\u9686\u5c9b\u6807\u51c6\u65f6\u95f4", "PMST",
                                                            "\u76ae\u57c3\u5c14\u5c9b\u53ca\u5bc6\u514b\u9686\u5c9b\u590f\u4ee4\u65f6", "PMDT"}},
            @@ -464,8 +462,8 @@ public final class TimeZoneNames_zh_CN extends TimeZoneNamesBundle {
                                                            "\u6234\u7ef4\u65af\u590f\u4ee4\u65f6", "DAVST"}},
                         {"Antarctica/DumontDUrville", new String[] {"Dumont-d'Urville \u65f6\u95f4", "DDUT",
                                                                     "Dumont-d'Urville \u590f\u4ee4\u65f6", "DDUST"}},
            -            {"Antarctica/Macquarie", new String[] {"Macquarie Island Time", "MIST",
            -                                                   "Macquarie Island Summer Time", "MIST"}},
            +            {"Antarctica/Macquarie", new String[] {"\u9EA6\u5938\u91CC\u5C9B\u65F6\u95F4", "MIST",
            +                                                   "\u9EA6\u5938\u91CC\u5C9B\u590F\u4EE4\u65F6", "MIST"}},
                         {"Antarctica/Mawson", new String[] {"\u83ab\u68ee\u65f6\u95f4", "MAWT",
                                                             "\u83ab\u68ee\u590f\u4ee4\u65f6", "MAWST"}},
                         {"Antarctica/McMurdo", NZST},
            @@ -481,7 +479,7 @@ public final class TimeZoneNames_zh_CN extends TimeZoneNamesBundle {
                         {"Asia/Aden", ARAST},
                         {"Asia/Almaty", new String[] {"Alma-Ata \u65f6\u95f4", "ALMT",
                                                       "Alma-Ata \u590f\u4ee4\u65f6", "ALMST"}},
            -            {"Asia/Amman", EET},
            +            {"Asia/Amman", ARAST},
                         {"Asia/Anadyr", new String[] {"\u963f\u90a3\u5e95\u6cb3\u65f6\u95f4", "ANAT",
                                                       "\u963f\u90a3\u5e95\u6cb3\u590f\u4ee4\u65f6", "ANAST"}},
                         {"Asia/Aqtau", new String[] {"Aqtau \u65f6\u95f4", "AQTT",
            @@ -525,7 +523,7 @@ public final class TimeZoneNames_zh_CN extends TimeZoneNamesBundle {
                                                        "\u4f0a\u5c14\u5e93\u6b21\u514b\u590f\u4ee4\u65f6", "IRKST"}},
                         {"Asia/Istanbul", EET},
                         {"Asia/Jakarta", WIT},
            -            {"Asia/Jayapura", new String[] {"\u4e1c\u5370\u5ea6\u5c3c\u897f\u4e9a\u65f6\u95f4", "EIT",
            +            {"Asia/Jayapura", new String[] {"\u4e1c\u5370\u5ea6\u5c3c\u897f\u4e9a\u65f6\u95f4", "WIT",
                                                         "\u4e1c\u5370\u5ea6\u5c3c\u897f\u4e9a\u590f\u4ee4\u65f6", "EIST"}},
                         {"Asia/Kabul", new String[] {"\u963f\u5bcc\u6c57\u65f6\u95f4", "AFT",
                                                      "\u963f\u5bcc\u6c57\u590f\u4ee4\u65f6", "AFST"}},
            @@ -535,8 +533,8 @@ public final class TimeZoneNames_zh_CN extends TimeZoneNamesBundle {
                         {"Asia/Kashgar", CTT},
                         {"Asia/Kathmandu", NPT},
                         {"Asia/Katmandu", NPT},
            -            {"Asia/Khandyga", new String[] {"Khandyga Time", "YAKT",
            -                                            "Khandyga Summer Time", "YAKST"}},
            +            {"Asia/Khandyga", new String[] {"\u6C49\u5FB7\u52A0\u65F6\u95F4", "YAKT",
            +                                            "\u6C49\u5FB7\u52A0\u590F\u4EE4\u65F6", "YAKST"}},
                         {"Asia/Kolkata", IST},
                         {"Asia/Krasnoyarsk", new String[] {"\u514b\u62c9\u65af\u8bfa\u4e9a\u5c14\u65af\u514b\u65f6\u95f4", "KRAT",
                                                            "\u514b\u62c9\u65af\u8bfa\u4e9a\u5c14\u65af\u514b\u590f\u4ee4\u65f6", "KRAST"}},
            @@ -585,8 +583,8 @@ public final class TimeZoneNames_zh_CN extends TimeZoneNamesBundle {
                         {"Asia/Ulaanbaatar", ULAT},
                         {"Asia/Ulan_Bator", ULAT},
                         {"Asia/Urumqi", CTT},
            -            {"Asia/Ust-Nera", new String[] {"Ust-Nera Time", "VLAT",
            -                                            "Ust-Nera Summer Time", "VLAST"}},
            +            {"Asia/Ust-Nera", new String[] {"\u4E4C\u65AF\u5B63\u6D85\u62C9\u65F6\u95F4", "VLAT",
            +                                            "\u4E4C\u65AF\u5B63\u6D85\u62C9\u590F\u4EE4\u65F6", "VLAST"}},
                         {"Asia/Vientiane", ICT},
                         {"Asia/Vladivostok", new String[] {"\u6d77\u53c2\u5d34\u65f6\u95f4", "VLAT",
                                                            "\u6d77\u53c2\u5d34\u590f\u4ee4\u65f6", "VLAST"}},
            @@ -618,8 +616,8 @@ public final class TimeZoneNames_zh_CN extends TimeZoneNamesBundle {
                         {"Australia/Canberra", EST_NSW},
                         {"Australia/Currie", EST_NSW},
                         {"Australia/Darwin", DARWIN},
            -            {"Australia/Eucla", new String[] {"\u4e2d\u897f\u90e8\u6807\u51c6\u65f6\u95f4\uff08\u6fb3\u5927\u5229\u4e9a\uff09", "CWST",
            -                                              "\u4e2d\u897f\u90e8\u590f\u4ee4\u65f6\uff08\u6fb3\u5927\u5229\u4e9a\uff09", "CWST"}},
            +            {"Australia/Eucla", new String[] {"\u4E2D\u897F\u90E8\u6807\u51C6\u65F6\u95F4 (\u6FB3\u5927\u5229\u4E9A)", "CWST",
            +                                              "\u4E2D\u897F\u90E8\u590F\u4EE4\u65F6 (\u6FB3\u5927\u5229\u4E9A)", "CWST"}},
                         {"Australia/Hobart", TASMANIA},
                         {"Australia/LHI", LORD_HOWE},
                         {"Australia/Lindeman", BRISBANE},
            @@ -675,6 +673,7 @@ public final class TimeZoneNames_zh_CN extends TimeZoneNamesBundle {
                         {"Europe/Bratislava", CET},
                         {"Europe/Brussels", CET},
                         {"Europe/Budapest", CET},
            +            {"Europe/Busingen", CET},
                         {"Europe/Chisinau", EET},
                         {"Europe/Copenhagen", CET},
                         {"Europe/Dublin", DUBLIN},
            diff --git a/jdk/src/share/classes/sun/util/resources/zh/TimeZoneNames_zh_TW.java b/jdk/src/share/classes/sun/util/resources/zh/TimeZoneNames_zh_TW.java
            index 66de2c388af..322eecfb3d8 100644
            --- a/jdk/src/share/classes/sun/util/resources/zh/TimeZoneNames_zh_TW.java
            +++ b/jdk/src/share/classes/sun/util/resources/zh/TimeZoneNames_zh_TW.java
            @@ -45,10 +45,8 @@ import sun.util.resources.TimeZoneNamesBundle;
             public final class TimeZoneNames_zh_TW extends TimeZoneNamesBundle {
             
                 protected final Object[][] getContents() {
            -        String ACT[] = new String[] {"Acre \u6642\u9593", "ACT",
            -                                     "Acre \u590f\u4ee4\u6642\u9593", "ACST"};
            -        String ADELAIDE[] = new String[] {"\u4e2d\u90e8\u6a19\u6e96\u6642\u9593 (\u6fb3\u5927\u5229\u4e9e\u5357\u5340)", "CST",
            -                                          "\u4e2d\u90e8\u590f\u4ee4\u6642\u9593 (\u6fb3\u5927\u5229\u4e9e\u5357\u5340)", "CST"};
            +        String ADELAIDE[] = new String[] {"\u4E2D\u90E8\u6A19\u6E96\u6642\u9593 (\u6FB3\u5927\u5229\u4E9E\u5357\u90E8)", "CST",
            +                                          "\u4E2D\u90E8\u590F\u4EE4\u6642\u9593 (\u6FB3\u5927\u5229\u4E9E\u5357\u5340)", "CST"};
                     String AGT[] = new String[] {"\u963f\u6839\u5ef7\u6642\u9593", "ART",
                                                  "\u963f\u6839\u5ef7\u590f\u4ee4\u6642\u9593", "ARST"};
                     String AKST[] = new String[] {"\u963f\u62c9\u65af\u52a0\u6a19\u6e96\u6642\u9593", "AKST",
            @@ -63,10 +61,10 @@ public final class TimeZoneNames_zh_TW extends TimeZoneNamesBundle {
                                                  "\u5927\u897f\u6d0b\u65e5\u5149\u7bc0\u7d04\u6642\u9593", "ADT"};
                     String BDT[] = new String[] {"\u5b5f\u52a0\u62c9\u6642\u9593", "BDT",
                                                  "\u5b5f\u52a0\u62c9\u590f\u4ee4\u6642\u9593", "BDST"};
            -        String BRISBANE[] = new String[] {"\u6771\u90e8\u6a19\u6e96\u6642\u9593 (\u6606\u58eb\u862d)", "EST",
            -                                          "\u6771\u90e8\u590f\u4ee4\u6642\u9593 (\u6606\u58eb\u862d)", "EST"};
            -        String BROKEN_HILL[] = new String[] {"\u4e2d\u90e8\u6a19\u6e96\u6642\u9593 (\u6fb3\u5927\u5229\u4e9e\u5357\u5340/\u65b0\u5357\u5a01\u723e\u65af)", "CST",
            -                                             "\u4e2d\u90e8\u590f\u4ee4\u6642\u9593 (\u6fb3\u5927\u5229\u4e9e\u5357\u5340/\u65b0\u5357\u5a01\u723e\u65af)", "CST"};
            +        String BRISBANE[] = new String[] {"\u6771\u90E8\u6A19\u6E96\u6642\u9593 (\u6606\u58EB\u862D)", "EST",
            +                                          "\u6771\u90E8\u590F\u4EE4\u6642\u9593 (\u6606\u58EB\u862D)", "EST"};
            +        String BROKEN_HILL[] = new String[] {"\u4E2D\u90E8\u6A19\u6E96\u6642\u9593 (\u6FB3\u5927\u5229\u4E9E\u5357\u5340/\u65B0\u5357\u5A01\u723E\u65AF)", "CST",
            +                                             "\u4E2D\u90E8\u590F\u4EE4\u6642\u9593 (\u6FB3\u5927\u5229\u4E9E\u5357\u5340/\u65B0\u5357\u5A01\u723E\u65AF)", "CST"};
                     String BRT[] = new String[] {"\u5df4\u897f\u5229\u4e9e\u6642\u9593", "BRT",
                                                  "\u5df4\u897f\u5229\u4e9e\u590f\u4ee4\u6642\u9593", "BRST"};
                     String BTT[] = new String[] {"\u4e0d\u4e39\u6642\u9593", "BTT",
            @@ -77,9 +75,9 @@ public final class TimeZoneNames_zh_TW extends TimeZoneNamesBundle {
                                                  "\u4e2d\u6b50\u590f\u4ee4\u6642\u9593", "CEST"};
                     String CHAST[] = new String[] {"\u67e5\u5766\u6a19\u6e96\u6642\u9593", "CHAST",
                                                    "\u67e5\u5766\u65e5\u5149\u7bc0\u7d04\u6642\u9593", "CHADT"};
            -        String CHUT[] = new String[] {"Chuuk Time", "CHUT",
            -                                      "Chuuk Summer Time", "CHUST"};
            -        String CIT[] = new String[] {"\u4e2d\u5370\u5ea6\u5c3c\u897f\u4e9e\u6642\u9593", "CIT",
            +        String CHUT[] = new String[] {"\u695A\u514B\u6642\u9593", "CHUT",
            +                                      "\u695A\u514B\u590F\u4EE4\u6642\u9593", "CHUST"};
            +        String CIT[] = new String[] {"\u4e2d\u5370\u5ea6\u5c3c\u897f\u4e9e\u6642\u9593", "WITA",
                                                  "\u4e2d\u5370\u5ea6\u5c3c\u897f\u4e9e\u590f\u4ee4\u6642\u9593", "CIST"};
                     String CLT[] = new String[] {"\u667a\u5229\u6642\u9593", "CLT",
                                                  "\u667a\u5229\u590f\u4ee4\u6642\u9593", "CLST"};
            @@ -89,8 +87,8 @@ public final class TimeZoneNames_zh_TW extends TimeZoneNamesBundle {
                                                  "\u4e2d\u570b\u65e5\u5149\u7bc0\u7d04\u6642\u9593", "CDT"};
                     String CUBA[] = new String[] {"\u53e4\u5df4\u6a19\u6e96\u6642\u9593", "CST",
                                                   "\u53e4\u5df4\u65e5\u5149\u7bc0\u7d04\u6642\u9593", "CDT"};
            -        String DARWIN[] = new String[] {"\u4e2d\u90e8\u6a19\u6e96\u6642\u9593 (\u5317\u90e8\u5404\u5730\u5340)", "CST",
            -                                        "\u4e2d\u90e8\u590f\u4ee4\u6642\u9593 (\u5317\u90e8\u5404\u5730\u5340)", "CST"};
            +        String DARWIN[] = new String[] {"\u4E2D\u90E8\u6A19\u6E96\u6642\u9593 (\u5317\u90E8\u5404\u5730\u5340)", "CST",
            +                                        "\u4E2D\u90E8\u590F\u4EE4\u6642\u9593 (\u5317\u90E8\u5404\u5730\u5340)", "CST"};
                     String DUBLIN[] = new String[] {"\u683c\u6797\u5a01\u6cbb\u5e73\u5747\u6642\u9593", "GMT",
                                                     "\u611b\u723e\u862d\u590f\u4ee4\u6642\u9593", "IST"};
                     String EAT[] = new String[] {"\u6771\u975e\u6642\u9593", "EAT",
            @@ -103,10 +101,10 @@ public final class TimeZoneNames_zh_TW extends TimeZoneNamesBundle {
                                                  "\u6771\u683c\u6797\u5cf6\u590f\u4ee4\u6642\u9593", "EGST"};
                     String EST[] = new String[] {"\u6771\u65b9\u6a19\u6e96\u6642\u9593", "EST",
                                                  "\u6771\u65b9\u65e5\u5149\u7bc0\u7d04\u6642\u9593", "EDT"};
            -        String EST_NSW[] = new String[] {"\u6771\u65b9\u6a19\u6e96\u6642\u9593 (\u65b0\u5357\u5a01\u723e\u65af)", "EST",
            -                                         "\u6771\u65b9\u590f\u4ee4\u6642\u9593 (\u65b0\u5357\u5a01\u723e\u65af)", "EST"};
            -        String FET[] = new String[] {"Further-eastern European Time", "FET",
            -                                     "Further-eastern European Summer Time", "FEST"};
            +        String EST_NSW[] = new String[] {"\u6771\u90E8\u6A19\u6E96\u6642\u9593 (\u65B0\u5357\u5A01\u723E\u65AF)", "EST",
            +                                         "\u6771\u90E8\u590F\u4EE4\u6642\u9593 (\u65B0\u5357\u5A01\u723E\u65AF)", "EST"};
            +        String FET[] = new String[] {"\u6771\u6B50\u5167\u9678\u6642\u9593", "FET",
            +                                     "\u6771\u6B50\u5167\u9678\u590F\u4EE4\u6642\u9593", "FEST"};
                     String GHMT[] = new String[] {"\u8fe6\u7d0d\u5e73\u5747\u6642\u9593", "GMT",
                                                   "\u8fe6\u7d0d\u590f\u4ee4\u6642\u9593", "GHST"};
                     String GAMBIER[] =  new String[] {"\u7518\u6bd4\u723e\u6642\u9593", "GAMT",
            @@ -159,8 +157,8 @@ public final class TimeZoneNames_zh_TW extends TimeZoneNamesBundle {
                                                     "\u76ae\u7279\u5eb7\u65e5\u5149\u7bc0\u7d04\u6642\u9593", "PDT"};
                     String PKT[] = new String[] {"\u5df4\u57fa\u65af\u5766\u6642\u9593", "PKT",
                                                  "\u5df4\u57fa\u65af\u5766\u590f\u4ee4\u6642\u9593", "PKST"};
            -        String PONT[] = new String[] {"Pohnpei Time", "PONT",
            -                                      "Pohnpei Summer Time", "PONST"};
            +        String PONT[] = new String[] {"\u6CE2\u7D0D\u4F69\u6642\u9593", "PONT",
            +                                      "\u6CE2\u7D0D\u4F69\u590F\u4EE4\u6642\u9593", "PONST"};
                     String PST[] = new String[] {"\u592a\u5e73\u6d0b\u6a19\u6e96\u6642\u9593", "PST",
                                                  "\u592a\u5e73\u6d0b\u65e5\u5149\u7bc0\u7d04\u6642\u9593", "PDT"};
                     String SAST[] = new String[] {"\u5357\u975e\u6a19\u6e96\u6642\u9593", "SAST",
            @@ -171,8 +169,8 @@ public final class TimeZoneNames_zh_TW extends TimeZoneNamesBundle {
                                                  "\u65b0\u52a0\u5761\u590f\u4ee4\u6642\u9593", "SGST"};
                     String SLST[] = new String[] {"\u683c\u6797\u5a01\u6cbb\u5e73\u5747\u6642\u9593", "GMT",
                                                   "\u7345\u5b50\u5c71\u590f\u4ee4\u6642\u9593", "SLST"};
            -        String TASMANIA[] = new String[] {"\u6771\u90e8\u6a19\u6e96\u6642\u9593 (\u5854\u65af\u6885\u5c3c\u4e9e\u5cf6)", "EST",
            -                                          "\u6771\u90e8\u590f\u4ee4\u6642\u9593 (\u5854\u65af\u6885\u5c3c\u4e9e\u5cf6)", "EST"};
            +        String TASMANIA[] = new String[] {"\u6771\u90E8\u6A19\u6E96\u6642\u9593 (\u5854\u65AF\u6885\u5C3C\u4E9E\u5CF6)", "EST",
            +                                          "\u6771\u90E8\u590F\u4EE4\u6642\u9593 (\u5854\u65AF\u6885\u5C3C\u4E9E\u5CF6)", "EST"};
                     String TMT[] = new String[] {"\u571f\u5eab\u66fc\u6642\u9593", "TMT",
                                                  "\u571f\u5eab\u66fc\u590f\u4ee4\u6642\u9593", "TMST"};
                     String ULAT[]= new String[] {"\u5eab\u502b\u6642\u9593", "ULAT",
            @@ -183,18 +181,18 @@ public final class TimeZoneNames_zh_TW extends TimeZoneNamesBundle {
                                                  "\u897f\u975e\u590f\u4ee4\u6642\u9593", "WAST"};
                     String WET[] = new String[] {"\u897f\u6b50\u6642\u9593", "WET",
                                                  "\u897f\u6b50\u590f\u4ee4\u6642\u9593", "WEST"};
            -        String WIT[] = new String[] {"\u897f\u5370\u5c3c\u6642\u9593", "WIT",
            +        String WIT[] = new String[] {"\u897f\u5370\u5c3c\u6642\u9593", "WIB",
                                                  "\u897f\u5370\u5c3c\u590f\u4ee4\u6642\u9593", "WIST"};
            -        String WST_AUS[] = new String[] {"\u897f\u65b9\u6a19\u6e96\u6642\u9593 (\u6fb3\u5927\u5229\u4e9e)", "WST",
            -                                         "\u897f\u65b9\u590f\u4ee4\u6642\u9593 (\u6fb3\u5927\u5229\u4e9e)", "WST"};
            +        String WST_AUS[] = new String[] {"\u897F\u90E8\u6A19\u6E96\u6642\u9593 (\u6FB3\u5927\u5229\u4E9E)", "WST",
            +                                         "\u897F\u90E8\u590F\u4EE4\u6642\u9593 (\u6FB3\u5927\u5229\u4E9E)", "WST"};
                     String SAMOA[] = new String[] {"\u85a9\u6469\u4e9e\u6a19\u6e96\u6642\u9593", "SST",
                                                    "\u85a9\u6469\u4e9e\u65e5\u5149\u7bc0\u7d04\u6642\u9593", "SDT"};
                     String WST_SAMOA[] = new String[] {"\u897f\u85a9\u6469\u4e9e\u6642\u9593", "WST",
                                                        "\u897f\u85a9\u6469\u4e9e\u590f\u4ee4\u6642\u9593", "WSDT"};
                     String ChST[] = new String[] {"\u67e5\u83ab\u6d1b\u6a19\u6e96\u6642\u9593", "ChST",
                                                  "\u67e5\u83ab\u6d1b\u65e5\u5149\u7bc0\u7d04\u6642\u9593", "ChDT"};
            -        String VICTORIA[] = new String[] {"\u6771\u90e8\u6a19\u6e96\u6642\u9593 (\u7dad\u591a\u5229\u4e9e\u90a6)", "EST",
            -                                          "\u6771\u90e8\u590f\u4ee4\u6642\u9593 (\u7dad\u591a\u5229\u4e9e\u90a6)", "EST"};
            +        String VICTORIA[] = new String[] {"\u6771\u90E8\u6A19\u6E96\u6642\u9593 (\u7DAD\u591A\u5229\u4E9E\u90A6)", "EST",
            +                                          "\u6771\u90E8\u590F\u4EE4\u6642\u9593 (\u7DAD\u591A\u5229\u4E9E\u90A6)", "EST"};
                     String UTC[] = new String[] {"\u5354\u8abf\u4e16\u754c\u6642\u9593", "UTC",
                                                  "\u5354\u8abf\u4e16\u754c\u6642\u9593", "UTC"};
                     String UZT[] = new String[] {"\u70cf\u8332\u5225\u514b\u65af\u5766\u6642\u9593", "UZT",
            @@ -306,7 +304,7 @@ public final class TimeZoneNames_zh_TW extends TimeZoneNamesBundle {
                         {"America/Argentina/Rio_Gallegos", AGT},
                         {"America/Argentina/Salta", AGT},
                         {"America/Argentina/San_Juan", AGT},
            -            {"America/Argentina/San_Luis", WART},
            +            {"America/Argentina/San_Luis", AGT},
                         {"America/Argentina/Tucuman", AGT},
                         {"America/Argentina/Ushuaia", AGT},
                         {"America/Aruba", AST},
            @@ -399,8 +397,8 @@ public final class TimeZoneNames_zh_TW extends TimeZoneNamesBundle {
                         {"America/Mendoza", AGT},
                         {"America/Menominee", CST},
                         {"America/Merida", CST},
            -            {"America/Metlakatla", new String[] {"Metlakatla Standard Time", "MeST",
            -                                                 "Metlakatla Daylight Time", "MeDT"}},
            +            {"America/Metlakatla", new String[] {"\u6885\u7279\u62C9\u5361\u7279\u62C9\u6A19\u6E96\u6642\u9593", "MeST",
            +                                                 "\u6885\u7279\u62C9\u5361\u7279\u62C9\u65E5\u5149\u7BC0\u7D04\u6642\u9593", "MeDT"}},
                         {"America/Mexico_City", CST},
                         {"America/Miquelon", new String[] {"\u76ae\u57c3\u723e\u5cf6\u53ca\u5bc6\u514b\u9686\u5cf6\u6a19\u6e96\u6642\u9593", "PMST",
                                                            "\u76ae\u57c3\u723e\u5cf6\u53ca\u5bc6\u514b\u9686\u5cf6\u65e5\u5149\u7bc0\u7d04\u6642\u9593", "PMDT"}},
            @@ -464,8 +462,8 @@ public final class TimeZoneNames_zh_TW extends TimeZoneNamesBundle {
                                                            "\u81fa\u7dad\u65af\u590f\u4ee4\u6642\u9593", "DAVST"}},
                         {"Antarctica/DumontDUrville", new String[] {"Dumont-d'Urville \u6642\u9593", "DDUT",
                                                                     "Dumont-d'Urville \u590f\u4ee4\u6642\u9593", "DDUST"}},
            -            {"Antarctica/Macquarie", new String[] {"Macquarie Island Time", "MIST",
            -                                                   "Macquarie Island Summer Time", "MIST"}},
            +            {"Antarctica/Macquarie", new String[] {"\u9EA5\u5938\u5229\u5CF6\u6642\u9593", "MIST",
            +                                                   "\u9EA5\u5938\u5229\u5CF6\u590F\u4EE4\u6642\u9593", "MIST"}},
                         {"Antarctica/Mawson", new String[] {"\u83ab\u68ee\u6642\u9593", "MAWT",
                                                             "\u83ab\u68ee\u590f\u4ee4\u6642\u9593", "MAWST"}},
                         {"Antarctica/McMurdo", NZST},
            @@ -481,7 +479,7 @@ public final class TimeZoneNames_zh_TW extends TimeZoneNamesBundle {
                         {"Asia/Aden", ARAST},
                         {"Asia/Almaty", new String[] {"Alma-Ata \u6642\u9593", "ALMT",
                                                       "Alma-Ata \u590f\u4ee4\u6642\u9593", "ALMST"}},
            -            {"Asia/Amman", EET},
            +            {"Asia/Amman", ARAST},
                         {"Asia/Anadyr", new String[] {"\u963f\u90a3\u5e95\u6cb3\u6642\u9593", "ANAT",
                                                       "\u963f\u90a3\u5e95\u6cb3\u590f\u4ee4\u6642\u9593", "ANAST"}},
                         {"Asia/Aqtau", new String[] {"Aqtau \u6642\u9593", "AQTT",
            @@ -525,7 +523,7 @@ public final class TimeZoneNames_zh_TW extends TimeZoneNamesBundle {
                                                        "Irkutsk \u590f\u4ee4\u6642\u9593", "IRKST"}},
                         {"Asia/Istanbul", EET},
                         {"Asia/Jakarta", WIT},
            -            {"Asia/Jayapura", new String[] {"\u6771\u5370\u5ea6\u5c3c\u897f\u4e9e\u6642\u9593", "EIT",
            +            {"Asia/Jayapura", new String[] {"\u6771\u5370\u5ea6\u5c3c\u897f\u4e9e\u6642\u9593", "WIT",
                                                         "\u6771\u5370\u5ea6\u5c3c\u897f\u4e9e\u590f\u65e5\u6642\u9593", "EIST"}},
                         {"Asia/Kabul", new String[] {"\u963f\u5bcc\u6c57\u6642\u9593", "AFT",
                                                      "\u963f\u5bcc\u6c57\u590f\u4ee4\u6642\u9593", "AFST"}},
            @@ -535,8 +533,8 @@ public final class TimeZoneNames_zh_TW extends TimeZoneNamesBundle {
                         {"Asia/Kashgar", CTT},
                         {"Asia/Kathmandu", NPT},
                         {"Asia/Katmandu", NPT},
            -            {"Asia/Khandyga", new String[] {"Khandyga Time", "YAKT",
            -                                            "Khandyga Summer Time", "YAKST"}},
            +            {"Asia/Khandyga", new String[] {"\u6F22\u5730\u52A0 (Khandyga) \u6642\u9593", "YAKT",
            +                                            "\u6F22\u5730\u52A0 (Khandyga) \u590F\u4EE4\u6642\u9593", "YAKST"}},
                         {"Asia/Kolkata", IST},
                         {"Asia/Krasnoyarsk", new String[] {"\u514b\u62c9\u65af\u8afe\u4e9e\u723e\u65af\u514b\u6642\u9593", "KRAT",
                                                            "\u514b\u62c9\u65af\u8afe\u4e9e\u723e\u65af\u514b\u590f\u4ee4\u6642\u9593", "KRAST"}},
            @@ -586,8 +584,8 @@ public final class TimeZoneNames_zh_TW extends TimeZoneNamesBundle {
                         {"Asia/Ulaanbaatar", ULAT},
                         {"Asia/Ulan_Bator", ULAT},
                         {"Asia/Urumqi", CTT},
            -            {"Asia/Ust-Nera", new String[] {"Ust-Nera Time", "VLAT",
            -                                            "Ust-Nera Summer Time", "VLAST"}},
            +            {"Asia/Ust-Nera", new String[] {"\u70CF\u65AF\u5167\u62C9 (Ust-Nera) \u6642\u9593", "VLAT",
            +                                            "\u70CF\u65AF\u5167\u62C9 (Ust-Nera) \u590F\u4EE4\u6642\u9593", "VLAST"}},
                         {"Asia/Vientiane", ICT},
                         {"Asia/Vladivostok", new String[] {"\u6d77\u53c3\u5d34\u6642\u9593", "VLAT",
                                                            "\u6d77\u53c3\u5d34\u590f\u4ee4\u6642\u9593", "VLAST"}},
            @@ -619,8 +617,8 @@ public final class TimeZoneNames_zh_TW extends TimeZoneNamesBundle {
                         {"Australia/Canberra", EST_NSW},
                         {"Australia/Currie", EST_NSW},
                         {"Australia/Darwin", DARWIN},
            -            {"Australia/Eucla", new String[] {"\u4e2d\u897f\u90e8\u6a19\u6e96\u6642\u9593 (\u6fb3\u5927\u5229\u4e9e)", "CWST",
            -                                              "\u4e2d\u897f\u90e8\u65e5\u5149\u7bc0\u7d04\u6642\u9593 (\u6fb3\u5927\u5229\u4e9e)", "CWST"}},
            +            {"Australia/Eucla", new String[] {"\u4E2D\u897F\u90E8\u6A19\u6E96\u6642\u9593 (\u6FB3\u5927\u5229\u4E9E)", "CWST",
            +                                              "\u4E2D\u897F\u90E8\u590F\u4EE4\u6642\u9593 (\u6FB3\u5927\u5229\u4E9E)", "CWST"}},
                         {"Australia/Hobart", TASMANIA},
                         {"Australia/LHI", LORD_HOWE},
                         {"Australia/Lindeman", BRISBANE},
            @@ -676,6 +674,7 @@ public final class TimeZoneNames_zh_TW extends TimeZoneNamesBundle {
                         {"Europe/Bratislava", CET},
                         {"Europe/Brussels", CET},
                         {"Europe/Budapest", CET},
            +            {"Europe/Busingen", CET},
                         {"Europe/Chisinau", EET},
                         {"Europe/Copenhagen", CET},
                         {"Europe/Dublin", DUBLIN},
            diff --git a/jdk/test/sun/util/calendar/zi/tzdata/VERSION b/jdk/test/sun/util/calendar/zi/tzdata/VERSION
            index e50b6f37dcc..ea1c49a6f83 100644
            --- a/jdk/test/sun/util/calendar/zi/tzdata/VERSION
            +++ b/jdk/test/sun/util/calendar/zi/tzdata/VERSION
            @@ -21,4 +21,4 @@
             # or visit www.oracle.com if you need additional information or have any
             # questions.
             #
            -tzdata2013d
            +tzdata2013g
            diff --git a/jdk/test/sun/util/calendar/zi/tzdata/africa b/jdk/test/sun/util/calendar/zi/tzdata/africa
            index 6b19b982c6b..19bc98afe16 100644
            --- a/jdk/test/sun/util/calendar/zi/tzdata/africa
            +++ b/jdk/test/sun/util/calendar/zi/tzdata/africa
            @@ -881,13 +881,23 @@ Zone	Indian/Mayotte	3:00:56 -	LMT	1911 Jul	# Mamoutzou
             # transitions would be 2013-07-07 and 2013-08-10; see:
             # http://www.maroc.ma/en/news/morocco-suspends-daylight-saving-time-july-7-aug10
             
            -# From Paul Eggert (2013-07-03):
            +# From Steffen Thorsen (2013-09-28):
            +# Morocco extends DST by one month, on very short notice, just 1 day
            +# before it was going to end.  There is a new decree (2.13.781) for
            +# this, where DST from now on goes from last Sunday of March at 02:00
            +# to last Sunday of October at 03:00, similar to EU rules.  Official
            +# source (French):
            +# http://www.maroc.gov.ma/fr/actualites/lhoraire-dete-gmt1-maintenu-jusquau-27-octobre-2013
            +# Another source (specifying the time for start and end in the decree):
            +# http://www.lemag.ma/Heure-d-ete-au-Maroc-jusqu-au-27-octobre_a75620.html
            +
            +# From Paul Eggert (2013-09-30):
             # To estimate what the Moroccan government will do in future years,
            -# transition dates for 2014 through 2021 were determined by running
            +# transition dates for 2014 through 2037 were determined by running
             # the following program under GNU Emacs 24.3:
             #
             # (let ((islamic-year 1435))
            -#   (while (< islamic-year 1444)
            +#   (while (< islamic-year 1460)
             #     (let ((a
             #	     (calendar-gregorian-from-absolute
             #	      (calendar-islamic-to-absolute (list 9 1 islamic-year))))
            @@ -902,13 +912,14 @@ Zone	Indian/Mayotte	3:00:56 -	LMT	1911 Jul	# Mamoutzou
             #	  (car (cdr (cdr b))) (calendar-month-name (car b) t) (car (cdr b)))))
             #     (setq islamic-year (+ 1 islamic-year))))
             #
            -# with the results hand-edited for 2020-2022, when the normal spring-forward
            -# date falls during the estimated Ramadan.
            -#
            -# From 2023 through 2038 Ramadan is not predicted to overlap with
            -# daylight saving time.  Starting in 2039 there will be overlap again,
            +# with spring-forward transitions removed for 2023-2025, when the
            +# normal spring-forward date falls during the estimated Ramadan; with
            +# all transitions removed for 2026-2035, where the estimated Ramadan
            +# falls entirely outside daylight-saving time; and with fall-back
            +# transitions removed for 2036-2037, where the normal fall-back
            +# date falls during the estimated Ramadan.  Problems continue after that,
             # but 32-bit time_t values roll around in 2038 so for now do not worry
            -# about dates after 2038.
            +# about dates after 2037.
             
             # RULE	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER/S
             
            @@ -935,12 +946,14 @@ Rule	Morocco	2010	only	-	May	 2	 0:00	1:00	S
             Rule	Morocco	2010	only	-	Aug	 8	 0:00	0	-
             Rule	Morocco	2011	only	-	Apr	 3	 0:00	1:00	S
             Rule	Morocco	2011	only	-	Jul	 31	 0	0	-
            -Rule	Morocco	2012	2019	-	Apr	 lastSun 2:00	1:00	S
            -Rule	Morocco	2012	max	-	Sep	 lastSun 3:00	0	-
            +Rule	Morocco	2012	2013	-	Apr	 lastSun 2:00	1:00	S
            +Rule	Morocco	2012	only	-	Sep	 30	 3:00	0	-
             Rule	Morocco	2012	only	-	Jul	 20	 3:00	0	-
             Rule	Morocco	2012	only	-	Aug	 20	 2:00	1:00	S
             Rule	Morocco	2013	only	-	Jul	  7	 3:00	0	-
             Rule	Morocco	2013	only	-	Aug	 10	 2:00	1:00	S
            +Rule	Morocco	2013	2035	-	Oct	 lastSun 3:00	0	-
            +Rule	Morocco	2014	2022	-	Mar	 lastSun 2:00	1:00	S
             Rule	Morocco	2014	only	-	Jun	 29	 3:00	0	-
             Rule	Morocco	2014	only	-	Jul	 29	 2:00	1:00	S
             Rule	Morocco	2015	only	-	Jun	 18	 3:00	0	-
            @@ -953,10 +966,21 @@ Rule	Morocco	2018	only	-	May	 16	 3:00	0	-
             Rule	Morocco	2018	only	-	Jun	 15	 2:00	1:00	S
             Rule	Morocco	2019	only	-	May	  6	 3:00	0	-
             Rule	Morocco	2019	only	-	Jun	  5	 2:00	1:00	S
            +Rule	Morocco	2020	only	-	Apr	 24	 3:00	0	-
             Rule	Morocco	2020	only	-	May	 24	 2:00	1:00	S
            +Rule	Morocco	2021	only	-	Apr	 13	 3:00	0	-
             Rule	Morocco	2021	only	-	May	 13	 2:00	1:00	S
            +Rule	Morocco	2022	only	-	Apr	  3	 3:00	0	-
             Rule	Morocco	2022	only	-	May	  3	 2:00	1:00	S
            -Rule	Morocco	2023	max	-	Apr	 lastSun 2:00	1:00	S
            +Rule	Morocco	2023	only	-	Apr	 22	 2:00	1:00	S
            +Rule	Morocco	2024	only	-	Apr	 10	 2:00	1:00	S
            +Rule	Morocco	2025	only	-	Mar	 31	 2:00	1:00	S
            +Rule	Morocco	2026	max	-	Mar	 lastSun 2:00	1:00	S
            +Rule	Morocco	2036	only	-	Oct	 21	 3:00	0	-
            +Rule	Morocco	2037	only	-	Oct	 11	 3:00	0	-
            +Rule	Morocco	2038	only	-	Sep	 30	 3:00	0	-
            +Rule	Morocco	2038	only	-	Oct	 30	 2:00	1:00	S
            +Rule	Morocco	2038	max	-	Oct	 lastSun 3:00	0	-
             
             # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
             Zone Africa/Casablanca	-0:30:20 -	LMT	1913 Oct 26
            @@ -1123,9 +1147,7 @@ Zone	Africa/Khartoum	2:10:08 -	LMT	1931
             			3:00	-	EAT
             
             # South Sudan
            -Zone	Africa/Juba	2:06:24 -	LMT	1931
            -			2:00	Sudan	CA%sT	2000 Jan 15 12:00
            -			3:00	-	EAT
            +Link Africa/Khartoum Africa/Juba
             
             # Swaziland
             # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
            diff --git a/jdk/test/sun/util/calendar/zi/tzdata/antarctica b/jdk/test/sun/util/calendar/zi/tzdata/antarctica
            index 434432611ca..f30cf747f10 100644
            --- a/jdk/test/sun/util/calendar/zi/tzdata/antarctica
            +++ b/jdk/test/sun/util/calendar/zi/tzdata/antarctica
            @@ -39,9 +39,9 @@
             #
             # Except for the French entries,
             # I made up all time zone abbreviations mentioned here; corrections welcome!
            -# FORMAT is `zzz' and GMTOFF is 0 for locations while uninhabited.
            +# FORMAT is 'zzz' and GMTOFF is 0 for locations while uninhabited.
             
            -# These rules are stolen from the `southamerica' file.
            +# These rules are stolen from the 'southamerica' file.
             # Rule	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER/S
             Rule	ArgAQ	1964	1966	-	Mar	 1	0:00	0	-
             Rule	ArgAQ	1964	1966	-	Oct	15	0:00	1:00	S
            @@ -251,9 +251,10 @@ Zone Antarctica/Syowa	0	-	zzz	1957 Jan 29
             # Scott Island (never inhabited)
             #
             # year-round base
            -# Scott, Ross Island, since 1957-01, is like Antarctica/McMurdo.
            +# Scott Base, Ross Island, since 1957-01.
            +# See Pacific/Auckland.
             #
            -# These rules for New Zealand are stolen from the `australasia' file.
            +# These rules for New Zealand are stolen from the 'australasia' file.
             # Rule	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER/S
             Rule	NZAQ	1974	only	-	Nov	 3	2:00s	1:00	D
             Rule	NZAQ	1975	1988	-	Oct	lastSun	2:00s	1:00	D
            @@ -291,11 +292,11 @@ Rule	NZAQ	2008	max	-	Apr	Sun>=1	2:00s	0	S
             # From Lee Hotz (2001-03-08):
             # I queried the folks at Columbia who spent the summer at Vostok and this is
             # what they had to say about time there:
            -# ``in the US Camp (East Camp) we have been on New Zealand (McMurdo)
            +# "in the US Camp (East Camp) we have been on New Zealand (McMurdo)
             # time, which is 12 hours ahead of GMT. The Russian Station Vostok was
             # 6 hours behind that (although only 2 miles away, i.e. 6 hours ahead
             # of GMT). This is a time zone I think two hours east of Moscow. The
            -# natural time zone is in between the two: 8 hours ahead of GMT.''
            +# natural time zone is in between the two: 8 hours ahead of GMT."
             #
             # From Paul Eggert (2001-05-04):
             # This seems to be hopelessly confusing, so I asked Lee Hotz about it
            @@ -360,16 +361,8 @@ Zone Antarctica/Palmer	0	-	zzz	1965
             			-4:00	ChileAQ	CL%sT
             #
             #
            -# McMurdo, Ross Island, since 1955-12
            -# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
            -Zone Antarctica/McMurdo	0	-	zzz	1956
            -			12:00	NZAQ	NZ%sT
            -#
            -# Amundsen-Scott, South Pole, continuously occupied since 1956-11-20
            -#
            -# From Paul Eggert (1996-09-03):
            -# Normally it wouldn't have a separate entry, since it's like the
            -# larger Antarctica/McMurdo since 1970, but it's too famous to omit.
            +# McMurdo Station, Ross Island, since 1955-12
            +# Amundsen-Scott South Pole Station, continuously occupied since 1956-11-20
             #
             # From Chris Carrier (1996-06-27):
             # Siple, the first commander of the South Pole station,
            @@ -391,4 +384,4 @@ Zone Antarctica/McMurdo	0	-	zzz	1956
             # we have to go around and set them back 5 minutes or so.
             # Maybe if we let them run fast all of the time, we'd get to leave here sooner!!
             #
            -Link	Antarctica/McMurdo	Antarctica/South_Pole
            +# See 'australasia' for Antarctica/McMurdo.
            diff --git a/jdk/test/sun/util/calendar/zi/tzdata/asia b/jdk/test/sun/util/calendar/zi/tzdata/asia
            index f0931b3264d..fd278e5c8a8 100644
            --- a/jdk/test/sun/util/calendar/zi/tzdata/asia
            +++ b/jdk/test/sun/util/calendar/zi/tzdata/asia
            @@ -29,7 +29,7 @@
             # go ahead and edit the file (and please send any changes to
             # tz@iana.org for general use in the future).
             
            -# From Paul Eggert (2013-02-21):
            +# From Paul Eggert (2013-08-11):
             #
             # A good source for time zone historical data outside the U.S. is
             # Thomas G. Shanks and Rique Pottenger, The International Atlas (6th edition),
            @@ -67,11 +67,11 @@
             #	4:00 GST	Gulf*
             #	5:30 IST	India
             #	7:00 ICT	Indochina*
            -#	7:00 WIT	west Indonesia
            -#	8:00 CIT	central Indonesia
            +#	7:00 WIB	west Indonesia (Waktu Indonesia Barat)
            +#	8:00 WITA	central Indonesia (Waktu Indonesia Tengah)
             #	8:00 CST	China
             #	9:00 CJT	Central Japanese Time (1896/1937)*
            -#	9:00 EIT	east Indonesia
            +#	9:00 WIT	east Indonesia (Waktu Indonesia Timur)
             #	9:00 JST  JDT	Japan
             #	9:00 KST  KDT	Korea
             #	9:30 CST	(Australian) Central Standard Time
            @@ -779,7 +779,7 @@ Zone	Asia/Dili	8:22:20 -	LMT	1912
             			8:00	-	TLT	1942 Feb 21 23:00 # E Timor Time
             			9:00	-	JST	1945 Sep 23
             			9:00	-	TLT	1976 May  3
            -			8:00	-	CIT	2000 Sep 17 00:00
            +			8:00	-	WITA	2000 Sep 17 00:00
             			9:00	-	TLT
             
             # India
            @@ -816,36 +816,53 @@ Zone	Asia/Kolkata	5:53:28 -	LMT	1880	# Kolkata
             # (Hollandia).  For now, assume all Indonesian locations other than Jayapura
             # switched on 1945-09-23.
             #
            +# From Paul Eggert (2013-08-11):
            +# Normally the tz database uses English-language abbreviations, but in
            +# Indonesia it's typical to use Indonesian-language abbreviations even
            +# when writing in English.  For example, see the English-language
            +# summary published by the Time and Frequency Laboratory of the
            +# Research Center for Calibration, Instrumentation and Metrology,
            +# Indonesia,  (2006-09-29).
            +# The abbreviations are:
            +#
            +# WIB  - UTC+7 - Waktu Indonesia Barat (Indonesia western time)
            +# WITA - UTC+8 - Waktu Indonesia Tengah (Indonesia central time)
            +# WIT  - UTC+9 - Waktu Indonesia Timur (Indonesia eastern time)
            +#
             # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
            +# Java, Sumatra
             Zone Asia/Jakarta	7:07:12 -	LMT	1867 Aug 10
             # Shanks & Pottenger say the next transition was at 1924 Jan 1 0:13,
             # but this must be a typo.
            -			7:07:12	-	JMT	1923 Dec 31 23:47:12 # Jakarta
            +			7:07:12	-	BMT	1923 Dec 31 23:47:12 # Batavia
             			7:20	-	JAVT	1932 Nov	 # Java Time
            -			7:30	-	WIT	1942 Mar 23
            +			7:30	-	WIB	1942 Mar 23
             			9:00	-	JST	1945 Sep 23
            -			7:30	-	WIT	1948 May
            -			8:00	-	WIT	1950 May
            -			7:30	-	WIT	1964
            -			7:00	-	WIT
            +			7:30	-	WIB	1948 May
            +			8:00	-	WIB	1950 May
            +			7:30	-	WIB	1964
            +			7:00	-	WIB
            +# west and central Borneo
             Zone Asia/Pontianak	7:17:20	-	LMT	1908 May
             			7:17:20	-	PMT	1932 Nov    # Pontianak MT
            -			7:30	-	WIT	1942 Jan 29
            +			7:30	-	WIB	1942 Jan 29
             			9:00	-	JST	1945 Sep 23
            -			7:30	-	WIT	1948 May
            -			8:00	-	WIT	1950 May
            -			7:30	-	WIT	1964
            -			8:00	-	CIT	1988 Jan  1
            -			7:00	-	WIT
            +			7:30	-	WIB	1948 May
            +			8:00	-	WIB	1950 May
            +			7:30	-	WIB	1964
            +			8:00	-	WITA	1988 Jan  1
            +			7:00	-	WIB
            +# Sulawesi, Lesser Sundas, east and south Borneo
             Zone Asia/Makassar	7:57:36 -	LMT	1920
             			7:57:36	-	MMT	1932 Nov    # Macassar MT
            -			8:00	-	CIT	1942 Feb  9
            +			8:00	-	WITA	1942 Feb  9
             			9:00	-	JST	1945 Sep 23
            -			8:00	-	CIT
            +			8:00	-	WITA
            +# Maluku Islands, West Papua, Papua
             Zone Asia/Jayapura	9:22:48 -	LMT	1932 Nov
            -			9:00	-	EIT	1944 Sep  1
            +			9:00	-	WIT	1944 Sep  1
             			9:30	-	CST	1964
            -			9:00	-	EIT
            +			9:00	-	WIT
             
             # Iran
             
            @@ -1387,9 +1404,11 @@ Zone	Asia/Tokyo	9:18:59	-	LMT	1887 Dec 31 15:00u
             # until about the same time next year (at least).
             # http://www.petra.gov.jo/Public_News/Nws_NewsDetails.aspx?NewsID=88950
             #
            -# From Paul Eggert (2012-10-25):
            -# For now, assume this is just a one-year measure.  If it becomes
            -# permanent, we should move Jordan from EET to AST effective tomorrow.
            +# From Paul Eggert (2013-09-21):
            +# It's looking like this change will be permanent; see
            +# Petra News Agency, Cancelling winter saved Jordan $7 million (2013-02-20)
            +# .
            +# So move Jordan to UTC+3 as of the abovementioned date.
             
             # Rule	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER/S
             Rule	Jordan	1973	only	-	Jun	6	0:00	1:00	S
            @@ -1415,15 +1434,15 @@ Rule	Jordan	1995	1998	-	Sep	Fri>=15	0:00s	0	-
             Rule	Jordan	1999	only	-	Jul	 1	0:00s	1:00	S
             Rule	Jordan	1999	2002	-	Sep	lastFri	0:00s	0	-
             Rule	Jordan	2000	2001	-	Mar	lastThu	0:00s	1:00	S
            -Rule	Jordan	2002	max	-	Mar	lastThu	24:00	1:00	S
            +Rule	Jordan	2002	2012	-	Mar	lastThu	24:00	1:00	S
             Rule	Jordan	2003	only	-	Oct	24	0:00s	0	-
             Rule	Jordan	2004	only	-	Oct	15	0:00s	0	-
             Rule	Jordan	2005	only	-	Sep	lastFri	0:00s	0	-
            -Rule	Jordan	2006	2011	-	Oct	lastFri	0:00s	0	-
            -Rule	Jordan	2013	max	-	Oct	lastFri	0:00s	0	-
            +Rule	Jordan	2006	2012	-	Oct	lastFri	0:00s	0	-
             # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
             Zone	Asia/Amman	2:23:44 -	LMT	1931
            -			2:00	Jordan	EE%sT
            +			2:00	Jordan	EE%sT	2012 Oct 26 0:00s
            +			3:00	-	AST
             
             
             # Kazakhstan
            @@ -2303,9 +2322,18 @@ Zone	Asia/Karachi	4:28:12 -	LMT	1907
             # http://www.samanews.com/index.php?act=Show&id=154120
             # http://safa.ps/details/news/99844/%D8%B1%D8%A7%D9%85-%D8%A7%D9%84%D9%84%D9%87-%D8%A8%D8%AF%D8%A1-%D8%A7%D9%84%D8%AA%D9%88%D9%82%D9%8A%D8%AA-%D8%A7%D9%84%D8%B5%D9%8A%D9%81%D9%8A-29-%D8%A7%D9%84%D8%AC%D8%A7%D8%B1%D9%8A.html
             
            -# From Paul Eggert (2013-04-15):
            +# From Steffen Thorsen (2013-09-24):
            +# The Gaza and West Bank are ending DST Thursday at midnight
            +# (2013-09-27 00:00:00) (one hour earlier than last year...).
            +# This source in English, says "that winter time will go into effect
            +# at midnight on Thursday in the West Bank and Gaza Strip":
            +# http://english.wafa.ps/index.php?action=detail&id=23246
            +# official source...:
            +# http://www.palestinecabinet.gov.ps/ar/Views/ViewDetails.aspx?pid=1252
            +
            +# From Paul Eggert (2013-09-24):
             # For future dates, guess the last Thursday in March at 24:00 through
            -# the first Friday on or after September 21 at 01:00.  This is consistent with
            +# the first Friday on or after September 21 at 00:00.  This is consistent with
             # the predictions in today's editions of the following URLs,
             # which are for Gaza and Hebron respectively:
             # http://www.timeanddate.com/worldclock/timezone.html?n=702
            @@ -2336,7 +2364,8 @@ Rule Palestine	2011	only	-	Aug	 1	0:00	0	-
             Rule Palestine	2011	only	-	Aug	30	0:00	1:00	S
             Rule Palestine	2011	only	-	Sep	30	0:00	0	-
             Rule Palestine	2012	max	-	Mar	lastThu	24:00	1:00	S
            -Rule Palestine	2012	max	-	Sep	Fri>=21	1:00	0	-
            +Rule Palestine	2012	only	-	Sep	21	1:00	0	-
            +Rule Palestine	2013	max	-	Sep	Fri>=21	0:00	0	-
             
             # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
             Zone	Asia/Gaza	2:17:52	-	LMT	1900 Oct
            diff --git a/jdk/test/sun/util/calendar/zi/tzdata/australasia b/jdk/test/sun/util/calendar/zi/tzdata/australasia
            index 11a3cb97fee..cd6b724859d 100644
            --- a/jdk/test/sun/util/calendar/zi/tzdata/australasia
            +++ b/jdk/test/sun/util/calendar/zi/tzdata/australasia
            @@ -375,16 +375,25 @@ Zone	Indian/Cocos	6:27:40	-	LMT	1900
             # today confirmed that Fiji will start daylight savings at 2 am on Sunday 21st
             # October 2012 and end at 3 am on Sunday 20th January 2013.
             # http://www.fiji.gov.fj/index.php?option=com_content&view=article&id=6702&catid=71&Itemid=155
            +
            +# From the Fijian Government Media Center (2013-08-30) via David Wheeler:
            +# Fiji will start daylight savings on Sunday 27th October, 2013 and end at 3am
            +# on Sunday 19th January, 2014....  move clocks forward by one hour from 2am
            +# http://www.fiji.gov.fj/Media-Center/Press-Releases/DAYLIGHT-SAVING-STARTS-ON-SUNDAY,-27th-OCTOBER-201.aspx
             #
            -# From Paul Eggert (2012-08-31):
            -# For now, guess a pattern of the penultimate Sundays in October and January.
            +# From Paul Eggert (2013-09-09):
            +# For now, guess that Fiji springs forward the Sunday before the fourth
            +# Monday in October.  This matches both recent practice and
            +# timeanddate.com's current spring-forward prediction.
            +# For the January 2014 transition we guessed right while timeanddate.com
            +# guessed wrong, so leave the fall-back prediction alone.
             
             # Rule	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER/S
             Rule	Fiji	1998	1999	-	Nov	Sun>=1	2:00	1:00	S
             Rule	Fiji	1999	2000	-	Feb	lastSun	3:00	0	-
             Rule	Fiji	2009	only	-	Nov	29	2:00	1:00	S
             Rule	Fiji	2010	only	-	Mar	lastSun	3:00	0	-
            -Rule	Fiji	2010	max	-	Oct	Sun>=18	2:00	1:00	S
            +Rule	Fiji	2010	max	-	Oct	Sun>=21	2:00	1:00	S
             Rule	Fiji	2011	only	-	Mar	Sun>=1	3:00	0	-
             Rule	Fiji	2012	max	-	Jan	Sun>=18	3:00	0	-
             # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
            @@ -510,6 +519,7 @@ Zone Pacific/Auckland	11:39:04 -	LMT	1868 Nov  2
             Zone Pacific/Chatham	12:13:48 -	LMT	1957 Jan  1
             			12:45	Chatham	CHA%sT
             
            +Link Pacific/Auckland Antarctica/McMurdo
             
             # Auckland Is
             # uninhabited; Maori and Moriori, colonial settlers, pastoralists, sealers,
            @@ -759,7 +769,7 @@ Zone Pacific/Funafuti	11:56:52 -	LMT	1901
             # 1886-1891; Baker was similar but exact dates are not known.
             # Inhabited by civilians 1935-1942; U.S. military bases 1943-1944;
             # uninhabited thereafter.
            -# Howland observed Hawaii Standard Time (UTC-10:30) in 1937;
            +# Howland observed Hawaii Standard Time (UT-10:30) in 1937;
             # see page 206 of Elgen M. Long and Marie K. Long,
             # Amelia Earhart: the Mystery Solved, Simon & Schuster (2000).
             # So most likely Howland and Baker observed Hawaii Time from 1935
            @@ -772,8 +782,17 @@ Zone Pacific/Funafuti	11:56:52 -	LMT	1901
             # no information; was probably like Pacific/Kiritimati
             
             # Johnston
            -# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
            -Zone Pacific/Johnston	-10:00	-	HST
            +#
            +# From Paul Eggert (2013-09-03):
            +# In his memoirs of June 6th to October 4, 1945
            +#  (2005), Herbert C. Bach writes,
            +# "We started our letdown to Kwajalein Atoll and landed there at 5:00 AM
            +# Johnston time, 1:30 AM Kwajalein time."  This was in June 1945, and
            +# confirms that Johnston kept the same time as Honolulu in summer 1945.
            +# We have no better information, so for now, assume this has been true
            +# indefinitely into the past.
            +#
            +# See 'northamerica' for Pacific/Johnston.
             
             # Kingman
             # uninhabited
            diff --git a/jdk/test/sun/util/calendar/zi/tzdata/backward b/jdk/test/sun/util/calendar/zi/tzdata/backward
            index ca4c437a150..5afe9a317ff 100644
            --- a/jdk/test/sun/util/calendar/zi/tzdata/backward
            +++ b/jdk/test/sun/util/calendar/zi/tzdata/backward
            @@ -45,15 +45,17 @@ Link	America/Kentucky/Louisville	America/Louisville
             Link	America/Argentina/Mendoza	America/Mendoza
             Link	America/Rio_Branco	America/Porto_Acre
             Link	America/Argentina/Cordoba	America/Rosario
            -Link	America/St_Thomas	America/Virgin
            +Link	America/Denver		America/Shiprock
            +Link	America/Port_of_Spain	America/Virgin
            +Link	Pacific/Auckland	Antarctica/South_Pole
             Link	Asia/Ashgabat		Asia/Ashkhabad
            +Link	Asia/Kolkata		Asia/Calcutta
             Link	Asia/Chongqing		Asia/Chungking
             Link	Asia/Dhaka		Asia/Dacca
             Link	Asia/Kathmandu		Asia/Katmandu
            -Link	Asia/Kolkata		Asia/Calcutta
             Link	Asia/Macau		Asia/Macao
            -Link	Asia/Jerusalem		Asia/Tel_Aviv
             Link	Asia/Ho_Chi_Minh	Asia/Saigon
            +Link	Asia/Jerusalem		Asia/Tel_Aviv
             Link	Asia/Thimphu		Asia/Thimbu
             Link	Asia/Makassar		Asia/Ujung_Pandang
             Link	Asia/Ulaanbaatar	Asia/Ulan_Bator
            @@ -111,10 +113,10 @@ Link	Pacific/Auckland	NZ
             Link	Pacific/Chatham		NZ-CHAT
             Link	America/Denver		Navajo
             Link	Asia/Shanghai		PRC
            -Link	Pacific/Pago_Pago	Pacific/Samoa
            -Link	Pacific/Chuuk		Pacific/Yap
            -Link	Pacific/Chuuk		Pacific/Truk
             Link	Pacific/Pohnpei		Pacific/Ponape
            +Link	Pacific/Pago_Pago	Pacific/Samoa
            +Link	Pacific/Chuuk		Pacific/Truk
            +Link	Pacific/Chuuk		Pacific/Yap
             Link	Europe/Warsaw		Poland
             Link	Europe/Lisbon		Portugal
             Link	Asia/Taipei		ROC
            diff --git a/jdk/test/sun/util/calendar/zi/tzdata/etcetera b/jdk/test/sun/util/calendar/zi/tzdata/etcetera
            index d557e3033fb..ebaa5fdfc04 100644
            --- a/jdk/test/sun/util/calendar/zi/tzdata/etcetera
            +++ b/jdk/test/sun/util/calendar/zi/tzdata/etcetera
            @@ -54,9 +54,9 @@ Link	Etc/GMT				Etc/GMT0
             # even though this is the opposite of what many people expect.
             # POSIX has positive signs west of Greenwich, but many people expect
             # positive signs east of Greenwich.  For example, TZ='Etc/GMT+4' uses
            -# the abbreviation "GMT+4" and corresponds to 4 hours behind UTC
            +# the abbreviation "GMT+4" and corresponds to 4 hours behind UT
             # (i.e. west of Greenwich) even though many people would expect it to
            -# mean 4 hours ahead of UTC (i.e. east of Greenwich).
            +# mean 4 hours ahead of UT (i.e. east of Greenwich).
             #
             # In the draft 5 of POSIX 1003.1-200x, the angle bracket notation allows for
             # TZ='+4'; if you want time zone abbreviations conforming to
            diff --git a/jdk/test/sun/util/calendar/zi/tzdata/europe b/jdk/test/sun/util/calendar/zi/tzdata/europe
            index 688136c8016..9f574a3b2b6 100644
            --- a/jdk/test/sun/util/calendar/zi/tzdata/europe
            +++ b/jdk/test/sun/util/calendar/zi/tzdata/europe
            @@ -65,7 +65,7 @@
             #	 (1998-09-21, in Portuguese)
             
             #
            -# I invented the abbreviations marked `*' in the following table;
            +# I invented the abbreviations marked '*' in the following table;
             # the rest are from earlier versions of this file, or from other sources.
             # Corrections are welcome!
             #                   std dst  2dst
            @@ -119,7 +119,7 @@
             # and a sketch map showing some of the sightlines involved. One paragraph
             # of the text said:
             #
            -# `An old stone obelisk marking a forgotten terrestrial meridian stands
            +# 'An old stone obelisk marking a forgotten terrestrial meridian stands
             # beside the river at Kew. In the 18th century, before time and longitude
             # was standardised by the Royal Observatory in Greenwich, scholars observed
             # this stone and the movement of stars from Kew Observatory nearby. They
            @@ -163,7 +163,7 @@
             # From Paul Eggert (2003-09-27):
             # Summer Time was first seriously proposed by William Willett (1857-1915),
             # a London builder and member of the Royal Astronomical Society
            -# who circulated a pamphlet ``The Waste of Daylight'' (1907)
            +# who circulated a pamphlet "The Waste of Daylight" (1907)
             # that proposed advancing clocks 20 minutes on each of four Sundays in April,
             # and retarding them by the same amount on four Sundays in September.
             # A bill was drafted in 1909 and introduced in Parliament several times,
            @@ -188,10 +188,10 @@
             #	
             
             # From Paul Eggert (1996-09-03):
            -# The OED Supplement says that the English originally said ``Daylight Saving''
            +# The OED Supplement says that the English originally said "Daylight Saving"
             # when they were debating the adoption of DST in 1908; but by 1916 this
             # term appears only in quotes taken from DST's opponents, whereas the
            -# proponents (who eventually won the argument) are quoted as using ``Summer''.
            +# proponents (who eventually won the argument) are quoted as using "Summer".
             
             # From Arthur David Olson (1989-01-19):
             #
            @@ -231,9 +231,9 @@
             # which could not be said to run counter to any official description.
             
             # From Paul Eggert (2000-10-02):
            -# Howse writes (p 157) `DBST' too, but `BDST' seems to have been common
            +# Howse writes (p 157) 'DBST' too, but 'BDST' seems to have been common
             # and follows the more usual convention of putting the location name first,
            -# so we use `BDST'.
            +# so we use 'BDST'.
             
             # Peter Ilieve (1998-04-19) described at length
             # the history of summer time legislation in the United Kingdom.
            @@ -454,6 +454,8 @@ Rule	GB-Eire 1981	1989	-	Oct	Sun>=23	1:00u	0	GMT
             Rule	GB-Eire 1990	1995	-	Oct	Sun>=22	1:00u	0	GMT
             # Summer Time Order 1997 (S.I. 1997/2982)
             # See EU for rules starting in 1996.
            +#
            +# Use Europe/London for Jersey, Guernsey, and the Isle of Man.
             
             # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
             Zone	Europe/London	-0:01:15 -	LMT	1847 Dec  1 0:00s
            @@ -820,7 +822,7 @@ Zone	Europe/Brussels	0:17:30 -	LMT	1880
             			1:00	EU	CE%sT
             
             # Bosnia and Herzegovina
            -# see Serbia
            +# See Europe/Belgrade.
             
             # Bulgaria
             #
            @@ -848,10 +850,10 @@ Zone	Europe/Sofia	1:33:16 -	LMT	1880
             			2:00	EU	EE%sT
             
             # Croatia
            -# see Serbia
            +# See Europe/Belgrade.
             
             # Cyprus
            -# Please see the `asia' file for Asia/Nicosia.
            +# Please see the 'asia' file for Asia/Nicosia.
             
             # Czech Republic
             # Rule	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER/S
            @@ -868,6 +870,7 @@ Zone	Europe/Prague	0:57:44 -	LMT	1850
             			1:00	C-Eur	CE%sT	1944 Sep 17 2:00s
             			1:00	Czech	CE%sT	1979
             			1:00	EU	CE%sT
            +# Use Europe/Prague also for Slovakia.
             
             # Denmark, Faroe Islands, and Greenland
             
            @@ -1031,12 +1034,12 @@ Zone America/Thule	-4:35:08 -	LMT	1916 Jul 28 # Pituffik air base
             # From Peter Ilieve (1996-10-28):
             # [IATA SSIM (1992/1996) claims that the Baltic republics switch at 01:00s,
             # but a relative confirms that Estonia still switches at 02:00s, writing:]
            -# ``I do not [know] exactly but there are some little different
            +# "I do not [know] exactly but there are some little different
             # (confusing) rules for International Air and Railway Transport Schedules
             # conversion in Sunday connected with end of summer time in Estonia....
             # A discussion is running about the summer time efficiency and effect on
             # human physiology.  It seems that Estonia maybe will not change to
            -# summer time next spring.''
            +# summer time next spring."
             
             # From Peter Ilieve (1998-11-04), heavily edited:
             # 
            @@ -1091,7 +1094,7 @@ Zone	Europe/Tallinn	1:39:00	-	LMT	1880
             # Well, here in Helsinki we're just changing from summer time to regular one,
             # and it's supposed to change at 4am...
             
            -# From Janne Snabb (2010-0715):
            +# From Janne Snabb (2010-07-15):
             #
             # I noticed that the Finland data is not accurate for years 1981 and 1982.
             # During these two first trial years the DST adjustment was made one hour
            @@ -1148,7 +1151,7 @@ Link	Europe/Helsinki	Europe/Mariehamn
             
             
             #
            -# Shank & Pottenger seem to use `24:00' ambiguously; resolve it with Whitman.
            +# Shank & Pottenger seem to use '24:00' ambiguously; resolve it with Whitman.
             # Rule	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER/S
             Rule	France	1916	only	-	Jun	14	23:00s	1:00	S
             Rule	France	1916	1919	-	Oct	Sun>=1	23:00s	0	-
            @@ -1438,7 +1441,7 @@ Zone Atlantic/Reykjavik	-1:27:24 -	LMT	1837
             # 
             # Day-light Saving Time in Italy (2006-02-03)
             # 
            -# (`FP' below), taken from an Italian National Electrotechnical Institute
            +# ('FP' below), taken from an Italian National Electrotechnical Institute
             # publication. When the three sources disagree, guess who's right, as follows:
             #
             # year	FP	Shanks&P. (S)	Whitman (W)	Go with:
            @@ -1584,10 +1587,22 @@ Zone	Europe/Riga	1:36:24	-	LMT	1880
             			2:00	EU	EE%sT
             
             # Liechtenstein
            -# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
            -Zone	Europe/Vaduz	0:38:04 -	LMT	1894 Jun
            -			1:00	-	CET	1981
            -			1:00	EU	CE%sT
            +
            +# From Paul Eggert (2013-09-09):
            +# Shanks & Pottenger say Vaduz is like Zurich.
            +
            +# From Alois Treindl (2013-09-18):
            +# http://www.eliechtensteinensia.li/LIJ/1978/1938-1978/1941.pdf
            +# ... confirms on p. 6 that Liechtenstein followed Switzerland in 1941 and 1942.
            +# I ... translate only the last two paragraphs:
            +#    ... during second world war, in the years 1941 and 1942, Liechtenstein
            +#    introduced daylight saving time, adapting to Switzerland.  From 1943 on
            +#    central European time was in force throughout the year.
            +#    From a report of the duke's government to the high council,
            +#    regarding the introduction of a time law, of 31 May 1977.
            +
            +Link Europe/Zurich Europe/Vaduz
            +
             
             # Lithuania
             
            @@ -1675,7 +1690,7 @@ Zone Europe/Luxembourg	0:24:36 -	LMT	1904 Jun
             			1:00	EU	CE%sT
             
             # Macedonia
            -# see Serbia
            +# See Europe/Belgrade.
             
             # Malta
             # Rule	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER/S
            @@ -1768,7 +1783,7 @@ Zone	Europe/Monaco	0:29:32 -	LMT	1891 Mar 15
             			1:00	EU	CE%sT
             
             # Montenegro
            -# see Serbia
            +# See Europe/Belgrade.
             
             # Netherlands
             
            @@ -1883,7 +1898,7 @@ Zone	Europe/Oslo	0:43:00 -	LMT	1895 Jan  1
             # before 1895, and therefore probably changed the local time somewhere
             # between 1895 and 1925 (inclusive).
             
            -# From Paul Eggert (2001-05-01):
            +# From Paul Eggert (2013-09-04):
             #
             # Actually, Jan Mayen was never occupied by Germany during World War II,
             # so it must have diverged from Oslo time during the war, as Oslo was
            @@ -1894,7 +1909,7 @@ Zone	Europe/Oslo	0:43:00 -	LMT	1895 Jan  1
             # 1941 with a small Norwegian garrison and continued operations despite
             # frequent air ttacks from Germans.  In 1943 the Americans established a
             # radiolocating station on the island, called "Atlantic City".  Possibly
            -# the UTC offset changed during the war, but I think it unlikely that
            +# the UT offset changed during the war, but I think it unlikely that
             # Jan Mayen used German daylight-saving rules.
             #
             # Svalbard is more complicated, as it was raided in August 1941 by an
            @@ -1907,9 +1922,8 @@ Zone	Europe/Oslo	0:43:00 -	LMT	1895 Jan  1
             # the German armed forces at the Svalbard weather station code-named
             # Haudegen did not surrender to the Allies until September 1945.
             #
            -# All these events predate our cutoff date of 1970.  Unless we can
            -# come up with more definitive info about the timekeeping during the
            -# war years it's probably best just do...the following for now:
            +# All these events predate our cutoff date of 1970, so use Europe/Oslo
            +# for these regions.
             Link	Europe/Oslo	Arctic/Longyearbyen
             
             # Poland
            @@ -2167,7 +2181,7 @@ Zone Europe/Bucharest	1:44:24 -	LMT	1891 Oct
             # so we (Novosibirsk) simply did not switch.
             #
             # From Andrey A. Chernov (1996-10-04):
            -# `MSK' and `MSD' were born and used initially on Moscow computers with
            +# 'MSK' and 'MSD' were born and used initially on Moscow computers with
             # UNIX-like OSes by several developer groups (e.g. Demos group, Kiae group)....
             # The next step was the UUCP network, the Relcom predecessor
             # (used mainly for mail), and MSK/MSD was actively used there.
            @@ -2466,6 +2480,9 @@ Zone Asia/Anadyr	11:49:56 -	LMT	1924 May  2
             			11:00	Russia	ANA%sT	2011 Mar 27 2:00s
             			12:00	-	ANAT
             
            +# San Marino
            +# See Europe/Rome.
            +
             # Serbia
             # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
             Zone	Europe/Belgrade	1:22:00	-	LMT	1884
            @@ -2488,7 +2505,7 @@ Link Europe/Belgrade Europe/Zagreb	# Croatia
             Link Europe/Prague Europe/Bratislava
             
             # Slovenia
            -# see Serbia
            +# See Europe/Belgrade.
             
             # Spain
             # Rule	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER/S
            @@ -2622,7 +2639,7 @@ Zone Europe/Stockholm	1:12:12 -	LMT	1879 Jan  1
             # and their performance improved enormously.  Communities began to keep
             # mean time in preference to apparent time -- Geneva from 1780 ....
             # Rule	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER/S
            -# From Whitman (who writes ``Midnight?''):
            +# From Whitman (who writes "Midnight?"):
             # Rule	Swiss	1940	only	-	Nov	 2	0:00	1:00	S
             # Rule	Swiss	1940	only	-	Dec	31	0:00	0	-
             # From Shanks & Pottenger:
            @@ -2667,23 +2684,53 @@ Zone Europe/Stockholm	1:12:12 -	LMT	1879 Jan  1
             # The 1940 rules must be deleted.
             #
             # One further detail for Switzerland, which is probably out of scope for
            -# most users of tzdata:
            -# The zone file
            -# Zone    Europe/Zurich   0:34:08 -       LMT     1848 Sep 12
            -#                          0:29:44 -       BMT     1894 Jun #Bern Mean Time
            -#                          1:00    Swiss   CE%sT   1981
            -#                          1:00    EU      CE%sT
            +# most users of tzdata: The [Europe/Zurich zone] ...
             # describes all of Switzerland correctly, with the exception of
             # the Cantone Geneve (Geneva, Genf). Between 1848 and 1894 Geneve did not
             # follow Bern Mean Time but kept its own local mean time.
             # To represent this, an extra zone would be needed.
            +#
            +# From Alois Treindl (2013-09-11):
            +# The Federal regulations say
            +# http://www.admin.ch/opc/de/classified-compilation/20071096/index.html
            +# ... the meridian for Bern mean time ... is 7 degrees 26'22.50".
            +# Expressed in time, it is 0h29m45.5s.
            +
            +# From Pierre-Yves Berger (2013-09-11):
            +# the "Circulaire du conseil federal" (December 11 1893)
            +#  ...
            +# clearly states that the [1894-06-01] change should be done at midnight
            +# but if no one is present after 11 at night, could be postponed until one
            +# hour before the beginning of service.
            +
            +# From Paul Eggert (2013-09-11):
            +# Round BMT to the nearest even second, 0:29:46.
            +#
            +# We can find no reliable source for Shanks's assertion that all of Switzerland
            +# except Geneva switched to Bern Mean Time at 00:00 on 1848-09-12.  This book:
            +#
            +#	Jakob Messerli. Gleichmassig, punktlich, schnell: Zeiteinteilung und
            +#	Zeitgebrauch in der Schweiz im 19. Jahrhundert. Chronos, Zurich 1995,
            +#	ISBN 3-905311-68-2, OCLC 717570797.
            +#
            +# suggests that the transition was more gradual, and that the Swiss did not
            +# agree about civil time during the transition.  The timekeeping it gives the
            +# most detail for is postal and telegraph time: here, federal legislation (the
            +# "Bundesgesetz uber die Erstellung von elektrischen Telegraphen") passed on
            +# 1851-11-23, and an official implementation notice was published 1853-07-16
            +# (Bundesblatt 1853, Bd. II, S. 859).  On p 72 Messerli writes that in
            +# practice since July 1853 Bernese time was used in "all postal and telegraph
            +# offices in Switzerland from Geneva to St. Gallen and Basel to Chiasso"
            +# (Google translation).  For now, model this transition as occurring on
            +# 1853-07-16, though it probably occurred at some other date in Zurich, and
            +# legal civil time probably changed at still some other transition date.
             
             # Rule	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER/S
             Rule	Swiss	1941	1942	-	May	Mon>=1	1:00	1:00	S
             Rule	Swiss	1941	1942	-	Oct	Mon>=1	2:00	0	-
             # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
            -Zone	Europe/Zurich	0:34:08 -	LMT	1848 Sep 12
            -			0:29:44	-	BMT	1894 Jun # Bern Mean Time
            +Zone	Europe/Zurich	0:34:08 -	LMT	1853 Jul 16 # See above comment.
            +			0:29:46	-	BMT	1894 Jun # Bern Mean Time
             			1:00	Swiss	CE%sT	1981
             			1:00	EU	CE%sT
             
            @@ -2907,7 +2954,7 @@ Zone Europe/Simferopol	2:16:24 -	LMT	1880
             # From Paul Eggert (2006-03-22):
             # The _Economist_ (1994-05-28, p 45) reports that central Crimea switched
             # from Kiev to Moscow time sometime after the January 1994 elections.
            -# Shanks (1999) says ``date of change uncertain'', but implies that it happened
            +# Shanks (1999) says "date of change uncertain", but implies that it happened
             # sometime between the 1994 DST switches.  Shanks & Pottenger simply say
             # 1994-09-25 03:00, but that can't be right.  For now, guess it
             # changed in May.
            @@ -2921,6 +2968,9 @@ Zone Europe/Simferopol	2:16:24 -	LMT	1880
             			3:00	-	MSK	1997 Mar lastSun 1:00u
             			2:00	EU	EE%sT
             
            +# Vatican City
            +# See Europe/Rome.
            +
             ###############################################################################
             
             # One source shows that Bulgaria, Cyprus, Finland, and Greece observe DST from
            diff --git a/jdk/test/sun/util/calendar/zi/tzdata/iso3166.tab b/jdk/test/sun/util/calendar/zi/tzdata/iso3166.tab
            index c6b2d0af3f1..28fb64b647e 100644
            --- a/jdk/test/sun/util/calendar/zi/tzdata/iso3166.tab
            +++ b/jdk/test/sun/util/calendar/zi/tzdata/iso3166.tab
            @@ -32,7 +32,7 @@
             # 1.  ISO 3166-1 alpha-2 country code, current as of
             #     ISO 3166-1 Newsletter VI-15 (2013-05-10).  See: Updates on ISO 3166
             #   http://www.iso.org/iso/home/standards/country_codes/updates_on_iso_3166.htm
            -# 2.  The usual English name for the country,
            +# 2.  The usual English name for the coded region,
             #     chosen so that alphabetic sorting of subsets produces helpful lists.
             #     This is not the same as the English name in the ISO 3166 tables.
             #
            @@ -46,7 +46,7 @@
             # to take or endorse any position on legal or territorial claims.
             #
             #country-
            -#code	country name
            +#code	name of country, territory, area, or subdivision
             AD	Andorra
             AE	United Arab Emirates
             AF	Afghanistan
            @@ -76,7 +76,7 @@ BL	St Barthelemy
             BM	Bermuda
             BN	Brunei
             BO	Bolivia
            -BQ	Bonaire, St Eustatius & Saba
            +BQ	Caribbean Netherlands
             BR	Brazil
             BS	Bahamas
             BT	Bhutan
            diff --git a/jdk/test/sun/util/calendar/zi/tzdata/leapseconds b/jdk/test/sun/util/calendar/zi/tzdata/leapseconds
            index 912801227a2..faf5319d408 100644
            --- a/jdk/test/sun/util/calendar/zi/tzdata/leapseconds
            +++ b/jdk/test/sun/util/calendar/zi/tzdata/leapseconds
            @@ -20,18 +20,24 @@
             # 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.
            -#
            -# 
            -# This file is in the public domain, so clarified as of
            -# 2009-05-17 by Arthur David Olson.
             
             # Allowance for leapseconds added to each timezone file.
             
            +# This file is in the public domain.
            +
            +# This file is generated automatically from the data in the public-domain
            +# leap-seconds.list file available from most NIST time servers.
            +# If the URL  does not work,
            +# you should be able to pick up leap-seconds.list from a secondary NIST server.
            +# For more about leap-seconds.list, please see
            +# The NTP Timescale and Leap Seconds
            +# .
            +
             # The International Earth Rotation Service periodically uses leap seconds
             # to keep UTC to within 0.9 s of UT1
             # (which measures the true angular orientation of the earth in space); see
             # Terry J Quinn, The BIPM and the accurate measure of time,
            -# Proc IEEE 79, 7 (July 1991), 894-905.
            +# Proc IEEE 79, 7 (July 1991), 894-905 .
             # There were no leap seconds before 1972, because the official mechanism
             # accounting for the discrepancy between atomic time and the earth's rotation
             # did not exist until the early 1970s.
            @@ -42,8 +48,8 @@
             # or
             #	Leap	YEAR	MON	DAY	23:59:59	-	R/S
             
            -# If the leapsecond is Rolling (R) the given time is local time
            -# If the leapsecond is Stationary (S) the given time is UTC
            +# If the leapsecond is Rolling (R) the given time is local time.
            +# If the leapsecond is Stationary (S) the given time is UTC.
             
             # Leap	YEAR	MONTH	DAY	HH:MM:SS	CORR	R/S
             Leap	1972	Jun	30	23:59:60	+	S
            @@ -71,53 +77,3 @@ Leap	1998	Dec	31	23:59:60	+	S
             Leap	2005	Dec	31	23:59:60	+	S
             Leap	2008	Dec	31	23:59:60	+	S
             Leap	2012	Jun	30	23:59:60	+	S
            -
            -# INTERNATIONAL EARTH ROTATION AND REFERENCE SYSTEMS SERVICE (IERS)
            -#
            -# SERVICE INTERNATIONAL DE LA ROTATION TERRESTRE ET DES SYSTEMES DE REFERENCE
            -#
            -#
            -# SERVICE DE LA ROTATION TERRESTRE
            -# OBSERVATOIRE DE PARIS
            -# 61, Av. de l'Observatoire 75014 PARIS (France)
            -# Tel.      : 33 (0) 1 40 51 22 26
            -# FAX       : 33 (0) 1 40 51 22 91
            -# e-mail    : (E-Mail Removed)
            -# http://hpiers.obspm.fr/eop-pc
            -#
            -# Paris, 5 January 2012
            -#
            -#
            -# Bulletin C 43
            -#
            -# To authorities responsible
            -# for the measurement and
            -# distribution of time
            -#
            -#
            -# UTC TIME STEP
            -# on the 1st of July 2012
            -#
            -#
            -# A positive leap second will be introduced at the end of June 2012.
            -# The sequence of dates of the UTC second markers will be:
            -#
            -#                          2012 June 30,     23h 59m 59s
            -#                          2012 June 30,     23h 59m 60s
            -#                          2012 July  1,      0h  0m  0s
            -#
            -# The difference between UTC and the International Atomic Time TAI is:
            -#
            -# from 2009 January 1, 0h UTC, to 2012 July 1  0h UTC  : UTC-TAI = - 34s
            -# from 2012 July 1,    0h UTC, until further notice    : UTC-TAI = - 35s
            -#
            -# Leap seconds can be introduced in UTC at the end of the months of December
            -# or June, depending on the evolution of UT1-TAI. Bulletin C is mailed every
            -# six months, either to announce a time step in UTC or to confirm that there
            -# will be no time step at the next possible date.
            -#
            -#
            -# Daniel GAMBIS
            -# Head
            -# Earth Orientation Center of IERS
            -# Observatoire de Paris, France
            diff --git a/jdk/test/sun/util/calendar/zi/tzdata/northamerica b/jdk/test/sun/util/calendar/zi/tzdata/northamerica
            index 43a0b22504b..b8caf6d019b 100644
            --- a/jdk/test/sun/util/calendar/zi/tzdata/northamerica
            +++ b/jdk/test/sun/util/calendar/zi/tzdata/northamerica
            @@ -43,7 +43,7 @@
             # Howse writes (pp 121-125) that time zones were invented by
             # Professor Charles Ferdinand Dowd (1825-1904),
             # Principal of Temple Grove Ladies' Seminary (Saratoga Springs, NY).
            -# His pamphlet ``A System of National Time for Railroads'' (1870)
            +# His pamphlet "A System of National Time for Railroads" (1870)
             # was the result of his proposals at the Convention of Railroad Trunk Lines
             # in New York City (1869-10).  His 1870 proposal was based on Washington, DC,
             # but in 1872-05 he moved the proposed origin to Greenwich.
            @@ -63,8 +63,8 @@
             
             # From Paul Eggert (2001-03-06):
             # Daylight Saving Time was first suggested as a joke by Benjamin Franklin
            -# in his whimsical essay ``An Economical Project for Diminishing the Cost
            -# of Light'' published in the Journal de Paris (1784-04-26).
            +# in his whimsical essay "An Economical Project for Diminishing the Cost
            +# of Light" published in the Journal de Paris (1784-04-26).
             # Not everyone is happy with the results:
             #
             #	I don't really care how time is reckoned so long as there is some
            @@ -190,8 +190,8 @@ Zone	PST8PDT		 -8:00	US	P%sT
             #    of the Aleutian islands.   No DST.
             
             # From Paul Eggert (1995-12-19):
            -# The tables below use `NST', not `NT', for Nome Standard Time.
            -# I invented `CAWT' for Central Alaska War Time.
            +# The tables below use 'NST', not 'NT', for Nome Standard Time.
            +# I invented 'CAWT' for Central Alaska War Time.
             
             # From U. S. Naval Observatory (1989-01-19):
             # USA  EASTERN       5 H  BEHIND UTC    NEW YORK, WASHINGTON
            @@ -260,9 +260,9 @@ Zone	PST8PDT		 -8:00	US	P%sT
             # H.R. 6, Energy Policy Act of 2005, SEC. 110. DAYLIGHT SAVINGS.
             #   (a) Amendment- Section 3(a) of the Uniform Time Act of 1966 (15
             #   U.S.C. 260a(a)) is amended--
            -#     (1) by striking `first Sunday of April' and inserting `second
            +#     (1) by striking 'first Sunday of April' and inserting 'second
             #     Sunday of March'; and
            -#     (2) by striking `last Sunday of October' and inserting `first
            +#     (2) by striking 'last Sunday of October' and inserting 'first
             #     Sunday of November'.
             #   (b) Effective Date- Subsection (a) shall take effect 1 year after the
             #   date of enactment of this Act or March 1, 2007, whichever is later.
            @@ -623,6 +623,8 @@ Zone Pacific/Honolulu	-10:31:26 -	LMT	1896 Jan 13 12:00 #Schmitt&Cox
             			-10:30	-	HST	1947 Jun  8 2:00 #Schmitt&Cox+2
             			-10:00	-	HST
             
            +Link Pacific/Honolulu Pacific/Johnston
            +
             # Now we turn to US areas that have diverged from the consensus since 1970.
             
             # Arizona mostly uses MST.
            @@ -659,8 +661,9 @@ Zone America/Phoenix	-7:28:18 -	LMT	1883 Nov 18 11:31:42
             # Navajo Nation participates in the Daylight Saving Time policy, due to its
             # large size and location in three states."  (The "only" means that other
             # tribal nations don't use DST.)
            -
            -Link America/Denver America/Shiprock
            +#
            +# From Paul Eggert (2013-08-26):
            +# See America/Denver for a zone appropriate for the Navajo Nation.
             
             # Southern Idaho (Ada, Adams, Bannock, Bear Lake, Bingham, Blaine,
             # Boise, Bonneville, Butte, Camas, Canyon, Caribou, Cassia, Clark,
            @@ -700,13 +703,13 @@ Zone America/Boise	-7:44:49 -	LMT	1883 Nov 18 12:15:11
             #   and Switzerland counties have their own time zone histories as noted below.
             #
             # Shanks partitioned Indiana into 345 regions, each with its own time history,
            -# and wrote ``Even newspaper reports present contradictory information.''
            +# and wrote "Even newspaper reports present contradictory information."
             # Those Hoosiers!  Such a flighty and changeable people!
             # Fortunately, most of the complexity occurred before our cutoff date of 1970.
             #
             # Other than Indianapolis, the Indiana place names are so nondescript
            -# that they would be ambiguous if we left them at the `America' level.
            -# So we reluctantly put them all in a subdirectory `America/Indiana'.
            +# that they would be ambiguous if we left them at the 'America' level.
            +# So we reluctantly put them all in a subdirectory 'America/Indiana'.
             
             # From Paul Eggert (2005-08-16):
             # http://www.mccsc.edu/time.html says that Indiana will use DST starting 2006.
            @@ -970,8 +973,8 @@ Zone America/Kentucky/Monticello -5:39:24 - LMT	1883 Nov 18 12:20:36
             # This story is too entertaining to be false, so go with Howse over Shanks.
             #
             # From Paul Eggert (2001-03-06):
            -# Garland (1927) writes ``Cleveland and Detroit advanced their clocks
            -# one hour in 1914.''  This change is not in Shanks.  We have no more
            +# Garland (1927) writes "Cleveland and Detroit advanced their clocks
            +# one hour in 1914."  This change is not in Shanks.  We have no more
             # info, so omit this for now.
             #
             # Most of Michigan observed DST from 1973 on, but was a bit late in 1975.
            @@ -1011,7 +1014,7 @@ Zone America/Menominee	-5:50:27 -	LMT	1885 Sep 18 12:00
             # occupied 1857/1900 by the Navassa Phosphate Co
             # US lighthouse 1917/1996-09
             # currently uninhabited
            -# see Mark Fineman, ``An Isle Rich in Guano and Discord'',
            +# see Mark Fineman, "An Isle Rich in Guano and Discord",
             # _Los Angeles Times_ (1998-11-10), A1, A10; it cites
             # Jimmy Skaggs, _The Great Guano Rush_ (1994).
             
            @@ -1045,7 +1048,7 @@ Zone America/Menominee	-5:50:27 -	LMT	1885 Sep 18 12:00
             #	Milne J. Civil time. Geogr J. 1899 Feb;13(2):173-94
             #	.
             #
            -# See the `europe' file for Greenland.
            +# See the 'europe' file for Greenland.
             
             # Canada
             
            @@ -1246,7 +1249,7 @@ Zone America/St_Johns	-3:30:52 -	LMT	1884
             
             # most of east Labrador
             
            -# The name `Happy Valley-Goose Bay' is too long; use `Goose Bay'.
            +# The name 'Happy Valley-Goose Bay' is too long; use 'Goose Bay'.
             # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
             Zone America/Goose_Bay	-4:01:40 -	LMT	1884 # Happy Valley-Goose Bay
             			-3:30:52 -	NST	1918
            @@ -1363,25 +1366,27 @@ Zone America/Moncton	-4:19:08 -	LMT	1883 Dec  9
             
             # Quebec
             
            -# From Paul Eggert (2006-07-09):
            -# Shanks & Pottenger write that since 1970 most of Quebec has been
            -# like Montreal.
            +# From Paul Eggert (2013-08-30):
            +# Since 1970 most of Quebec has been like Toronto.
            +# However, because earlier versions of the tz database mistakenly relied on data
            +# from Shanks & Pottenger saying that Quebec differed from Ontario after 1970,
            +# a separate entry was created for most of Quebec.  We're loath to lose
            +# its pre-1970 info, even though the tz database is normally limited to
            +# zones that differ after 1970, so keep this otherwise out-of-scope entry.
             
            -# From Paul Eggert (2006-06-27):
             # Matthews and Vincent (1998) also write that Quebec east of the -63
             # meridian is supposed to observe AST, but residents as far east as
             # Natashquan use EST/EDT, and residents east of Natashquan use AST.
            -# In "Official time in Quebec" the Quebec department of justice writes in
            -# http://www.justice.gouv.qc.ca/english/publications/generale/temps-regl-1-a.htm
            -# that "The residents of the Municipality of the
            -# Cote-Nord-du-Golfe-Saint-Laurent and the municipalities of Saint-Augustin,
            -# Bonne-Esperance and Blanc-Sablon apply the Official Time Act as it is
            -# written and use Atlantic standard time all year round. The same applies to
            -# the residents of the Native facilities along the lower North Shore."
            -# 
            +# The Quebec department of justice writes in
            +# "The situation in Minganie and Basse-Cote-Nord"
            +# http://www.justice.gouv.qc.ca/english/publications/generale/temps-minganie-a.htm
            +# that the coastal strip from just east of Natashquan to Blanc-Sablon
            +# observes Atlantic standard time all year round.
            +# http://www.assnat.qc.ca/Media/Process.aspx?MediaId=ANQ.Vigie.Bll.DocumentGenerique_8845en
             # says this common practice was codified into law as of 2007.
             # For lack of better info, guess this practice began around 1970, contra to
             # Shanks & Pottenger who have this region observing AST/ADT.
            +# for post-1970 data America/Puerto_Rico.
             
             # Rule	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER/S
             Rule	Mont	1917	only	-	Mar	25	2:00	1:00	D
            @@ -1425,7 +1430,6 @@ Zone America/Montreal	-4:54:16 -	LMT	1884
             			-5:00	Mont	E%sT	1974
             			-5:00	Canada	E%sT
             
            -
             # Ontario
             
             # From Paul Eggert (2006-07-09):
            @@ -1644,7 +1648,7 @@ Zone America/Thunder_Bay -5:57:00 -	LMT	1895
             			-6:00	-	CST	1910
             			-5:00	-	EST	1942
             			-5:00	Canada	E%sT	1970
            -			-5:00	Mont	E%sT	1973
            +			-5:00	Toronto	E%sT	1973
             			-5:00	-	EST	1974
             			-5:00	Canada	E%sT
             Zone America/Nipigon	-5:53:04 -	LMT	1895
            @@ -2231,7 +2235,7 @@ Zone America/Dawson	-9:17:40 -	LMT	1900 Aug 20
             # From Paul Eggert (1996-06-12):
             # For an English translation of the decree, see
             # 
            -# ``Diario Oficial: Time Zone Changeover'' (1996-01-04).
            +# "Diario Oficial: Time Zone Changeover" (1996-01-04).
             # 
             
             # From Rives McDow (1998-10-08):
            @@ -2568,9 +2572,7 @@ Zone America/Santa_Isabel	-7:39:28 -	LMT	1922 Jan  1  0:20:32
             ###############################################################################
             
             # Anguilla
            -# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
            -Zone America/Anguilla	-4:12:16 -	LMT	1912 Mar 2
            -			-4:00	-	AST
            +# See 'southamerica'.
             
             # Antigua and Barbuda
             # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
            @@ -2639,13 +2641,13 @@ Zone	America/Belize	-5:52:48 -	LMT	1912 Apr
             # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
             Zone Atlantic/Bermuda	-4:19:18 -	LMT	1930 Jan  1 2:00    # Hamilton
             			-4:00	-	AST	1974 Apr 28 2:00
            -			-4:00	Bahamas	A%sT	1976
            +			-4:00	Canada	A%sT	1976
             			-4:00	US	A%sT
             
             # Cayman Is
             # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
             Zone	America/Cayman	-5:25:32 -	LMT	1890		# Georgetown
            -			-5:07:12 -	KMT	1912 Feb    # Kingston Mean Time
            +			-5:07:11 -	KMT	1912 Feb    # Kingston Mean Time
             			-5:00	-	EST
             
             # Costa Rica
            @@ -2660,7 +2662,7 @@ Rule	CR	1991	1992	-	Jan	Sat>=15	0:00	1:00	D
             # go with Shanks & Pottenger.
             Rule	CR	1991	only	-	Jul	 1	0:00	0	S
             Rule	CR	1992	only	-	Mar	15	0:00	0	S
            -# There are too many San Joses elsewhere, so we'll use `Costa Rica'.
            +# There are too many San Joses elsewhere, so we'll use 'Costa Rica'.
             # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
             Zone America/Costa_Rica	-5:36:13 -	LMT	1890		# San Jose
             			-5:36:13 -	SJMT	1921 Jan 15 # San Jose Mean Time
            @@ -2892,9 +2894,7 @@ Zone	America/Havana	-5:29:28 -	LMT	1890
             			-5:00	Cuba	C%sT
             
             # Dominica
            -# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
            -Zone America/Dominica	-4:05:36 -	LMT	1911 Jul 1 0:01		# Roseau
            -			-4:00	-	AST
            +# See 'southamerica'.
             
             # Dominican Republic
             
            @@ -2943,18 +2943,10 @@ Zone America/El_Salvador -5:56:48 -	LMT	1921		# San Salvador
             			-6:00	Salv	C%sT
             
             # Grenada
            -# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
            -Zone	America/Grenada	-4:07:00 -	LMT	1911 Jul	# St George's
            -			-4:00	-	AST
            -
             # Guadeloupe
            -# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
            -Zone America/Guadeloupe	-4:06:08 -	LMT	1911 Jun 8	# Pointe a Pitre
            -			-4:00	-	AST
             # St Barthelemy
            -Link America/Guadeloupe	America/St_Barthelemy
             # St Martin (French part)
            -Link America/Guadeloupe	America/Marigot
            +# See 'southamerica'.
             
             # Guatemala
             #
            @@ -3097,17 +3089,12 @@ Zone America/Tegucigalpa -5:48:52 -	LMT	1921 Apr
             # Great Swan I ceded by US to Honduras in 1972
             
             # Jamaica
            -
            -# From Bob Devine (1988-01-28):
            -# Follows US rules.
            -
            -# From U. S. Naval Observatory (1989-01-19):
            -# JAMAICA             5 H  BEHIND UTC
            -
            -# From Shanks & Pottenger:
            +# Shanks & Pottenger give -5:07:12, but Milne records -5:07:10.41 from an
            +# unspecified official document, and says "This time is used throughout the
            +# island".  Go with Milne.  Round to the nearest second as required by zic.
             # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
            -Zone	America/Jamaica	-5:07:12 -	LMT	1890		# Kingston
            -			-5:07:12 -	KMT	1912 Feb    # Kingston Mean Time
            +Zone	America/Jamaica	-5:07:11 -	LMT	1890		# Kingston
            +			-5:07:11 -	KMT	1912 Feb    # Kingston Mean Time
             			-5:00	-	EST	1974 Apr 28 2:00
             			-5:00	US	E%sT	1984
             			-5:00	-	EST
            @@ -3121,12 +3108,7 @@ Zone America/Martinique	-4:04:20 -      LMT	1890		# Fort-de-France
             			-4:00	-	AST
             
             # Montserrat
            -# From Paul Eggert (2006-03-22):
            -# In 1995 volcanic eruptions forced evacuation of Plymouth, the capital.
            -# world.gazetteer.com says Cork Hill is the most populous location now.
            -# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
            -Zone America/Montserrat	-4:08:52 -	LMT	1911 Jul 1 0:01   # Cork Hill
            -			-4:00	-	AST
            +# See 'southamerica'.
             
             # Nicaragua
             #
            @@ -3200,7 +3182,7 @@ Zone	America/Panama	-5:18:08 -	LMT	1890
             			-5:00	-	EST
             
             # Puerto Rico
            -# There are too many San Juans elsewhere, so we'll use `Puerto_Rico'.
            +# There are too many San Juans elsewhere, so we'll use 'Puerto_Rico'.
             # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
             Zone America/Puerto_Rico -4:24:25 -	LMT	1899 Mar 28 12:00    # San Juan
             			-4:00	-	AST	1942 May  3
            @@ -3208,18 +3190,11 @@ Zone America/Puerto_Rico -4:24:25 -	LMT	1899 Mar 28 12:00    # San Juan
             			-4:00	-	AST
             
             # St Kitts-Nevis
            -# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
            -Zone America/St_Kitts	-4:10:52 -	LMT	1912 Mar 2	# Basseterre
            -			-4:00	-	AST
            -
             # St Lucia
            -# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
            -Zone America/St_Lucia	-4:04:00 -	LMT	1890		# Castries
            -			-4:04:00 -	CMT	1912	    # Castries Mean Time
            -			-4:00	-	AST
            +# See 'southamerica'.
             
             # St Pierre and Miquelon
            -# There are too many St Pierres elsewhere, so we'll use `Miquelon'.
            +# There are too many St Pierres elsewhere, so we'll use 'Miquelon'.
             # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
             Zone America/Miquelon	-3:44:40 -	LMT	1911 May 15	# St Pierre
             			-4:00	-	AST	1980 May
            @@ -3227,10 +3202,7 @@ Zone America/Miquelon	-3:44:40 -	LMT	1911 May 15	# St Pierre
             			-3:00	Canada	PM%sT
             
             # St Vincent and the Grenadines
            -# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
            -Zone America/St_Vincent	-4:04:56 -	LMT	1890		# Kingstown
            -			-4:04:56 -	KMT	1912	   # Kingstown Mean Time
            -			-4:00	-	AST
            +# See 'southamerica'.
             
             # Turks and Caicos
             #
            @@ -3260,15 +3232,9 @@ Rule	TC	2007	max	-	Mar	Sun>=8	2:00	1:00	D
             Rule	TC	2007	max	-	Nov	Sun>=1	2:00	0	S
             # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
             Zone America/Grand_Turk	-4:44:32 -	LMT	1890
            -			-5:07:12 -	KMT	1912 Feb    # Kingston Mean Time
            +			-5:07:11 -	KMT	1912 Feb    # Kingston Mean Time
             			-5:00	TC	E%sT
             
             # British Virgin Is
            -# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
            -Zone America/Tortola	-4:18:28 -	LMT	1911 Jul    # Road Town
            -			-4:00	-	AST
            -
             # Virgin Is
            -# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
            -Zone America/St_Thomas	-4:19:44 -	LMT	1911 Jul    # Charlotte Amalie
            -			-4:00	-	AST
            +# See 'southamerica'.
            diff --git a/jdk/test/sun/util/calendar/zi/tzdata/southamerica b/jdk/test/sun/util/calendar/zi/tzdata/southamerica
            index e7df18ad2c3..2230d066661 100644
            --- a/jdk/test/sun/util/calendar/zi/tzdata/southamerica
            +++ b/jdk/test/sun/util/calendar/zi/tzdata/southamerica
            @@ -474,6 +474,17 @@ Rule	Arg	2008	only	-	Oct	Sun>=15	0:00	1:00	S
             # rules...San Luis is still using "Western ARgentina Time" and it got
             # stuck on Summer daylight savings time even though the summer is over.
             
            +# From Paul Eggert (2013-09-05):
            +# Perhaps San Luis operates on the legal fiction that it is at UTC-4
            +# with perpetual summer time, but ordinary usage typically seems to
            +# just say it's at UTC-3; see, for example,
            +# .
            +# We've documented similar situations as being plain changes to
            +# standard time, so let's do that here too.  This does not change UTC
            +# offsets, only tm_isdst and the time zone abbreviations.  One minor
            +# plus is that this silences a zic complaint that there's no POSIX TZ
            +# setting for time stamps past 2038.
            +
             # From Paul Eggert (2013-02-21):
             # Milne says Cordoba time was -4:16:48.2.  Round to the nearest second.
             
            @@ -611,7 +622,7 @@ Zone America/Argentina/Mendoza -4:35:16 - LMT	1894 Oct 31
             # San Luis (SL)
             
             Rule	SanLuis	2008	2009	-	Mar	Sun>=8	0:00	0	-
            -Rule	SanLuis	2007	2009	-	Oct	Sun>=8	0:00	1:00	S
            +Rule	SanLuis	2007	2008	-	Oct	Sun>=8	0:00	1:00	S
             
             Zone America/Argentina/San_Luis -4:25:24 - LMT	1894 Oct 31
             			-4:16:48 -	CMT	1920 May
            @@ -627,7 +638,8 @@ Zone America/Argentina/San_Luis -4:25:24 - LMT	1894 Oct 31
             			-3:00	-	ART	2004 May 31
             			-4:00	-	WART	2004 Jul 25
             			-3:00	Arg	AR%sT	2008 Jan 21
            -			-4:00	SanLuis	WAR%sT
            +			-4:00	SanLuis	WAR%sT	2009 Oct 11
            +			-3:00	-	ART
             #
             # Santa Cruz (SC)
             Zone America/Argentina/Rio_Gallegos -4:36:52 - LMT 1894 Oct 31
            @@ -654,10 +666,7 @@ Zone America/Argentina/Ushuaia -4:33:12 - LMT 1894 Oct 31
             			-3:00	-	ART
             
             # Aruba
            -# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
            -Zone	America/Aruba	-4:40:24 -	LMT	1912 Feb 12	# Oranjestad
            -			-4:30	-	ANT	1965 # Netherlands Antilles Time
            -			-4:00	-	AST
            +Link America/Curacao America/Aruba
             
             # Bolivia
             # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
            @@ -859,6 +868,12 @@ Zone	America/La_Paz	-4:32:36 -	LMT	1890
             # Tocantins state will have DST.
             # http://noticias.terra.com.br/brasil/noticias/0,,OI6232536-EI306.html
             
            +# From Steffen Thorsen (2013-09-20):
            +# Tocantins in Brazil is very likely not to observe DST from October....
            +# http://conexaoto.com.br/2013/09/18/ministerio-confirma-que-tocantins-esta-fora-do-horario-de-verao-em-2013-mas-falta-publicacao-de-decreto
            +# We will keep this article updated when this is confirmed:
            +# http://www.timeanddate.com/news/time/brazil-starts-dst-2013.html
            +
             # Rule	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER/S
             # Decree 20,466 (1931-10-01)
             # Decree 21,896 (1932-01-10)
            @@ -1078,7 +1093,8 @@ Zone America/Araguaina	-3:12:48 -	LMT	1914
             			-3:00	-	BRT	1995 Sep 14
             			-3:00	Brazil	BR%sT	2003 Sep 24
             			-3:00	-	BRT	2012 Oct 21
            -			-3:00	Brazil	BR%sT
            +			-3:00	Brazil	BR%sT	2013 Sep
            +			-3:00	-	BRT
             #
             # Alagoas (AL), Sergipe (SE)
             Zone America/Maceio	-2:22:52 -	LMT	1914
            @@ -1373,12 +1389,12 @@ Zone	America/Curacao	-4:35:47 -	LMT	1912 Feb 12	# Willemstad
             			-4:00	-	AST
             
             # From Arthur David Olson (2011-06-15):
            -# At least for now, use links for places with new iso3166 codes.
            +# use links for places with new iso3166 codes.
             # The name "Lower Prince's Quarter" is both longer than fourteen charaters
             # and contains an apostrophe; use "Lower_Princes" below.
             
            -Link	America/Curacao	America/Lower_Princes # Sint Maarten
            -Link	America/Curacao	America/Kralendijk # Bonaire, Sint Estatius and Saba
            +Link	America/Curacao	America/Lower_Princes	# Sint Maarten
            +Link	America/Curacao	America/Kralendijk	# Caribbean Netherlands
             
             # Ecuador
             #
            @@ -1519,10 +1535,16 @@ Zone	America/Guyana	-3:52:40 -	LMT	1915 Mar	# Georgetown
             			-4:00	-	GYT
             
             # Paraguay
            +#
             # From Paul Eggert (2006-03-22):
             # Shanks & Pottenger say that spring transitions are from 01:00 -> 02:00,
             # and autumn transitions are from 00:00 -> 23:00.  Go with pre-1999
             # editions of Shanks, and with the IATA, who say transitions occur at 00:00.
            +#
            +# From Waldemar Villamayor-Venialbo (2013-09-20):
            +# No time of the day is established for the adjustment, so people normally
            +# adjust their clocks at 0 hour of the given dates.
            +#
             # Rule	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER/S
             Rule	Para	1975	1988	-	Oct	 1	0:00	1:00	S
             Rule	Para	1975	1978	-	Mar	 1	0:00	0	-
            @@ -1656,6 +1678,19 @@ Zone America/Paramaribo	-3:40:40 -	LMT	1911
             Zone America/Port_of_Spain -4:06:04 -	LMT	1912 Mar 2
             			-4:00	-	AST
             
            +Link America/Port_of_Spain America/Anguilla
            +Link America/Port_of_Spain America/Dominica
            +Link America/Port_of_Spain America/Grenada
            +Link America/Port_of_Spain America/Guadeloupe
            +Link America/Port_of_Spain America/Marigot
            +Link America/Port_of_Spain America/Montserrat
            +Link America/Port_of_Spain America/St_Barthelemy
            +Link America/Port_of_Spain America/St_Kitts
            +Link America/Port_of_Spain America/St_Lucia
            +Link America/Port_of_Spain America/St_Thomas
            +Link America/Port_of_Spain America/St_Vincent
            +Link America/Port_of_Spain America/Tortola
            +
             # Uruguay
             # From Paul Eggert (1993-11-18):
             # Uruguay wins the prize for the strangest peacetime manipulation of the rules.
            @@ -1673,7 +1708,7 @@ Rule	Uruguay	1937	1941	-	Mar	lastSun	 0:00	0	-
             # Whitman gives 1937 Oct 3; go with Shanks & Pottenger.
             Rule	Uruguay	1937	1940	-	Oct	lastSun	 0:00	0:30	HS
             # Whitman gives 1941 Oct 24 - 1942 Mar 27, 1942 Dec 14 - 1943 Apr 13,
            -# and 1943 Apr 13 ``to present time''; go with Shanks & Pottenger.
            +# and 1943 Apr 13 "to present time"; go with Shanks & Pottenger.
             Rule	Uruguay	1941	only	-	Aug	 1	 0:00	0:30	HS
             Rule	Uruguay	1942	only	-	Jan	 1	 0:00	0	-
             Rule	Uruguay	1942	only	-	Dec	14	 0:00	1:00	S
            diff --git a/jdk/test/sun/util/calendar/zi/tzdata/zone.tab b/jdk/test/sun/util/calendar/zi/tzdata/zone.tab
            index aa247c26df8..b34cdb0dc7d 100644
            --- a/jdk/test/sun/util/calendar/zi/tzdata/zone.tab
            +++ b/jdk/test/sun/util/calendar/zi/tzdata/zone.tab
            @@ -26,27 +26,30 @@
             # This file is in the public domain, so clarified as of
             # 2009-05-17 by Arthur David Olson.
             #
            -# From Paul Eggert (2013-05-27):
            +# From Paul Eggert (2013-08-14):
             #
            -# This file contains a table with the following columns:
            -# 1.  ISO 3166 2-character country code.  See the file `iso3166.tab'.
            -#     This identifies a country that overlaps the zone.  The country may
            -#     overlap other zones and the zone may overlap other countries.
            -# 2.  Latitude and longitude of the zone's principal location
            +# This file contains a table where each row stands for an area that is
            +# the intersection of a region identified by a country code and of a
            +# zone where civil clocks have agreed since 1970.  The columns of the
            +# table are as follows:
            +#
            +# 1.  ISO 3166 2-character country code.  See the file 'iso3166.tab'.
            +# 2.  Latitude and longitude of the area's principal location
             #     in ISO 6709 sign-degrees-minutes-seconds format,
             #     either +-DDMM+-DDDMM or +-DDMMSS+-DDDMMSS,
             #     first latitude (+ is north), then longitude (+ is east).
            -#     This location need not lie within the column-1 country.
             # 3.  Zone name used in value of TZ environment variable.
             #     Please see the 'Theory' file for how zone names are chosen.
            +#     If multiple zones overlap a country, each has a row in the
            +#     table, with column 1 being duplicated.
             # 4.  Comments; present if and only if the country has multiple rows.
             #
             # Columns are separated by a single tab.
             # The table is sorted first by country, then an order within the country that
             # (1) makes some geographical sense, and
            -# (2) puts the most populous zones first, where that does not contradict (1).
            +# (2) puts the most populous areas first, where that does not contradict (1).
             #
            -# Lines beginning with `#' are comments.
            +# Lines beginning with '#' are comments.
             #
             # This table is intended as an aid for users, to help them select time
             # zone data appropriate for their practical needs.  It is not intended
            @@ -62,8 +65,7 @@ AI	+1812-06304	America/Anguilla
             AL	+4120+01950	Europe/Tirane
             AM	+4011+04430	Asia/Yerevan
             AO	-0848+01314	Africa/Luanda
            -AQ	-7750+16636	Antarctica/McMurdo	McMurdo Station, Ross Island
            -AQ	-9000+00000	Antarctica/South_Pole	Amundsen-Scott Station, South Pole
            +AQ	-7750+16636	Antarctica/McMurdo	McMurdo, South Pole, Scott (New Zealand time)
             AQ	-6734-06808	Antarctica/Rothera	Rothera Station, Adelaide Island
             AQ	-6448-06406	Antarctica/Palmer	Palmer Station, Anvers Island
             AQ	-6736+06253	Antarctica/Mawson	Mawson Station, Holme Bay
            @@ -143,8 +145,7 @@ CA	+4612-05957	America/Glace_Bay	Atlantic Time - Nova Scotia - places that did n
             CA	+4606-06447	America/Moncton	Atlantic Time - New Brunswick
             CA	+5320-06025	America/Goose_Bay	Atlantic Time - Labrador - most locations
             CA	+5125-05707	America/Blanc-Sablon	Atlantic Standard Time - Quebec - Lower North Shore
            -CA	+4531-07334	America/Montreal	Eastern Time - Quebec - most locations
            -CA	+4339-07923	America/Toronto	Eastern Time - Ontario - most locations
            +CA	+4339-07923	America/Toronto	Eastern Time - Ontario & Quebec - most locations
             CA	+4901-08816	America/Nipigon	Eastern Time - Ontario & Quebec - places that did not observe DST 1967-1973
             CA	+4823-08915	America/Thunder_Bay	Eastern Time - Thunder Bay, Ontario
             CA	+6344-06828	America/Iqaluit	Eastern Time - east Nunavut - most locations
            @@ -255,7 +256,7 @@ IR	+3540+05126	Asia/Tehran
             IS	+6409-02151	Atlantic/Reykjavik
             IT	+4154+01229	Europe/Rome
             JE	+4912-00207	Europe/Jersey
            -JM	+1800-07648	America/Jamaica
            +JM	+175805-0764736	America/Jamaica
             JO	+3157+03556	Asia/Amman
             JP	+353916+1394441	Asia/Tokyo
             KE	-0117+03649	Africa/Nairobi
            @@ -444,8 +445,7 @@ US	+465042-1012439	America/North_Dakota/New_Salem	Central Time - North Dakota -
             US	+471551-1014640	America/North_Dakota/Beulah	Central Time - North Dakota - Mercer County
             US	+394421-1045903	America/Denver	Mountain Time
             US	+433649-1161209	America/Boise	Mountain Time - south Idaho & east Oregon
            -US	+364708-1084111	America/Shiprock	Mountain Time - Navajo
            -US	+332654-1120424	America/Phoenix	Mountain Standard Time - Arizona
            +US	+332654-1120424	America/Phoenix	Mountain Standard Time - Arizona (except Navajo)
             US	+340308-1181434	America/Los_Angeles	Pacific Time
             US	+611305-1495401	America/Anchorage	Alaska Time
             US	+581807-1342511	America/Juneau	Alaska Time - Alaska panhandle
            
            From 63f8dbc1d382d52ca8b2711d4c8dc22265d26865 Mon Sep 17 00:00:00 2001
            From: Henry Jen 
            Date: Wed, 16 Oct 2013 21:34:26 -0700
            Subject: [PATCH 127/131] 8026768: java.util.Map.Entry comparingBy methods
             missing @since 1.8
            
            Reviewed-by: dholmes
            ---
             jdk/src/share/classes/java/util/Map.java | 45 +++++++++++++-----------
             1 file changed, 25 insertions(+), 20 deletions(-)
            
            diff --git a/jdk/src/share/classes/java/util/Map.java b/jdk/src/share/classes/java/util/Map.java
            index d1695ef23ee..d67e58db248 100644
            --- a/jdk/src/share/classes/java/util/Map.java
            +++ b/jdk/src/share/classes/java/util/Map.java
            @@ -465,6 +465,7 @@ public interface Map {
                      * @param   the type of the map values
                      * @return a comparator that compares {@link Map.Entry} in natural order on key.
                      * @see Comparable
            +         * @since 1.8
                      */
                     public static , V> Comparator> comparingByKey() {
                         return (Comparator> & Serializable)
            @@ -481,6 +482,7 @@ public interface Map {
                      * @param  the {@link Comparable} type of the map values
                      * @return a comparator that compares {@link Map.Entry} in natural order on value.
                      * @see Comparable
            +         * @since 1.8
                      */
                     public static > Comparator> comparingByValue() {
                         return (Comparator> & Serializable)
            @@ -498,6 +500,7 @@ public interface Map {
                      * @param   the type of the map values
                      * @param  cmp the key {@link Comparator}
                      * @return a comparator that compares {@link Map.Entry} by the key.
            +         * @since 1.8
                      */
                     public static  Comparator> comparingByKey(Comparator cmp) {
                         Objects.requireNonNull(cmp);
            @@ -516,6 +519,7 @@ public interface Map {
                      * @param   the type of the map values
                      * @param  cmp the value {@link Comparator}
                      * @return a comparator that compares {@link Map.Entry} by the value.
            +         * @since 1.8
                      */
                     public static  Comparator> comparingByValue(Comparator cmp) {
                         Objects.requireNonNull(cmp);
            @@ -558,26 +562,27 @@ public interface Map {
                 // Defaultable methods
             
                 /**
            -    *  Returns the value to which the specified key is mapped,
            -    *  or {@code defaultValue} if this map contains no mapping
            -    *  for the key.
            -    *
            -    * 

            The default implementation makes no guarantees about synchronization - * or atomicity properties of this method. Any implementation providing - * atomicity guarantees must override this method and document its - * concurrency properties. - * - * @param key the key whose associated value is to be returned - * @param defaultValue the default mapping of the key - * @return the value to which the specified key is mapped, or - * {@code defaultValue} if this map contains no mapping for the key - * @throws ClassCastException if the key is of an inappropriate type for - * this map - * (optional) - * @throws NullPointerException if the specified key is null and this map - * does not permit null keys - * (optional) - */ + * Returns the value to which the specified key is mapped, + * or {@code defaultValue} if this map contains no mapping + * for the key. + * + *

            The default implementation makes no guarantees about synchronization + * or atomicity properties of this method. Any implementation providing + * atomicity guarantees must override this method and document its + * concurrency properties. + * + * @param key the key whose associated value is to be returned + * @param defaultValue the default mapping of the key + * @return the value to which the specified key is mapped, or + * {@code defaultValue} if this map contains no mapping for the key + * @throws ClassCastException if the key is of an inappropriate type for + * this map + * (optional) + * @throws NullPointerException if the specified key is null and this map + * does not permit null keys + * (optional) + * @since 1.8 + */ default V getOrDefault(Object key, V defaultValue) { V v; return (((v = get(key)) != null) || containsKey(key)) From 26af18b4267e76d506f36e7d921c47df1bee8cb8 Mon Sep 17 00:00:00 2001 From: Yuka Kamiya Date: Thu, 17 Oct 2013 13:57:42 +0900 Subject: [PATCH 128/131] 8025703: Update LSR datafile for BCP 47 Reviewed-by: okutsu --- .../sun/util/locale/LocaleEquivalentMaps.java | 14 +- jdk/test/java/util/Locale/Bug8025703.java | 71 ++ .../Locale/tools/language-subtag-registry.txt | 707 +++++++++++++++++- 3 files changed, 763 insertions(+), 29 deletions(-) create mode 100644 jdk/test/java/util/Locale/Bug8025703.java diff --git a/jdk/src/share/classes/sun/util/locale/LocaleEquivalentMaps.java b/jdk/src/share/classes/sun/util/locale/LocaleEquivalentMaps.java index 3133fd34ba7..64638d03913 100644 --- a/jdk/src/share/classes/sun/util/locale/LocaleEquivalentMaps.java +++ b/jdk/src/share/classes/sun/util/locale/LocaleEquivalentMaps.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -43,7 +43,9 @@ final class LocaleEquivalentMaps { regionVariantEquivMap = new HashMap<>(); // This is an auto-generated file and should not be manually edited. - // LSR Revision: 2012-09-04 + // LSR Revision: 2013-09-23 + singleEquivMap.put("acn", "xia"); + singleEquivMap.put("adx", "pcr"); singleEquivMap.put("ami", "i-ami"); singleEquivMap.put("art-lojban", "jbo"); singleEquivMap.put("ase", "sgn-us"); @@ -52,6 +54,7 @@ final class LocaleEquivalentMaps { singleEquivMap.put("bjd", "drl"); singleEquivMap.put("bnn", "i-bnn"); singleEquivMap.put("bzs", "sgn-br"); + singleEquivMap.put("cir", "meg"); singleEquivMap.put("cjr", "mom"); singleEquivMap.put("cka", "cmr"); singleEquivMap.put("cmk", "xch"); @@ -65,6 +68,7 @@ final class LocaleEquivalentMaps { singleEquivMap.put("dse", "sgn-nl"); singleEquivMap.put("dsl", "sgn-dk"); singleEquivMap.put("fsl", "sgn-fr"); + singleEquivMap.put("gal", "ilw"); singleEquivMap.put("gan", "zh-gan"); singleEquivMap.put("gav", "dev"); singleEquivMap.put("gsg", "sgn-de"); @@ -84,6 +88,7 @@ final class LocaleEquivalentMaps { singleEquivMap.put("i-tsu", "tsu"); singleEquivMap.put("ibi", "opa"); singleEquivMap.put("id", "in"); + singleEquivMap.put("ilw", "gal"); singleEquivMap.put("in", "id"); singleEquivMap.put("ise", "sgn-it"); singleEquivMap.put("isg", "sgn-ie"); @@ -100,6 +105,7 @@ final class LocaleEquivalentMaps { singleEquivMap.put("lb", "i-lux"); singleEquivMap.put("lcq", "ppr"); singleEquivMap.put("lrr", "yma"); + singleEquivMap.put("meg", "cir"); singleEquivMap.put("mfs", "sgn-mx"); singleEquivMap.put("mo", "ro"); singleEquivMap.put("mom", "cjr"); @@ -113,6 +119,7 @@ final class LocaleEquivalentMaps { singleEquivMap.put("nun", "ayx"); singleEquivMap.put("nv", "i-navajo"); singleEquivMap.put("opa", "ibi"); + singleEquivMap.put("pcr", "adx"); singleEquivMap.put("ppr", "lcq"); singleEquivMap.put("psr", "sgn-pt"); singleEquivMap.put("pwn", "i-pwn"); @@ -158,8 +165,10 @@ final class LocaleEquivalentMaps { singleEquivMap.put("weo", "tlw"); singleEquivMap.put("wuu", "zh-wuu"); singleEquivMap.put("xch", "cmk"); + singleEquivMap.put("xia", "acn"); singleEquivMap.put("yi", "ji"); singleEquivMap.put("yma", "lrr"); + singleEquivMap.put("yos", "zom"); singleEquivMap.put("yue", "zh-yue"); singleEquivMap.put("zh-cmn-hans", "cmn-hans"); singleEquivMap.put("zh-cmn-hant", "cmn-hant"); @@ -168,6 +177,7 @@ final class LocaleEquivalentMaps { singleEquivMap.put("zh-wuu", "wuu"); singleEquivMap.put("zh-xiang", "hsn"); singleEquivMap.put("zh-yue", "yue"); + singleEquivMap.put("zom", "yos"); multiEquivsMap.put("ccq", new String[] {"rki", "ybd"}); multiEquivsMap.put("cmn", new String[] {"zh-guoyu", "zh-cmn"}); diff --git a/jdk/test/java/util/Locale/Bug8025703.java b/jdk/test/java/util/Locale/Bug8025703.java new file mode 100644 index 00000000000..8a694aecb7b --- /dev/null +++ b/jdk/test/java/util/Locale/Bug8025703.java @@ -0,0 +1,71 @@ +/* + * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @bug 8025703 + * @summary Verify implementation for Locale matching. + * @run main Bug8025703 + */ + +import java.util.*; +import java.util.Locale.LanguageRange; + +public class Bug8025703 { + + public static void main(String[] args) { + boolean err = false; + + String[][] mappings = {{"ilw", "gal"}, + {"meg", "cir"}, + {"pcr", "adx"}, + {"xia", "acn"}, + {"yos", "zom"}}; + + for (int i = 0; i < mappings.length; i++) { + List got = LanguageRange.parse(mappings[i][0]); + ArrayList expected = new ArrayList<>(); + expected.add(new LanguageRange(mappings[i][0], 1.0)); + expected.add(new LanguageRange(mappings[i][1], 1.0)); + + if (!expected.equals(got)) { + err = true; + System.err.println("Incorrect language ranges. "); + for (LanguageRange lr : expected) { + System.err.println(" Expected: range=" + + lr.getRange() + ", weight=" + lr.getWeight()); + } + for (LanguageRange lr : got) { + System.err.println(" Got: range=" + + lr.getRange() + ", weight=" + lr.getWeight()); + } + } + } + + if (err) { + throw new RuntimeException("Failed."); + } + } + +} + diff --git a/jdk/test/java/util/Locale/tools/language-subtag-registry.txt b/jdk/test/java/util/Locale/tools/language-subtag-registry.txt index d7e1d33c182..916cb101389 100644 --- a/jdk/test/java/util/Locale/tools/language-subtag-registry.txt +++ b/jdk/test/java/util/Locale/tools/language-subtag-registry.txt @@ -1,4 +1,4 @@ -File-Date: 2012-09-04 +File-Date: 2013-09-23 %% Type: language Subtag: aa @@ -3103,7 +3103,7 @@ Added: 2009-07-29 %% Type: language Subtag: asj -Description: Nsari +Description: Sari Added: 2009-07-29 %% Type: language @@ -3622,13 +3622,18 @@ Description: Yaka (Central African Republic) Added: 2009-07-29 %% Type: language +Subtag: axl +Description: Lower Southern Aranda +Added: 2013-09-10 +%% +Type: language Subtag: axm Description: Middle Armenian Added: 2009-07-29 %% Type: language Subtag: axx -Description: Xaragure +Description: Xârâgurè Added: 2009-07-29 %% Type: language @@ -5021,6 +5026,11 @@ Description: Mid-Southern Banda Added: 2009-07-29 %% Type: language +Subtag: bjp +Description: Fanamaket +Added: 2013-09-10 +%% +Type: language Subtag: bjq Description: Southern Betsimisaraka Malagasy Added: 2009-07-29 @@ -5705,7 +5715,7 @@ Added: 2009-07-29 %% Type: language Subtag: bpa -Description: Dakaka +Description: Daakaka Added: 2009-07-29 %% Type: language @@ -5741,6 +5751,7 @@ Added: 2009-07-29 Type: language Subtag: bpk Description: Orowe +Description: 'Ôrôê Added: 2009-07-29 %% Type: language @@ -5831,6 +5842,7 @@ Added: 2009-07-29 Type: language Subtag: bqc Description: Boko (Benin) +Description: Boo Added: 2009-07-29 %% Type: language @@ -6523,6 +6535,11 @@ Description: Bolgo Added: 2009-07-29 %% Type: language +Subtag: bvp +Description: Bumang +Added: 2013-09-10 +%% +Type: language Subtag: bvq Description: Birri Added: 2009-07-29 @@ -6696,7 +6713,7 @@ Added: 2009-07-29 %% Type: language Subtag: bxa -Description: Bauro +Description: Tairaha Added: 2009-07-29 %% Type: language @@ -6722,7 +6739,9 @@ Added: 2009-07-29 Type: language Subtag: bxf Description: Bilur +Description: Minigir Added: 2009-07-29 +Comments: see also vmg %% Type: language Subtag: bxg @@ -7054,7 +7073,7 @@ Added: 2009-07-29 %% Type: language Subtag: bzv -Description: Bebe +Description: Naami Added: 2009-07-29 %% Type: language @@ -7700,6 +7719,8 @@ Added: 2009-07-29 Type: language Subtag: cir Description: Tiri +Description: Haméa +Description: Méa Added: 2009-07-29 %% Type: language @@ -7805,6 +7826,11 @@ Description: Cibak Added: 2009-07-29 %% Type: language +Subtag: ckn +Description: Kaang Chin +Added: 2013-09-10 +%% +Type: language Subtag: cko Description: Anufo Added: 2009-07-29 @@ -8229,6 +8255,11 @@ Description: Cherepon Added: 2009-07-29 %% Type: language +Subtag: cpo +Description: Kpeego +Added: 2013-09-10 +%% +Type: language Subtag: cpp Description: Portuguese-based creoles and pidgins Added: 2005-10-16 @@ -8441,6 +8472,11 @@ Description: Coast Miwok Added: 2009-07-29 %% Type: language +Subtag: csj +Description: Songlai Chin +Added: 2013-09-10 +%% +Type: language Subtag: csk Description: Jola-Kasa Added: 2009-07-29 @@ -8800,6 +8836,8 @@ Type: language Subtag: daf Description: Dan Added: 2009-07-29 +Deprecated: 2013-09-10 +Comments: see dnj, lda %% Type: language Subtag: dag @@ -8897,7 +8935,7 @@ Added: 2009-07-29 %% Type: language Subtag: dba -Description: Bangi Me +Description: Bangime Added: 2009-07-29 %% Type: language @@ -9221,7 +9259,7 @@ Added: 2009-07-29 %% Type: language Subtag: dgt -Description: Ndrag'ngith +Description: Ndra'ngith Added: 2012-08-12 %% Type: language @@ -9258,6 +9296,7 @@ Macrolanguage: mwr %% Type: language Subtag: dhg +Description: Djangu Description: Dhangu Added: 2009-07-29 %% @@ -9304,6 +9343,7 @@ Added: 2009-07-29 Type: language Subtag: dhv Description: Dehu +Description: Drehu Added: 2009-07-29 %% Type: language @@ -9312,6 +9352,11 @@ Description: Dhanwar (Nepal) Added: 2009-07-29 %% Type: language +Subtag: dhx +Description: Dhungaloo +Added: 2013-09-10 +%% +Type: language Subtag: dia Description: Dia Added: 2009-07-29 @@ -9489,6 +9534,8 @@ Type: language Subtag: djl Description: Djiwarli Added: 2009-07-29 +Deprecated: 2013-09-10 +Comments: see dze, iin %% Type: language Subtag: djm @@ -9559,6 +9606,11 @@ Description: Dolgan Added: 2009-07-29 %% Type: language +Subtag: dlk +Description: Dahalik +Added: 2013-09-10 +%% +Type: language Subtag: dlm Description: Dalmatian Added: 2009-07-29 @@ -9580,7 +9632,7 @@ Added: 2011-08-16 %% Type: language Subtag: dmc -Description: Dimir +Description: Gavak Added: 2009-07-29 %% Type: language @@ -9646,6 +9698,11 @@ Description: Dumpas Added: 2009-07-29 %% Type: language +Subtag: dmw +Description: Mudburra +Added: 2013-09-10 +%% +Type: language Subtag: dmx Description: Dema Added: 2009-07-29 @@ -9682,6 +9739,11 @@ Description: Lower Grand Valley Dani Added: 2009-07-29 %% Type: language +Subtag: dnj +Description: Dan +Added: 2013-09-10 +%% +Type: language Subtag: dnk Description: Dengka Added: 2009-07-29 @@ -10067,6 +10129,7 @@ Added: 2009-07-29 Type: language Subtag: duf Description: Dumbea +Description: Drubea Added: 2009-07-29 %% Type: language @@ -10259,6 +10322,11 @@ Description: Daza Added: 2009-07-29 %% Type: language +Subtag: dze +Description: Djiwarli +Added: 2013-09-10 +%% +Type: language Subtag: dzg Description: Dazaga Added: 2009-07-29 @@ -10274,6 +10342,11 @@ Description: Dzando Added: 2009-07-29 %% Type: language +Subtag: eaa +Description: Karenggapa +Added: 2013-09-10 +%% +Type: language Subtag: ebg Description: Ebughu Added: 2009-07-29 @@ -10392,6 +10465,11 @@ Description: Ekajuk Added: 2005-10-16 %% Type: language +Subtag: ekc +Description: Eastern Karnic +Added: 2013-09-10 +%% +Type: language Subtag: eke Description: Ekit Added: 2009-07-29 @@ -10859,6 +10937,11 @@ Added: 2009-07-29 Macrolanguage: kln %% Type: language +Subtag: eza +Description: Ezaa +Added: 2013-09-10 +%% +Type: language Subtag: eze Description: Uzekwe Added: 2009-07-29 @@ -10870,7 +10953,7 @@ Added: 2009-07-29 %% Type: language Subtag: fab -Description: Fa D'ambu +Description: Fa d'Ambu Added: 2009-07-29 %% Type: language @@ -11374,7 +11457,7 @@ Added: 2009-07-29 %% Type: language Subtag: gal -Description: Galoli +Description: Galolen Added: 2009-07-29 %% Type: language @@ -11564,6 +11647,11 @@ Description: Gbanu Added: 2009-07-29 %% Type: language +Subtag: gbw +Description: Gabi-Gabi +Added: 2013-09-10 +%% +Type: language Subtag: gbx Description: Eastern Xwla Gbe Added: 2009-07-29 @@ -11710,6 +11798,11 @@ Description: Ghandruk Sign Language Added: 2012-08-12 %% Type: language +Subtag: gdt +Description: Kungardutyi +Added: 2013-09-10 +%% +Type: language Subtag: gdu Description: Gudu Added: 2009-07-29 @@ -11872,6 +11965,8 @@ Type: language Subtag: ggr Description: Aghu Tharnggalu Added: 2009-07-29 +Deprecated: 2013-09-10 +Comments: see ggm, gtu, ikr %% Type: language Subtag: ggt @@ -11881,6 +11976,7 @@ Added: 2009-07-29 Type: language Subtag: ggu Description: Gagu +Description: Gban Added: 2009-07-29 %% Type: language @@ -11970,6 +12066,11 @@ Description: Goaria Added: 2009-07-29 %% Type: language +Subtag: gih +Description: Githabul +Added: 2013-09-10 +%% +Type: language Subtag: gil Description: Gilbertese Added: 2005-10-16 @@ -12052,6 +12153,11 @@ Description: Kachi Koli Added: 2009-07-29 %% Type: language +Subtag: gjm +Description: Gunditjmara +Added: 2013-09-10 +%% +Type: language Subtag: gjn Description: Gonja Added: 2009-07-29 @@ -12119,6 +12225,11 @@ Description: Gilaki Added: 2009-07-29 %% Type: language +Subtag: gll +Description: Garlali +Added: 2013-09-10 +%% +Type: language Subtag: glo Description: Galambu Added: 2009-07-29 @@ -12218,6 +12329,11 @@ Description: Mycenaean Greek Added: 2009-07-29 %% Type: language +Subtag: gmz +Description: Mgbolizhia +Added: 2013-09-10 +%% +Type: language Subtag: gna Description: Kaansa Added: 2009-07-29 @@ -12651,6 +12767,11 @@ Description: Gbati-ri Added: 2009-07-29 %% Type: language +Subtag: gtu +Description: Aghu-Tharnggala +Added: 2013-09-10 +%% +Type: language Subtag: gua Description: Shiki Added: 2009-07-29 @@ -13703,6 +13824,11 @@ Description: Hrangkhol Added: 2009-07-29 %% Type: language +Subtag: hrc +Description: Niwer Mil +Added: 2013-09-10 +%% +Type: language Subtag: hre Description: Hre Added: 2009-07-29 @@ -13724,6 +13850,11 @@ Description: Haroi Added: 2009-07-29 %% Type: language +Subtag: hrp +Description: Nhirrpi +Added: 2013-09-10 +%% +Type: language Subtag: hrr Description: Horuru Added: 2009-07-29 @@ -13741,6 +13872,11 @@ Description: Hruso Added: 2009-07-29 %% Type: language +Subtag: hrw +Description: Warwar Feni +Added: 2013-09-10 +%% +Type: language Subtag: hrx Description: Hunsrik Added: 2009-07-29 @@ -13957,6 +14093,7 @@ Added: 2009-07-29 Type: language Subtag: hwc Description: Hawai'i Creole English +Description: Hawai'i Pidgin Added: 2009-07-29 %% Type: language @@ -14092,6 +14229,7 @@ Added: 2009-07-29 Type: language Subtag: idc Description: Idon +Description: Ajiya Added: 2009-07-29 %% Type: language @@ -14236,6 +14374,11 @@ Description: Bidhawal Added: 2012-08-12 %% Type: language +Subtag: iin +Description: Thiin +Added: 2013-09-10 +%% +Type: language Subtag: iir Description: Indo-Iranian languages Added: 2009-07-29 @@ -14304,6 +14447,11 @@ Description: Ikpeshi Added: 2009-07-29 %% Type: language +Subtag: ikr +Description: Ikaranggal +Added: 2013-09-10 +%% +Type: language Subtag: ikt Description: Inuinnaqtun Description: Western Canadian Inuktitut @@ -14384,6 +14532,8 @@ Type: language Subtag: ilw Description: Talur Added: 2009-07-29 +Deprecated: 2013-09-10 +Preferred-Value: gal %% Type: language Subtag: ima @@ -14533,6 +14683,11 @@ Description: Iquito Added: 2009-07-29 %% Type: language +Subtag: iqw +Description: Ikwo +Added: 2013-09-10 +%% +Type: language Subtag: ira Description: Iranian languages Added: 2005-10-16 @@ -14809,6 +14964,8 @@ Type: language Subtag: izi Description: Izi-Ezaa-Ikwo-Mgbo Added: 2009-07-29 +Deprecated: 2013-09-10 +Comments: see eza, gmz, iqw, izz %% Type: language Subtag: izr @@ -14816,6 +14973,11 @@ Description: Izere Added: 2009-07-29 %% Type: language +Subtag: izz +Description: Izii +Added: 2013-09-10 +%% +Type: language Subtag: jaa Description: Jamamadí Added: 2009-07-29 @@ -14932,6 +15094,11 @@ Description: Judeo-Berber Added: 2009-07-29 %% Type: language +Subtag: jbi +Description: Badjiri +Added: 2013-09-10 +%% +Type: language Subtag: jbj Description: Arandai Added: 2009-07-29 @@ -15902,7 +16069,8 @@ Added: 2009-07-29 %% Type: language Subtag: kdk -Description: Numee +Description: Numèè +Description: Kwényi Added: 2009-07-29 %% Type: language @@ -19073,8 +19241,6 @@ Type: language Subtag: lcq Description: Luhu Added: 2009-07-29 -Deprecated: 2012-08-12 -Preferred-Value: ppr %% Type: language Subtag: lcs @@ -19082,6 +19248,11 @@ Description: Lisabata-Nuniali Added: 2009-07-29 %% Type: language +Subtag: lda +Description: Kla-Dan +Added: 2013-09-10 +%% +Type: language Subtag: ldb Description: Dũya Added: 2009-07-29 @@ -19526,6 +19697,11 @@ Description: Libinza Added: 2009-07-29 %% Type: language +Subtag: lja +Description: Golpa +Added: 2013-09-10 +%% +Type: language Subtag: lje Description: Rampi Added: 2009-07-29 @@ -19546,6 +19722,16 @@ Description: Lampung Api Added: 2009-07-29 %% Type: language +Subtag: ljw +Description: Yirandali +Added: 2013-09-10 +%% +Type: language +Subtag: ljx +Description: Yuru +Added: 2013-09-10 +%% +Type: language Subtag: lka Description: Lakalei Added: 2009-07-29 @@ -19593,6 +19779,11 @@ Description: Laeko-Libuat Added: 2009-07-29 %% Type: language +Subtag: lkm +Description: Kalaamaya +Added: 2013-09-10 +%% +Type: language Subtag: lkn Description: Lakon Description: Vure @@ -19623,6 +19814,11 @@ Description: Lakota Added: 2009-07-29 %% Type: language +Subtag: lku +Description: Kungkari +Added: 2013-09-10 +%% +Type: language Subtag: lky Description: Lokoya Added: 2009-07-29 @@ -19914,6 +20110,11 @@ Description: Longuda Added: 2009-07-29 %% Type: language +Subtag: lnw +Description: Lanima +Added: 2013-09-10 +%% +Type: language Subtag: lnz Description: Lonzo Added: 2009-07-29 @@ -20432,6 +20633,11 @@ Description: Lewotobi Added: 2009-07-29 %% Type: language +Subtag: lwu +Description: Lawu +Added: 2013-09-10 +%% +Type: language Subtag: lww Description: Lewo Added: 2009-07-29 @@ -20526,6 +20732,7 @@ Added: 2009-07-29 Type: language Subtag: man Description: Mandingo +Description: Manding Added: 2005-10-16 Scope: macrolanguage %% @@ -20990,6 +21197,8 @@ Type: language Subtag: meg Description: Mea Added: 2009-07-29 +Deprecated: 2013-09-10 +Preferred-Value: cir %% Type: language Subtag: meh @@ -21065,7 +21274,7 @@ Added: 2009-07-29 %% Type: language Subtag: mev -Description: Mann +Description: Mano Added: 2009-07-29 %% Type: language @@ -21117,7 +21326,7 @@ Added: 2009-07-29 %% Type: language Subtag: mfg -Description: Mixifore +Description: Mogofin Added: 2009-07-29 %% Type: language @@ -21525,6 +21734,7 @@ Added: 2009-07-29 Type: language Subtag: mij Description: Abar +Description: Mungbam Added: 2009-07-29 %% Type: language @@ -21871,6 +22081,7 @@ Type: language Subtag: mld Description: Malakhel Added: 2009-07-29 +Deprecated: 2013-09-10 %% Type: language Subtag: mle @@ -22199,6 +22410,8 @@ Type: language Subtag: mnt Description: Maykulan Added: 2009-07-29 +Deprecated: 2013-09-10 +Comments: see wnn, xyj, xyk, xyt %% Type: language Subtag: mnu @@ -22996,7 +23209,7 @@ Added: 2009-07-29 %% Type: language Subtag: muc -Description: Mbu' +Description: Ajumbu Added: 2009-07-29 %% Type: language @@ -23250,6 +23463,8 @@ Type: language Subtag: mwd Description: Mudbura Added: 2009-07-29 +Deprecated: 2013-09-10 +Comments: see dmw, xrq %% Type: language Subtag: mwe @@ -23577,6 +23792,7 @@ Type: language Subtag: myq Description: Forest Maninka Added: 2009-07-29 +Deprecated: 2013-09-10 Macrolanguage: man %% Type: language @@ -23990,6 +24206,8 @@ Type: language Subtag: nbx Description: Ngura Added: 2009-07-29 +Deprecated: 2013-09-10 +Comments: see ekc, gll, jbi, xpt, xwk %% Type: language Subtag: nby @@ -24428,7 +24646,7 @@ Added: 2009-07-29 %% Type: language Subtag: ngk -Description: Ngalkbun +Description: Dalabon Added: 2009-07-29 %% Type: language @@ -25011,9 +25229,16 @@ Description: Ngul Added: 2009-07-29 %% Type: language +Subtag: nlq +Description: Lao Naga +Added: 2013-09-10 +%% +Type: language Subtag: nlr Description: Ngarla Added: 2009-07-29 +Deprecated: 2013-09-10 +Comments: see nrk, ywg %% Type: language Subtag: nlu @@ -25026,6 +25251,11 @@ Description: Orizaba Nahuatl Added: 2009-07-29 %% Type: language +Subtag: nlw +Description: Walangama +Added: 2013-09-10 +%% +Type: language Subtag: nlx Description: Nahali Added: 2009-07-29 @@ -25348,6 +25578,11 @@ Description: Nooksack Added: 2009-07-29 %% Type: language +Subtag: nol +Description: Nomlaki +Added: 2013-09-10 +%% +Type: language Subtag: nom Description: Nocamán Added: 2009-07-29 @@ -25493,6 +25728,11 @@ Added: 2006-06-05 Suppress-Script: Nkoo %% Type: language +Subtag: nqq +Description: Kyan-Karyaw Naga +Added: 2013-09-10 +%% +Type: language Subtag: nqy Description: Akyaung Ari Naga Added: 2012-08-12 @@ -25528,6 +25768,11 @@ Description: Chokri Naga Added: 2009-07-29 %% Type: language +Subtag: nrk +Description: Ngarla +Added: 2013-09-10 +%% +Type: language Subtag: nrl Description: Ngarluma Added: 2009-07-29 @@ -25550,6 +25795,7 @@ Added: 2009-07-29 Type: language Subtag: nrr Description: Norra +Description: Nora Added: 2009-07-29 %% Type: language @@ -25701,6 +25947,11 @@ Description: Nathembo Added: 2009-07-29 %% Type: language +Subtag: ntg +Description: Ngantangarra +Added: 2013-09-10 +%% +Type: language Subtag: nti Description: Natioro Added: 2009-07-29 @@ -25768,7 +26019,7 @@ Added: 2009-07-29 %% Type: language Subtag: nua -Description: Yuaga +Description: Yuanga Added: 2009-07-29 %% Type: language @@ -26517,6 +26768,11 @@ Description: Olekha Added: 2009-07-29 %% Type: language +Subtag: olk +Description: Olkol +Added: 2013-09-10 +%% +Type: language Subtag: olm Description: Oloma Added: 2009-07-29 @@ -27339,6 +27595,8 @@ Type: language Subtag: pcr Description: Panang Added: 2009-07-29 +Deprecated: 2013-09-10 +Preferred-Value: adx %% Type: language Subtag: pcw @@ -28086,11 +28344,22 @@ Description: Aoheng Added: 2009-07-29 %% Type: language +Subtag: pnj +Description: Pinjarup +Added: 2013-09-10 +%% +Type: language Subtag: pnk Description: Paunaka Added: 2012-08-12 %% Type: language +Subtag: pnl +Description: Paleni +Added: 2013-09-10 +Comments: see also wbf +%% +Type: language Subtag: pnm Description: Punan Batu 1 Added: 2009-07-29 @@ -28219,7 +28488,7 @@ Added: 2009-07-29 %% Type: language Subtag: pop -Description: Pwapwa +Description: Pwapwâ Added: 2009-07-29 %% Type: language @@ -28318,6 +28587,8 @@ Type: language Subtag: ppr Description: Piru Added: 2009-07-29 +Deprecated: 2013-09-10 +Preferred-Value: lcq %% Type: language Subtag: pps @@ -28758,6 +29029,11 @@ Description: Gapapaiwa Added: 2009-07-29 %% Type: language +Subtag: pwi +Description: Patwin +Added: 2013-09-10 +%% +Type: language Subtag: pwm Description: Molbog Added: 2009-07-29 @@ -29532,6 +29808,11 @@ Description: Kamta Added: 2009-07-29 %% Type: language +Subtag: rkw +Description: Arakwal +Added: 2013-09-10 +%% +Type: language Subtag: rma Description: Rama Added: 2009-07-29 @@ -29941,6 +30222,16 @@ Added: 2009-07-29 Macrolanguage: mwr %% Type: language +Subtag: rxd +Description: Ngardi +Added: 2013-09-10 +%% +Type: language +Subtag: rxw +Description: Karuwali +Added: 2013-09-10 +%% +Type: language Subtag: ryn Description: Northern Amami-Oshima Added: 2009-07-29 @@ -30840,6 +31131,7 @@ Added: 2009-07-29 Type: language Subtag: sih Description: Zire +Description: Sîshëë Added: 2009-07-29 %% Type: language @@ -32117,6 +32409,11 @@ Description: Satawalese Added: 2009-07-29 %% Type: language +Subtag: sty +Description: Siberian Tatar +Added: 2013-09-10 +%% +Type: language Subtag: sua Description: Sulka Added: 2009-07-29 @@ -32241,6 +32538,11 @@ Description: Slovakian Sign Language Added: 2009-07-29 %% Type: language +Subtag: svm +Description: Slavomolisano +Added: 2013-09-10 +%% +Type: language Subtag: svr Description: Savara Added: 2009-07-29 @@ -33213,6 +33515,8 @@ Type: language Subtag: tgg Description: Tangga Added: 2009-07-29 +Deprecated: 2013-09-10 +Comments: see bjp, hrc, hrw %% Type: language Subtag: tgh @@ -33570,6 +33874,11 @@ Description: Tjurruru Added: 2009-07-29 %% Type: language +Subtag: tjw +Description: Djabwurrung +Added: 2013-09-10 +%% +Type: language Subtag: tka Description: Truká Added: 2009-07-29 @@ -34004,7 +34313,7 @@ Added: 2009-07-29 %% Type: language Subtag: tnr -Description: Bedik +Description: Ménik Added: 2009-07-29 %% Type: language @@ -35088,7 +35397,7 @@ Added: 2009-07-29 %% Type: language Subtag: tye -Description: Kyenga +Description: Kyanga Added: 2009-07-29 %% Type: language @@ -35172,6 +35481,11 @@ Description: Tz'utujil Added: 2009-07-29 %% Type: language +Subtag: tzl +Description: Talossan +Added: 2013-09-10 +%% +Type: language Subtag: tzm Description: Central Atlas Tamazight Added: 2009-07-29 @@ -35409,6 +35723,11 @@ Description: Ulch Added: 2009-07-29 %% Type: language +Subtag: ule +Description: Lule +Added: 2013-09-10 +%% +Type: language Subtag: ulf Description: Usku Description: Afra @@ -35548,6 +35867,11 @@ Added: 2009-07-29 Macrolanguage: del %% Type: language +Subtag: unn +Description: Kurnai +Added: 2013-09-10 +%% +Type: language Subtag: unp Description: Worora Added: 2009-07-29 @@ -35560,6 +35884,11 @@ Description: Mundari Added: 2009-07-29 %% Type: language +Subtag: unu +Description: Unubahe +Added: 2013-09-10 +%% +Type: language Subtag: unx Description: Munda Added: 2009-07-29 @@ -35781,6 +36110,7 @@ Added: 2009-07-29 Type: language Subtag: uve Description: West Uvean +Description: Fagauvea Added: 2009-07-29 %% Type: language @@ -36071,7 +36401,7 @@ Added: 2009-07-29 %% Type: language Subtag: vmb -Description: Mbabaram +Description: Barbaram Added: 2009-07-29 %% Type: language @@ -36096,8 +36426,9 @@ Added: 2009-07-29 %% Type: language Subtag: vmg -Description: Minigir +Description: Lungalunga Added: 2009-07-29 +Comments: see also bxf %% Type: language Subtag: vmh @@ -36389,6 +36720,7 @@ Added: 2009-07-29 Type: language Subtag: wax Description: Watam +Description: Marangis Added: 2009-07-29 %% Type: language @@ -36420,6 +36752,7 @@ Type: language Subtag: wbf Description: Wara Added: 2009-07-29 +Comments: see also pnl %% Type: language Subtag: wbh @@ -36508,11 +36841,21 @@ Description: Wadjiginy Added: 2009-07-29 %% Type: language +Subtag: wdk +Description: Wadikali +Added: 2013-09-10 +%% +Type: language Subtag: wdu Description: Wadjigu Added: 2009-07-29 %% Type: language +Subtag: wdy +Description: Wadjabangayi +Added: 2013-09-10 +%% +Type: language Subtag: wea Description: Wewaw Added: 2009-07-29 @@ -36528,6 +36871,11 @@ Description: Wedau Added: 2009-07-29 %% Type: language +Subtag: weg +Description: Wergaia +Added: 2013-09-10 +%% +Type: language Subtag: weh Description: Weh Added: 2009-07-29 @@ -36720,6 +37068,8 @@ Type: language Subtag: wit Description: Wintu Added: 2009-07-29 +Deprecated: 2013-09-10 +Comments: see nol, pwi, wnw %% Type: language Subtag: wiu @@ -36785,6 +37135,11 @@ Description: Wakawaka Added: 2009-07-29 %% Type: language +Subtag: wky +Description: Wangkayutyuru +Added: 2013-09-10 +%% +Type: language Subtag: wla Description: Walio Added: 2009-07-29 @@ -36975,6 +37330,11 @@ Description: Wanggamala Added: 2009-07-29 %% Type: language +Subtag: wnn +Description: Wunumara +Added: 2013-09-10 +%% +Type: language Subtag: wno Description: Wano Added: 2009-07-29 @@ -36990,6 +37350,11 @@ Description: Usan Added: 2009-07-29 %% Type: language +Subtag: wnw +Description: Wintu +Added: 2013-09-10 +%% +Type: language Subtag: wny Description: Wanyi Added: 2012-08-12 @@ -37221,6 +37586,11 @@ Description: Watiwa Added: 2009-07-29 %% Type: language +Subtag: wth +Description: Wathawurrung +Added: 2013-09-10 +%% +Type: language Subtag: wti Description: Berta Added: 2009-07-29 @@ -37338,6 +37708,11 @@ Description: Waxianghua Added: 2009-07-29 %% Type: language +Subtag: wxw +Description: Wardandi +Added: 2013-09-10 +%% +Type: language Subtag: wya Description: Wyandot Added: 2009-07-29 @@ -37348,6 +37723,11 @@ Description: Wangaaybuwan-Ngiyambaa Added: 2009-07-29 %% Type: language +Subtag: wyi +Description: Woiwurrung +Added: 2013-09-10 +%% +Type: language Subtag: wym Description: Wymysorys Added: 2009-07-29 @@ -37479,11 +37859,31 @@ Description: Bactrian Added: 2009-07-29 %% Type: language +Subtag: xbd +Description: Bindal +Added: 2013-09-10 +%% +Type: language +Subtag: xbe +Description: Bigambal +Added: 2013-09-10 +%% +Type: language +Subtag: xbg +Description: Bunganditj +Added: 2013-09-10 +%% +Type: language Subtag: xbi Description: Kombio Added: 2009-07-29 %% Type: language +Subtag: xbj +Description: Birrpayi +Added: 2013-09-10 +%% +Type: language Subtag: xbm Description: Middle Breton Added: 2009-07-29 @@ -37499,6 +37899,11 @@ Description: Bolgarian Added: 2009-07-29 %% Type: language +Subtag: xbp +Description: Bibbulman +Added: 2013-09-10 +%% +Type: language Subtag: xbr Description: Kambera Added: 2009-07-29 @@ -37514,6 +37919,11 @@ Description: Kabixí Added: 2009-07-29 %% Type: language +Subtag: xby +Description: Batyala +Added: 2013-09-10 +%% +Type: language Subtag: xcb Description: Cumbric Added: 2009-07-29 @@ -37590,11 +38000,21 @@ Description: Cayuse Added: 2009-07-29 %% Type: language +Subtag: xda +Description: Darkinyung +Added: 2013-09-10 +%% +Type: language Subtag: xdc Description: Dacian Added: 2009-07-29 %% Type: language +Subtag: xdk +Description: Dharuk +Added: 2013-09-10 +%% +Type: language Subtag: xdm Description: Edomite Added: 2009-07-29 @@ -37670,16 +38090,36 @@ Description: Gbin Added: 2012-08-12 %% Type: language +Subtag: xgd +Description: Gudang +Added: 2013-09-10 +%% +Type: language Subtag: xgf Description: Gabrielino-Fernandeño Added: 2009-07-29 %% Type: language +Subtag: xgg +Description: Goreng +Added: 2013-09-10 +%% +Type: language +Subtag: xgi +Description: Garingbal +Added: 2013-09-10 +%% +Type: language Subtag: xgl Description: Galindan Added: 2009-07-29 %% Type: language +Subtag: xgm +Description: Guwinmal +Added: 2013-09-10 +%% +Type: language Subtag: xgn Description: Mongolian languages Added: 2009-07-29 @@ -37696,6 +38136,11 @@ Description: Unggumi Added: 2012-08-12 %% Type: language +Subtag: xgw +Description: Guwa +Added: 2013-09-10 +%% +Type: language Subtag: xha Description: Harami Added: 2009-07-29 @@ -37740,6 +38185,8 @@ Type: language Subtag: xia Description: Xiandao Added: 2009-07-29 +Deprecated: 2013-09-10 +Preferred-Value: acn %% Type: language Subtag: xib @@ -37782,6 +38229,16 @@ Description: Xipaya Added: 2009-07-29 %% Type: language +Subtag: xjb +Description: Minjungbal +Added: 2013-09-10 +%% +Type: language +Subtag: xjt +Description: Jaitmatang +Added: 2013-09-10 +%% +Type: language Subtag: xka Description: Kalkoti Added: 2009-07-29 @@ -38127,6 +38584,16 @@ Description: Kuanhua Added: 2009-07-29 %% Type: language +Subtag: xni +Description: Ngarigu +Added: 2013-09-10 +%% +Type: language +Subtag: xnk +Description: Nganakarti +Added: 2013-09-10 +%% +Type: language Subtag: xnn Description: Northern Kankanay Added: 2009-07-29 @@ -38153,6 +38620,16 @@ Description: Narragansett Added: 2010-03-11 %% Type: language +Subtag: xnu +Description: Nukunul +Added: 2013-09-10 +%% +Type: language +Subtag: xny +Description: Nyiyaparli +Added: 2013-09-10 +%% +Type: language Subtag: xnz Description: Kenzi Description: Mattoki @@ -38214,6 +38691,11 @@ Description: Kowaki Added: 2009-07-29 %% Type: language +Subtag: xpa +Description: Pirriya +Added: 2013-09-10 +%% +Type: language Subtag: xpc Description: Pecheneg Added: 2009-07-29 @@ -38280,6 +38762,11 @@ Description: Pisidian Added: 2009-07-29 %% Type: language +Subtag: xpt +Description: Punthamara +Added: 2013-09-10 +%% +Type: language Subtag: xpu Description: Punic Added: 2009-07-29 @@ -38310,11 +38797,21 @@ Description: Eastern Karaboro Added: 2009-07-29 %% Type: language +Subtag: xrd +Description: Gundungurra +Added: 2013-09-10 +%% +Type: language Subtag: xre Description: Kreye Added: 2009-07-29 %% Type: language +Subtag: xrg +Description: Minang +Added: 2013-09-10 +%% +Type: language Subtag: xri Description: Krikati-Timbira Added: 2009-07-29 @@ -38330,6 +38827,11 @@ Description: Arin Added: 2009-07-29 %% Type: language +Subtag: xrq +Description: Karranga +Added: 2013-09-10 +%% +Type: language Subtag: xrr Description: Raetic Added: 2009-07-29 @@ -38476,6 +38978,11 @@ Description: Transalpine Gaulish Added: 2009-07-29 %% Type: language +Subtag: xth +Description: Yitha Yitha +Added: 2013-09-10 +%% +Type: language Subtag: xti Description: Sinicahua Mixtec Added: 2009-07-29 @@ -38536,6 +39043,11 @@ Description: Cuyamecalco Mixtec Added: 2009-07-29 %% Type: language +Subtag: xtv +Description: Thawa +Added: 2013-09-10 +%% +Type: language Subtag: xtw Description: Tawandê Added: 2009-07-29 @@ -38576,13 +39088,18 @@ Description: Jennu Kurumba Added: 2009-07-29 %% Type: language +Subtag: xul +Description: Ngunawal +Added: 2013-09-10 +%% +Type: language Subtag: xum Description: Umbrian Added: 2009-07-29 %% Type: language Subtag: xun -Description: Unggarranggu +Description: Unggaranggu Added: 2012-08-12 %% Type: language @@ -38646,6 +39163,11 @@ Description: Woccon Added: 2009-07-29 %% Type: language +Subtag: xwd +Description: Wadi Wadi +Added: 2013-09-10 +%% +Type: language Subtag: xwe Description: Xwela Gbe Added: 2009-07-29 @@ -38656,6 +39178,16 @@ Description: Kwegu Added: 2009-07-29 %% Type: language +Subtag: xwj +Description: Wajuk +Added: 2013-09-10 +%% +Type: language +Subtag: xwk +Description: Wangkumara +Added: 2013-09-10 +%% +Type: language Subtag: xwl Description: Western Xwla Gbe Added: 2009-07-29 @@ -38671,6 +39203,16 @@ Description: Kwerba Mamberamo Added: 2009-07-29 %% Type: language +Subtag: xwt +Description: Wotjobaluk +Added: 2013-09-10 +%% +Type: language +Subtag: xww +Description: Wemba Wemba +Added: 2013-09-10 +%% +Type: language Subtag: xxb Description: Boro (Ghana) Added: 2009-07-29 @@ -38681,6 +39223,11 @@ Description: Ke'o Added: 2009-07-29 %% Type: language +Subtag: xxm +Description: Minkin +Added: 2013-09-10 +%% +Type: language Subtag: xxr Description: Koropó Added: 2009-07-29 @@ -38691,11 +39238,36 @@ Description: Tambora Added: 2009-07-29 %% Type: language +Subtag: xya +Description: Yaygir +Added: 2013-09-10 +%% +Type: language +Subtag: xyb +Description: Yandjibara +Added: 2013-09-10 +%% +Type: language +Subtag: xyj +Description: Mayi-Yapi +Added: 2013-09-10 +%% +Type: language +Subtag: xyk +Description: Mayi-Kulan +Added: 2013-09-10 +%% +Type: language Subtag: xyl Description: Yalakalore Added: 2009-07-29 %% Type: language +Subtag: xyt +Description: Mayi-Thakurti +Added: 2013-09-10 +%% +Type: language Subtag: xyy Description: Yorta Yorta Added: 2012-08-12 @@ -38938,6 +39510,11 @@ Description: Chepya Added: 2009-07-29 %% Type: language +Subtag: yda +Description: Yanda +Added: 2013-09-10 +%% +Type: language Subtag: ydd Description: Eastern Yiddish Added: 2009-07-29 @@ -39036,6 +39613,11 @@ Description: Malyangapa Added: 2012-08-12 %% Type: language +Subtag: ygi +Description: Yiningayi +Added: 2013-09-10 +%% +Type: language Subtag: ygl Description: Yangum Gel Added: 2009-07-29 @@ -39056,6 +39638,11 @@ Description: Yagaria Added: 2009-07-29 %% Type: language +Subtag: ygu +Description: Yugul +Added: 2013-09-10 +%% +Type: language Subtag: ygw Description: Yagwoia Added: 2009-07-29 @@ -39171,6 +39758,8 @@ Type: language Subtag: yiy Description: Yir Yoront Added: 2009-07-29 +Deprecated: 2013-09-10 +Comments: see yrm, yyr %% Type: language Subtag: yiz @@ -39295,6 +39884,7 @@ Added: 2009-07-29 Type: language Subtag: yly Description: Nyâlayu +Description: Nyelâyu Added: 2009-07-29 %% Type: language @@ -39499,6 +40089,8 @@ Type: language Subtag: yos Description: Yos Added: 2009-07-29 +Deprecated: 2013-09-10 +Preferred-Value: zom %% Type: language Subtag: yot @@ -39597,6 +40189,11 @@ Description: Nhengatu Added: 2009-07-29 %% Type: language +Subtag: yrm +Description: Yirrk-Mel +Added: 2013-09-10 +%% +Type: language Subtag: yrn Description: Yerong Added: 2009-07-29 @@ -39612,6 +40209,11 @@ Description: Yarawata Added: 2009-07-29 %% Type: language +Subtag: yry +Description: Yarluyandi +Added: 2013-09-10 +%% +Type: language Subtag: ysc Description: Yassic Added: 2009-07-29 @@ -39682,6 +40284,11 @@ Description: Yout Wam Added: 2010-03-11 %% Type: language +Subtag: yty +Description: Yatay +Added: 2013-09-10 +%% +Type: language Subtag: yua Description: Yucateco Description: Yucatec Maya @@ -39810,6 +40417,11 @@ Description: Kalou Added: 2009-07-29 %% Type: language +Subtag: ywg +Description: Yinhawangka +Added: 2013-09-10 +%% +Type: language Subtag: ywl Description: Western Lalu Added: 2009-07-29 @@ -39846,16 +40458,41 @@ Description: Yawarawarga Added: 2009-07-29 %% Type: language +Subtag: yxa +Description: Mayawali +Added: 2013-09-10 +%% +Type: language Subtag: yxg Description: Yagara Added: 2012-08-12 %% Type: language +Subtag: yxl +Description: Yardliyawarra +Added: 2013-09-10 +%% +Type: language +Subtag: yxm +Description: Yinwum +Added: 2013-09-10 +%% +Type: language +Subtag: yxu +Description: Yuyu +Added: 2013-09-10 +%% +Type: language Subtag: yxy Description: Yabula Yabula Added: 2012-08-12 %% Type: language +Subtag: yyr +Description: Yir Yoront +Added: 2013-09-03 +%% +Type: language Subtag: yyu Description: Yau (Sandaun Province) Added: 2009-07-29 @@ -40096,6 +40733,11 @@ Added: 2009-07-29 Macrolanguage: za %% Type: language +Subtag: zgh +Description: Standard Moroccan Tamazight +Added: 2013-01-25 +%% +Type: language Subtag: zgm Description: Minz Zhuang Added: 2009-07-29 @@ -40859,7 +41501,7 @@ Macrolanguage: za %% Type: language Subtag: zyp -Description: Zyphe +Description: Zyphe Chin Added: 2009-07-29 %% Type: language @@ -42574,6 +43216,11 @@ Description: Afaka Added: 2011-01-07 %% Type: script +Subtag: Aghb +Description: Caucasian Albanian +Added: 2012-11-01 +%% +Type: script Subtag: Arab Description: Arabic Added: 2005-10-16 @@ -42844,6 +43491,7 @@ Added: 2005-10-16 Type: script Subtag: Hung Description: Old Hungarian +Description: Hungarian Runic Added: 2005-10-16 %% Type: script @@ -42986,6 +43634,11 @@ Description: Lydian Added: 2006-07-21 %% Type: script +Subtag: Mahj +Description: Mahajani +Added: 2012-11-01 +%% +Type: script Subtag: Mand Description: Mandaic Description: Mandaean @@ -44404,7 +45057,7 @@ Added: 2005-10-16 %% Type: region Subtag: PS -Description: Occupied Palestinian Territory +Description: State of Palestine Added: 2005-10-16 %% Type: region From 91f6f174aeba163044c438e59d961bcead810b6c Mon Sep 17 00:00:00 2001 From: Bradford Wetmore Date: Wed, 16 Oct 2013 23:32:19 -0700 Subject: [PATCH 129/131] 8026762: jdk8-tl builds windows builds failing in corba - javac: no source files Reviewed-by: katleman, dholmes --- jdk/makefiles/GenerateClasses.gmk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/jdk/makefiles/GenerateClasses.gmk b/jdk/makefiles/GenerateClasses.gmk index 072e411aa0b..771f791f854 100644 --- a/jdk/makefiles/GenerateClasses.gmk +++ b/jdk/makefiles/GenerateClasses.gmk @@ -53,7 +53,7 @@ $(eval $(call SetupJavaCompilation,BUILD_BOOTSTRAP_RMIC, \ ########################################################################################## BTRMIC_CP := $(CORBA_OUTPUTDIR)/btjars/btcorba.jar$(PATH_SEP)$(JDK_OUTPUTDIR)/btclasses_rmic$(PATH_SEP)$(BOOTSTRAP_JAVAC_JAR) -BTRMIC_ARGS := "-Xbootclasspath/p:$(BTRMIC_CP)" -cp $(BTRMIC_CP) +BTRMIC_ARGS := "-Xbootclasspath/p:$(BTRMIC_CP)" -cp "$(BTRMIC_CP)" RMIC := $(JAVA) $(BTRMIC_ARGS) sun.rmi.rmic.Main CLASSES_DIR := $(JDK_OUTPUTDIR)/classes From 286d559a2fc94c2a79a4f2cf069b1ff83245f7f0 Mon Sep 17 00:00:00 2001 From: Weijun Wang Date: Thu, 17 Oct 2013 20:56:07 +0800 Subject: [PATCH 130/131] 8026712: TEST_BUG: update sun/security/tools/keytool/autotest.sh with a new location to find of libsoftokn3.so Reviewed-by: vinnie --- jdk/test/sun/security/tools/keytool/autotest.sh | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/jdk/test/sun/security/tools/keytool/autotest.sh b/jdk/test/sun/security/tools/keytool/autotest.sh index 7afed3ea74e..0d8e57ce680 100644 --- a/jdk/test/sun/security/tools/keytool/autotest.sh +++ b/jdk/test/sun/security/tools/keytool/autotest.sh @@ -73,11 +73,13 @@ case "$OS" in if [ $B32 = true ]; then LIBNAME=`find_one \ "/usr/lib/libsoftokn3.so" \ - "/usr/lib/i386-linux-gnu/nss/libsoftokn3.so"` + "/usr/lib/i386-linux-gnu/nss/libsoftokn3.so" \ + "/usr/lib/nss/libsoftokn3.so"` else LIBNAME=`find_one \ "/usr/lib64/libsoftokn3.so" \ - "/usr/lib/x86_64-linux-gnu/nss/libsoftokn3.so"` + "/usr/lib/x86_64-linux-gnu/nss/libsoftokn3.so" \ + "/usr/lib/nss/libsoftokn3.so"` fi ;; * ) From c668ed8f33ca9484b480bc20ebd272594b948ced Mon Sep 17 00:00:00 2001 From: David Chase Date: Wed, 16 Oct 2013 17:55:49 -0400 Subject: [PATCH 131/131] 8022718: Runtime accessibility checking: protected class, if extended, should be accessible from another package Modify accessibility check; it was muddled about Java vs JVM protection terminology. Reviewed-by: jrose --- .../lang/invoke/InvokerBytecodeGenerator.java | 3 +- .../classes/sun/invoke/util/VerifyAccess.java | 17 +- .../share/classes/sun/reflect/Reflection.java | 4 +- .../accessProtectedSuper/BogoLoader.java | 157 ++++++++++++++++++ .../accessProtectedSuper/MethodInvoker.java | 40 +++++ .../invoke/accessProtectedSuper/Test.java | 119 +++++++++++++ .../anotherpkg/MethodSupplierOuter.java | 34 ++++ 7 files changed, 368 insertions(+), 6 deletions(-) create mode 100644 jdk/test/java/lang/invoke/accessProtectedSuper/BogoLoader.java create mode 100644 jdk/test/java/lang/invoke/accessProtectedSuper/MethodInvoker.java create mode 100644 jdk/test/java/lang/invoke/accessProtectedSuper/Test.java create mode 100644 jdk/test/java/lang/invoke/accessProtectedSuper/anotherpkg/MethodSupplierOuter.java diff --git a/jdk/src/share/classes/java/lang/invoke/InvokerBytecodeGenerator.java b/jdk/src/share/classes/java/lang/invoke/InvokerBytecodeGenerator.java index 7b6b4137549..639b3628fa5 100644 --- a/jdk/src/share/classes/java/lang/invoke/InvokerBytecodeGenerator.java +++ b/jdk/src/share/classes/java/lang/invoke/InvokerBytecodeGenerator.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -609,6 +609,7 @@ class InvokerBytecodeGenerator { cls = cls.getComponentType(); if (cls.isPrimitive()) return true; // int[].class, for example + // could use VerifyAccess.isClassAccessible but the following is a safe approximation if (cls.getClassLoader() != Object.class.getClassLoader()) return false; if (VerifyAccess.isSamePackage(MethodHandle.class, cls)) diff --git a/jdk/src/share/classes/sun/invoke/util/VerifyAccess.java b/jdk/src/share/classes/sun/invoke/util/VerifyAccess.java index 3b65b586757..02a6e664301 100644 --- a/jdk/src/share/classes/sun/invoke/util/VerifyAccess.java +++ b/jdk/src/share/classes/sun/invoke/util/VerifyAccess.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2008, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2008, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -27,6 +27,7 @@ package sun.invoke.util; import java.lang.reflect.Modifier; import static java.lang.reflect.Modifier.*; +import sun.reflect.Reflection; /** * This class centralizes information about the JVM's linkage access control. @@ -140,7 +141,17 @@ public class VerifyAccess { } static boolean isPublicSuperClass(Class defc, Class lookupClass) { - return isPublic(defc.getModifiers()) && defc.isAssignableFrom(lookupClass); + return isPublic(getClassModifiers(defc)) && defc.isAssignableFrom(lookupClass); + } + + static int getClassModifiers(Class c) { + // This would return the mask stored by javac for the source-level modifiers. + // return c.getModifiers(); + // But what we need for JVM access checks are the actual bits from the class header. + // ...But arrays and primitives are synthesized with their own odd flags: + if (c.isArray() || c.isPrimitive()) + return c.getModifiers(); + return Reflection.getClassAccessFlags(c); } /** @@ -159,7 +170,7 @@ public class VerifyAccess { if (allowedModes == 0) return false; assert((allowedModes & PUBLIC) != 0 && (allowedModes & ~(ALL_ACCESS_MODES|PACKAGE_ALLOWED)) == 0); - int mods = refc.getModifiers(); + int mods = getClassModifiers(refc); if (isPublic(mods)) return true; if ((allowedModes & PACKAGE_ALLOWED) != 0 && diff --git a/jdk/src/share/classes/sun/reflect/Reflection.java b/jdk/src/share/classes/sun/reflect/Reflection.java index 274705fc249..a57b89b2b1d 100644 --- a/jdk/src/share/classes/sun/reflect/Reflection.java +++ b/jdk/src/share/classes/sun/reflect/Reflection.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 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 @@ -65,7 +65,7 @@ public class Reflection { to compatibility reasons; see 4471811. Only the values of the low 13 bits (i.e., a mask of 0x1FFF) are guaranteed to be valid. */ - private static native int getClassAccessFlags(Class c); + public static native int getClassAccessFlags(Class c); /** A quick "fast-path" check to try to avoid getCallerClass() calls. */ diff --git a/jdk/test/java/lang/invoke/accessProtectedSuper/BogoLoader.java b/jdk/test/java/lang/invoke/accessProtectedSuper/BogoLoader.java new file mode 100644 index 00000000000..190761dd6df --- /dev/null +++ b/jdk/test/java/lang/invoke/accessProtectedSuper/BogoLoader.java @@ -0,0 +1,157 @@ +/* + * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + * + */ + +import java.io.BufferedInputStream; +import java.io.IOException; +import java.io.InputStream; +import java.util.Map; +import java.util.Set; +import java.util.Vector; +import jdk.internal.org.objectweb.asm.*; +// Compile with -XDignore.symbol.file=true + +public class BogoLoader extends ClassLoader { + + static interface VisitorMaker { + ClassVisitor make(ClassVisitor visitor); + } + + + /** + * Use this property to verify that the desired classloading is happening. + */ + private final boolean verbose = Boolean.getBoolean("bogoloader.verbose"); + /** + * Use this property to disable replacement for testing purposes. + */ + private final boolean noReplace = Boolean.getBoolean("bogoloader.noreplace"); + + /** + * Set of class names that should be loaded with this loader. + * Others are loaded with the system class loader, except for those + * that are transformed. + */ + private Set nonSystem; + + /** + * Map from class names to a bytecode transformer factory. + */ + private Map replaced; + + /** + * Keep track (not terribly efficiently) of which classes have already + * been loaded by this class loader. + */ + private final Vector history = new Vector(); + + private boolean useSystemLoader(String name) { + return ! nonSystem.contains(name) && ! replaced.containsKey(name); + } + + public BogoLoader(Set non_system, Map replaced) { + super(Thread.currentThread().getContextClassLoader()); + this.nonSystem = non_system; + this.replaced = replaced; + } + + private byte[] readResource(String className) throws IOException { + return readResource(className, "class"); + } + + private byte[] readResource(String className, String suffix) throws IOException { + // Note to the unwary -- "/" works on Windows, leave it alone. + String fileName = className.replace('.', '/') + "." + suffix; + InputStream origStream = getResourceAsStream(fileName); + if (origStream == null) { + throw new IOException("Resource not found : " + fileName); + } + BufferedInputStream stream = new java.io.BufferedInputStream(origStream); + byte[] data = new byte[stream.available()]; + int how_many = stream.read(data); + // Really ought to deal with the corner cases of stream.available() + return data; + } + + protected byte[] getClass(String name) throws ClassNotFoundException, + IOException { + return readResource(name, "class"); + } + + /** + * Loads the named class from the system class loader unless + * the name appears in either replaced or nonSystem. + * nonSystem classes are loaded into this classloader, + * and replaced classes get their content from the specified array + * of bytes (and are also loaded into this classloader). + */ + protected Class loadClass(String name, boolean resolve) + throws ClassNotFoundException { + Class clazz; + + if (history.contains(name)) { + Class c = this.findLoadedClass(name); + return c; + } + if (useSystemLoader(name)) { + clazz = findSystemClass(name); + if (verbose) System.err.println("Loading system class " + name); + } else { + history.add(name); + try { + if (verbose) { + System.err.println("Loading classloader class " + name); + } + byte[] classData = getClass(name);; + boolean expanded = false; + if (!noReplace && replaced.containsKey(name)) { + if (verbose) { + System.err.println("Replacing class " + name); + } + ClassReader cr = new ClassReader(classData); + ClassWriter cw = new ClassWriter(0); + VisitorMaker vm = replaced.get(name); + cr.accept(vm.make(cw), 0); + classData = cw.toByteArray(); + } + clazz = defineClass(name, classData, 0, classData.length); + } catch (java.io.EOFException ioe) { + throw new ClassNotFoundException( + "IO Exception in reading class : " + name + " ", ioe); + } catch (ClassFormatError ioe) { + throw new ClassNotFoundException( + "ClassFormatError in reading class file: ", ioe); + } catch (IOException ioe) { + throw new ClassNotFoundException( + "IO Exception in reading class file: ", ioe); + } + } + if (clazz == null) { + throw new ClassNotFoundException(name); + } + if (resolve) { + resolveClass(clazz); + } + return clazz; + } +} diff --git a/jdk/test/java/lang/invoke/accessProtectedSuper/MethodInvoker.java b/jdk/test/java/lang/invoke/accessProtectedSuper/MethodInvoker.java new file mode 100644 index 00000000000..d14e7ef8a35 --- /dev/null +++ b/jdk/test/java/lang/invoke/accessProtectedSuper/MethodInvoker.java @@ -0,0 +1,40 @@ +/* + * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + * + */ + +import anotherpkg.MethodSupplierOuter; + +public class MethodInvoker extends MethodSupplierOuter.MethodSupplier { + public static void invoke() throws Exception { + MethodInvoker ms = new MethodInvoker(); + ms.m(); + ms.myfi().invokeMethodReference(); + MyFunctionalInterface fi = ms::m; // Should not fail with modified bytecodes + fi.invokeMethodReference(); + } + + MyFunctionalInterface myfi() { + MyFunctionalInterface fi = this::m; // Should not fail with modified bytecodes + return fi; + } +} diff --git a/jdk/test/java/lang/invoke/accessProtectedSuper/Test.java b/jdk/test/java/lang/invoke/accessProtectedSuper/Test.java new file mode 100644 index 00000000000..3907ceb1849 --- /dev/null +++ b/jdk/test/java/lang/invoke/accessProtectedSuper/Test.java @@ -0,0 +1,119 @@ +/* + * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + * + */ + +/** + * @test + * @bug 8022718 + * @summary Runtime accessibility checking: protected class, if extended, should be accessible from another package + * + * @compile -XDignore.symbol.file BogoLoader.java MethodInvoker.java Test.java anotherpkg/MethodSupplierOuter.java + * @run main/othervm Test + */ + +import java.lang.reflect.InvocationTargetException; +import java.lang.reflect.Method; +import java.util.HashMap; +import java.util.HashSet; +import jdk.internal.org.objectweb.asm.ClassWriter; +import jdk.internal.org.objectweb.asm.MethodVisitor; +import jdk.internal.org.objectweb.asm.ClassVisitor; +import jdk.internal.org.objectweb.asm.Opcodes; + +interface MyFunctionalInterface { + + void invokeMethodReference(); +} + +class MakeProtected implements BogoLoader.VisitorMaker, Opcodes { + + final boolean whenVisitInner; + + MakeProtected(boolean when_visit_inner) { + super(); + whenVisitInner = when_visit_inner; + } + + public ClassVisitor make(ClassVisitor cv) { + return new ClassVisitor(Opcodes.ASM5, cv) { + + @Override + public void visitInnerClass(String name, String outerName, + String innerName, int access) { + if (whenVisitInner) { + int access_ = (ACC_PROTECTED | access) & ~(ACC_PRIVATE | ACC_PUBLIC); + System.out.println("visitInnerClass: name = " + name + + ", outerName = " + outerName + + ", innerName = " + innerName + + ", access original = 0x" + Integer.toHexString(access) + + ", access modified to 0x" + Integer.toHexString(access_)); + access = access_; + } + super.visitInnerClass(name, outerName, innerName, access); + } + }; + } +}; + +public class Test { + + public static void main(String argv[]) throws Exception, Throwable { + BogoLoader.VisitorMaker makeProtectedNop = new MakeProtected(false); + BogoLoader.VisitorMaker makeProtectedMod = new MakeProtected(true); + + int errors = 0; + errors += tryModifiedInvocation(makeProtectedNop); + errors += tryModifiedInvocation(makeProtectedMod); + + if (errors > 0) { + throw new Error("FAIL; there were errors"); + } + } + + private static int tryModifiedInvocation(BogoLoader.VisitorMaker makeProtected) + throws Throwable, ClassNotFoundException { + HashMap replace + = new HashMap(); + replace.put("anotherpkg.MethodSupplierOuter$MethodSupplier", makeProtected); + HashSet in_bogus = new HashSet(); + in_bogus.add("MethodInvoker"); + in_bogus.add("MyFunctionalInterface"); + in_bogus.add("anotherpkg.MethodSupplierOuter"); // seems to be never loaded + in_bogus.add("anotherpkg.MethodSupplierOuter$MethodSupplier"); + + BogoLoader bl = new BogoLoader(in_bogus, replace); + try { + Class isw = bl.loadClass("MethodInvoker"); + Method meth = isw.getMethod("invoke"); + Object result = meth.invoke(null); + } catch (Throwable th) { + System.out.flush(); + Thread.sleep(250); // Let Netbeans get its I/O sorted out. + th.printStackTrace(); + System.err.flush(); + Thread.sleep(250); // Let Netbeans get its I/O sorted out. + return 1; + } + return 0; + } +} diff --git a/jdk/test/java/lang/invoke/accessProtectedSuper/anotherpkg/MethodSupplierOuter.java b/jdk/test/java/lang/invoke/accessProtectedSuper/anotherpkg/MethodSupplierOuter.java new file mode 100644 index 00000000000..314f8eab707 --- /dev/null +++ b/jdk/test/java/lang/invoke/accessProtectedSuper/anotherpkg/MethodSupplierOuter.java @@ -0,0 +1,34 @@ +/* + * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + * + */ + +package anotherpkg; + +public class MethodSupplierOuter { + // MethodSupplier is "public" for javac compilation, modified to "protected" for test. + public static class MethodSupplier { + public void m() { + System.out.println("good"); + } + } +}