diff --git a/.hgtags b/.hgtags index 24dc9213f13fbcadddfb2807883e1d9b4f333064..8bd85bbd69d2492a0487169e5a312fe6b978f0d3 100644 --- a/.hgtags +++ b/.hgtags @@ -93,3 +93,6 @@ e250cef36ea05e627e7e6f7d75e5e19f529e2ba3 jdk7-b114 1657ed4e1d86c8aa2028ab5a41f9da1ac4a369f8 jdk7-b116 3e6726bbf80a4254ecd01051c8ed77ee19325e46 jdk7-b117 b357910aa04aead2a16b6d6ff395a8df4b51d1dd jdk7-b118 +ecab7eefb8f2326fd90fb632f47f1b6f81e928f8 jdk7-b119 +37d74e29687cf07c2bf9411af58c7e42440855c3 jdk7-b120 +a661d8587b5d8986aacae086f5df66af9e1a96b1 jdk7-b121 diff --git a/make/common/Defs.gmk b/make/common/Defs.gmk index 31e3a4a8f65c03213ad3f51e9e1a7942aa2a1856..71ab366ab61e07afc42c98b6a557cd0f08da7c17 100644 --- a/make/common/Defs.gmk +++ b/make/common/Defs.gmk @@ -83,14 +83,19 @@ ifndef CLOSED_SRC CLOSED_SRC = $(BUILDDIR)/../src/closed endif -# If we have no closed directory, force it to an openjdk build -CLOSED_SRC_DIR_EXISTS := $(shell \ - if [ -d $(CLOSED_SRC) ] ; then \ - echo true; \ - else \ - echo false; \ - fi) -ifeq ($(CLOSED_SRC_DIR_EXISTS), false) +# If CLOSE_SRC_INCLUDED isn't set to true, check if there's any +# closed directory. +ifneq ($(CLOSED_SRC_INCLUDED), true) + CLOSED_SRC_INCLUDED := $(shell \ + if [ -d $(CLOSED_SRC) ] ; then \ + echo true; \ + else \ + echo false; \ + fi) +endif + +# Set OPENJDK based on CLOSED_SRC_INCLUDED +ifeq ($(CLOSED_SRC_INCLUDED), false) OPENJDK = true endif diff --git a/make/sun/nio/cs/FILES_java.gmk b/make/sun/nio/cs/FILES_java.gmk index d930065d83f66d6ba583eabf112d6f18e647e54f..b177d64b4c10a753d5d4b45eeb56cf58917bd7e8 100644 --- a/make/sun/nio/cs/FILES_java.gmk +++ b/make/sun/nio/cs/FILES_java.gmk @@ -85,6 +85,7 @@ FILES_src = \ sun/io/ByteToCharCp500.java \ sun/io/ByteToCharCp737.java \ sun/io/ByteToCharCp775.java \ + sun/io/ByteToCharCp833.java \ sun/io/ByteToCharCp834.java \ sun/io/ByteToCharCp838.java \ sun/io/ByteToCharCp850.java \ @@ -214,6 +215,7 @@ FILES_src = \ sun/io/CharToByteCp500.java \ sun/io/CharToByteCp737.java \ sun/io/CharToByteCp775.java \ + sun/io/CharToByteCp833.java \ sun/io/CharToByteCp834.java \ sun/io/CharToByteCp838.java \ sun/io/CharToByteCp850.java \ @@ -331,6 +333,7 @@ FILES_gen_extcs = \ sun/nio/cs/ext/IBM420.java \ sun/nio/cs/ext/IBM424.java \ sun/nio/cs/ext/IBM500.java \ + sun/nio/cs/ext/IBM833.java \ sun/nio/cs/ext/IBM838.java \ sun/nio/cs/ext/IBM856.java \ sun/nio/cs/ext/IBM860.java \ diff --git a/make/sun/xawt/mapfile-vers b/make/sun/xawt/mapfile-vers index 0d951efff1d200ae6110026c0a6594869d5de64b..920d829fc93f52704767fde4d7c26ccb55d4cee2 100644 --- a/make/sun/xawt/mapfile-vers +++ b/make/sun/xawt/mapfile-vers @@ -432,6 +432,7 @@ SUNWprivate_1.1 { Java_sun_awt_X11_GtkFileDialogPeer_initIDs; Java_sun_awt_X11_GtkFileDialogPeer_run; Java_sun_awt_X11_GtkFileDialogPeer_quit; + Java_sun_awt_X11_GtkFileDialogPeer_toFront; Java_sun_print_CUPSPrinter_initIDs; Java_sun_print_CUPSPrinter_getCupsServer; diff --git a/make/tools/CharsetMapping/IBM833.c2b b/make/tools/CharsetMapping/IBM833.c2b new file mode 100644 index 0000000000000000000000000000000000000000..b751d80bc0064e8d2a792d722a860b0b90429b5d --- /dev/null +++ b/make/tools/CharsetMapping/IBM833.c2b @@ -0,0 +1,94 @@ +0x5A U+FF01 +0x7F U+FF02 +0x7B U+FF03 +0x5B U+FF04 +0x6C U+FF05 +0x50 U+FF06 +0x7D U+FF07 +0x4D U+FF08 +0x5D U+FF09 +0x5C U+FF0A +0x4E U+FF0B +0x6B U+FF0C +0x60 U+FF0D +0x4B U+FF0E +0x61 U+FF0F +0xF0 U+FF10 +0xF1 U+FF11 +0xF2 U+FF12 +0xF3 U+FF13 +0xF4 U+FF14 +0xF5 U+FF15 +0xF6 U+FF16 +0xF7 U+FF17 +0xF8 U+FF18 +0xF9 U+FF19 +0x7A U+FF1A +0x5E U+FF1B +0x4C U+FF1C +0x7E U+FF1D +0x6E U+FF1E +0x6F U+FF1F +0x7C U+FF20 +0xC1 U+FF21 +0xC2 U+FF22 +0xC3 U+FF23 +0xC4 U+FF24 +0xC5 U+FF25 +0xC6 U+FF26 +0xC7 U+FF27 +0xC8 U+FF28 +0xC9 U+FF29 +0xD1 U+FF2A +0xD2 U+FF2B +0xD3 U+FF2C +0xD4 U+FF2D +0xD5 U+FF2E +0xD6 U+FF2F +0xD7 U+FF30 +0xD8 U+FF31 +0xD9 U+FF32 +0xE2 U+FF33 +0xE3 U+FF34 +0xE4 U+FF35 +0xE5 U+FF36 +0xE6 U+FF37 +0xE7 U+FF38 +0xE8 U+FF39 +0xE9 U+FF3A +0x70 U+FF3B +0xB2 U+FF3C +0x80 U+FF3D +0xB0 U+FF3E +0x6D U+FF3F +0x79 U+FF40 +0x81 U+FF41 +0x82 U+FF42 +0x83 U+FF43 +0x84 U+FF44 +0x85 U+FF45 +0x86 U+FF46 +0x87 U+FF47 +0x88 U+FF48 +0x89 U+FF49 +0x91 U+FF4A +0x92 U+FF4B +0x93 U+FF4C +0x94 U+FF4D +0x95 U+FF4E +0x96 U+FF4F +0x97 U+FF50 +0x98 U+FF51 +0x99 U+FF52 +0xA2 U+FF53 +0xA3 U+FF54 +0xA4 U+FF55 +0xA5 U+FF56 +0xA6 U+FF57 +0xA7 U+FF58 +0xA8 U+FF59 +0xA9 U+FF5A +0xC0 U+FF5B +0x4F U+FF5C +0xD0 U+FF5D +0xA1 U+FF5E diff --git a/make/tools/CharsetMapping/IBM833.map b/make/tools/CharsetMapping/IBM833.map new file mode 100644 index 0000000000000000000000000000000000000000..b36860ae4e7a144ce372f6e181a082a37659adf2 --- /dev/null +++ b/make/tools/CharsetMapping/IBM833.map @@ -0,0 +1,217 @@ +0x00 U+0000 +0x01 U+0001 +0x02 U+0002 +0x03 U+0003 +0x37 U+0004 +0x2D U+0005 +0x2E U+0006 +0x2F U+0007 +0x16 U+0008 +0x05 U+0009 +0x25 U+000A +0x0B U+000B +0x0C U+000C +0x0D U+000D +0x0E U+000E +0x0F U+000F +0x10 U+0010 +0x11 U+0011 +0x12 U+0012 +0x13 U+0013 +0x3C U+0014 +0x3D U+0015 +0x32 U+0016 +0x26 U+0017 +0x18 U+0018 +0x19 U+0019 +0x3F U+001A +0x27 U+001B +0x1C U+001C +0x1D U+001D +0x1E U+001E +0x1F U+001F +0x40 U+0020 +0x5A U+0021 +0x7F U+0022 +0x7B U+0023 +0x5B U+0024 +0x6C U+0025 +0x50 U+0026 +0x7D U+0027 +0x4D U+0028 +0x5D U+0029 +0x5C U+002A +0x4E U+002B +0x6B U+002C +0x60 U+002D +0x4B U+002E +0x61 U+002F +0xF0 U+0030 +0xF1 U+0031 +0xF2 U+0032 +0xF3 U+0033 +0xF4 U+0034 +0xF5 U+0035 +0xF6 U+0036 +0xF7 U+0037 +0xF8 U+0038 +0xF9 U+0039 +0x7A U+003A +0x5E U+003B +0x4C U+003C +0x7E U+003D +0x6E U+003E +0x6F U+003F +0x7C U+0040 +0xC1 U+0041 +0xC2 U+0042 +0xC3 U+0043 +0xC4 U+0044 +0xC5 U+0045 +0xC6 U+0046 +0xC7 U+0047 +0xC8 U+0048 +0xC9 U+0049 +0xD1 U+004A +0xD2 U+004B +0xD3 U+004C +0xD4 U+004D +0xD5 U+004E +0xD6 U+004F +0xD7 U+0050 +0xD8 U+0051 +0xD9 U+0052 +0xE2 U+0053 +0xE3 U+0054 +0xE4 U+0055 +0xE5 U+0056 +0xE6 U+0057 +0xE7 U+0058 +0xE8 U+0059 +0xE9 U+005A +0x70 U+005B +0xB2 U+005C +0x80 U+005D +0xB0 U+005E +0x6D U+005F +0x79 U+0060 +0x81 U+0061 +0x82 U+0062 +0x83 U+0063 +0x84 U+0064 +0x85 U+0065 +0x86 U+0066 +0x87 U+0067 +0x88 U+0068 +0x89 U+0069 +0x91 U+006A +0x92 U+006B +0x93 U+006C +0x94 U+006D +0x95 U+006E +0x96 U+006F +0x97 U+0070 +0x98 U+0071 +0x99 U+0072 +0xA2 U+0073 +0xA3 U+0074 +0xA4 U+0075 +0xA5 U+0076 +0xA6 U+0077 +0xA7 U+0078 +0xA8 U+0079 +0xA9 U+007A +0xC0 U+007B +0x4F U+007C +0xD0 U+007D +0xA1 U+007E +0x07 U+007F +0x20 U+0080 +0x21 U+0081 +0x22 U+0082 +0x23 U+0083 +0x24 U+0084 +0x15 U+0085 +0x06 U+0086 +0x17 U+0087 +0x28 U+0088 +0x29 U+0089 +0x2A U+008A +0x2B U+008B +0x2C U+008C +0x09 U+008D +0x0A U+008E +0x1B U+008F +0x30 U+0090 +0x31 U+0091 +0x1A U+0092 +0x33 U+0093 +0x34 U+0094 +0x35 U+0095 +0x36 U+0096 +0x08 U+0097 +0x38 U+0098 +0x39 U+0099 +0x3A U+009A +0x3B U+009B +0x04 U+009C +0x14 U+009D +0x3E U+009E +0xFF U+009F +0x4A U+00A2 +0x6A U+00A6 +0x5F U+00AC +0xA0 U+203E +0xE0 U+20A9 +0x42 U+FFA0 +0x43 U+FFA1 +0x44 U+FFA2 +0x45 U+FFA3 +0x46 U+FFA4 +0x47 U+FFA5 +0x48 U+FFA6 +0x49 U+FFA7 +0x52 U+FFA8 +0x53 U+FFA9 +0x54 U+FFAA +0x55 U+FFAB +0x56 U+FFAC +0x57 U+FFAD +0x58 U+FFAE +0x59 U+FFAF +0x62 U+FFB0 +0x63 U+FFB1 +0x64 U+FFB2 +0x65 U+FFB3 +0x66 U+FFB4 +0x67 U+FFB5 +0x68 U+FFB6 +0x69 U+FFB7 +0x72 U+FFB8 +0x73 U+FFB9 +0x74 U+FFBA +0x75 U+FFBB +0x76 U+FFBC +0x77 U+FFBD +0x78 U+FFBE +0x8A U+FFC2 +0x8B U+FFC3 +0x8C U+FFC4 +0x8D U+FFC5 +0x8E U+FFC6 +0x8F U+FFC7 +0x9A U+FFCA +0x9B U+FFCB +0x9C U+FFCC +0x9D U+FFCD +0x9E U+FFCE +0x9F U+FFCF +0xAA U+FFD2 +0xAB U+FFD3 +0xAC U+FFD4 +0xAD U+FFD5 +0xAE U+FFD6 +0xAF U+FFD7 +0xBA U+FFDA +0xBB U+FFDB +0xBC U+FFDC diff --git a/make/tools/CharsetMapping/extsbcs b/make/tools/CharsetMapping/extsbcs index 81a6acdf8176650ba67d5c250907b11968c2c145..ac24dbe7a7dbd1f127a27259ef36d2c3e67f2194 100644 --- a/make/tools/CharsetMapping/extsbcs +++ b/make/tools/CharsetMapping/extsbcs @@ -32,6 +32,7 @@ IBM297 IBM297 Cp297 false sun.nio.cs.ext IBM420 IBM420 Cp420 false sun.nio.cs.ext IBM424 IBM424 Cp424 false sun.nio.cs.ext IBM500 IBM500 Cp500 false sun.nio.cs.ext +IBM833 x-IBM833 Cp833 false sun.nio.cs.ext IBM838 IBM-Thai Cp838 false sun.nio.cs.ext IBM856 x-IBM856 Cp856 false sun.nio.cs.ext IBM860 IBM860 Cp860 false sun.nio.cs.ext diff --git a/src/share/bin/java.c b/src/share/bin/java.c index 01eeb2a0547ab076b0db300e7e2eed29c301f54f..e02b8ac8bb0896eb147df78fd013c7be587ea57e 100644 --- a/src/share/bin/java.c +++ b/src/share/bin/java.c @@ -65,6 +65,7 @@ static jboolean printVersion = JNI_FALSE; /* print and exit */ static jboolean showVersion = JNI_FALSE; /* print but continue */ static jboolean printUsage = JNI_FALSE; /* print and exit*/ static jboolean printXUsage = JNI_FALSE; /* print and exit*/ +static char *showSettings = NULL; /* print but continue */ static const char *_program_name; static const char *_launcher_name; @@ -109,6 +110,7 @@ static void SetApplicationClassPath(const char**); static void PrintJavaVersion(JNIEnv *env, jboolean extraLF); static void PrintUsage(JNIEnv* env, jboolean doXUsage); +static void ShowSettings(JNIEnv* env, char *optString); static void SetPaths(int argc, char **argv); @@ -157,6 +159,7 @@ static jboolean IsWildCardEnabled(); * create a new thread to invoke JVM. See 6316197 for more information. */ static jlong threadStackSize = 0; /* stack size of the new thread */ +static jlong heapSize = 0; /* heap size */ int JNICALL JavaMain(void * args); /* entry point */ @@ -376,6 +379,10 @@ JavaMain(void * _args) } } + if (showSettings != NULL) { + ShowSettings(env, showSettings); + CHECK_EXCEPTION_LEAVE(0); + } /* If the user specified neither a class name nor a JAR file */ if (printXUsage || printUsage || (jarfile == 0 && classname == 0)) { PrintUsage(env, printXUsage); @@ -611,7 +618,7 @@ CheckJvmType(int *pargc, char ***argv, jboolean speculative) { /* copied from HotSpot function "atomll()" */ static int -parse_stack_size(const char *s, jlong *result) { +parse_size(const char *s, jlong *result) { jlong n = 0; int args_read = sscanf(s, jlong_format_specifier(), &n); if (args_read != 1) { @@ -673,10 +680,17 @@ AddOption(char *str, void *info) options[numOptions++].extraInfo = info; if (JLI_StrCCmp(str, "-Xss") == 0) { - jlong tmp; - if (parse_stack_size(str + 4, &tmp)) { - threadStackSize = tmp; - } + jlong tmp; + if (parse_size(str + 4, &tmp)) { + threadStackSize = tmp; + } + } + + if (JLI_StrCCmp(str, "-Xmx") == 0) { + jlong tmp; + if (parse_size(str + 4, &tmp)) { + heapSize = tmp; + } } } @@ -1014,6 +1028,13 @@ ParseArguments(int *pargc, char ***pargv, char **pjarfile, } else if (JLI_StrCmp(arg, "-X") == 0) { printXUsage = JNI_TRUE; return JNI_TRUE; +/* + * The following case checks for -XshowSettings OR -XshowSetting:SUBOPT. + * In the latter case, any SUBOPT value not recognized will default to "all" + */ + } else if (JLI_StrCmp(arg, "-XshowSettings") == 0 || + JLI_StrCCmp(arg, "-XshowSettings:") == 0) { + showSettings = arg; /* * The following case provide backward compatibility with old-style * command line options. @@ -1474,6 +1495,27 @@ PrintJavaVersion(JNIEnv *env, jboolean extraLF) (*env)->CallStaticVoidMethod(env, ver, print); } +/* + * Prints all the Java settings, see the java implementation for more details. + */ +static void +ShowSettings(JNIEnv *env, char *optString) +{ + jclass cls; + jmethodID showSettingsID; + jstring joptString; + NULL_CHECK(cls = FindBootStrapClass(env, "sun/launcher/LauncherHelper")); + NULL_CHECK(showSettingsID = (*env)->GetStaticMethodID(env, cls, + "showSettings", "(ZLjava/lang/String;JJZ)V")); + joptString = (*env)->NewStringUTF(env, optString); + (*env)->CallStaticVoidMethod(env, cls, showSettingsID, + JNI_TRUE, + joptString, + (jlong)heapSize, + (jlong)threadStackSize, + ServerClassMachine()); +} + /* * Prints default usage or the Xusage message, see sun.launcher.LauncherHelper.java */ diff --git a/src/share/classes/com/sun/java/util/jar/pack/AdaptiveCoding.java b/src/share/classes/com/sun/java/util/jar/pack/AdaptiveCoding.java index 477806bd912f6e2cf851683107bfee938524f699..a782e8631e5a935c9dec9b3dba9813b0b7ca35a0 100644 --- a/src/share/classes/com/sun/java/util/jar/pack/AdaptiveCoding.java +++ b/src/share/classes/com/sun/java/util/jar/pack/AdaptiveCoding.java @@ -25,8 +25,10 @@ package com.sun.java.util.jar.pack; -import java.util.*; -import java.io.*; +import java.io.ByteArrayOutputStream; +import java.io.IOException; +import java.io.InputStream; +import java.io.OutputStream; /** * Adaptive coding. diff --git a/src/share/classes/com/sun/java/util/jar/pack/Attribute.java b/src/share/classes/com/sun/java/util/jar/pack/Attribute.java index b662ebb9683ddfd1e5e4c6ccb8f3c29744fd32b1..7b838f26d022ddc35c6ec27787cf7ff5cb94d75b 100644 --- a/src/share/classes/com/sun/java/util/jar/pack/Attribute.java +++ b/src/share/classes/com/sun/java/util/jar/pack/Attribute.java @@ -25,9 +25,17 @@ package com.sun.java.util.jar.pack; -import java.io.*; -import java.util.*; -import com.sun.java.util.jar.pack.ConstantPool.*; +import com.sun.java.util.jar.pack.ConstantPool.Entry; +import com.sun.java.util.jar.pack.ConstantPool.Index; +import java.io.ByteArrayOutputStream; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collection; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; /** * Represents an attribute in a class-file. diff --git a/src/share/classes/com/sun/java/util/jar/pack/BandStructure.java b/src/share/classes/com/sun/java/util/jar/pack/BandStructure.java index 1c8266cd69f579b65f9b9c8fcd9f6d79e79d0a3c..7af5e38019d3ab1b3197d7ec4fc64b1bd8d87deb 100644 --- a/src/share/classes/com/sun/java/util/jar/pack/BandStructure.java +++ b/src/share/classes/com/sun/java/util/jar/pack/BandStructure.java @@ -25,12 +25,28 @@ package com.sun.java.util.jar.pack; -import java.io.*; -import java.util.*; -import java.util.jar.*; -import com.sun.java.util.jar.pack.Package.Class; -import com.sun.java.util.jar.pack.Package.InnerClass; -import com.sun.java.util.jar.pack.ConstantPool.*; +import com.sun.java.util.jar.pack.ConstantPool.Entry; +import com.sun.java.util.jar.pack.ConstantPool.Index; +import com.sun.java.util.jar.pack.Package.Class.Field; +import java.io.BufferedOutputStream; +import java.io.ByteArrayInputStream; +import java.io.ByteArrayOutputStream; +import java.io.EOFException; +import java.io.File; +import java.io.FileOutputStream; +import java.io.FilterInputStream; +import java.io.FilterOutputStream; +import java.io.IOException; +import java.io.InputStream; +import java.io.OutputStream; +import java.io.PrintStream; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collections; +import java.util.HashMap; +import java.util.Iterator; +import java.util.List; +import java.util.jar.Pack200; /** * Define the structure and ordering of "bands" in a packed file. @@ -1629,7 +1645,7 @@ class BandStructure implements Constants { } } - protected void setConstantValueIndex(Class.Field f) { + protected void setConstantValueIndex(com.sun.java.util.jar.pack.Package.Class.Field f) { Index ix = null; if (f != null) { byte tag = f.getLiteralTag(); diff --git a/src/share/classes/com/sun/java/util/jar/pack/ClassReader.java b/src/share/classes/com/sun/java/util/jar/pack/ClassReader.java index 356be128b450c14afeb0cda28fae068e7c5517a5..a1bce52a5e2b8e60587b248638b271372bc051ed 100644 --- a/src/share/classes/com/sun/java/util/jar/pack/ClassReader.java +++ b/src/share/classes/com/sun/java/util/jar/pack/ClassReader.java @@ -25,11 +25,19 @@ package com.sun.java.util.jar.pack; -import java.io.*; -import java.util.*; +import com.sun.java.util.jar.pack.ConstantPool.ClassEntry; +import com.sun.java.util.jar.pack.ConstantPool.DescriptorEntry; +import com.sun.java.util.jar.pack.ConstantPool.Entry; +import com.sun.java.util.jar.pack.ConstantPool.SignatureEntry; +import com.sun.java.util.jar.pack.ConstantPool.Utf8Entry; import com.sun.java.util.jar.pack.Package.Class; import com.sun.java.util.jar.pack.Package.InnerClass; -import com.sun.java.util.jar.pack.ConstantPool.*; +import java.io.DataInputStream; +import java.io.FilterInputStream; +import java.io.IOException; +import java.io.InputStream; +import java.util.ArrayList; +import java.util.Map; /** * Reader for a class file that is being incorporated into a package. diff --git a/src/share/classes/com/sun/java/util/jar/pack/ClassWriter.java b/src/share/classes/com/sun/java/util/jar/pack/ClassWriter.java index 516954c937a67e19c4b28f52111880d2d132dffc..a4ceff5768665b480255ba4fe3a047f008be89c4 100644 --- a/src/share/classes/com/sun/java/util/jar/pack/ClassWriter.java +++ b/src/share/classes/com/sun/java/util/jar/pack/ClassWriter.java @@ -25,11 +25,19 @@ package com.sun.java.util.jar.pack; -import java.io.*; -import java.util.*; + +import com.sun.java.util.jar.pack.ConstantPool.Entry; +import com.sun.java.util.jar.pack.ConstantPool.Index; +import com.sun.java.util.jar.pack.ConstantPool.NumberEntry; import com.sun.java.util.jar.pack.Package.Class; import com.sun.java.util.jar.pack.Package.InnerClass; -import com.sun.java.util.jar.pack.ConstantPool.*; +import java.io.BufferedOutputStream; +import java.io.ByteArrayOutputStream; +import java.io.DataOutputStream; +import java.io.IOException; +import java.io.OutputStream; +import java.util.Iterator; +import java.util.List; /** * Writer for a class file that is incorporated into a package. diff --git a/src/share/classes/com/sun/java/util/jar/pack/Code.java b/src/share/classes/com/sun/java/util/jar/pack/Code.java index 3461d44293c171b69d229c54c85a142c9e000dbf..e6272f57a5bb528260c62818e9b5ef2454b8de13 100644 --- a/src/share/classes/com/sun/java/util/jar/pack/Code.java +++ b/src/share/classes/com/sun/java/util/jar/pack/Code.java @@ -25,10 +25,10 @@ package com.sun.java.util.jar.pack; -import java.io.*; -import java.util.*; import com.sun.java.util.jar.pack.Package.Class; import java.lang.reflect.Modifier; +import java.util.Arrays; +import java.util.Collection; /** * Represents a chunk of bytecodes. diff --git a/src/share/classes/com/sun/java/util/jar/pack/Coding.java b/src/share/classes/com/sun/java/util/jar/pack/Coding.java index 6e72d1baae8def13ab5aa316cb4ba9d817992b08..a35261f5db91bdcc65f79f786d29b19bc1cab487 100644 --- a/src/share/classes/com/sun/java/util/jar/pack/Coding.java +++ b/src/share/classes/com/sun/java/util/jar/pack/Coding.java @@ -25,8 +25,10 @@ package com.sun.java.util.jar.pack; -import java.io.*; -import java.util.*; +import java.io.IOException; +import java.io.InputStream; +import java.io.OutputStream; +import java.util.HashMap; /** * Define the conversions between sequences of small integers and raw bytes. diff --git a/src/share/classes/com/sun/java/util/jar/pack/CodingChooser.java b/src/share/classes/com/sun/java/util/jar/pack/CodingChooser.java index 2f1f3e1b83900f3d014ac1c6fb4011688db7739e..61a6710a6f6d202208132ad92440b27d25e04122 100644 --- a/src/share/classes/com/sun/java/util/jar/pack/CodingChooser.java +++ b/src/share/classes/com/sun/java/util/jar/pack/CodingChooser.java @@ -25,9 +25,17 @@ package com.sun.java.util.jar.pack; -import java.io.*; -import java.util.*; -import java.util.zip.*; +import java.io.ByteArrayOutputStream; +import java.io.IOException; +import java.io.OutputStream; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashSet; +import java.util.Iterator; +import java.util.List; +import java.util.Random; +import java.util.zip.Deflater; +import java.util.zip.DeflaterOutputStream; /** * Heuristic chooser of basic encodings. diff --git a/src/share/classes/com/sun/java/util/jar/pack/CodingMethod.java b/src/share/classes/com/sun/java/util/jar/pack/CodingMethod.java index 75f32a86118524d2d159299ba71266ce15c4ee5f..d0b1d9d9604a0cb436e58ed817ba17d5e44cca4d 100644 --- a/src/share/classes/com/sun/java/util/jar/pack/CodingMethod.java +++ b/src/share/classes/com/sun/java/util/jar/pack/CodingMethod.java @@ -25,7 +25,9 @@ package com.sun.java.util.jar.pack; -import java.io.*; +import java.io.IOException; +import java.io.InputStream; +import java.io.OutputStream; /** * Interface for encoding and decoding int arrays using bytewise codes. diff --git a/src/share/classes/com/sun/java/util/jar/pack/ConstantPool.java b/src/share/classes/com/sun/java/util/jar/pack/ConstantPool.java index ac6199abe25e3dee29c821326bf683110e2f13a2..abafbd92b4096c644fdb74e7616a0c4844ed5b4d 100644 --- a/src/share/classes/com/sun/java/util/jar/pack/ConstantPool.java +++ b/src/share/classes/com/sun/java/util/jar/pack/ConstantPool.java @@ -25,7 +25,14 @@ package com.sun.java.util.jar.pack; -import java.util.*; +import java.util.AbstractList; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collection; +import java.util.List; +import java.util.ListIterator; +import java.util.Map; +import java.util.Set; /** * Representation of constant pool entries and indexes. diff --git a/src/share/classes/com/sun/java/util/jar/pack/Constants.java b/src/share/classes/com/sun/java/util/jar/pack/Constants.java index 19ce04cf559612e4574d7dfc965a0e309a17e301..512dac7972fd09d803639a6a27c900ab081ddc91 100644 --- a/src/share/classes/com/sun/java/util/jar/pack/Constants.java +++ b/src/share/classes/com/sun/java/util/jar/pack/Constants.java @@ -25,7 +25,8 @@ package com.sun.java.util.jar.pack; -import java.util.*; +import java.util.Arrays; +import java.util.List; /** * Shared constants diff --git a/src/share/classes/com/sun/java/util/jar/pack/Driver.java b/src/share/classes/com/sun/java/util/jar/pack/Driver.java index 2630febb7c35c721c54154cd3525f1fe03e28d9f..a7c47a8a8cc6b6e1f4f01031d73e5264927e4e06 100644 --- a/src/share/classes/com/sun/java/util/jar/pack/Driver.java +++ b/src/share/classes/com/sun/java/util/jar/pack/Driver.java @@ -25,11 +25,32 @@ package com.sun.java.util.jar.pack; -import java.io.*; +import java.io.BufferedInputStream; +import java.io.BufferedOutputStream; +import java.io.File; +import java.io.FileInputStream; +import java.io.FileOutputStream; +import java.io.IOException; +import java.io.InputStream; +import java.io.OutputStream; +import java.io.PrintStream; import java.text.MessageFormat; -import java.util.*; -import java.util.jar.*; -import java.util.zip.*; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Iterator; +import java.util.List; +import java.util.ListIterator; +import java.util.Map; +import java.util.Properties; +import java.util.ResourceBundle; +import java.util.SortedMap; +import java.util.TreeMap; +import java.util.jar.JarFile; +import java.util.jar.JarOutputStream; +import java.util.jar.Pack200; +import java.util.zip.GZIPInputStream; +import java.util.zip.GZIPOutputStream; /** Command line interface for Pack200. */ diff --git a/src/share/classes/com/sun/java/util/jar/pack/Fixups.java b/src/share/classes/com/sun/java/util/jar/pack/Fixups.java index 3cb47069c8f3ee9334995202219f144cb58be8ee..77815b43b2275f05e88d3e872326fd465e09aab4 100644 --- a/src/share/classes/com/sun/java/util/jar/pack/Fixups.java +++ b/src/share/classes/com/sun/java/util/jar/pack/Fixups.java @@ -25,9 +25,11 @@ package com.sun.java.util.jar.pack; -import java.io.*; -import java.util.*; -import com.sun.java.util.jar.pack.ConstantPool.*; +import com.sun.java.util.jar.pack.ConstantPool.Entry; +import java.util.AbstractCollection; +import java.util.ArrayList; +import java.util.Collection; +import java.util.Iterator; /** * Collection of relocatable constant pool references. diff --git a/src/share/classes/com/sun/java/util/jar/pack/Histogram.java b/src/share/classes/com/sun/java/util/jar/pack/Histogram.java index 1c03e592b0260e936b79371c39737de404fd921d..92cf6e4e918b36184eaa2b538966d607a43b27cf 100644 --- a/src/share/classes/com/sun/java/util/jar/pack/Histogram.java +++ b/src/share/classes/com/sun/java/util/jar/pack/Histogram.java @@ -25,8 +25,10 @@ package com.sun.java.util.jar.pack; -import java.util.*; -import java.io.*; +import java.io.IOException; +import java.io.InputStream; +import java.io.PrintStream; +import java.util.Arrays; /** * Histogram derived from an integer array of events (int[]). diff --git a/src/share/classes/com/sun/java/util/jar/pack/NativeUnpack.java b/src/share/classes/com/sun/java/util/jar/pack/NativeUnpack.java index c6d9608518014840ae2750f3dcd118ee42436091..2ea9f4d4721c091b9e7a561576a5d0ed3ad796df 100644 --- a/src/share/classes/com/sun/java/util/jar/pack/NativeUnpack.java +++ b/src/share/classes/com/sun/java/util/jar/pack/NativeUnpack.java @@ -26,10 +26,18 @@ package com.sun.java.util.jar.pack; -import java.nio.*; -import java.io.*; -import java.util.jar.*; -import java.util.zip.*; +import java.io.BufferedInputStream; +import java.io.File; +import java.io.FileInputStream; +import java.io.IOException; +import java.io.InputStream; +import java.nio.ByteBuffer; +import java.util.jar.JarOutputStream; +import java.util.jar.Pack200; +import java.util.zip.CRC32; +import java.util.zip.Deflater; +import java.util.zip.ZipEntry; +import java.util.zip.ZipOutputStream; class NativeUnpack { // Pointer to the native unpacker obj diff --git a/src/share/classes/com/sun/java/util/jar/pack/Package.java b/src/share/classes/com/sun/java/util/jar/pack/Package.java index 29d217687c49b1283ad03ba864bff6d24543509f..981bd53b75c67adbabb9ec9b02df6619e4bda90a 100644 --- a/src/share/classes/com/sun/java/util/jar/pack/Package.java +++ b/src/share/classes/com/sun/java/util/jar/pack/Package.java @@ -26,11 +26,32 @@ package com.sun.java.util.jar.pack; import com.sun.java.util.jar.pack.Attribute.Layout; +import com.sun.java.util.jar.pack.ConstantPool.ClassEntry; +import com.sun.java.util.jar.pack.ConstantPool.DescriptorEntry; +import com.sun.java.util.jar.pack.ConstantPool.Index; +import com.sun.java.util.jar.pack.ConstantPool.LiteralEntry; +import com.sun.java.util.jar.pack.ConstantPool.Utf8Entry; +import com.sun.java.util.jar.pack.ConstantPool.Entry; +import java.io.ByteArrayInputStream; +import java.io.ByteArrayOutputStream; +import java.io.IOException; +import java.io.InputStream; +import java.io.OutputStream; +import java.io.SequenceInputStream; import java.lang.reflect.Modifier; -import java.util.*; -import java.util.jar.*; -import java.io.*; -import com.sun.java.util.jar.pack.ConstantPool.*; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collection; +import java.util.Collections; +import java.util.Comparator; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Iterator; +import java.util.List; +import java.util.ListIterator; +import java.util.Map; +import java.util.Set; +import java.util.jar.JarFile; /** * Define the main data structure transmitted by pack/unpack. diff --git a/src/share/classes/com/sun/java/util/jar/pack/PackageReader.java b/src/share/classes/com/sun/java/util/jar/pack/PackageReader.java index 73efca5ca85e0f518663fc06d140a252643f29c2..be8ba0d008b0c0d7ac134d115ddcf42df05b579b 100644 --- a/src/share/classes/com/sun/java/util/jar/pack/PackageReader.java +++ b/src/share/classes/com/sun/java/util/jar/pack/PackageReader.java @@ -25,12 +25,18 @@ package com.sun.java.util.jar.pack; +import com.sun.java.util.jar.pack.ConstantPool.ClassEntry; +import com.sun.java.util.jar.pack.ConstantPool.DescriptorEntry; +import com.sun.java.util.jar.pack.ConstantPool.Entry; +import com.sun.java.util.jar.pack.ConstantPool.Index; +import com.sun.java.util.jar.pack.ConstantPool.MemberEntry; +import com.sun.java.util.jar.pack.ConstantPool.SignatureEntry; +import com.sun.java.util.jar.pack.ConstantPool.Utf8Entry; import java.io.*; import java.util.*; import com.sun.java.util.jar.pack.Package.Class; import com.sun.java.util.jar.pack.Package.File; import com.sun.java.util.jar.pack.Package.InnerClass; -import com.sun.java.util.jar.pack.ConstantPool.*; /** * Reader for a package file. diff --git a/src/share/classes/com/sun/java/util/jar/pack/PackageWriter.java b/src/share/classes/com/sun/java/util/jar/pack/PackageWriter.java index 55b64cce5e851ca2bfa1072f419a17a088f524d3..cbfcb8aacfd0a13fbf283ffafc0e8d40fa6d91a0 100644 --- a/src/share/classes/com/sun/java/util/jar/pack/PackageWriter.java +++ b/src/share/classes/com/sun/java/util/jar/pack/PackageWriter.java @@ -25,12 +25,30 @@ package com.sun.java.util.jar.pack; -import java.io.*; -import java.util.*; +import com.sun.java.util.jar.pack.ConstantPool.ClassEntry; +import com.sun.java.util.jar.pack.ConstantPool.DescriptorEntry; +import com.sun.java.util.jar.pack.ConstantPool.Entry; +import com.sun.java.util.jar.pack.ConstantPool.Index; +import com.sun.java.util.jar.pack.ConstantPool.IndexGroup; +import com.sun.java.util.jar.pack.ConstantPool.MemberEntry; +import com.sun.java.util.jar.pack.ConstantPool.NumberEntry; +import com.sun.java.util.jar.pack.ConstantPool.SignatureEntry; +import com.sun.java.util.jar.pack.ConstantPool.StringEntry; import com.sun.java.util.jar.pack.Package.Class; import com.sun.java.util.jar.pack.Package.File; import com.sun.java.util.jar.pack.Package.InnerClass; -import com.sun.java.util.jar.pack.ConstantPool.*; +import java.io.IOException; +import java.io.OutputStream; +import java.io.PrintStream; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Comparator; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Iterator; +import java.util.List; +import java.util.ListIterator; +import java.util.Map; /** * Writer for a package file. diff --git a/src/share/classes/com/sun/java/util/jar/pack/PackerImpl.java b/src/share/classes/com/sun/java/util/jar/pack/PackerImpl.java index f48407099977518c970cb7b33bdf9858c669b64c..7e2f6a27c02f7bf6de89b495442783ff90980586 100644 --- a/src/share/classes/com/sun/java/util/jar/pack/PackerImpl.java +++ b/src/share/classes/com/sun/java/util/jar/pack/PackerImpl.java @@ -26,10 +26,27 @@ package com.sun.java.util.jar.pack; import com.sun.java.util.jar.pack.Attribute.Layout; -import java.util.*; -import java.util.jar.*; -import java.io.*; import java.beans.PropertyChangeListener; +import java.io.BufferedInputStream; +import java.io.ByteArrayInputStream; +import java.io.ByteArrayOutputStream; +import java.io.File; +import java.io.FileInputStream; +import java.io.IOException; +import java.io.InputStream; +import java.io.OutputStream; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.ListIterator; +import java.util.Map; +import java.util.SortedMap; +import java.util.TimeZone; +import java.util.jar.JarEntry; +import java.util.jar.JarFile; +import java.util.jar.JarInputStream; +import java.util.jar.Pack200; /* diff --git a/src/share/classes/com/sun/java/util/jar/pack/PopulationCoding.java b/src/share/classes/com/sun/java/util/jar/pack/PopulationCoding.java index 599d86fa6b2604e632257dd83ccb84d947673be0..3e5ecf170c3dd31b3279d4e0ee3cabef46302923 100644 --- a/src/share/classes/com/sun/java/util/jar/pack/PopulationCoding.java +++ b/src/share/classes/com/sun/java/util/jar/pack/PopulationCoding.java @@ -25,8 +25,12 @@ package com.sun.java.util.jar.pack; -import java.util.*; -import java.io.*; +import java.io.ByteArrayOutputStream; +import java.io.IOException; +import java.io.InputStream; +import java.io.OutputStream; +import java.util.Arrays; +import java.util.HashSet; /** * Population-based coding. diff --git a/src/share/classes/com/sun/java/util/jar/pack/PropMap.java b/src/share/classes/com/sun/java/util/jar/pack/PropMap.java index 78c709f343d554c5b2c25699a10574f29c9cd734..3072ef394eb0ddb53027fcf227063e94d821a539 100644 --- a/src/share/classes/com/sun/java/util/jar/pack/PropMap.java +++ b/src/share/classes/com/sun/java/util/jar/pack/PropMap.java @@ -25,13 +25,24 @@ package com.sun.java.util.jar.pack; -import java.util.*; -import java.util.jar.*; -import java.util.jar.Pack200; -import java.util.zip.*; -import java.io.*; import java.beans.PropertyChangeListener; import java.beans.PropertyChangeEvent; +import java.io.BufferedInputStream; +import java.io.IOException; +import java.io.InputStream; +import java.io.PrintStream; +import java.io.PrintWriter; +import java.util.ArrayList; +import java.util.Collection; +import java.util.HashMap; +import java.util.Iterator; +import java.util.List; +import java.util.Map; +import java.util.Properties; +import java.util.Set; +import java.util.SortedMap; +import java.util.TreeMap; +import java.util.jar.Pack200; /** * Control block for publishing Pack200 options to the other classes. */ diff --git a/src/share/classes/com/sun/java/util/jar/pack/UnpackerImpl.java b/src/share/classes/com/sun/java/util/jar/pack/UnpackerImpl.java index 5b9f8ec61f6ee56434660cce13aa738f1ec41df8..a0c1e4d26ef457e873c5ce658fb66974b38077ca 100644 --- a/src/share/classes/com/sun/java/util/jar/pack/UnpackerImpl.java +++ b/src/share/classes/com/sun/java/util/jar/pack/UnpackerImpl.java @@ -25,11 +25,25 @@ package com.sun.java.util.jar.pack; -import java.util.*; -import java.util.jar.*; -import java.util.zip.*; -import java.io.*; import java.beans.PropertyChangeListener; +import java.io.BufferedInputStream; +import java.io.ByteArrayOutputStream; +import java.io.File; +import java.io.FileInputStream; +import java.io.IOException; +import java.io.InputStream; +import java.io.OutputStream; +import java.util.HashSet; +import java.util.Iterator; +import java.util.SortedMap; +import java.util.TimeZone; +import java.util.jar.JarEntry; +import java.util.jar.JarInputStream; +import java.util.jar.JarOutputStream; +import java.util.jar.Pack200; +import java.util.zip.CRC32; +import java.util.zip.CheckedOutputStream; +import java.util.zip.ZipEntry; /* * Implementation of the Pack provider. diff --git a/src/share/classes/com/sun/java/util/jar/pack/Utils.java b/src/share/classes/com/sun/java/util/jar/pack/Utils.java index 84f65ac2ccfcbbbc769f769e95b43eeef2c6b8da..d14d59926ca60471f10e6b7b2f150ce2bfc105b7 100644 --- a/src/share/classes/com/sun/java/util/jar/pack/Utils.java +++ b/src/share/classes/com/sun/java/util/jar/pack/Utils.java @@ -25,18 +25,27 @@ package com.sun.java.util.jar.pack; -import com.sun.java.util.jar.pack.Attribute.Layout; import com.sun.java.util.jar.pack.ConstantPool.ClassEntry; import com.sun.java.util.jar.pack.ConstantPool.DescriptorEntry; import com.sun.java.util.jar.pack.ConstantPool.LiteralEntry; import com.sun.java.util.jar.pack.ConstantPool.MemberEntry; import com.sun.java.util.jar.pack.ConstantPool.SignatureEntry; import com.sun.java.util.jar.pack.ConstantPool.Utf8Entry; -import java.util.*; -import java.util.jar.*; -import java.util.zip.*; -import java.io.*; - +import java.io.BufferedInputStream; +import java.io.BufferedOutputStream; +import java.io.File; +import java.io.FilterOutputStream; +import java.io.IOException; +import java.io.InputStream; +import java.io.OutputStream; +import java.util.Date; +import java.util.Enumeration; +import java.util.Map; +import java.util.jar.JarEntry; +import java.util.jar.JarFile; +import java.util.jar.JarInputStream; +import java.util.jar.JarOutputStream; +import java.util.zip.ZipEntry; import sun.util.logging.PlatformLogger; class Utils { diff --git a/src/share/classes/com/sun/net/httpserver/HttpsConfigurator.java b/src/share/classes/com/sun/net/httpserver/HttpsConfigurator.java index a299c1acf5eab9346e30614dede36dd632a83bc5..355242b8aa4aa2d393b4e1f28a61718d7c6e2bee 100644 --- a/src/share/classes/com/sun/net/httpserver/HttpsConfigurator.java +++ b/src/share/classes/com/sun/net/httpserver/HttpsConfigurator.java @@ -91,6 +91,7 @@ public class HttpsConfigurator { return context; } +//BEGIN_TIGER_EXCLUDE /** * Called by the HttpsServer to configure the parameters * for a https connection currently being established. @@ -111,4 +112,5 @@ public class HttpsConfigurator { public void configure (HttpsParameters params) { params.setSSLParameters (getSSLContext().getDefaultSSLParameters()); } +//END_TIGER_EXCLUDE } diff --git a/src/share/classes/com/sun/net/httpserver/HttpsParameters.java b/src/share/classes/com/sun/net/httpserver/HttpsParameters.java index c54e917c02ea38ca50ce120a9ee168fe197e06b0..d4dc1ee3cf8248d239a47c332e2d28897a6571c5 100644 --- a/src/share/classes/com/sun/net/httpserver/HttpsParameters.java +++ b/src/share/classes/com/sun/net/httpserver/HttpsParameters.java @@ -25,7 +25,9 @@ package com.sun.net.httpserver; import java.net.InetSocketAddress; +//BEGIN_TIGER_EXCLUDE import javax.net.ssl.SSLParameters; +//END_TIGER_EXCLUDE /** * Represents the set of parameters for each https @@ -67,6 +69,7 @@ public abstract class HttpsParameters { */ public abstract InetSocketAddress getClientAddress(); +//BEGIN_TIGER_EXCLUDE /** * Sets the SSLParameters to use for this HttpsParameters. * The parameters must be supported by the SSLContext contained @@ -79,6 +82,7 @@ public abstract class HttpsParameters { * invalid or unsupported. */ public abstract void setSSLParameters (SSLParameters params); +//END_TIGER_EXCLUDE /** * Returns a copy of the array of ciphersuites or null if none diff --git a/src/share/classes/com/sun/rowset/RowSetResourceBundle.properties b/src/share/classes/com/sun/rowset/RowSetResourceBundle.properties index fce926ea4efaaef4ccbbb268307b8a099535950f..47ad98d28aec6157e89526bd35796ee0f79a0612 100644 --- a/src/share/classes/com/sun/rowset/RowSetResourceBundle.properties +++ b/src/share/classes/com/sun/rowset/RowSetResourceBundle.properties @@ -1,5 +1,5 @@ # -# Copyright (c) 2005, 2006, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2005, 2010, 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 @@ -140,7 +140,7 @@ syncrsimpl.valtores = Value to be resolved can either be in the database or in c #WebRowSetXmlReader exception wrsxmlreader.invalidcp = End of RowSet reached. Invalid cursor position wrsxmlreader.readxml = readXML : {0} -wrsxmlreader.parseerr = ** Parsing Error : {0} , line : {0} , uri : {0} +wrsxmlreader.parseerr = ** Parsing Error : {0} , line : {1} , uri : {2} #WebRowSetXmlWriter exceptions wrsxmlwriter.ioex = IOException : {0} @@ -151,7 +151,7 @@ wsrxmlwriter.notproper = Not a proper type #XmlReaderContentHandler exceptions xmlrch.errmap = Error setting Map : {0} xmlrch.errmetadata = Error setting metadata : {0} -xmlrch.errinsert = Error inserting values : {0} +xmlrch.errinsertval = Error inserting values : {0} xmlrch.errconstr = Error constructing row : {0} xmlrch.errdel = Error deleting row : {0} xmlrch.errinsert = Error constructing insert row : {0} @@ -161,7 +161,7 @@ xmlrch.errupdrow = Error updating row : {0} xmlrch.chars = characters : xmlrch.badvalue = Bad value ; non-nullable property xmlrch.badvalue1 = Bad value ; non-nullable metadata -xmlrch.warning = ** Warning : {0} , line : {0} , uri : {0} +xmlrch.warning = ** Warning : {0} , line : {1} , uri : {2} #RIOptimisticProvider Exceptions riop.locking = Locking classification is not supported diff --git a/src/share/classes/com/sun/rowset/internal/XmlReaderContentHandler.java b/src/share/classes/com/sun/rowset/internal/XmlReaderContentHandler.java index 5008a289e20ceeb350a85bc5b5647c19ce9870f8..47b78fd82859b4179513bf7ae0328242b90e1582 100644 --- a/src/share/classes/com/sun/rowset/internal/XmlReaderContentHandler.java +++ b/src/share/classes/com/sun/rowset/internal/XmlReaderContentHandler.java @@ -738,7 +738,7 @@ public class XmlReaderContentHandler extends DefaultHandler { // columnValue now need to be reset to the empty string columnValue = ""; } catch (SQLException ex) { - throw new SAXException(MessageFormat.format(resBundle.handleGetObject("xmlrch.errinsert").toString(), ex.getMessage())); + throw new SAXException(MessageFormat.format(resBundle.handleGetObject("xmlrch.errinsertval").toString(), ex.getMessage())); } break; case RowTag: diff --git a/src/share/classes/java/awt/Color.java b/src/share/classes/java/awt/Color.java index 8cbe667ca000e364b2577ee974ddf65dcd787dd9..2ff9a6d5e1b96e3f20adc4df0b41d5026e2b2d64 100644 --- a/src/share/classes/java/awt/Color.java +++ b/src/share/classes/java/awt/Color.java @@ -611,12 +611,15 @@ public class Color implements Paint, java.io.Serializable { *
* This method applies an arbitrary scale factor to each of the three RGB
* components of this Color to create a brighter version
- * of this Color. Although brighter and
+ * of this Color.
+ * The {@code alpha} value is preserved.
+ * Although brighter and
* darker are inverse operations, the results of a
* series of invocations of these two methods might be inconsistent
* because of rounding errors.
* @return a new Color object that is
- * a brighter version of this Color.
+ * a brighter version of this Color
+ * with the same {@code alpha} value.
* @see java.awt.Color#darker
* @since JDK1.0
*/
@@ -624,6 +627,7 @@ public class Color implements Paint, java.io.Serializable {
int r = getRed();
int g = getGreen();
int b = getBlue();
+ int alpha = getAlpha();
/* From 2D group:
* 1. black.brighter() should return grey
@@ -632,7 +636,7 @@ public class Color implements Paint, java.io.Serializable {
*/
int i = (int)(1.0/(1.0-FACTOR));
if ( r == 0 && g == 0 && b == 0) {
- return new Color(i, i, i);
+ return new Color(i, i, i, alpha);
}
if ( r > 0 && r < i ) r = i;
if ( g > 0 && g < i ) g = i;
@@ -640,7 +644,8 @@ public class Color implements Paint, java.io.Serializable {
return new Color(Math.min((int)(r/FACTOR), 255),
Math.min((int)(g/FACTOR), 255),
- Math.min((int)(b/FACTOR), 255));
+ Math.min((int)(b/FACTOR), 255),
+ alpha);
}
/**
@@ -649,19 +654,23 @@ public class Color implements Paint, java.io.Serializable {
*
* This method applies an arbitrary scale factor to each of the three RGB
* components of this Color to create a darker version of
- * this Color. Although brighter and
+ * this Color.
+ * The {@code alpha} value is preserved.
+ * Although brighter and
* darker are inverse operations, the results of a series
* of invocations of these two methods might be inconsistent because
* of rounding errors.
* @return a new Color object that is
- * a darker version of this Color.
+ * a darker version of this Color
+ * with the same {@code alpha} value.
* @see java.awt.Color#brighter
* @since JDK1.0
*/
public Color darker() {
return new Color(Math.max((int)(getRed() *FACTOR), 0),
Math.max((int)(getGreen()*FACTOR), 0),
- Math.max((int)(getBlue() *FACTOR), 0));
+ Math.max((int)(getBlue() *FACTOR), 0),
+ getAlpha());
}
/**
diff --git a/src/share/classes/java/awt/Container.java b/src/share/classes/java/awt/Container.java
index a7ee77e16cbf5a711e34256fade7a0d46796b97e..8a463b005e4a6ec1f44f18e4d659a29a66acec37 100644
--- a/src/share/classes/java/awt/Container.java
+++ b/src/share/classes/java/awt/Container.java
@@ -51,6 +51,7 @@ import javax.accessibility.*;
import sun.util.logging.PlatformLogger;
import sun.awt.AppContext;
+import sun.awt.AWTAccessor;
import sun.awt.CausedFocusEvent;
import sun.awt.PeerEvent;
import sun.awt.SunToolkit;
@@ -247,6 +248,13 @@ public class Container extends Component {
if (!GraphicsEnvironment.isHeadless()) {
initIDs();
}
+
+ AWTAccessor.setContainerAccessor(new AWTAccessor.ContainerAccessor() {
+ @Override
+ public void validateUnconditionally(Container cont) {
+ cont.validateUnconditionally();
+ }
+ });
}
/**
diff --git a/src/share/classes/java/awt/Dialog.java b/src/share/classes/java/awt/Dialog.java
index b408148b1cb8b410533ad70047122443c71ebd36..c3a87bda6ad063e00c8fde6b37eb642c03fd052d 100644
--- a/src/share/classes/java/awt/Dialog.java
+++ b/src/share/classes/java/awt/Dialog.java
@@ -1248,14 +1248,31 @@ public class Dialog extends Window {
/**
* Disables or enables decorations for this dialog.
- * This method can only be called while the dialog is not displayable.
- * @param undecorated true if no dialog decorations are
- * to be enabled;
- * false if dialog decorations are to be enabled.
- * @throws IllegalComponentStateException if the dialog
- * is displayable.
+ *
+ * This method can only be called while the dialog is not displayable. To
+ * make this dialog decorated, it must be opaque and have the default shape,
+ * otherwise the {@code IllegalComponentStateException} will be thrown.
+ * Refer to {@link Window#setShape}, {@link Window#setOpacity} and {@link
+ * Window#setBackground} for details
+ *
+ * @param undecorated {@code true} if no dialog decorations are to be
+ * enabled; {@code false} if dialog decorations are to be enabled
+ *
+ * @throws IllegalComponentStateException if the dialog is displayable
+ * @throws IllegalComponentStateException if {@code undecorated} is
+ * {@code false}, and this dialog does not have the default shape
+ * @throws IllegalComponentStateException if {@code undecorated} is
+ * {@code false}, and this dialog opacity is less than {@code 1.0f}
+ * @throws IllegalComponentStateException if {@code undecorated} is
+ * {@code false}, and the alpha value of this dialog background
+ * color is less than {@code 1.0f}
+ *
* @see #isUndecorated
* @see Component#isDisplayable
+ * @see Window#getShape
+ * @see Window#getOpacity
+ * @see Window#getBackground
+ *
* @since 1.4
*/
public void setUndecorated(boolean undecorated) {
@@ -1264,6 +1281,18 @@ public class Dialog extends Window {
if (isDisplayable()) {
throw new IllegalComponentStateException("The dialog is displayable.");
}
+ if (!undecorated) {
+ if (getOpacity() < 1.0f) {
+ throw new IllegalComponentStateException("The dialog is not opaque");
+ }
+ if (getShape() != null) {
+ throw new IllegalComponentStateException("The dialog does not have a default shape");
+ }
+ Color bg = getBackground();
+ if ((bg != null) && (bg.getAlpha() < 255)) {
+ throw new IllegalComponentStateException("The dialog background color is not opaque");
+ }
+ }
this.undecorated = undecorated;
}
}
@@ -1280,6 +1309,45 @@ public class Dialog extends Window {
return undecorated;
}
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public void setOpacity(float opacity) {
+ synchronized (getTreeLock()) {
+ if ((opacity < 1.0f) && !isUndecorated()) {
+ throw new IllegalComponentStateException("The dialog is decorated");
+ }
+ super.setOpacity(opacity);
+ }
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public void setShape(Shape shape) {
+ synchronized (getTreeLock()) {
+ if ((shape != null) && !isUndecorated()) {
+ throw new IllegalComponentStateException("The dialog is decorated");
+ }
+ super.setShape(shape);
+ }
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public void setBackground(Color bgColor) {
+ synchronized (getTreeLock()) {
+ if ((bgColor != null) && (bgColor.getAlpha() < 255) && !isUndecorated()) {
+ throw new IllegalComponentStateException("The dialog is decorated");
+ }
+ super.setBackground(bgColor);
+ }
+ }
+
/**
* Returns a string representing the state of this dialog. This
* method is intended to be used only for debugging purposes, and the
diff --git a/src/share/classes/java/awt/FileDialog.java b/src/share/classes/java/awt/FileDialog.java
index 033b7660d0edbf36ab1af970cfc13437db93f755..5e35bfe2ea90d3d0a16257b07b5d9763157d4192 100644
--- a/src/share/classes/java/awt/FileDialog.java
+++ b/src/share/classes/java/awt/FileDialog.java
@@ -99,7 +99,7 @@ public class FileDialog extends Dialog {
* Contains the File instances for all the files that the user selects.
*
* @serial
- * @see getFiles
+ * @see #getFiles
* @since 1.7
*/
private File[] files;
diff --git a/src/share/classes/java/awt/Frame.java b/src/share/classes/java/awt/Frame.java
index f69e02f5239aa9453736c422528ba940d444fede..bd2539f055bd7a12ac8f28e589e2506d32929ea4 100644
--- a/src/share/classes/java/awt/Frame.java
+++ b/src/share/classes/java/awt/Frame.java
@@ -828,6 +828,11 @@ public class Frame extends Window implements MenuContainer {
return frame.state;
}
}
+ public Rectangle getMaximizedBounds(Frame frame) {
+ synchronized(frame.getObjectLock()) {
+ return frame.maximizedBounds;
+ }
+ }
}
);
}
@@ -855,8 +860,10 @@ public class Frame extends Window implements MenuContainer {
* @see #getMaximizedBounds()
* @since 1.4
*/
- public synchronized void setMaximizedBounds(Rectangle bounds) {
- this.maximizedBounds = bounds;
+ public void setMaximizedBounds(Rectangle bounds) {
+ synchronized(getObjectLock()) {
+ this.maximizedBounds = bounds;
+ }
FramePeer peer = (FramePeer)this.peer;
if (peer != null) {
peer.setMaximizedBounds(bounds);
@@ -873,21 +880,40 @@ public class Frame extends Window implements MenuContainer {
* @since 1.4
*/
public Rectangle getMaximizedBounds() {
- return maximizedBounds;
+ synchronized(getObjectLock()) {
+ return maximizedBounds;
+ }
}
/**
* Disables or enables decorations for this frame.
- * This method can only be called while the frame is not displayable.
- * @param undecorated true if no frame decorations are
- * to be enabled;
- * false if frame decorations are to be enabled.
- * @throws IllegalComponentStateException if the frame
- * is displayable.
+ *
+ * This method can only be called while the frame is not displayable. To + * make this frame decorated, it must be opaque and have the default shape, + * otherwise the {@code IllegalComponentStateException} will be thrown. + * Refer to {@link Window#setShape}, {@link Window#setOpacity} and {@link + * Window#setBackground} for details + * + * @param undecorated {@code true} if no frame decorations are to be + * enabled; {@code false} if frame decorations are to be enabled + * + * @throws IllegalComponentStateException if the frame is displayable + * @throws IllegalComponentStateException if {@code undecorated} is + * {@code false}, and this frame does not have the default shape + * @throws IllegalComponentStateException if {@code undecorated} is + * {@code false}, and this frame opacity is less than {@code 1.0f} + * @throws IllegalComponentStateException if {@code undecorated} is + * {@code false}, and the alpha value of this frame background + * color is less than {@code 1.0f} + * * @see #isUndecorated * @see Component#isDisplayable + * @see Window#getShape + * @see Window#getOpacity + * @see Window#getBackground * @see javax.swing.JFrame#setDefaultLookAndFeelDecorated(boolean) + * * @since 1.4 */ public void setUndecorated(boolean undecorated) { @@ -896,6 +922,18 @@ public class Frame extends Window implements MenuContainer { if (isDisplayable()) { throw new IllegalComponentStateException("The frame is displayable."); } + if (!undecorated) { + if (getOpacity() < 1.0f) { + throw new IllegalComponentStateException("The frame is not opaque"); + } + if (getShape() != null) { + throw new IllegalComponentStateException("The frame does not have a default shape"); + } + Color bg = getBackground(); + if ((bg != null) && (bg.getAlpha() < 255)) { + throw new IllegalComponentStateException("The frame background color is not opaque"); + } + } this.undecorated = undecorated; } } @@ -912,6 +950,45 @@ public class Frame extends Window implements MenuContainer { return undecorated; } + /** + * {@inheritDoc} + */ + @Override + public void setOpacity(float opacity) { + synchronized (getTreeLock()) { + if ((opacity < 1.0f) && !isUndecorated()) { + throw new IllegalComponentStateException("The frame is decorated"); + } + super.setOpacity(opacity); + } + } + + /** + * {@inheritDoc} + */ + @Override + public void setShape(Shape shape) { + synchronized (getTreeLock()) { + if ((shape != null) && !isUndecorated()) { + throw new IllegalComponentStateException("The frame is decorated"); + } + super.setShape(shape); + } + } + + /** + * {@inheritDoc} + */ + @Override + public void setBackground(Color bgColor) { + synchronized (getTreeLock()) { + if ((bgColor != null) && (bgColor.getAlpha() < 255) && !isUndecorated()) { + throw new IllegalComponentStateException("The frame is decorated"); + } + super.setBackground(bgColor); + } + } + /** * Removes the specified menu bar from this frame. * @param m the menu component to remove. diff --git a/src/share/classes/java/awt/Window.java b/src/share/classes/java/awt/Window.java index 03dbd535e9f0d5f146c83ba2ad6247399096e1e6..064c8494f4e969479a92cf648b04ae7975af58db 100644 --- a/src/share/classes/java/awt/Window.java +++ b/src/share/classes/java/awt/Window.java @@ -3474,14 +3474,20 @@ public class Window extends Container implements Accessible { * level of 0 may or may not disable the mouse event handling on this * window. This is a platform-dependent behavior. *
- * In order for this method to enable the translucency effect, the {@link - * GraphicsDevice#isWindowTranslucencySupported(GraphicsDevice.WindowTranslucency)} method must indicate that - * the {@link GraphicsDevice.WindowTranslucency#TRANSLUCENT TRANSLUCENT} - * translucency is supported. + * The following conditions must be met in order to set the opacity value + * less than {@code 1.0f}: + *
- * Also note that the window must not be in the full-screen mode when - * setting the opacity value < 1.0f. Otherwise the {@code - * IllegalComponentStateException} is thrown. + * If the requested opacity value is less than {@code 1.0f}, and any of the + * above conditions are not met, the window opacity will not change, + * and the {@code IllegalComponentStateException} will be thrown. *
* The translucency levels of individual pixels may also be effected by the * alpha component of their color (see {@link Window#setBackground(Color)}) and the @@ -3491,15 +3497,20 @@ public class Window extends Container implements Accessible { * * @throws IllegalArgumentException if the opacity is out of the range * [0..1] + * @throws IllegalComponentStateException if the window is decorated and + * the opacity is less than {@code 1.0f} * @throws IllegalComponentStateException if the window is in full screen - * mode, and the opacity is less than 1.0f + * mode, and the opacity is less than {@code 1.0f} * @throws UnsupportedOperationException if the {@code * GraphicsDevice.WindowTranslucency#TRANSLUCENT TRANSLUCENT} - * translucency kind is not supported and the opacity is less than 1.0f + * translucency is not supported and the opacity is less than + * {@code 1.0f} * * @see Window#getOpacity * @see Window#setBackground(Color) * @see Window#setShape(Shape) + * @see Frame#isUndecorated + * @see Dialog#isUndecorated * @see GraphicsDevice.WindowTranslucency * @see GraphicsDevice#isWindowTranslucencySupported(GraphicsDevice.WindowTranslucency) * @@ -3557,24 +3568,26 @@ public class Window extends Container implements Accessible { /** * Sets the shape of the window. *
- * Setting a shape enables cutting off some parts of the window, leaving - * visible and clickable only those parts belonging to the given shape - * (see {@link Shape}). If the shape argument is null, this methods - * restores the default shape (making the window rectangular on most - * platforms.) + * Setting a shape cuts off some parts of the window. Only the parts that + * belong to the given {@link Shape} remain visible and clickable. If + * the shape argument is {@code null}, this method restores the default + * shape, making the window rectangular on most platforms. *
- * The following conditions must be met in order to set a non-null shape: + * The following conditions must be met to set a non-null shape: *
+ * If the requested shape is not {@code null}, and any of the above + * conditions are not met, the shape of this window will not change, + * and either the {@code UnsupportedOperationException} or {@code + * IllegalComponentStateException} will be thrown. *
* The tranlucency levels of individual pixels may also be effected by the * alpha component of their color (see {@link Window#setBackground(Color)}) and the @@ -3584,6 +3597,8 @@ public class Window extends Container implements Accessible { * @param shape the shape to set to the window * * @throws IllegalComponentStateException if the shape is not {@code + * null} and the window is decorated + * @throws IllegalComponentStateException if the shape is not {@code * null} and the window is in full-screen mode * @throws UnsupportedOperationException if the shape is not {@code * null} and {@link GraphicsDevice.WindowTranslucency#PERPIXEL_TRANSPARENT @@ -3592,6 +3607,8 @@ public class Window extends Container implements Accessible { * @see Window#getShape() * @see Window#setBackground(Color) * @see Window#setOpacity(float) + * @see Frame#isUndecorated + * @see Dialog#isUndecorated * @see GraphicsDevice.WindowTranslucency * @see GraphicsDevice#isWindowTranslucencySupported(GraphicsDevice.WindowTranslucency) * @@ -3645,37 +3662,46 @@ public class Window extends Container implements Accessible { * GraphicsDevice.WindowTranslucency#PERPIXEL_TRANSLUCENT PERPIXEL_TRANSLUCENT} * tranclucency, the alpha component of the given background color * may effect the mode of operation for this window: it indicates whether - * this window must be opaque (alpha == 1.0f) or per-pixel translucent - * (alpha < 1.0f). All the following conditions must be met in order - * to be able to enable the per-pixel transparency mode for this window: + * this window must be opaque (alpha equals {@code 1.0f}) or per-pixel translucent + * (alpha is less than {@code 1.0f}). If the given background color is + * {@code null}, the window is considered completely opaque. + *
+ * All the following conditions must be met to enable the per-pixel + * transparency mode for this window: *
+ * If the alpha component of the requested background color is less than + * {@code 1.0f}, and any of the above conditions are not met, the background + * color of this window will not change, the alpha component of the given + * background color will not affect the mode of operation for this window, + * and either the {@code UnsupportedOperationException} or {@code + * IllegalComponentStateException} will be thrown. *
* When the window is per-pixel translucent, the drawing sub-system * respects the alpha value of each individual pixel. If a pixel gets * painted with the alpha color component equal to zero, it becomes - * visually transparent, if the alpha of the pixel is equal to 1.0f, the + * visually transparent. If the alpha of the pixel is equal to 1.0f, the * pixel is fully opaque. Interim values of the alpha color component make - * the pixel semi-transparent. In this mode the background of the window - * gets painted with the alpha value of the given background color (meaning - * that it is not painted at all if the alpha value of the argument of this - * method is equal to zero.) + * the pixel semi-transparent. In this mode, the background of the window + * gets painted with the alpha value of the given background color. If the + * alpha value of the argument of this method is equal to {@code 0}, the + * background is not painted at all. *
* The actual level of translucency of a given pixel also depends on window * opacity (see {@link #setOpacity(float)}), as well as the current shape of * this window (see {@link #setShape(Shape)}). *
- * Note that painting a pixel with the alpha value of 0 may or may not - * disable the mouse event handling on this pixel. This is a - * platform-dependent behavior. To make sure the mouse clicks do not get + * Note that painting a pixel with the alpha value of {@code 0} may or may + * not disable the mouse event handling on this pixel. This is a + * platform-dependent behavior. To make sure the mouse events do not get * dispatched to a particular pixel, the pixel must be excluded from the * shape of the window. *
@@ -3685,17 +3711,21 @@ public class Window extends Container implements Accessible { * @param bgColor the color to become this window's background color. * * @throws IllegalComponentStateException if the alpha value of the given - * background color is less than 1.0f and the window is in + * background color is less than {@code 1.0f} and the window is decorated + * @throws IllegalComponentStateException if the alpha value of the given + * background color is less than {@code 1.0f} and the window is in * full-screen mode * @throws UnsupportedOperationException if the alpha value of the given - * background color is less than 1.0f and - * {@link GraphicsDevice.WindowTranslucency#PERPIXEL_TRANSLUCENT + * background color is less than {@code 1.0f} and {@link + * GraphicsDevice.WindowTranslucency#PERPIXEL_TRANSLUCENT * PERPIXEL_TRANSLUCENT} translucency is not supported * * @see Window#getBackground * @see Window#isOpaque * @see Window#setOpacity(float) * @see Window#setShape(Shape) + * @see Frame#isUndecorated + * @see Dialog#isUndecorated * @see GraphicsDevice.WindowTranslucency * @see GraphicsDevice#isWindowTranslucencySupported(GraphicsDevice.WindowTranslucency) * @see GraphicsConfiguration#isTranslucencyCapable() @@ -3739,7 +3769,7 @@ public class Window extends Container implements Accessible { *
* The method returns {@code false} if the background color of the window * is not {@code null} and the alpha component of the color is less than - * 1.0f. The method returns {@code true} otherwise. + * {@code 1.0f}. The method returns {@code true} otherwise. * * @return {@code true} if the window is opaque, {@code false} otherwise * diff --git a/src/share/classes/java/io/BufferedInputStream.java b/src/share/classes/java/io/BufferedInputStream.java index d61f74bcbd38189f986c50ed28c38af2049c6106..73885f318d9b69a6c8b78a01cfde31adfcca3b12 100644 --- a/src/share/classes/java/io/BufferedInputStream.java +++ b/src/share/classes/java/io/BufferedInputStream.java @@ -395,7 +395,11 @@ class BufferedInputStream extends FilterInputStream { * or an I/O error occurs. */ public synchronized int available() throws IOException { - return getInIfOpen().available() + (count - pos); + int n = count - pos; + int avail = getInIfOpen().available(); + return n > (Integer.MAX_VALUE - avail) + ? Integer.MAX_VALUE + : n + avail; } /** diff --git a/src/share/classes/java/io/PushbackInputStream.java b/src/share/classes/java/io/PushbackInputStream.java index 1984247e57573c4179c80106d6e3c2abb886db3d..0a8e0c9cf64acfb7873792674969d8a60ec0d576 100644 --- a/src/share/classes/java/io/PushbackInputStream.java +++ b/src/share/classes/java/io/PushbackInputStream.java @@ -273,7 +273,11 @@ class PushbackInputStream extends FilterInputStream { */ public int available() throws IOException { ensureOpen(); - return (buf.length - pos) + super.available(); + int n = buf.length - pos; + int avail = super.available(); + return n > (Integer.MAX_VALUE - avail) + ? Integer.MAX_VALUE + : n + avail; } /** diff --git a/src/share/classes/java/lang/Readable.java b/src/share/classes/java/lang/Readable.java index c97d792cca8c7b65376829bbb4221a60c5b58a97..51279ef27ec186dcdaabc5bfd0d6afb927dee94b 100644 --- a/src/share/classes/java/lang/Readable.java +++ b/src/share/classes/java/lang/Readable.java @@ -44,11 +44,11 @@ public interface Readable { * rewinding of the buffer is performed. * * @param cb the buffer to read characters into - * @return @return The number of char values added to the buffer, + * @return The number of {@code char} values added to the buffer, * or -1 if this source of characters is at its end * @throws IOException if an I/O error occurs * @throws NullPointerException if cb is null - * @throws ReadOnlyBufferException if cb is a read only buffer + * @throws java.nio.ReadOnlyBufferException if cb is a read only buffer */ public int read(java.nio.CharBuffer cb) throws IOException; diff --git a/src/share/classes/java/nio/StringCharBuffer.java b/src/share/classes/java/nio/StringCharBuffer.java index b5df238573c1a09509b7092434d56a42668cb30e..52d7a2087a500371e2b54e63976d8b92064ff4e3 100644 --- a/src/share/classes/java/nio/StringCharBuffer.java +++ b/src/share/classes/java/nio/StringCharBuffer.java @@ -47,7 +47,7 @@ class StringCharBuffer // package-private 0, this.remaining(), this.remaining(), - this.position()); + offset + this.position()); } private StringCharBuffer(CharSequence s, diff --git a/src/share/classes/java/nio/channels/AsynchronousSocketChannel.java b/src/share/classes/java/nio/channels/AsynchronousSocketChannel.java index d37bd2efc463d7750a37dd4ddb14c972e55802ca..6d04f4f52a2a74309bb8eeb4d88435f566c30772 100644 --- a/src/share/classes/java/nio/channels/AsynchronousSocketChannel.java +++ b/src/share/classes/java/nio/channels/AsynchronousSocketChannel.java @@ -110,7 +110,8 @@ import java.nio.ByteBuffer; * state of the {@link ByteBuffer}, or the sequence of buffers, for the I/O * operation is not defined. Buffers should be discarded or at least care must * be taken to ensure that the buffers are not accessed while the channel remains - * open. + * open. All methods that accept timeout parameters treat values less than or + * equal to zero to mean that the I/O operation does not timeout. * * @since 1.7 */ @@ -367,7 +368,7 @@ public abstract class AsynchronousSocketChannel * @param dst * The buffer into which bytes are to be transferred * @param timeout - * The timeout, or {@code 0L} for no timeout + * The maximum time for the I/O operation to complete * @param unit * The time unit of the {@code timeout} argument * @param attachment @@ -376,8 +377,7 @@ public abstract class AsynchronousSocketChannel * The handler for consuming the result * * @throws IllegalArgumentException - * If the {@code timeout} parameter is negative or the buffer is - * read-only + * If the buffer is read-only * @throws ReadPendingException * If a read operation is already in progress on this channel * @throws NotYetConnectedException @@ -471,7 +471,7 @@ public abstract class AsynchronousSocketChannel * The maximum number of buffers to be accessed; must be non-negative * and no larger than {@code dsts.length - offset} * @param timeout - * The timeout, or {@code 0L} for no timeout + * The maximum time for the I/O operation to complete * @param unit * The time unit of the {@code timeout} argument * @param attachment @@ -483,8 +483,7 @@ public abstract class AsynchronousSocketChannel * If the pre-conditions for the {@code offset} and {@code length} * parameter aren't met * @throws IllegalArgumentException - * If the {@code timeout} parameter is negative, or a buffer is - * read-only + * If the buffer is read-only * @throws ReadPendingException * If a read operation is already in progress on this channel * @throws NotYetConnectedException @@ -524,7 +523,7 @@ public abstract class AsynchronousSocketChannel * @param src * The buffer from which bytes are to be retrieved * @param timeout - * The timeout, or {@code 0L} for no timeout + * The maximum time for the I/O operation to complete * @param unit * The time unit of the {@code timeout} argument * @param attachment @@ -532,8 +531,6 @@ public abstract class AsynchronousSocketChannel * @param handler * The handler for consuming the result * - * @throws IllegalArgumentException - * If the {@code timeout} parameter is negative * @throws WritePendingException * If a write operation is already in progress on this channel * @throws NotYetConnectedException @@ -623,7 +620,7 @@ public abstract class AsynchronousSocketChannel * The maximum number of buffers to be accessed; must be non-negative * and no larger than {@code srcs.length - offset} * @param timeout - * The timeout, or {@code 0L} for no timeout + * The maximum time for the I/O operation to complete * @param unit * The time unit of the {@code timeout} argument * @param attachment @@ -634,8 +631,6 @@ public abstract class AsynchronousSocketChannel * @throws IndexOutOfBoundsException * If the pre-conditions for the {@code offset} and {@code length} * parameter aren't met - * @throws IllegalArgumentException - * If the {@code timeout} parameter is negative * @throws WritePendingException * If a write operation is already in progress on this channel * @throws NotYetConnectedException diff --git a/src/share/classes/java/sql/SQLPermission.java b/src/share/classes/java/sql/SQLPermission.java index e7e799c1caca038fb4defc9d04046693f00f705d..9f45718853d020c53690e4b3fe7a4552c680671f 100644 --- a/src/share/classes/java/sql/SQLPermission.java +++ b/src/share/classes/java/sql/SQLPermission.java @@ -84,7 +84,7 @@ import java.security.*; * {@code setJNDIContext} and {@code setLogger} *
This is an abstract class for representing the system policy for
* Subject-based authorization. A subclass implementation
@@ -159,6 +162,10 @@ public abstract class Policy {
private static Policy policy;
private static ClassLoader contextClassLoader;
+ // true if a custom (not com.sun.security.auth.PolicyFile) system-wide
+ // policy object is set
+ private static boolean isCustomPolicy;
+
static {
contextClassLoader = java.security.AccessController.doPrivileged
(new java.security.PrivilegedAction"+code+Code.msg(code)+"
"+message
+ code, false, ""+code+Code.msg(code)+"
"+message
);
- /* connection is already closed by sendReply, now remove it */
- allConnections.remove(connection);
+ closeConnection(connection);
}
void sendReply (
int code, boolean closeNow, String text)
{
try {
- String s = "HTTP/1.1 " + code + Code.msg(code) + "\r\n";
+ StringBuilder builder = new StringBuilder (512);
+ builder.append ("HTTP/1.1 ")
+ .append (code).append (Code.msg(code)).append ("\r\n");
+
if (text != null && text.length() != 0) {
- s = s + "Content-Length: "+text.length()+"\r\n";
- s = s + "Content-Type: text/html\r\n";
+ builder.append ("Content-Length: ")
+ .append (text.length()).append ("\r\n")
+ .append ("Content-Type: text/html\r\n");
} else {
- s = s + "Content-Length: 0\r\n";
+ builder.append ("Content-Length: 0\r\n");
text = "";
}
if (closeNow) {
- s = s + "Connection: close\r\n";
+ builder.append ("Connection: close\r\n");
}
- s = s + "\r\n" + text;
+ builder.append ("\r\n").append (text);
+ String s = builder.toString();
byte[] b = s.getBytes("ISO8859_1");
rawout.write (b);
rawout.flush();
if (closeNow) {
- connection.close();
+ closeConnection(connection);
}
} catch (IOException e) {
logger.log (Level.FINER, "ServerImpl.sendReply", e);
- connection.close();
+ closeConnection(connection);
}
}
}
void logReply (int code, String requestStr, String text) {
+ if (!logger.isLoggable(Level.FINE)) {
+ return;
+ }
if (text == null) {
text = "";
}
- String message = requestStr + " [" + code + " " +
+ String r;
+ if (requestStr.length() > 80) {
+ r = requestStr.substring (0, 80) + "
The source.
diff --git a/src/share/demo/java2d/J2DBench/src/j2dbench/J2DBench.java b/src/share/demo/java2d/J2DBench/src/j2dbench/J2DBench.java
index 193264670d53c7fb9cd21cdd2f827e643a11b3de..e198c0c84245db5952218558d5933ab4444ba098 100644
--- a/src/share/demo/java2d/J2DBench/src/j2dbench/J2DBench.java
+++ b/src/share/demo/java2d/J2DBench/src/j2dbench/J2DBench.java
@@ -75,7 +75,8 @@ public class J2DBench {
static JFrame guiFrame;
- static final SimpleDateFormat sdf = new SimpleDateFormat("MM.dd.yyyy 'at' HH:mm aaa z");
+ static final SimpleDateFormat sdf =
+ new SimpleDateFormat("MM.dd.yyyy 'at' HH:mm aaa z");
public static void init() {
progoptroot = new Group("prog", "Program Options");
@@ -176,6 +177,8 @@ public class J2DBench {
public static void main(String argv[]) {
init();
TestEnvironment.init();
+ Result.init();
+
Destinations.init();
GraphicsTests.init();
RenderTests.init();
@@ -323,7 +326,7 @@ public class J2DBench {
} else if (type.equalsIgnoreCase("m")) {
multiplyWith = 60;
} else {
- System.out.println("Invalid \"-loop\" option specified.");
+ System.err.println("Invalid \"-loop\" option specified.");
usage(1);
}
@@ -331,32 +334,20 @@ public class J2DBench {
try {
val = Integer.parseInt(argv[i].substring(0, argv[i].length() - 1));
} catch(Exception e) {
- System.out.println("Invalid \"-loop\" option specified.");
+ System.err.println("Invalid \"-loop\" option specified.");
usage(1);
}
requiredLoopTime = val * multiplyWith * 1000;
}
- } else if (arg.length() > 7 &&
- arg.substring(0, 7).equalsIgnoreCase("-report"))
- {
- for (int j = 7; j < arg.length(); j++) {
- char c = arg.charAt(j);
- switch (c) {
- case 'N': Result.unitScale = Result.UNITS_WHOLE; break;
- case 'M': Result.unitScale = Result.UNITS_MILLIONS; break;
- case 'K': Result.unitScale = Result.UNITS_THOUSANDS; break;
- case 'A': Result.unitScale = Result.UNITS_AUTO; break;
- case 'U': Result.useUnits = true; break;
- case 'O': Result.useUnits = false; break;
- case 's': Result.timeScale = Result.SECONDS_WHOLE; break;
- case 'm': Result.timeScale = Result.SECONDS_MILLIS; break;
- case 'u': Result.timeScale = Result.SECONDS_MICROS; break;
- case 'n': Result.timeScale = Result.SECONDS_NANOS; break;
- case 'a': Result.timeScale = Result.SECONDS_AUTO; break;
- case '/': Result.invertRate = !Result.invertRate; break;
- }
+ } else if (arg.length() > 8 &&
+ arg.substring(0, 8).equalsIgnoreCase("-report:"))
+ {
+ String error = Result.parseRateOpt(arg.substring(8));
+ if (error != null) {
+ System.err.println("Invalid rate: "+error);
+ usage(1);
}
} else {
String reason = Group.root.setOption(arg);
@@ -411,7 +402,7 @@ public class J2DBench {
writer.flush();
} catch(IOException ioe) {
ioe.printStackTrace();
- System.out.println("\nERROR : Could not create Loop-Report. Exit");
+ System.err.println("\nERROR : Could not create Loop-Report. Exit");
System.exit(1);
}
}
@@ -466,7 +457,7 @@ public class J2DBench {
} while(J2DBench.looping);
- if(J2DBench.looping) {
+ if (J2DBench.looping) {
writer.println("