# HG changeset patch # User Andrew John Hughes # Date 1373461154 -3600 # Node ID ce5dbd04cea5ef8122a3cb15766aa2973b59b4b6 # Parent a6de0621a57b411a59265ec63534444d8956f909 Backport additional fixes. Additional fixes were applied to jdk7u as part of the security release. This patch includes a subset of them. 2013-07-01 Omair Majid * patches/openjdk/7188114-alternate_command_line_parser.patch, * patches/openjdk/7199143-OCSP_timeout.patch, * patches/openjdk/8006120-server_jre.patch, * patches/openjdk/8006536-remove_trailing_slashes.patch, * patches/openjdk/8009165-inappropriate_method_in_reflectutil.patch, * patches/openjdk/8009217-fix_test_compile.patch, * patches/openjdk/8009463-space_and_final_backslash.patch, * patches/openjdk/8009610-blacklist_malware_certificate.patch, * patches/openjdk/8010213-set_socketoptions_windows.patch, * patches/openjdk/8010714-xml_dsig_retrievalmethod.patch, * patches/openjdk/8011154-awt_regresssion.patch, * patches/openjdk/8011313-OCSP_timeout_wrong_value.patch, * patches/openjdk/8011992-MlibOpsTest_failed.patch, * patches/openjdk/8012112-MlibOpsTest_fails.patch, * patches/openjdk/8012617-arrayindexoutofbounds_linebreakmeasurer.patch, * patches/openjdk/8012933-appcontext_disposed_too_early.patch, * patches/openjdk/8013196-TimeZone_getDefault_throws_exception.patch, * patches/openjdk/8014205-blank_swing_dialogs_windows.patch, * patches/openjdk/8014427-raster_regresssion.patch, * patches/openjdk/8014618-strip_leading_zeros_premastersecret.patch, * patches/openjdk/8014676-javadebugger_space_in_paths.patch, * patches/openjdk/8014968-OCSP_timeout_default.patch: New file. Backport from icedtea/openjdk 7. * Makefile.am (ICEDTEA_PATCHES): Apply the above. * patches/ecj/override.patch: Add new hunk for BufferedImage. * NEWS: Update with backports. diff -r a6de0621a57b -r ce5dbd04cea5 ChangeLog --- a/ChangeLog Wed Jun 26 15:10:59 2013 -0400 +++ b/ChangeLog Wed Jul 10 13:59:14 2013 +0100 @@ -1,3 +1,32 @@ +2013-07-01 Omair Majid + + * patches/openjdk/7188114-alternate_command_line_parser.patch, + * patches/openjdk/7199143-OCSP_timeout.patch, + * patches/openjdk/8006120-server_jre.patch, + * patches/openjdk/8006536-remove_trailing_slashes.patch, + * patches/openjdk/8009165-inappropriate_method_in_reflectutil.patch, + * patches/openjdk/8009217-fix_test_compile.patch, + * patches/openjdk/8009463-space_and_final_backslash.patch, + * patches/openjdk/8009610-blacklist_malware_certificate.patch, + * patches/openjdk/8010213-set_socketoptions_windows.patch, + * patches/openjdk/8010714-xml_dsig_retrievalmethod.patch, + * patches/openjdk/8011154-awt_regresssion.patch, + * patches/openjdk/8011313-OCSP_timeout_wrong_value.patch, + * patches/openjdk/8011992-MlibOpsTest_failed.patch, + * patches/openjdk/8012112-MlibOpsTest_fails.patch, + * patches/openjdk/8012617-arrayindexoutofbounds_linebreakmeasurer.patch, + * patches/openjdk/8012933-appcontext_disposed_too_early.patch, + * patches/openjdk/8013196-TimeZone_getDefault_throws_exception.patch, + * patches/openjdk/8014205-blank_swing_dialogs_windows.patch, + * patches/openjdk/8014427-raster_regresssion.patch, + * patches/openjdk/8014618-strip_leading_zeros_premastersecret.patch, + * patches/openjdk/8014676-javadebugger_space_in_paths.patch, + * patches/openjdk/8014968-OCSP_timeout_default.patch: New file. + Backport from icedtea/openjdk 7. + * Makefile.am (ICEDTEA_PATCHES): Apply the above. + * patches/ecj/override.patch: Add new hunk for BufferedImage. + * NEWS: Update with backports. + 2013-06-26 Chris Phillips * Makefile.am (SECURITY_PATCHES): Drop patches/security/20130618/7158805-nested_subroutine_rewriting.patch diff -r a6de0621a57b -r ce5dbd04cea5 Makefile.am --- a/Makefile.am Wed Jun 26 15:10:59 2013 -0400 +++ b/Makefile.am Wed Jul 10 13:59:14 2013 +0100 @@ -652,7 +652,29 @@ patches/jaxws-tempfiles-ioutils-6.patch \ patches/object-factory-cl-internal.patch \ patches/openjdk/8009530-icu_kern_table_support_broken.patch \ - patches/openjdk/7171223-strict_aliasing.patch + patches/openjdk/7171223-strict_aliasing.patch \ + patches/openjdk/7188114-alternate_command_line_parser.patch \ + patches/openjdk/7199143-OCSP_timeout.patch \ + patches/openjdk/8006120-server_jre.patch \ + patches/openjdk/8006536-remove_trailing_slashes.patch \ + patches/openjdk/8009165-inappropriate_method_in_reflectutil.patch \ + patches/openjdk/8009217-fix_test_compile.patch \ + patches/openjdk/8009463-space_and_final_backslash.patch \ + patches/openjdk/8009610-blacklist_malware_certificate.patch \ + patches/openjdk/8010213-set_socketoptions_windows.patch \ + patches/openjdk/8010714-xml_dsig_retrievalmethod.patch \ + patches/openjdk/8011154-awt_regresssion.patch \ + patches/openjdk/8011313-OCSP_timeout_wrong_value.patch \ + patches/openjdk/8011992-MlibOpsTest_failed.patch \ + patches/openjdk/8012112-MlibOpsTest_fails.patch \ + patches/openjdk/8012617-arrayindexoutofbounds_linebreakmeasurer.patch \ + patches/openjdk/8012933-appcontext_disposed_too_early.patch \ + patches/openjdk/8013196-TimeZone_getDefault_throws_exception.patch \ + patches/openjdk/8014205-blank_swing_dialogs_windows.patch \ + patches/openjdk/8014427-raster_regresssion.patch \ + patches/openjdk/8014618-strip_leading_zeros_premastersecret.patch \ + patches/openjdk/8014676-javadebugger_space_in_paths.patch \ + patches/openjdk/8014968-OCSP_timeout_default.patch if WITH_RHINO ICEDTEA_PATCHES += \ diff -r a6de0621a57b -r ce5dbd04cea5 NEWS --- a/NEWS Wed Jun 26 15:10:59 2013 -0400 +++ b/NEWS Wed Jul 10 13:59:14 2013 +0100 @@ -13,6 +13,31 @@ New in release 1.12.6 (2013-06-XX): +* Security fixes +* Backports + - S7188114: (launcher) need an alternate command line parser for Windows + - S7199143: RFE: OCSP revocation checker should provide possibility to specify connection timeout + - S8006120: Provide "Server JRE" for 7u train + - S8006536: [launcher] removes trailing slashes on arguments + - S8009165: Fix for 8006435 needs revision + - S8009217: REGRESSION: test com/sun/org/apache/xml/internal/security/transforms/ClassLoaderTest.java fails to compile since 7u21b03 + - S8009463: Regression test test\java\lang\Runtime\exec\ArgWithSpaceAndFinalBackslash.java failing. + - S8009610: Blacklist certificate used with malware. + - S8010213: Some api/javax_net/SocketFactory tests fail in 7u25 nightly build + - S8010714: XML DSig API allows a RetrievalMethod to reference another RetrievalMethod + - S8011154: java/awt/Frame/ShapeNotSetSometimes/ShapeNotSetSometimes.java failed since 7u25b03 on windows + - S8011313: OCSP timeout set to wrong value if com.sun.security.ocsp.timeout not defined + - S8011992: java/awt/image/mlib/MlibOpsTest.java failed since jdk7u25b05 + - S8012112: java/awt/image/mlib/MlibOpsTest.java fails on sparc solaris + - S8012617: ArrayIndexOutOfBoundsException with some fonts using LineBreakMeasurer + - S8012933: Test closed/java/awt/Dialog/DialogAnotherThread/JaWSTest.java fails since jdk 7u25 b07 + - S8013196: TimeZone.getDefault() throws NPE due to sun.awt.AppContext.getAppContext() + - S8014205: Most of the Swing dialogs are blank on one win7 MUI + - S8014427: REGRESSION: closed/javax/imageio/plugins/bmp/Write3ByteBgrTest.java fails since 7u25 b09 + - S8014618: Need to strip leading zeros in TlsPremasterSecret of DHKeyAgreement + - S8014676: Java debugger may fail to run + - S8014968: OCSP and CRL connection timeout is set to four hours by default + New in release 1.12.5 (2013-04-24): * New features diff -r a6de0621a57b -r ce5dbd04cea5 patches/ecj/override.patch --- a/patches/ecj/override.patch Wed Jun 26 15:10:59 2013 -0400 +++ b/patches/ecj/override.patch Wed Jul 10 13:59:14 2013 +0100 @@ -300,6 +300,17 @@ public final void close() { open = false; synchronized (AbstractMidiDevice.this.traRecLock) { +diff -ruN openjdk-ecj.orig/jdk/src/share/classes/java/awt/image/BufferedImage.java openjdk-ecj/jdk/src/share/classes/java/awt/image/BufferedImage.java +--- openjdk-ecj.orig/jdk/src/share/classes/java/awt/image/BufferedImage.java 2013-07-01 13:03:32.946070591 -0400 ++++ openjdk-ecj/jdk/src/share/classes/java/awt/image/BufferedImage.java 2013-07-01 13:33:55.905426035 -0400 +@@ -810,7 +810,6 @@ + new PrivilegedAction() + { + +- @Override + public Boolean run() { + final ClassLoader std = System.class.getClassLoader(); + diff -Nru openjdk-ecj.orig/jdk/src/share/classes/sun/swing/plaf/synth/SynthFileChooserUIImpl.java openjdk-ecj/jdk/src/share/classes/sun/swing/plaf/synth/SynthFileChooserUIImpl.java --- openjdk-ecj.orig/jdk/src/share/classes/sun/swing/plaf/synth/SynthFileChooserUIImpl.java 2011-01-07 21:33:03.000000000 +0000 +++ openjdk-ecj/jdk/src/share/classes/sun/swing/plaf/synth/SynthFileChooserUIImpl.java 2012-06-13 17:39:06.625931390 +0100 diff -r a6de0621a57b -r ce5dbd04cea5 patches/openjdk/7188114-alternate_command_line_parser.patch --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/patches/openjdk/7188114-alternate_command_line_parser.patch Wed Jul 10 13:59:14 2013 +0100 @@ -0,0 +1,611 @@ +# HG changeset patch +# User ksrini +# Date 1343740201 25200 +# Node ID 4f08c170e2daef20a8b249ba50a9986f7cd09e67 +# Parent 75cf6b2c4f573f155d3173f11d207a2155a887a9 +7188114: (launcher) need an alternate command line parser for Windows +Reviewed-by: darcy, dholmes, jjh +Contributed-by: akhil.arora@oracle.com + +new file mode 100644 +--- /dev/null ++++ openjdk/jdk/src/windows/bin/cmdtoargs.c +@@ -0,0 +1,598 @@ ++/* ++ * Copyright (c) 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. ++ */ ++ ++ ++/* ++ * Converts a single string command line to the traditional argc, argv. ++ * There are rules which govern the breaking of the the arguments, and ++ * these rules are embodied in the regression tests below, and duplicated ++ * in the jdk regression tests. ++ */ ++ ++#ifndef IDE_STANDALONE ++#include "java.h" ++#include "jli_util.h" ++#else /* IDE_STANDALONE */ ++// The defines we need for stand alone testing ++#include ++#include ++#include ++#define JNI_TRUE TRUE ++#define JNI_FALSE FALSE ++#define JLI_MemRealloc realloc ++#define JLI_StringDup _strdup ++#define JLI_MemFree free ++#define jboolean boolean ++typedef struct { ++ char* arg; ++ boolean has_wildcard; ++} StdArg ; ++#endif ++static StdArg *stdargs; ++static int stdargc; ++ ++static char* next_arg(char* cmdline, char* arg, jboolean* wildcard) { ++ ++ char* src = cmdline; ++ char* dest = arg; ++ jboolean separator = JNI_FALSE; ++ int quotes = 0; ++ int slashes = 0; ++ ++ char prev = 0; ++ char ch = 0; ++ int i; ++ jboolean done = JNI_FALSE; ++ ++ *wildcard = JNI_FALSE; ++ while ((ch = *src) != 0 && !done) { ++ switch (ch) { ++ case '"': ++ if (separator) { ++ done = JNI_TRUE; ++ break; ++ } ++ if (prev == '\\') { ++ for (i = 1; i < slashes; i += 2) { ++ *dest++ = prev; ++ } ++ if (slashes % 2 == 1) { ++ *dest++ = ch; ++ } else { ++ quotes++; ++ } ++ } else if (prev == '"' && quotes % 2 == 0) { ++ quotes++; ++ *dest++ = ch; // emit every other consecutive quote ++ } else if (quotes == 0) { ++ quotes++; // starting quote ++ } else { ++ quotes--; // matching quote ++ } ++ slashes = 0; ++ break; ++ ++ case '\\': ++ slashes++; ++ if (separator) { ++ done = JNI_TRUE; ++ separator = JNI_FALSE; ++ } ++ break; ++ ++ case ' ': ++ case '\t': ++ if (quotes % 2 == 1) { ++ *dest++ = ch; ++ } else { ++ separator = JNI_TRUE; ++ } ++ slashes = 0; ++ break; ++ ++ case '*': ++ case '?': ++ if (separator) { ++ done = JNI_TRUE; ++ separator = JNI_FALSE; ++ break; ++ } ++ if (quotes % 2 == 0) { ++ *wildcard = JNI_TRUE; ++ } ++ if (prev == '\\') { ++ *dest++ = prev; ++ } ++ *dest++ = ch; ++ break; ++ ++ default: ++ if (prev == '\\') { ++ for (i = 0 ; i < slashes ; i++) { ++ *dest++ = prev; ++ } ++ *dest++ = ch; ++ } else if (separator) { ++ done = JNI_TRUE; ++ } else { ++ *dest++ = ch; ++ } ++ slashes = 0; ++ } ++ ++ if (!done) { ++ prev = ch; ++ src++; ++ } ++ } ++ if (prev == '\\') { ++ for (i = 0; i < slashes; i++) { ++ *dest++ = prev; ++ } ++ } ++ *dest = 0; ++ return done ? src : NULL; ++} ++ ++int JLI_GetStdArgc() { ++ return stdargc; ++} ++ ++StdArg* JLI_GetStdArgs() { ++ return stdargs; ++} ++ ++void JLI_CmdToArgs(char* cmdline) { ++ int nargs = 0; ++ StdArg* argv = NULL; ++ jboolean wildcard = JNI_FALSE; ++ char* src = cmdline; ++ ++ // allocate arg buffer with sufficient space to receive the largest arg ++ char* arg = JLI_StringDup(cmdline); ++ ++ do { ++ src = next_arg(src, arg, &wildcard); ++ // resize to accommodate another Arg ++ argv = (StdArg*) JLI_MemRealloc(argv, (nargs+1) * sizeof(StdArg)); ++ argv[nargs].arg = JLI_StringDup(arg); ++ argv[nargs].has_wildcard = wildcard; ++ ++ nargs++; ++ } while (src != NULL); ++ ++ stdargc = nargs; ++ stdargs = argv; ++} ++ ++#ifdef IDE_STANDALONE ++void doexit(int rv) { ++ printf("Hit any key to quit\n"); ++ int c = getchar(); ++ exit(rv); ++} ++ ++void doabort() { ++ doexit(1); ++} ++ ++class Vector { ++public: ++ char* cmdline; ++ int argc; ++ char* argv[10]; ++ boolean wildcard[10]; ++ boolean enabled; ++ ++ Vector(){} ++ // Initialize our test vector with the program name, argv[0] ++ // and the single string command line. ++ Vector(char* pname, char* cline) { ++ argv[0] = pname; ++ wildcard[0] = FALSE; ++ cmdline = cline; ++ argc = 1; ++ enabled = TRUE; ++ } ++ ++ // add our expected strings, the program name has already been ++ // added so ignore that ++ void add(char* arg, boolean w) { ++ argv[argc] = arg; ++ wildcard[argc] = w; ++ argc++; ++ } ++ ++ void disable() { ++ enabled = FALSE; ++ } ++ ++ // validate the returned arguments with the expected arguments, using the ++ // new CmdToArgs method. ++ bool check() { ++ // "pgmname" rest of cmdline ie. pgmname + 2 double quotes + space + cmdline from windows ++ char* cptr = (char*) malloc(strlen(argv[0]) + sizeof(char) * 3 + strlen(cmdline) + 1); ++ _snprintf(cptr, MAX_PATH, "\"%s\" %s", argv[0], cmdline); ++ JLI_CmdToArgs(cptr); ++ free(cptr); ++ StdArg *kargv = JLI_GetStdArgs(); ++ int kargc = JLI_GetStdArgc(); ++ bool retval = true; ++ printf("\n===========================\n"); ++ printf("cmdline=%s\n", cmdline); ++ if (argc != kargc) { ++ printf("*** argument count does not match\n"); ++ printme(); ++ printtest(kargc, kargv); ++ doabort(); ++ } ++ for (int i = 0 ; i < argc && retval == true ; i++) { ++ if (strcmp(argv[i], kargv[i].arg) != 0) { ++ printf("*** argument at [%d] don't match\n got: %s\n exp: %s\n", ++ i, kargv[i].arg, argv[i]); ++ doabort(); ++ } ++ } ++ for (int i = 0 ; i < argc && retval == true ; i++) { ++ if (wildcard[i] != kargv[i].has_wildcard) { ++ printf("*** expansion flag at [%d] doesn't match\n got: %d\n exp: %d\n", ++ i, kargv[i].has_wildcard, wildcard[i]); ++ doabort(); ++ } ++ } ++ for (int i = 0 ; i < kargc ; i++) { ++ printf("k[%d]=%s\n", i, kargv[i].arg); ++ printf(" [%d]=%s\n", i, argv[i]); ++ } ++ return retval; ++ } ++ void printtest(int kargc, StdArg* kargv) { ++ for (int i = 0 ; i < kargc ; i++) { ++ printf("k[%d]=%s\n", i, kargv[i].arg); ++ } ++ } ++ void printme() { ++ for (int i = 0 ; i < argc ; i++) { ++ printf(" [%d]=%s\n", i, argv[i]); ++ } ++ } ++}; ++ ++void dotest(Vector** vectors) { ++ Vector* v = vectors[0]; ++ for (int i = 0 ; v != NULL;) { ++ if (v->enabled) { ++ v->check(); ++ } ++ v = vectors[++i]; ++ } ++} ++ ++#define MAXV 128 ++int main(int argc, char* argv[]) { ++ ++ int n; ++ for (n=1; n < argc; n++) { ++ printf("%d %s\n", n, argv[n]); ++ } ++ if (n > 1) { ++ JLI_CmdToArgs(GetCommandLine()); ++ for (n = 0; n < stdargc; n++) { ++ printf(" [%d]=%s\n", n, stdargs[n].arg); ++ printf(" [%d]=%s\n", n, stdargs[n].has_wildcard ? "TRUE" : "FALSE"); ++ } ++ doexit(0); ++ } ++ ++ Vector *vectors[MAXV]; ++ ++ memset(vectors, 0, sizeof(vectors)); ++ int i = 0; ++ Vector* v = new Vector(argv[0], "abcd"); ++ v->add("abcd", FALSE); ++ // v->disable(); ++ vectors[i++] = v; ++ ++ ++ v = new Vector(argv[0], "\"a b c d\""); ++ v->add("a b c d", FALSE); ++ // v->disable(); ++ vectors[i++] = v; ++ ++ ++ v = new Vector(argv[0], "a\"b c d\"e"); ++ v->add("ab c de", FALSE); ++ // v->disable(); ++ vectors[i++] = v; ++ ++ ++ v = new Vector(argv[0], "ab\\\"cd"); ++ v->add("ab\"cd", FALSE); ++ // v->disable(); ++ vectors[i++] = v; ++ ++ ++ v = new Vector(argv[0], "\"a b c d\\\\\""); ++ v->add("a b c d\\", FALSE); ++ // v->disable(); ++ vectors[i++] = v; ++ ++ ++ v = new Vector(argv[0], "ab\\\\\\\"cd"); ++ v->add("ab\\\"cd", FALSE); ++ // v->disable(); ++ vectors[i++] = v; ++ ++ ++ // Windows tests ++ v = new Vector(argv[0], "a\\\\\\c"); ++ v->add("a\\\\\\c", FALSE); ++ // v->disable(); ++ vectors[i++] = v; ++ ++ ++ v = new Vector(argv[0], "\"a\\\\\\d\""); ++ v->add("a\\\\\\d", FALSE); ++ // v->disable(); ++ vectors[i++] = v; ++ ++ ++ v = new Vector(argv[0], "\"a b c\" d e"); ++ v->add("a b c", FALSE); ++ v->add("d", FALSE); ++ v->add("e", FALSE); ++ // v->disable(); ++ vectors[i++] = v; ++ ++ ++ v = new Vector(argv[0], "\"ab\\\"c\" \"\\\\\" d"); ++ v->add("ab\"c", FALSE); ++ v->add("\\", FALSE); ++ v->add("d", FALSE); ++ // v->disable(); ++ vectors[i++] = v; ++ ++ ++ v = new Vector(argv[0], "a\\\\\\c d\"e f\"g h"); ++ v->add("a\\\\\\c", FALSE); ++ v->add("de fg", FALSE); ++ v->add("h", FALSE); ++ // v->disable(); ++ vectors[i++] = v; ++ ++ ++ v = new Vector(argv[0], "a\\\\\\\"b c d"); ++ v->add("a\\\"b", FALSE); // XXX "a\\\\\\\"b" ++ v->add("c", FALSE); ++ v->add("d", FALSE); ++ // v->disable(); ++ vectors[i++] = v; ++ ++ ++ v = new Vector(argv[0], "a\\\\\\\\\"g c\" d e"); // XXX "a\\\\\\\\\"b c\" d e" ++ v->add("a\\\\\g c", FALSE); // XXX "a\\\\\\\\\"b c" ++ v->add("d", FALSE); ++ v->add("e", FALSE); ++ // v->disable(); ++ vectors[i++] = v; ++ ++ ++ // Additional tests ++ v = new Vector(argv[0], "\"a b c\"\""); ++ v->add("a b c\"", FALSE); ++ // v->disable(); ++ vectors[i++] = v; ++ ++ ++ v = new Vector(argv[0], "\"\"a b c\"\""); ++ v->add("a", FALSE); ++ v->add("b", FALSE); ++ v->add("c", FALSE); ++ // v->disable(); ++ vectors[i++] = v; ++ ++ ++ v = new Vector(argv[0], "\"\"\"a b c\"\"\""); ++ v->add("\"a b c\"", FALSE); ++ // v->disable(); ++ vectors[i++] = v; ++ ++ ++ v = new Vector(argv[0], "\"\"\"\"a b c\"\"\"\""); ++ v->add("\"a", FALSE); ++ v->add("b", FALSE); ++ v->add("c\"", FALSE); ++ // v->disable(); ++ vectors[i++] = v; ++ ++ ++ v = new Vector(argv[0], "\"\"\"\"\"a b c\"\"\"\"\""); ++ v->add("\"\"a b c\"\"", FALSE); ++ // v->disable(); ++ vectors[i++] = v; ++ ++ ++ v = new Vector(argv[0], "\"C:\\TEST A\\\\\""); ++ v->add("C:\\TEST A\\", FALSE); ++ // v->disable(); ++ vectors[i++] = v; ++ ++ ++ v = new Vector(argv[0], "\"\"C:\\TEST A\\\\\"\""); ++ v->add("C:\\TEST", FALSE); ++ v->add("A\\", FALSE); ++ // v->disable(); ++ vectors[i++] = v; ++ ++ ++ // test if a wildcard is present ++ v = new Vector(argv[0], "abc*def"); ++ v->add("abc*def", TRUE); ++ // v->disable(); ++ vectors[i++] = v; ++ ++ ++ v = new Vector(argv[0], "\"abc*def\""); ++ v->add("abc*def", FALSE); ++ // v->disable(); ++ vectors[i++] = v; ++ ++ ++ v = new Vector(argv[0], "*.abc"); ++ v->add("*.abc", TRUE); ++ // v->disable(); ++ vectors[i++] = v; ++ ++ ++ v = new Vector(argv[0], "\"*.abc\""); ++ v->add("*.abc", FALSE); ++ // v->disable(); ++ vectors[i++] = v; ++ ++ ++ v = new Vector(argv[0], "x.???"); ++ v->add("x.???", TRUE); ++ // v->disable(); ++ vectors[i++] = v; ++ ++ ++ v = new Vector(argv[0], "\"x.???\""); ++ v->add("x.???", FALSE); ++ // v->disable(); ++ vectors[i++] = v; ++ ++ ++ v = new Vector(argv[0], "Debug\\*"); ++ v->add("Debug\\*", TRUE); ++ // v->disable(); ++ vectors[i++] = v; ++ ++ ++ v = new Vector(argv[0], "Debug\\f?a"); ++ v->add("Debug\\f?a", TRUE); ++ // v->disable(); ++ vectors[i++] = v; ++ ++ ++ v = new Vector(argv[0], "Debug\\?a.java"); ++ v->add("Debug\\?a.java", TRUE); ++ // v->disable(); ++ vectors[i++] = v; ++ ++ ++ v = new Vector(argv[0], "foo *.noexts"); ++ v->add("foo", FALSE); ++ v->add("*.noexts", TRUE); ++ // v->disable(); ++ vectors[i++] = v; ++ ++ ++ v = new Vector(argv[0], "X\\Y\\Z"); ++ v->add("X\\Y\\Z", FALSE); ++ // v->disable(); ++ vectors[i++] = v; ++ ++ ++ v = new Vector(argv[0], "\\X\\Y\\Z"); ++ v->add("\\X\\Y\\Z", FALSE); ++ // v->disable(); ++ vectors[i++] = v; ++ ++ ++ v = new Vector(argv[0], "a b"); ++ v->add("a", FALSE); ++ v->add("b", FALSE); ++ // v->disable(); ++ vectors[i++] = v; ++ ++ ++ v = new Vector(argv[0], "a\tb"); ++ v->add("a", FALSE); ++ v->add("b", FALSE); ++ // v->disable(); ++ vectors[i++] = v; ++ ++ ++ v = new Vector(argv[0], "a \t b"); ++ v->add("a", FALSE); ++ v->add("b", FALSE); ++ // v->disable(); ++ vectors[i++] = v; ++ ++ v = new Vector(argv[0], "*\\"); ++ v->add("*\\", TRUE); ++ // v->disable(); ++ vectors[i++] = v; ++ ++ v = new Vector(argv[0], "*/"); ++ v->add("*/", TRUE); ++ // v->disable(); ++ vectors[i++] = v; ++ ++ v = new Vector(argv[0], ".\\*"); ++ v->add(".\\*", TRUE); ++ // v->disable(); ++ vectors[i++] = v; ++ ++ v = new Vector(argv[0], "./*"); ++ v->add("./*", TRUE); ++ // v->disable(); ++ vectors[i++] = v; ++ ++ v = new Vector(argv[0], ".\\*"); ++ v->add(".\\*", TRUE); ++ // v->disable(); ++ vectors[i++] = v; ++ ++ v = new Vector(argv[0], ".//*"); ++ v->add(".//*", TRUE); ++ // v->disable(); ++ vectors[i++] = v; ++ ++ v = new Vector(argv[0], "..\\..\\*"); ++ v->add("..\\..\\*", TRUE); ++ // v->disable(); ++ vectors[i++] = v; ++ ++ v = new Vector(argv[0], "../../*"); ++ v->add("../../*", TRUE); ++ // v->disable(); ++ vectors[i++] = v; ++ ++ v = new Vector(argv[0], "..\\..\\"); ++ v->add("..\\..\\", FALSE); ++ // v->disable(); ++ vectors[i++] = v; ++ ++ v = new Vector(argv[0], "../../"); ++ v->add("../../", FALSE); ++ // v->disable(); ++ vectors[i++] = v; ++ ++ dotest(vectors); ++ printf("All tests pass [%d]\n", i); ++ doexit(0); ++} ++#endif /* IDE_STANDALONE */ diff -r a6de0621a57b -r ce5dbd04cea5 patches/openjdk/7199143-OCSP_timeout.patch --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/patches/openjdk/7199143-OCSP_timeout.patch Wed Jul 10 13:59:14 2013 +0100 @@ -0,0 +1,53 @@ +# HG changeset patch +# User andrew +# Date 1372302277 18000 +# Node ID 5db08be3f8c2f84a02ff21c433d319205865d5d5 +# Parent af2db2941f434093f07571ce1bbb35666a596694 +7199143: RFE: OCSP revocation checker should provide possibility to specify connection timeout +Summary: Added com.sun.security.ocsp.timeout system property to control timeout +Reviewed-by: mullan, vinnie +Contributed-by: jason.uh@oracle.com + +--- openjdk/jdk/src/share/classes/sun/security/provider/certpath/OCSP.java ++++ openjdk/jdk/src/share/classes/sun/security/provider/certpath/OCSP.java +@@ -43,6 +43,7 @@ + import java.util.Map; + + import static sun.security.provider.certpath.OCSPResponse.*; ++import sun.security.action.GetIntegerAction; + import sun.security.util.Debug; + import sun.security.x509.AccessDescription; + import sun.security.x509.AuthorityInfoAccessExtension; +@@ -65,7 +66,31 @@ + + private static final Debug debug = Debug.getInstance("certpath"); + +- private static final int CONNECT_TIMEOUT = 15000; // 15 seconds ++ private static final int DEFAULT_CONNECT_TIMEOUT = 15000; ++ ++ /** ++ * Integer value indicating the timeout length, in seconds, to be ++ * used for the OCSP check. A timeout of zero is interpreted as ++ * an infinite timeout. ++ */ ++ private static final int CONNECT_TIMEOUT = initializeTimeout(); ++ ++ /** ++ * Initialize the timeout length by getting the OCSP timeout ++ * system property. If the property has not been set, or if its ++ * value is negative, set the timeout length to the default. ++ */ ++ private static int initializeTimeout() { ++ int tmp = java.security.AccessController.doPrivileged( ++ new GetIntegerAction("com.sun.security.ocsp.timeout", ++ DEFAULT_CONNECT_TIMEOUT)); ++ if (tmp < 0) { ++ tmp = DEFAULT_CONNECT_TIMEOUT; ++ } ++ // Convert to milliseconds, as the system property will be ++ // specified in seconds ++ return tmp * 1000; ++ } + + private OCSP() {} + diff -r a6de0621a57b -r ce5dbd04cea5 patches/openjdk/8006120-server_jre.patch --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/patches/openjdk/8006120-server_jre.patch Wed Jul 10 13:59:14 2013 +0100 @@ -0,0 +1,60 @@ +# HG changeset patch +# User andrew +# Date 1372384541 18000 +# Node ID 75cf6b2c4f573f155d3173f11d207a2155a887a9 +# Parent 5db08be3f8c2f84a02ff21c433d319205865d5d5 +8006120: Provide "Server JRE" for 7u train +Reviewed-by: pbhat, cgruszka +Contributed-by: amy.y.wang@oracle.com + +--- openjdk/jdk/make/common/Defs.gmk ++++ openjdk/jdk/make/common/Defs.gmk +@@ -296,6 +296,7 @@ + + JDK_IMAGE_DIR = $(ABS_OUTPUTDIR)/j2sdk-image + JRE_IMAGE_DIR = $(ABS_OUTPUTDIR)/j2re-image ++JDK_SERVER_IMAGE_DIR = $(ABS_OUTPUTDIR)/j2sdk-server-image + + #where the demo source can be found + DEMOSRCDIR = $(SHARE_SRC)/demo +--- openjdk/jdk/make/common/Release.gmk ++++ openjdk/jdk/make/common/Release.gmk +@@ -226,15 +226,16 @@ + trim-image-jre trim-image-jdk \ + identify-image-jre identify-image-jdk \ + process-image-jre process-image-jdk \ +-compare-image \ +-sec-files sec-files-win jgss-files :: ++compare-image \ ++sec-files sec-files-win jgss-files server-jdk-image :: + @$(ECHO) ">>>Making "$@" @ `$(DATE)` ..." + + # Order is important here, trim jre after jdk image is created + images:: sanity-images post-sanity-images \ + $(INITIAL_IMAGE_JRE) $(INITIAL_IMAGE_JDK) \ + trim-image-jre trim-image-jdk \ +- process-image-jre process-image-jdk sec-files sec-files-win jgss-files ++ process-image-jre process-image-jdk sec-files sec-files-win \ ++ jgss-files server-jdk-image + + # Don't use these + image-jre:: initial-image-jre trim-image-jre identify-image-jre process-image-jre +@@ -850,6 +851,18 @@ + done + $(RM) $(JRE_BIN_LIST) + ++# Duplicate current j2re-image contents to server-j2re-image ++# for the server version of jre, before deploy build ++server-jdk-image:: ++ $(RM) -r $(JDK_SERVER_IMAGE_DIR) ++ $(CP) -r $(JDK_IMAGE_DIR) $(JDK_SERVER_IMAGE_DIR) ++ $(RM) -r $(JDK_SERVER_IMAGE_DIR)/demo ++ $(RM) -r $(JDK_SERVER_IMAGE_DIR)/sample ++ $(RM) $(JDK_SERVER_IMAGE_DIR)/bin/jcontrol ++ $(RM) $(JDK_SERVER_IMAGE_DIR)/jre/bin/jcontrol ++ $(RM) $(JDK_SERVER_IMAGE_DIR)/man/ja_JP.UTF-8/man1/javaws.1 ++ $(RM) $(JDK_SERVER_IMAGE_DIR)/man/man1/javaws.1 ++ + ###################################################### + # JDK Image + ###################################################### diff -r a6de0621a57b -r ce5dbd04cea5 patches/openjdk/8006536-remove_trailing_slashes.patch --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/patches/openjdk/8006536-remove_trailing_slashes.patch Wed Jul 10 13:59:14 2013 +0100 @@ -0,0 +1,43 @@ +# HG changeset patch +# User andrew +# Date 1372302908 18000 +# Node ID b904ff04371605b2bd33ea6f80794585cf6eb84c +# Parent 4f08c170e2daef20a8b249ba50a9986f7cd09e67 +8006536: [launcher] removes trailing slashes on arguments +Reviewed-by: ksrini, akhil +Contributed-by: jviswana@linux.vnet.ibm.com + +--- openjdk/jdk/src/windows/bin/cmdtoargs.c ++++ openjdk/jdk/src/windows/bin/cmdtoargs.c +@@ -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 +@@ -104,6 +104,11 @@ + + case ' ': + case '\t': ++ if (prev == '\\') { ++ for (i = 0 ; i < slashes; i++) { ++ *dest++ = prev; ++ } ++ } + if (quotes % 2 == 1) { + *dest++ = ch; + } else { +@@ -591,6 +596,12 @@ + // v->disable(); + vectors[i++] = v; + ++ v= new Vector(argv[0], "a b\\\\ d"); ++ v->add("a", FALSE); ++ v->add("b\\\\", FALSE); ++ v->add("d", FALSE); ++ vectors[i++] = v; ++ + dotest(vectors); + printf("All tests pass [%d]\n", i); + doexit(0); diff -r a6de0621a57b -r ce5dbd04cea5 patches/openjdk/8009165-inappropriate_method_in_reflectutil.patch --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/patches/openjdk/8009165-inappropriate_method_in_reflectutil.patch Wed Jul 10 13:59:14 2013 +0100 @@ -0,0 +1,68 @@ +# HG changeset patch +# User andrew +# Date 1372303219 18000 +# Node ID 80fba79ca568f299920968a4e4b440775e82df2c +# Parent b904ff04371605b2bd33ea6f80794585cf6eb84c +8009165: Fix for 8006435 needs revision +Summary: The fix for JDK-8006435 added a new ReflectUtil.ensureClassAccess method which is not an appropriate utility method in ReflectUtil. +Reviewed-by: alanb, mchung, dfuchs + +--- openjdk/jdk/src/share/classes/com/sun/jmx/mbeanserver/MBeanInstantiator.java ++++ openjdk/jdk/src/share/classes/com/sun/jmx/mbeanserver/MBeanInstantiator.java +@@ -31,6 +31,7 @@ + import java.io.IOException; + import java.io.ObjectInputStream; + import java.lang.reflect.Constructor; ++import java.lang.reflect.Modifier; + import java.lang.reflect.InvocationTargetException; + import java.security.AccessControlContext; + import java.security.AccessController; +@@ -227,7 +228,7 @@ + // Instantiate the new object + try { + ReflectUtil.checkPackageAccess(theClass); +- ReflectUtil.ensureClassAccess(theClass); ++ ensureClassAccess(theClass); + moi= cons.newInstance(); + } catch (InvocationTargetException e) { + // Wrap the exception. +@@ -303,7 +304,7 @@ + } + try { + ReflectUtil.checkPackageAccess(theClass); +- ReflectUtil.ensureClassAccess(theClass); ++ ensureClassAccess(theClass); + moi = cons.newInstance(params); + } + catch (NoSuchMethodError error) { +@@ -773,4 +774,13 @@ + }, ctx); + return loader; + } ++ ++ private static void ensureClassAccess(Class clazz) ++ throws IllegalAccessException ++ { ++ int mod = clazz.getModifiers(); ++ if (!Modifier.isPublic(mod)) { ++ throw new IllegalAccessException("Class is not public and can't be instantiated"); ++ } ++ } + } +--- openjdk/jdk/src/share/classes/sun/reflect/misc/ReflectUtil.java ++++ openjdk/jdk/src/share/classes/sun/reflect/misc/ReflectUtil.java +@@ -47,14 +47,6 @@ + return cls.newInstance(); + } + +- public static void ensureClassAccess(Class clazz) +- throws IllegalAccessException +- { +- int mod = clazz.getModifiers(); +- if ( ! Modifier.isPublic(mod) ){ +- throw new IllegalAccessException("Class is not public and can't be instantiated"); +- } +- } + /* + * Reflection.ensureMemberAccess is overly-restrictive + * due to a bug. We awkwardly work around it for now. diff -r a6de0621a57b -r ce5dbd04cea5 patches/openjdk/8009217-fix_test_compile.patch --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/patches/openjdk/8009217-fix_test_compile.patch Wed Jul 10 13:59:14 2013 +0100 @@ -0,0 +1,91 @@ +# HG changeset patch +# User mullan +# Date 1367245255 14400 +# Node ID 686d810cb9b66eae9456e259dd697854b8d0eaec +# Parent 80fba79ca568f299920968a4e4b440775e82df2c +8009217: REGRESSION: test com/sun/org/apache/xml/internal/security/transforms/ClassLoaderTest.java fails to compile since 7u21b03 +Reviewed-by: xuelei + +--- openjdk/jdk/test/com/sun/org/apache/xml/internal/security/transforms/ClassLoaderTest.java ++++ openjdk/jdk/test/com/sun/org/apache/xml/internal/security/transforms/ClassLoaderTest.java +@@ -1,5 +1,5 @@ + /* +- * Copyright (c) 2006, 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 +@@ -24,7 +24,7 @@ + /** + * @test + * @author Sean Mullan +- * @bug 6461674 ++ * @bug 6461674 8009217 + * @compile -XDignore.symbol.file ClassLoaderTest.java MyTransform.java + * @run main ClassLoaderTest + * @summary Ensure Transform.register works with transform implementations +@@ -43,13 +43,12 @@ + + public static void main(String[] args) throws Exception { + +- Transform.init(); + File file = new File(BASE); + URL[] urls = new URL[1]; + urls[0] = file.toURI().toURL(); + URLClassLoader ucl = new URLClassLoader(urls); +- Class c = ucl.loadClass("MyTransform"); +- Constructor cons = c.getConstructor(); ++ Class c = ucl.loadClass("MyTransform"); ++ Constructor cons = c.getConstructor(new Class[] {}); + Object o = cons.newInstance(); + // Apache code swallows the ClassNotFoundExc, so we need to + // check if the Transform has already been registered by registering +--- openjdk/jdk/test/com/sun/org/apache/xml/internal/security/transforms/MyTransform.java ++++ openjdk/jdk/test/com/sun/org/apache/xml/internal/security/transforms/MyTransform.java +@@ -1,5 +1,5 @@ + /* +- * Copyright (c) 2006, 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 +@@ -21,13 +21,8 @@ + * questions. + */ + +-import java.io.IOException; +-import javax.xml.parsers.ParserConfigurationException; +-import org.xml.sax.SAXException; +-import com.sun.org.apache.xml.internal.security.c14n.*; +-import com.sun.org.apache.xml.internal.security.exceptions.*; +-import com.sun.org.apache.xml.internal.security.signature.XMLSignatureInput; +-import com.sun.org.apache.xml.internal.security.transforms.*; ++import com.sun.org.apache.xml.internal.security.transforms.Transform; ++import com.sun.org.apache.xml.internal.security.transforms.TransformSpi; + + public class MyTransform extends TransformSpi { + +@@ -37,21 +32,13 @@ + public MyTransform() { + try { + System.out.println("Registering Transform"); +- Transform.init(); + Transform.register(URI, "MyTransform"); +- } catch (AlgorithmAlreadyRegisteredException e) { +- // should not occur, so ignore ++ } catch (Exception e) { ++ e.printStackTrace(); + } + } + + protected String engineGetURI() { + return URI; + } +- +- protected XMLSignatureInput enginePerformTransform(XMLSignatureInput input) +- throws IOException, CanonicalizationException, +- InvalidCanonicalizerException, TransformationException, +- ParserConfigurationException, SAXException { +- throw new TransformationException("Unsupported Operation"); +- } + } diff -r a6de0621a57b -r ce5dbd04cea5 patches/openjdk/8009463-space_and_final_backslash.patch --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/patches/openjdk/8009463-space_and_final_backslash.patch Wed Jul 10 13:59:14 2013 +0100 @@ -0,0 +1,33 @@ +# HG changeset patch +# User uta +# Date 1362736022 -14400 +# Node ID 81f7897e8144196779a3e0050150ceaa9d7c26fe +# Parent 686d810cb9b66eae9456e259dd697854b8d0eaec +8009463: Regression test test\java\lang\Runtime\exec\ArgWithSpaceAndFinalBackslash.java failing. +Reviewed-by: alanb, ahgross + +--- openjdk/jdk/src/windows/classes/java/lang/ProcessImpl.java ++++ openjdk/jdk/src/windows/classes/java/lang/ProcessImpl.java +@@ -262,6 +262,22 @@ + if (needsEscaping(isCmdFile, s)) { + cmdbuf.append('"'); + cmdbuf.append(s); ++ ++ // The code protects the [java.exe] and console command line ++ // parser, that interprets the [\"] combination as an escape ++ // sequence for the ["] char. ++ // http://msdn.microsoft.com/en-us/library/17w5ykft.aspx ++ // ++ // If the argument is an FS path, doubling of the tail [\] ++ // char is not a problem for non-console applications. ++ // ++ // The [\"] sequence is not an escape sequence for the [cmd.exe] ++ // command line parser. The case of the [""] tail escape ++ // sequence could not be realized due to the argument validation ++ // procedure. ++ if (!isCmdFile && s.endsWith("\\")) { ++ cmdbuf.append('\\'); ++ } + cmdbuf.append('"'); + } else { + cmdbuf.append(s); diff -r a6de0621a57b -r ce5dbd04cea5 patches/openjdk/8009610-blacklist_malware_certificate.patch --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/patches/openjdk/8009610-blacklist_malware_certificate.patch Wed Jul 10 13:59:14 2013 +0100 @@ -0,0 +1,64 @@ +# HG changeset patch +# User valeriep +# Date 1363057537 25200 +# Node ID e15562835a5e91f0bca6a088e58970c3c1c3dc3f +# Parent 81f7897e8144196779a3e0050150ceaa9d7c26fe +8009610: Blacklist certificate used with malware. +Summary: updated the black list and the reg test with the new cert. +Reviewed-by: weijun + +--- openjdk/jdk/src/share/classes/sun/security/util/UntrustedCertificates.java ++++ openjdk/jdk/src/share/classes/sun/security/util/UntrustedCertificates.java +@@ -843,5 +843,52 @@ + "zCOfhbsRWdMLYepauaNZOIMZXmFwcrIl0TGMkTAtATz+XmZc\n" + + "-----END CERTIFICATE-----"); + ++ // ++ // Revoked code signing certificate w/ a stolen key issued by GoDaddy ++ // used to sign malware ++ // ++ ++ // Subject: CN=CLEARESULT CONSULTING INC., OU=Corporate IT, ++ // O=CLEARESULT CONSULTING INC., L=Austin, ST=TX, C=US ++ // Issuer: SERIALNUMBER=07969287, ++ // CN=Go Daddy Secure Certification Authority, ++ // OU=http://certificates.godaddy.com/repository, ++ // O="GoDaddy.com, Inc.", ++ // L=Scottsdale, ++ // ST=Arizona, ++ // C=US ++ // Serial: 2b:73:43:2a:a8:4f:44 ++ add("clearesult-consulting-inc-2AA84F44", ++ "-----BEGIN CERTIFICATE-----\n" + ++ "MIIFYjCCBEqgAwIBAgIHK3NDKqhPRDANBgkqhkiG9w0BAQUFADCByjELMAkGA1UE\n" + ++ "BhMCVVMxEDAOBgNVBAgTB0FyaXpvbmExEzARBgNVBAcTClNjb3R0c2RhbGUxGjAY\n" + ++ "BgNVBAoTEUdvRGFkZHkuY29tLCBJbmMuMTMwMQYDVQQLEypodHRwOi8vY2VydGlm\n" + ++ "aWNhdGVzLmdvZGFkZHkuY29tL3JlcG9zaXRvcnkxMDAuBgNVBAMTJ0dvIERhZGR5\n" + ++ "IFNlY3VyZSBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eTERMA8GA1UEBRMIMDc5Njky\n" + ++ "ODcwHhcNMTIwMjE1MjEwOTA2WhcNMTQwMjE1MjEwOTA2WjCBjDELMAkGA1UEBgwC\n" + ++ "VVMxCzAJBgNVBAgMAlRYMQ8wDQYDVQQHDAZBdXN0aW4xIzAhBgNVBAoMGkNMRUFS\n" + ++ "RVNVTFQgQ09OU1VMVElORyBJTkMuMRUwEwYDVQQLDAxDb3Jwb3JhdGUgSVQxIzAh\n" + ++ "BgNVBAMMGkNMRUFSRVNVTFQgQ09OU1VMVElORyBJTkMuMIIBIjANBgkqhkiG9w0B\n" + ++ "AQEFAAOCAQ8AMIIBCgKCAQEAtIOjCKeAicull+7ZIzt0/4ya3IeXUFlfypqKMLkU\n" + ++ "IbKjn0P5uMj6VE3rlbZr44RCegxvdnR6umBh1c0ZXoN3o+yc0JKcKcLiApmJJ277\n" + ++ "p7IbLwYDhBXRQNoIJm187IOMRPIxsKN4hL91txn9jGBmW+9zKlJlNhR5R7vjwU2E\n" + ++ "jrH/6oqsc9EM2yYpfjlNv6+3jSwAYZCkSWr+27PQOV+YHKmIxtJjX0upFz5FdIrV\n" + ++ "9CCX+L2Kji1THOkSgG4QTbYxmEcHqGViWz8hXLeNXjcbEsPuIiAu3hknxRHfUTE/\n" + ++ "U0Lh0Ug1e3LrJu+WnxM2SmUY4krsZ22c0yWUW9hzWITIjQIDAQABo4IBhzCCAYMw\n" + ++ "DwYDVR0TAQH/BAUwAwEBADATBgNVHSUEDDAKBggrBgEFBQcDAzAOBgNVHQ8BAf8E\n" + ++ "BAMCB4AwMwYDVR0fBCwwKjAooCagJIYiaHR0cDovL2NybC5nb2RhZGR5LmNvbS9n\n" + ++ "ZHM1LTE2LmNybDBTBgNVHSAETDBKMEgGC2CGSAGG/W0BBxcCMDkwNwYIKwYBBQUH\n" + ++ "AgEWK2h0dHA6Ly9jZXJ0aWZpY2F0ZXMuZ29kYWRkeS5jb20vcmVwb3NpdG9yeS8w\n" + ++ "gYAGCCsGAQUFBwEBBHQwcjAkBggrBgEFBQcwAYYYaHR0cDovL29jc3AuZ29kYWRk\n" + ++ "eS5jb20vMEoGCCsGAQUFBzAChj5odHRwOi8vY2VydGlmaWNhdGVzLmdvZGFkZHku\n" + ++ "Y29tL3JlcG9zaXRvcnkvZ2RfaW50ZXJtZWRpYXRlLmNydDAfBgNVHSMEGDAWgBT9\n" + ++ "rGEyk2xF1uLuhV+auud2mWjM5zAdBgNVHQ4EFgQUDtdeKqeN2QkcbEp1HovFieNB\n" + ++ "XiowDQYJKoZIhvcNAQEFBQADggEBAD74Agw5tvi2aBl4/f/s7/VE/BClzDsKMb9K\n" + ++ "v9qpeC45ZA/jelxV11HKbQnVF194gDb7D2H9OsAsRUy8HVKbXEcc/8dKvwOqb+BC\n" + ++ "2i/EmfjLgmCfezNFtLq8xcPxF3zIRc44vPrK0z4YZsaHdH+yTEJ51p5EMdTqaLaP\n" + ++ "4n5m8LX3RfqlQB9dYFe6dUoYZjKm9d/pIRww3VqfOzjl42Edi1w6dWmBVMx1NZuR\n" + ++ "DBabJH1vJ9Gd+KwxMCmBZ6pQPl28JDimhJhI2LNqU349uADQVV0HJosddN/ARyyI\n" + ++ "LSIQO7BnNVKVG9Iujf33bvPNeg0qNz5qw+rKKq97Pqeum+L5oKU=\n" + ++ "-----END CERTIFICATE-----"); + } + } diff -r a6de0621a57b -r ce5dbd04cea5 patches/openjdk/8010213-set_socketoptions_windows.patch --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/patches/openjdk/8010213-set_socketoptions_windows.patch Wed Jul 10 13:59:14 2013 +0100 @@ -0,0 +1,29 @@ +# HG changeset patch +# User khazra +# Date 1363811996 25200 +# Node ID 7750666eaf166e523bf2bea826ef6ef1056ea252 +# Parent 05e5519ffbccc0a6cce2d7cffcd74778aba1378e +8010213: Some api/javax_net/SocketFactory tests fail in 7u25 nightly build +Summary: Eliminate fall-through while setting socket options on Windows +Reviewed-by: alanb, chegar + +--- openjdk/jdk/src/windows/classes/java/net/DualStackPlainSocketImpl.java ++++ openjdk/jdk/src/windows/classes/java/net/DualStackPlainSocketImpl.java +@@ -184,14 +184,15 @@ + int optionValue = 0; + + switch(opt) { +- case TCP_NODELAY : +- case SO_OOBINLINE : + case SO_REUSEADDR : + if (exclusiveBind) { + // SO_REUSEADDR emulated when using exclusive bind + isReuseAddress = on; + return; + } ++ // intentional fallthrough ++ case TCP_NODELAY : ++ case SO_OOBINLINE : + case SO_KEEPALIVE : + optionValue = on ? 1 : 0; + break; diff -r a6de0621a57b -r ce5dbd04cea5 patches/openjdk/8010714-xml_dsig_retrievalmethod.patch --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/patches/openjdk/8010714-xml_dsig_retrievalmethod.patch Wed Jul 10 13:59:14 2013 +0100 @@ -0,0 +1,345 @@ +# HG changeset patch +# User mullan +# Date 1368217731 14400 +# Node ID 0d497f17e31b82d42b5ae0a26e6636ee9ea65887 +# Parent 7750666eaf166e523bf2bea826ef6ef1056ea252 +8010714: XML DSig API allows a RetrievalMethod to reference another RetrievalMethod +Reviewed-by: xuelei, hawtin + +--- openjdk/jdk/src/share/classes/com/sun/org/apache/xml/internal/security/keys/KeyInfo.java ++++ openjdk/jdk/src/share/classes/com/sun/org/apache/xml/internal/security/keys/KeyInfo.java +@@ -54,6 +54,7 @@ + import com.sun.org.apache.xml.internal.security.utils.IdResolver; + import com.sun.org.apache.xml.internal.security.utils.SignatureElementProxy; + import com.sun.org.apache.xml.internal.security.utils.XMLUtils; ++import org.w3c.dom.Attr; + import org.w3c.dom.Document; + import org.w3c.dom.Element; + import org.w3c.dom.Node; +@@ -128,8 +129,11 @@ + */ + public KeyInfo(Element element, String BaseURI) throws XMLSecurityException { + super(element, BaseURI); +- // _storageResolvers.add(null); + ++ Attr attr = element.getAttributeNodeNS(null, "Id"); ++ if (attr != null) { ++ element.setIdAttributeNode(attr, true); ++ } + } + + /** +@@ -139,9 +143,8 @@ + */ + public void setId(String Id) { + +- if ((Id != null)) { +- this._constructionElement.setAttributeNS(null, Constants._ATT_ID, Id); +- IdResolver.registerElementById(this._constructionElement, Id); ++ if (Id != null) { ++ setLocalIdAttribute(Constants._ATT_ID, Id); + } + } + +@@ -1008,7 +1011,7 @@ + /** + * Stores the individual (per-KeyInfo) {@link KeyResolver}s + */ +- List _internalKeyResolvers = null; ++ List _internalKeyResolvers = new ArrayList(); + + /** + * This method is used to add a custom {@link KeyResolverSpi} to a KeyInfo +--- openjdk/jdk/src/share/classes/com/sun/org/apache/xml/internal/security/signature/Manifest.java ++++ openjdk/jdk/src/share/classes/com/sun/org/apache/xml/internal/security/signature/Manifest.java +@@ -42,6 +42,7 @@ + import com.sun.org.apache.xml.internal.security.utils.XMLUtils; + import com.sun.org.apache.xml.internal.security.utils.resolver.ResourceResolver; + import com.sun.org.apache.xml.internal.security.utils.resolver.ResourceResolverSpi; ++import org.w3c.dom.Attr; + import org.w3c.dom.DOMException; + import org.w3c.dom.Document; + import org.w3c.dom.Element; +@@ -100,6 +101,11 @@ + + super(element, BaseURI); + ++ Attr attr = element.getAttributeNodeNS(null, "Id"); ++ if (attr != null) { ++ element.setIdAttributeNode(attr, true); ++ } ++ + // check out Reference children + this._referencesEl = XMLUtils.selectDsNodes(this._constructionElement.getFirstChild(), + Constants._TAG_REFERENCE); +@@ -120,6 +126,11 @@ + this._references = new ArrayList(le); + + for (int i = 0; i < le; i++) { ++ Element refElem = this._referencesEl[i]; ++ Attr refAttr = refElem.getAttributeNodeNS(null, "Id"); ++ if (refAttr != null) { ++ refElem.setIdAttributeNode(refAttr, true); ++ } + this._references.add(null); + } + } +@@ -220,8 +231,7 @@ + public void setId(String Id) { + + if (Id != null) { +- this._constructionElement.setAttributeNS(null, Constants._ATT_ID, Id); +- IdResolver.registerElementById(this._constructionElement, Id); ++ setLocalIdAttribute(Constants._ATT_ID, Id); + } + } + +--- openjdk/jdk/src/share/classes/com/sun/org/apache/xml/internal/security/signature/ObjectContainer.java ++++ openjdk/jdk/src/share/classes/com/sun/org/apache/xml/internal/security/signature/ObjectContainer.java +@@ -68,9 +68,8 @@ + */ + public void setId(String Id) { + +- if ((Id != null)) { +- this._constructionElement.setAttributeNS(null, Constants._ATT_ID, Id); +- IdResolver.registerElementById(this._constructionElement, Id); ++ if (Id != null) { ++ setLocalIdAttribute(Constants._ATT_ID, Id); + } + } + +--- openjdk/jdk/src/share/classes/com/sun/org/apache/xml/internal/security/signature/Reference.java ++++ openjdk/jdk/src/share/classes/com/sun/org/apache/xml/internal/security/signature/Reference.java +@@ -284,8 +284,7 @@ + public void setId(String Id) { + + if ( Id != null ) { +- this._constructionElement.setAttributeNS(null, Constants._ATT_ID, Id); +- IdResolver.registerElementById(this._constructionElement, Id); ++ setLocalIdAttribute(Constants._ATT_ID, Id); + } + } + +--- openjdk/jdk/src/share/classes/com/sun/org/apache/xml/internal/security/signature/SignatureProperties.java ++++ openjdk/jdk/src/share/classes/com/sun/org/apache/xml/internal/security/signature/SignatureProperties.java +@@ -25,6 +25,7 @@ + import com.sun.org.apache.xml.internal.security.utils.IdResolver; + import com.sun.org.apache.xml.internal.security.utils.SignatureElementProxy; + import com.sun.org.apache.xml.internal.security.utils.XMLUtils; ++import org.w3c.dom.Attr; + import org.w3c.dom.Document; + import org.w3c.dom.Element; + +@@ -61,6 +62,21 @@ + public SignatureProperties(Element element, String BaseURI) + throws XMLSecurityException { + super(element, BaseURI); ++ ++ Attr attr = element.getAttributeNodeNS(null, "Id"); ++ if (attr != null) { ++ element.setIdAttributeNode(attr, true); ++ } ++ ++ int length = getLength(); ++ for (int i = 0; i < length; i++) { ++ Element propertyElem = ++ XMLUtils.selectDsNode(getElement(), Constants._TAG_SIGNATUREPROPERTY, i); ++ Attr propertyAttr = propertyElem.getAttributeNodeNS(null, "Id"); ++ if (propertyAttr != null) { ++ propertyElem.setIdAttributeNode(propertyAttr, true); ++ } ++ } + } + + /** +@@ -109,9 +125,8 @@ + */ + public void setId(String Id) { + +- if ((Id != null)) { +- this._constructionElement.setAttributeNS(null, Constants._ATT_ID, Id); +- IdResolver.registerElementById(this._constructionElement, Id); ++ if (Id != null) { ++ setLocalIdAttribute(Constants._ATT_ID, Id); + } + } + +--- openjdk/jdk/src/share/classes/com/sun/org/apache/xml/internal/security/signature/SignatureProperty.java ++++ openjdk/jdk/src/share/classes/com/sun/org/apache/xml/internal/security/signature/SignatureProperty.java +@@ -80,9 +80,8 @@ + */ + public void setId(String Id) { + +- if ((Id != null)) { +- this._constructionElement.setAttributeNS(null, Constants._ATT_ID, Id); +- IdResolver.registerElementById(this._constructionElement, Id); ++ if (Id != null) { ++ setLocalIdAttribute(Constants._ATT_ID, Id); + } + } + +--- openjdk/jdk/src/share/classes/com/sun/org/apache/xml/internal/security/signature/XMLSignature.java ++++ openjdk/jdk/src/share/classes/com/sun/org/apache/xml/internal/security/signature/XMLSignature.java +@@ -49,9 +49,11 @@ + import com.sun.org.apache.xml.internal.security.utils.XMLUtils; + import com.sun.org.apache.xml.internal.security.utils.resolver.ResourceResolver; + import com.sun.org.apache.xml.internal.security.utils.resolver.ResourceResolverSpi; ++import org.w3c.dom.Attr; + import org.w3c.dom.Document; + import org.w3c.dom.Element; + import org.w3c.dom.Node; ++import org.w3c.dom.NodeList; + import org.w3c.dom.Text; + + +@@ -306,6 +308,10 @@ + + throw new XMLSignatureException("xml.WrongContent", exArgs); + } ++ Attr signatureValueAttr = signatureValueElement.getAttributeNodeNS(null, "Id"); ++ if (signatureValueAttr != null) { ++ signatureValueElement.setIdAttributeNode(signatureValueAttr, true); ++ } + + // + Element keyInfoElem = XMLUtils.getNextElement(signatureValueElement.getNextSibling());//XMLUtils.selectDsNode(this._constructionElement.getFirstChild(), +@@ -316,6 +322,34 @@ + keyInfoElem.getLocalName().equals(Constants._TAG_KEYINFO)) ) { + this._keyInfo = new KeyInfo(keyInfoElem, BaseURI); + } ++ ++ // ++ Element objectElem = ++ XMLUtils.getNextElement(signatureValueElement.getNextSibling()); ++ while (objectElem != null) { ++ Attr objectAttr = objectElem.getAttributeNodeNS(null, "Id"); ++ if (objectAttr != null) { ++ objectElem.setIdAttributeNode(objectAttr, true); ++ } ++ ++ NodeList nodes = objectElem.getChildNodes(); ++ int length = nodes.getLength(); ++ // Register Ids of the Object child elements ++ for (int i = 0; i < length; i++) { ++ Node child = nodes.item(i); ++ if (child.getNodeType() == Node.ELEMENT_NODE) { ++ Element childElem = (Element)child; ++ String tag = childElem.getLocalName(); ++ if (tag.equals("Manifest")) { ++ new Manifest(childElem, BaseURI); ++ } else if (tag.equals("SignatureProperties")) { ++ new SignatureProperties(childElem, BaseURI); ++ } ++ } ++ } ++ ++ objectElem = XMLUtils.getNextElement(objectElem.getNextSibling()); ++ } + } + + /** +@@ -325,9 +359,8 @@ + */ + public void setId(String Id) { + +- if ( (Id != null)) { +- this._constructionElement.setAttributeNS(null, Constants._ATT_ID, Id); +- IdResolver.registerElementById(this._constructionElement, Id); ++ if (Id != null) { ++ setLocalIdAttribute(Constants._ATT_ID, Id); + } + } + +--- openjdk/jdk/src/share/classes/com/sun/org/apache/xml/internal/security/signature/XMLSignatureInput.java ++++ openjdk/jdk/src/share/classes/com/sun/org/apache/xml/internal/security/signature/XMLSignatureInput.java +@@ -27,7 +27,7 @@ + import java.io.OutputStream; + import java.io.UnsupportedEncodingException; + import java.util.ArrayList; +-import java.util.HashSet; ++import java.util.LinkedHashSet; + import java.util.List; + import java.util.Set; + +@@ -243,13 +243,13 @@ + if (circumvent) { + XMLUtils.circumventBug2650(XMLUtils.getOwnerDocument(_subNode)); + } +- this._inputNodeSet = new HashSet(); ++ this._inputNodeSet = new LinkedHashSet(); + XMLUtils.getSet(_subNode,this._inputNodeSet, excludeNode, this.excludeComments); + + return this._inputNodeSet; + } else if (this.isOctetStream()) { + convertToNodes(); +- HashSet result=new HashSet(); ++ LinkedHashSet result = new LinkedHashSet(); + XMLUtils.getSet(_subNode, result,null,false); + //this._inputNodeSet=result; + return result; +--- openjdk/jdk/src/share/classes/com/sun/org/apache/xml/internal/security/utils/ElementProxy.java ++++ openjdk/jdk/src/share/classes/com/sun/org/apache/xml/internal/security/utils/ElementProxy.java +@@ -515,4 +515,16 @@ + return prefixMappings.get(namespace); + } + ++ protected void setLocalIdAttribute(String attrName, String value) { ++ ++ if (value != null) { ++ Attr attr = getDocument().createAttributeNS(null, attrName); ++ attr.setValue(value); ++ getElement().setAttributeNodeNS(attr); ++ getElement().setIdAttributeNode(attr, true); ++ } ++ else { ++ getElement().removeAttributeNS(null, attrName); ++ } ++ } + } +--- openjdk/jdk/src/share/classes/org/jcp/xml/dsig/internal/dom/ApacheNodeSetData.java ++++ openjdk/jdk/src/share/classes/org/jcp/xml/dsig/internal/dom/ApacheNodeSetData.java +@@ -48,7 +48,7 @@ + + public Iterator iterator() { + // If nodefilters are set, must execute them first to create node-set +- if (xi.getNodeFilters() != null) { ++ if (xi.getNodeFilters() != null && !xi.getNodeFilters().isEmpty()) { + return Collections.unmodifiableSet + (getNodeSet(xi.getNodeFilters())).iterator(); + } +--- openjdk/jdk/src/share/classes/org/jcp/xml/dsig/internal/dom/DOMRetrievalMethod.java ++++ openjdk/jdk/src/share/classes/org/jcp/xml/dsig/internal/dom/DOMRetrievalMethod.java +@@ -230,6 +230,21 @@ + } catch (Exception e) { + throw new URIReferenceException(e); + } ++ ++ // guard against RetrievalMethod loops ++ if ((data instanceof NodeSetData) && Utils.secureValidation(context)) { ++ NodeSetData nsd = (NodeSetData)data; ++ Iterator i = nsd.iterator(); ++ if (i.hasNext()) { ++ Node root = (Node)i.next(); ++ if ("RetrievalMethod".equals(root.getLocalName())) { ++ throw new URIReferenceException( ++ "It is forbidden to have one RetrievalMethod point " + ++ "to another when secure validation is enabled"); ++ } ++ } ++ } ++ + return data; + } + +--- openjdk/jdk/src/share/classes/org/jcp/xml/dsig/internal/dom/Utils.java ++++ openjdk/jdk/src/share/classes/org/jcp/xml/dsig/internal/dom/Utils.java +@@ -107,6 +107,9 @@ + } + + static boolean secureValidation(XMLCryptoContext xc) { ++ if (xc == null) { ++ return false; ++ } + return getBoolean(xc, "org.jcp.xml.dsig.secureValidation"); + } + diff -r a6de0621a57b -r ce5dbd04cea5 patches/openjdk/8011154-awt_regresssion.patch --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/patches/openjdk/8011154-awt_regresssion.patch Wed Jul 10 13:59:14 2013 +0100 @@ -0,0 +1,20 @@ +# HG changeset patch +# User anthony +# Date 1365494933 -14400 +# Node ID 5e190bcba6be48c41e68cb85ae7173c51cc931c0 +# Parent 2d3faf2175618b8b5596acbbcb69f163b9773db5 +8011154: java/awt/Frame/ShapeNotSetSometimes/ShapeNotSetSometimes.java failed since 7u25b03 on windows +Reviewed-by: art, yan + +diff --git openjdk/jdk/src/windows/native/sun/windows/awt_Component.cpp openjdk/jdk/src/windows/native/sun/windows/awt_Component.cpp +--- openjdk/jdk/src/windows/native/sun/windows/awt_Component.cpp ++++ openjdk/jdk/src/windows/native/sun/windows/awt_Component.cpp +@@ -6125,7 +6125,7 @@ + + RGNDATA *pRgnData = (RGNDATA *) SAFE_SIZE_STRUCT_ALLOC(safe_Malloc, + sizeof(RGNDATAHEADER), sizeof(RECT_T), numrects); +- memcpy(pRgnData + sizeof(RGNDATAHEADER), pRect, sizeof(RECT_T) * numrects); ++ memcpy((BYTE*)pRgnData + sizeof(RGNDATAHEADER), pRect, sizeof(RECT_T) * numrects); + if (pRect != rects) { + free(pRect); + } diff -r a6de0621a57b -r ce5dbd04cea5 patches/openjdk/8011313-OCSP_timeout_wrong_value.patch --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/patches/openjdk/8011313-OCSP_timeout_wrong_value.patch Wed Jul 10 13:59:14 2013 +0100 @@ -0,0 +1,31 @@ +# HG changeset patch +# User andrew +# Date 1372303832 18000 +# Node ID c655aca607b16492caf7f89b3e2592c4b0c71e34 +# Parent 5e190bcba6be48c41e68cb85ae7173c51cc931c0 +8011313: OCSP timeout set to wrong value if com.sun.security.ocsp.timeout not defined +Reviewed-by: vinnie + +--- openjdk/jdk/src/share/classes/sun/security/provider/certpath/OCSP.java ++++ openjdk/jdk/src/share/classes/sun/security/provider/certpath/OCSP.java +@@ -1,5 +1,5 @@ + /* +- * Copyright (c) 2010, 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 +@@ -81,10 +81,9 @@ + * value is negative, set the timeout length to the default. + */ + private static int initializeTimeout() { +- int tmp = java.security.AccessController.doPrivileged( +- new GetIntegerAction("com.sun.security.ocsp.timeout", +- DEFAULT_CONNECT_TIMEOUT)); +- if (tmp < 0) { ++ Integer tmp = java.security.AccessController.doPrivileged( ++ new GetIntegerAction("com.sun.security.ocsp.timeout")); ++ if (tmp == null || tmp < 0) { + tmp = DEFAULT_CONNECT_TIMEOUT; + } + // Convert to milliseconds, as the system property will be diff -r a6de0621a57b -r ce5dbd04cea5 patches/openjdk/8011992-MlibOpsTest_failed.patch --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/patches/openjdk/8011992-MlibOpsTest_failed.patch Wed Jul 10 13:59:14 2013 +0100 @@ -0,0 +1,89 @@ +# HG changeset patch +# User bae +# Date 1365761717 -14400 +# Node ID 2a78c210f0e2ab6fdb6070789a8928acefa1383d +# Parent 94b16322eb0b0f7ab4d8eb91ac10a2ea2928f199 +8011992: java/awt/image/mlib/MlibOpsTest.java failed since jdk7u25b05 +Reviewed-by: prr, vadim + +--- openjdk/jdk/src/share/native/sun/awt/medialib/awt_ImagingLib.c ++++ openjdk/jdk/src/share/native/sun/awt/medialib/awt_ImagingLib.c +@@ -1302,29 +1302,39 @@ + return 0; + } + +- lut_nbands = (*env)->GetArrayLength(env, jtableArrays); +- +- ncomponents = srcImageP->cmodel.isDefaultCompatCM +- ? 4 +- : srcImageP->cmodel.numComponents; +- +- if (lut_nbands > ncomponents) { +- lut_nbands = ncomponents; ++ nbands = setImageHints(env, srcImageP, dstImageP, FALSE, TRUE, ++ FALSE, &hint); ++ ++ if (nbands < 1 || nbands > srcImageP->cmodel.numComponents) { ++ /* Can't handle any custom images */ ++ awt_freeParsedImage(srcImageP, TRUE); ++ awt_freeParsedImage(dstImageP, TRUE); ++ return 0; + } + + /* Make sure that color order can be used for + * re-ordering of lookup arrays. + */ +- for (i = 0; i < ncomponents; i++) { ++ for (i = 0; i < nbands; i++) { + int idx = srcImageP->hints.colorOrder[i]; + +- if (idx < 0 || idx >= ncomponents) { ++ if (idx < 0 || idx >= nbands) { + awt_freeParsedImage(srcImageP, TRUE); + awt_freeParsedImage(dstImageP, TRUE); + return 0; + } + } + ++ lut_nbands = (*env)->GetArrayLength(env, jtableArrays); ++ ++ ncomponents = srcImageP->cmodel.isDefaultCompatCM ++ ? 4 ++ : srcImageP->cmodel.numComponents; ++ ++ if (lut_nbands > ncomponents) { ++ lut_nbands = ncomponents; ++ } ++ + tbl = NULL; + if (SAFE_TO_ALLOC_2(ncomponents, sizeof(unsigned char *))) { + tbl = (unsigned char **) +@@ -1367,17 +1377,6 @@ + } + } + +- nbands = setImageHints(env, srcImageP, dstImageP, FALSE, TRUE, +- FALSE, &hint); +- if (nbands < 1) { +- /* Can't handle any custom images */ +- free(tbl); +- free(jtable); +- awt_freeParsedImage(srcImageP, TRUE); +- awt_freeParsedImage(dstImageP, TRUE); +- return 0; +- } +- + /* Allocate the arrays */ + if (allocateArray(env, srcImageP, &src, &sdata, TRUE, FALSE, FALSE) < 0) { + /* Must be some problem */ +--- openjdk/jdk/test/java/awt/image/mlib/MlibOpsTest.java ++++ openjdk/jdk/test/java/awt/image/mlib/MlibOpsTest.java +@@ -23,7 +23,7 @@ + + /* + * @test +- * @bug 6556332 ++ * @bug 6556332 8011992 + * @summary Test verifies that on-demnad loading of medialib library does + * not break imageing ops based on this library. + * @run main MlibOpsTest diff -r a6de0621a57b -r ce5dbd04cea5 patches/openjdk/8012112-MlibOpsTest_fails.patch --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/patches/openjdk/8012112-MlibOpsTest_fails.patch Wed Jul 10 13:59:14 2013 +0100 @@ -0,0 +1,51 @@ +# HG changeset patch +# User bae +# Date 1366020921 -14400 +# Node ID 22decf80e0e833a8667f3e413da735b269d97fe6 +# Parent 2a78c210f0e2ab6fdb6070789a8928acefa1383d +8012112: java/awt/image/mlib/MlibOpsTest.java fails on sparc solaris +Reviewed-by: prr, vadim + +--- openjdk/jdk/src/share/native/sun/awt/medialib/awt_ImagingLib.c ++++ openjdk/jdk/src/share/native/sun/awt/medialib/awt_ImagingLib.c +@@ -1312,13 +1312,17 @@ + return 0; + } + ++ ncomponents = srcImageP->cmodel.isDefaultCompatCM ++ ? 4 ++ : srcImageP->cmodel.numComponents; ++ + /* Make sure that color order can be used for + * re-ordering of lookup arrays. + */ + for (i = 0; i < nbands; i++) { + int idx = srcImageP->hints.colorOrder[i]; + +- if (idx < 0 || idx >= nbands) { ++ if (idx < 0 || idx >= ncomponents) { + awt_freeParsedImage(srcImageP, TRUE); + awt_freeParsedImage(dstImageP, TRUE); + return 0; +@@ -1327,10 +1331,6 @@ + + lut_nbands = (*env)->GetArrayLength(env, jtableArrays); + +- ncomponents = srcImageP->cmodel.isDefaultCompatCM +- ? 4 +- : srcImageP->cmodel.numComponents; +- + if (lut_nbands > ncomponents) { + lut_nbands = ncomponents; + } +--- openjdk/jdk/test/java/awt/image/mlib/MlibOpsTest.java ++++ openjdk/jdk/test/java/awt/image/mlib/MlibOpsTest.java +@@ -23,7 +23,7 @@ + + /* + * @test +- * @bug 6556332 8011992 ++ * @bug 6556332 8011992 8012112 + * @summary Test verifies that on-demnad loading of medialib library does + * not break imageing ops based on this library. + * @run main MlibOpsTest diff -r a6de0621a57b -r ce5dbd04cea5 patches/openjdk/8012617-arrayindexoutofbounds_linebreakmeasurer.patch --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/patches/openjdk/8012617-arrayindexoutofbounds_linebreakmeasurer.patch Wed Jul 10 13:59:14 2013 +0100 @@ -0,0 +1,480 @@ +# HG changeset patch +# User prr +# Date 1366951061 25200 +# Node ID 20d3d11e8d9a2eb2a3324eae651e0f1549f95f86 +# Parent 80383749fc726e4ff57a1fd99d15d7ab9f0d28c6 +8012617: ArrayIndexOutOfBoundsException with some fonts using LineBreakMeasurer +Reviewed-by: bae, srl + +--- openjdk/jdk/src/share/classes/sun/font/ExtendedTextSourceLabel.java ++++ openjdk/jdk/src/share/classes/sun/font/ExtendedTextSourceLabel.java +@@ -247,6 +247,10 @@ + float aw = 0f; + float ah = cm.ascent + cm.descent; + ++ if (charinfo == null || charinfo.length == 0) { ++ return new Rectangle2D.Float(al, at, aw, ah); ++ } ++ + boolean lineIsLTR = (source.getLayoutFlags() & 0x8) == 0; + int rn = info.length - numvals; + if (lineIsLTR) { +@@ -350,24 +354,42 @@ + + public float getCharX(int index) { + validate(index); +- return getCharinfo()[l2v(index) * numvals + posx]; ++ float[] charinfo = getCharinfo(); ++ int idx = l2v(index) * numvals + posx; ++ if (charinfo == null || idx >= charinfo.length) { ++ return 0f; ++ } else { ++ return charinfo[idx]; ++ } + } + + public float getCharY(int index) { + validate(index); +- return getCharinfo()[l2v(index) * numvals + posy]; ++ float[] charinfo = getCharinfo(); ++ int idx = l2v(index) * numvals + posy; ++ if (charinfo == null || idx >= charinfo.length) { ++ return 0f; ++ } else { ++ return charinfo[idx]; ++ } + } + + public float getCharAdvance(int index) { + validate(index); +- return getCharinfo()[l2v(index) * numvals + advx]; ++ float[] charinfo = getCharinfo(); ++ int idx = l2v(index) * numvals + advx; ++ if (charinfo == null || idx >= charinfo.length) { ++ return 0f; ++ } else { ++ return charinfo[idx]; ++ } + } + + public Rectangle2D handleGetCharVisualBounds(int index) { + validate(index); + float[] charinfo = getCharinfo(); + index = l2v(index) * numvals; +- if ((index+vish) >= charinfo.length) { ++ if (charinfo == null || (index+vish) >= charinfo.length) { + return new Rectangle2D.Float(); + } + return new Rectangle2D.Float( +@@ -463,7 +485,7 @@ + if (cidx >= charinfo.length) { + break; // layout bailed for some reason + } +- float adv = charinfo[l2v(start) * numvals + advx]; ++ float adv = charinfo[cidx]; + width -= adv; + } + +@@ -512,7 +534,13 @@ + // } + //} + +- return getCharinfo()[v * numvals + advx] != 0; ++ int idx = v * numvals + advx; ++ float[] charinfo = getCharinfo(); ++ if (charinfo == null || idx >= charinfo.length) { ++ return false; ++ } else { ++ return charinfo[idx] != 0; ++ } + } + + private final float[] getCharinfo() { +@@ -604,6 +632,9 @@ + */ + + int numGlyphs = gv.getNumGlyphs(); ++ if (numGlyphs == 0) { ++ return glyphinfo; ++ } + int[] indices = gv.getGlyphCharIndices(0, numGlyphs, null); + + boolean DEBUG = false; +--- openjdk/jdk/src/share/classes/sun/font/GlyphLayout.java ++++ openjdk/jdk/src/share/classes/sun/font/GlyphLayout.java +@@ -464,7 +464,12 @@ + break; + } + catch (IndexOutOfBoundsException e) { +- _gvdata.grow(); ++ if (_gvdata._count >=0) { ++ _gvdata.grow(); ++ } ++ } ++ if (_gvdata._count < 0) { ++ break; + } + } + } +@@ -473,7 +478,15 @@ + // _gvdata.adjustPositions(txinfo.invdtx); + // } + +- StandardGlyphVector gv = _gvdata.createGlyphVector(font, frc, result); ++ // If layout fails (negative glyph count) create an un-laid out GV instead. ++ // ie default positions. This will be a lot better than the alternative of ++ // a complete blank layout. ++ StandardGlyphVector gv; ++ if (_gvdata._count < 0) { ++ gv = new StandardGlyphVector(font, text, offset, count, frc); ++ } else { ++ gv = _gvdata.createGlyphVector(font, frc, result); ++ } + // System.err.println("Layout returns: " + gv); + return gv; + } +--- openjdk/jdk/src/share/native/sun/font/layout/ContextualSubstSubtables.cpp ++++ openjdk/jdk/src/share/native/sun/font/layout/ContextualSubstSubtables.cpp +@@ -218,6 +218,9 @@ + + LEGlyphID glyph = glyphIterator->getCurrGlyphID(); + le_int32 coverageIndex = getGlyphCoverage(lookupProcessor->getReference(), glyph, success); ++ if (LE_FAILURE(success)) { ++ return 0; ++ } + + if (coverageIndex >= 0) { + le_uint16 srSetCount = SWAPW(subRuleSetCount); +@@ -267,6 +270,9 @@ + + LEGlyphID glyph = glyphIterator->getCurrGlyphID(); + le_int32 coverageIndex = getGlyphCoverage(lookupProcessor->getReference(), glyph, success); ++ if (LE_FAILURE(success)) { ++ return 0; ++ } + + if (coverageIndex >= 0) { + const ClassDefinitionTable *classDefinitionTable = +@@ -395,6 +401,9 @@ + + LEGlyphID glyph = glyphIterator->getCurrGlyphID(); + le_int32 coverageIndex = getGlyphCoverage(lookupProcessor->getReference(), glyph, success); ++ if (LE_FAILURE(success)) { ++ return 0; ++ } + + if (coverageIndex >= 0) { + le_uint16 srSetCount = SWAPW(chainSubRuleSetCount); +@@ -466,6 +475,9 @@ + + LEGlyphID glyph = glyphIterator->getCurrGlyphID(); + le_int32 coverageIndex = getGlyphCoverage(lookupProcessor->getReference(), glyph, success); ++ if (LE_FAILURE(success)) { ++ return 0; ++ } + + if (coverageIndex >= 0) { + const ClassDefinitionTable *backtrackClassDefinitionTable = +--- openjdk/jdk/src/share/native/sun/font/layout/CursiveAttachmentSubtables.cpp ++++ openjdk/jdk/src/share/native/sun/font/layout/CursiveAttachmentSubtables.cpp +@@ -45,7 +45,7 @@ + le_int32 coverageIndex = getGlyphCoverage(base, glyphID, success); + le_uint16 eeCount = SWAPW(entryExitCount); + +- if (coverageIndex < 0 || coverageIndex >= eeCount) { ++ if (coverageIndex < 0 || coverageIndex >= eeCount || LE_FAILURE(success)) { + glyphIterator->setCursiveGlyph(); + return 0; + } +--- openjdk/jdk/src/share/native/sun/font/layout/ExtensionSubtables.cpp ++++ openjdk/jdk/src/share/native/sun/font/layout/ExtensionSubtables.cpp +@@ -44,10 +44,10 @@ + #define READ_LONG(code) (le_uint32)((SWAPW(*(le_uint16*)&code) << 16) + SWAPW(*(((le_uint16*)&code) + 1))) + + // FIXME: should look at the format too... maybe have a sub-class for it? +-le_uint32 ExtensionSubtable::process(const LookupProcessor *lookupProcessor, le_uint16 lookupType, ++le_uint32 ExtensionSubtable::process(const LEReferenceTo &thisRef, ++ const LookupProcessor *lookupProcessor, le_uint16 lookupType, + GlyphIterator *glyphIterator, const LEFontInstance *fontInstance, LEErrorCode& success) const + { +- const LEReferenceTo thisRef(lookupProcessor->getReference(), success); // create a reference to this + + if (LE_FAILURE(success)) { + return 0; +@@ -57,7 +57,7 @@ + + if (elt != lookupType) { + le_uint32 extOffset = READ_LONG(extensionOffset); +- LEReferenceTo subtable(thisRef, success, extOffset); ++ LEReferenceTo subtable(thisRef, success, extOffset); + + if(LE_SUCCESS(success)) { + return lookupProcessor->applySubtable(subtable, elt, glyphIterator, fontInstance, success); +--- openjdk/jdk/src/share/native/sun/font/layout/ExtensionSubtables.h ++++ openjdk/jdk/src/share/native/sun/font/layout/ExtensionSubtables.h +@@ -52,7 +52,8 @@ + le_uint16 extensionLookupType; + le_uint32 extensionOffset; + +- le_uint32 process(const LookupProcessor *lookupProcessor, le_uint16 lookupType, ++ le_uint32 process(const LEReferenceTo &extRef, ++ const LookupProcessor *lookupProcessor, le_uint16 lookupType, + GlyphIterator *glyphIterator, const LEFontInstance *fontInstance, LEErrorCode& success) const; + }; + +--- openjdk/jdk/src/share/native/sun/font/layout/GlyphPosnLookupProc.cpp ++++ openjdk/jdk/src/share/native/sun/font/layout/GlyphPosnLookupProc.cpp +@@ -168,7 +168,7 @@ + { + LEReferenceTo subtable(lookupSubtable, success); + +- delta = subtable->process(this, lookupType, glyphIterator, fontInstance, success); ++ delta = subtable->process(subtable, this, lookupType, glyphIterator, fontInstance, success); + break; + } + +--- openjdk/jdk/src/share/native/sun/font/layout/GlyphSubstLookupProc.cpp ++++ openjdk/jdk/src/share/native/sun/font/layout/GlyphSubstLookupProc.cpp +@@ -139,7 +139,7 @@ + { + const LEReferenceTo subtable(lookupSubtable, success); + +- delta = subtable->process(this, lookupType, glyphIterator, fontInstance, success); ++ delta = subtable->process(subtable, this, lookupType, glyphIterator, fontInstance, success); + break; + } + +--- openjdk/jdk/src/share/native/sun/font/layout/LigatureSubstSubtables.cpp ++++ openjdk/jdk/src/share/native/sun/font/layout/LigatureSubstSubtables.cpp +@@ -45,6 +45,10 @@ + LEGlyphID glyph = glyphIterator->getCurrGlyphID(); + le_int32 coverageIndex = getGlyphCoverage(base, glyph, success); + ++ if (LE_FAILURE(success)) { ++ return 0; ++ } ++ + if (coverageIndex >= 0) { + Offset ligSetTableOffset = SWAPW(ligSetTableOffsetArray[coverageIndex]); + const LigatureSetTable *ligSetTable = (const LigatureSetTable *) ((char *) this + ligSetTableOffset); +--- openjdk/jdk/src/share/native/sun/font/layout/MarkToBasePosnSubtables.cpp ++++ openjdk/jdk/src/share/native/sun/font/layout/MarkToBasePosnSubtables.cpp +@@ -56,6 +56,10 @@ + LEGlyphID markGlyph = glyphIterator->getCurrGlyphID(); + le_int32 markCoverage = getGlyphCoverage(base, (LEGlyphID) markGlyph, success); + ++ if (LE_FAILURE(success)) { ++ return 0; ++ } ++ + if (markCoverage < 0) { + // markGlyph isn't a covered mark glyph + return 0; +--- openjdk/jdk/src/share/native/sun/font/layout/MarkToLigaturePosnSubtables.cpp ++++ openjdk/jdk/src/share/native/sun/font/layout/MarkToLigaturePosnSubtables.cpp +@@ -55,6 +55,10 @@ + LEGlyphID markGlyph = glyphIterator->getCurrGlyphID(); + le_int32 markCoverage = getGlyphCoverage(base, (LEGlyphID) markGlyph, success); + ++ if (LE_FAILURE(success)) { ++ return 0; ++ } ++ + if (markCoverage < 0) { + // markGlyph isn't a covered mark glyph + return 0; +--- openjdk/jdk/src/share/native/sun/font/layout/MarkToMarkPosnSubtables.cpp ++++ openjdk/jdk/src/share/native/sun/font/layout/MarkToMarkPosnSubtables.cpp +@@ -56,6 +56,10 @@ + LEGlyphID markGlyph = glyphIterator->getCurrGlyphID(); + le_int32 markCoverage = getGlyphCoverage(base, (LEGlyphID) markGlyph, success); + ++ if (LE_FAILURE(success)) { ++ return 0; ++ } ++ + if (markCoverage < 0) { + // markGlyph isn't a covered mark glyph + return 0; +--- openjdk/jdk/src/share/native/sun/font/layout/MultipleSubstSubtables.cpp ++++ openjdk/jdk/src/share/native/sun/font/layout/MultipleSubstSubtables.cpp +@@ -61,6 +61,10 @@ + le_int32 coverageIndex = getGlyphCoverage(base, glyph, success); + le_uint16 seqCount = SWAPW(sequenceCount); + ++ if (LE_FAILURE(success)) { ++ return 0; ++ } ++ + if (coverageIndex >= 0 && coverageIndex < seqCount) { + Offset sequenceTableOffset = SWAPW(sequenceTableOffsetArray[coverageIndex]); + const SequenceTable *sequenceTable = (const SequenceTable *) ((char *) this + sequenceTableOffset); +--- openjdk/jdk/src/share/native/sun/font/layout/PairPositioningSubtables.cpp ++++ openjdk/jdk/src/share/native/sun/font/layout/PairPositioningSubtables.cpp +@@ -126,6 +126,11 @@ + { + LEGlyphID firstGlyph = glyphIterator->getCurrGlyphID(); + le_int32 coverageIndex = getGlyphCoverage(base, firstGlyph, success); ++ ++ if (LE_FAILURE(success)) { ++ return 0; ++ } ++ + GlyphIterator tempIterator(*glyphIterator); + + if (coverageIndex >= 0 && glyphIterator->next()) { +--- openjdk/jdk/src/share/native/sun/font/layout/SinglePositioningSubtables.cpp ++++ openjdk/jdk/src/share/native/sun/font/layout/SinglePositioningSubtables.cpp +@@ -70,6 +70,9 @@ + { + LEGlyphID glyph = glyphIterator->getCurrGlyphID(); + le_int32 coverageIndex = getGlyphCoverage(base, glyph, success); ++ if (LE_FAILURE(success)) { ++ return 0; ++ } + + if (coverageIndex >= 0) { + valueRecord.adjustPosition(SWAPW(valueFormat), (const char *) this, *glyphIterator, fontInstance); +@@ -84,6 +87,9 @@ + { + LEGlyphID glyph = glyphIterator->getCurrGlyphID(); + le_int16 coverageIndex = (le_int16) getGlyphCoverage(base, glyph, success); ++ if (LE_FAILURE(success)) { ++ return 0; ++ } + + if (coverageIndex >= 0) { + valueRecordArray[0].adjustPosition(coverageIndex, SWAPW(valueFormat), (const char *) this, *glyphIterator, fontInstance); +--- openjdk/jdk/src/share/native/sun/font/layout/SingleSubstitutionSubtables.cpp ++++ openjdk/jdk/src/share/native/sun/font/layout/SingleSubstitutionSubtables.cpp +@@ -69,6 +69,9 @@ + { + LEGlyphID glyph = glyphIterator->getCurrGlyphID(); + le_int32 coverageIndex = getGlyphCoverage(base, glyph, success); ++ if (LE_FAILURE(success)) { ++ return 0; ++ } + + if (coverageIndex >= 0) { + TTGlyphID substitute = ((TTGlyphID) LE_GET_GLYPH(glyph)) + SWAPW(deltaGlyphID); +@@ -87,6 +90,9 @@ + { + LEGlyphID glyph = glyphIterator->getCurrGlyphID(); + le_int32 coverageIndex = getGlyphCoverage(base, glyph, success); ++ if (LE_FAILURE(success)) { ++ return 0; ++ } + + if (coverageIndex >= 0) { + TTGlyphID substitute = SWAPW(substituteArray[coverageIndex]); +--- openjdk/jdk/src/share/native/sun/font/layout/SunLayoutEngine.cpp ++++ openjdk/jdk/src/share/native/sun/font/layout/SunLayoutEngine.cpp +@@ -203,16 +203,19 @@ + getFloat(env, pt, x, y); + jboolean rtl = (typo_flags & TYPO_RTL) != 0; + int glyphCount = engine->layoutChars(chars, start - min, limit - start, len, rtl, x, y, success); +- // fprintf(stderr, "sle nl len %d -> gc: %d\n", len, glyphCount); fflush(stderr); ++ // fprintf(stderr, "sle nl len %d -> gc: %d\n", len, glyphCount); fflush(stderr); + + engine->getGlyphPosition(glyphCount, x, y, success); + +- // fprintf(stderr, "layout glyphs: %d x: %g y: %g\n", glyphCount, x, y); fflush(stderr); +- +- if (putGV(env, gmask, baseIndex, gvdata, engine, glyphCount)) { +- // !!! hmmm, could use current value in positions array of GVData... +- putFloat(env, pt, x, y); +- } ++ // fprintf(stderr, "layout glyphs: %d x: %g y: %g\n", glyphCount, x, y); fflush(stderr); ++ if (LE_FAILURE(success)) { ++ env->SetIntField(gvdata, gvdCountFID, -1); // flag failure ++ } else { ++ if (putGV(env, gmask, baseIndex, gvdata, engine, glyphCount)) { ++ // !!! hmmm, could use current value in positions array of GVData... ++ putFloat(env, pt, x, y); ++ } ++ } + + if (chars != buffer) { + free(chars); +new file mode 100644 +--- /dev/null ++++ openjdk/jdk/test/java/awt/font/LineBreakMeasurer/AllFontsLBM.java +@@ -0,0 +1,78 @@ ++/* ++ * 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 8012617 ++ * @summary ArrayIndexOutOfBoundsException in LineBreakMeasurer ++ */ ++ ++import java.awt.*; ++import java.awt.image.*; ++import java.awt.font.*; ++import java.awt.geom.*; ++import java.text.*; ++import java.util.Hashtable; ++ ++public class AllFontsLBM { ++ ++ public static void main(String[] args) { ++ Font[] allFonts = GraphicsEnvironment.getLocalGraphicsEnvironment().getAllFonts(); ++ for (int i=0;i 9000) { ++ throw new RuntimeException("Returning from dispose() took too much time, probably a bug"); ++ } ++ } ++ ++ private void createAppContext() { ++ isCreated = false; ++ final Runnable runnable = new Runnable() { ++ public void run() { ++ appContext = SunToolkit.createNewAppContext(); ++ synchronized (lock) { ++ isCreated = true; ++ lock.notifyAll(); ++ } ++ } ++ }; ++ ++ final Thread thread = new Thread(threadGroup, runnable, "creates app context"); ++ synchronized (lock) { ++ thread.start(); ++ while (!isCreated) { ++ try { ++ lock.wait(); ++ } catch (InterruptedException ie) { ++ ie.printStackTrace(); ++ } ++ } ++ } ++ ++ if (appContext == null) { ++ throw new RuntimeException("failed to create app context."); ++ } else { ++ System.out.println("app context was created."); ++ } ++ } ++ ++} diff -r a6de0621a57b -r ce5dbd04cea5 patches/openjdk/8013196-TimeZone_getDefault_throws_exception.patch --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/patches/openjdk/8013196-TimeZone_getDefault_throws_exception.patch Wed Jul 10 13:59:14 2013 +0100 @@ -0,0 +1,58 @@ +# HG changeset patch +# User coffeys +# Date 1367438524 -3600 +# Node ID 0f93d6b18a16bf893b152a46df0e22e32666f7ce +# Parent 55eaa0da2a8f6d9fe4966d3d9940258a1b0d4399 +8013196: TimeZone.getDefault() throws NPE due to sun.awt.AppContext.getAppContext() +Reviewed-by: mchung, okutsu + +--- openjdk/jdk/src/share/classes/sun/awt/AppContext.java ++++ openjdk/jdk/src/share/classes/sun/awt/AppContext.java +@@ -813,16 +813,24 @@ + static { + sun.misc.SharedSecrets.setJavaAWTAccess(new sun.misc.JavaAWTAccess() { + public Object get(Object key) { +- return getAppContext().get(key); ++ AppContext ac = getAppContext(); ++ return (ac == null) ? null : ac.get(key); + } + public void put(Object key, Object value) { +- getAppContext().put(key, value); ++ AppContext ac = getAppContext(); ++ if (ac != null) { ++ ac.put(key, value); ++ } + } + public void remove(Object key) { +- getAppContext().remove(key); ++ AppContext ac = getAppContext(); ++ if (ac != null) { ++ ac.remove(key); ++ } + } + public boolean isDisposed() { +- return getAppContext().isDisposed(); ++ AppContext ac = getAppContext(); ++ return (ac == null) ? true : ac.isDisposed(); + } + public boolean isMainAppContext() { + return (numAppContexts.get() == 1 && mainAppContext != null); +--- openjdk/jdk/src/share/classes/sun/misc/SharedSecrets.java ++++ openjdk/jdk/src/share/classes/sun/misc/SharedSecrets.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 +@@ -174,6 +174,9 @@ + public static JavaAWTAccess getJavaAWTAccess() { + // this may return null in which case calling code needs to + // provision for. ++ if (javaAWTAccess == null || javaAWTAccess.getContext() == null) { ++ return null; ++ } + return javaAWTAccess; + } + } diff -r a6de0621a57b -r ce5dbd04cea5 patches/openjdk/8014205-blank_swing_dialogs_windows.patch --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/patches/openjdk/8014205-blank_swing_dialogs_windows.patch Wed Jul 10 13:59:14 2013 +0100 @@ -0,0 +1,146 @@ +# HG changeset patch +# User bae +# Date 1368792434 -14400 +# Node ID 683f472433103a1aaee0bbee21814328fecd91a6 +# Parent 8c2f91c4c4b80f8725786a3006ee6043d765af72 +8014205: Most of the Swing dialogs are blank on one win7 MUI +Reviewed-by: prr, vadim + +--- openjdk/jdk/src/share/classes/java/awt/image/BufferedImage.java ++++ openjdk/jdk/src/share/classes/java/awt/image/BufferedImage.java +@@ -35,6 +35,8 @@ + import java.awt.geom.Point2D; + import java.awt.Point; + import java.awt.Rectangle; ++import java.security.AccessController; ++import java.security.PrivilegedAction; + import java.util.Hashtable; + import java.util.Vector; + +@@ -643,6 +645,7 @@ + this.properties = properties; + int numBands = raster.getNumBands(); + boolean isAlphaPre = cm.isAlphaPremultiplied(); ++ final boolean isStandard = isStandard(cm, raster); + ColorSpace cs; + + // Force the raster data alpha state to match the premultiplied +@@ -653,20 +656,19 @@ + cs = cm.getColorSpace(); + int csType = cs.getType(); + if (csType != ColorSpace.TYPE_RGB) { +- if (csType == ColorSpace.TYPE_GRAY +- && ComponentColorModel.class.equals(cm.getClass())) { ++ if (csType == ColorSpace.TYPE_GRAY && ++ isStandard && ++ cm instanceof ComponentColorModel) { + // Check if this might be a child raster (fix for bug 4240596) + if (sm instanceof ComponentSampleModel && + ((ComponentSampleModel)sm).getPixelStride() != numBands) { + imageType = TYPE_CUSTOM; + } else if (raster instanceof ByteComponentRaster && +- PixelInterleavedSampleModel.class.equals(sm.getClass()) && + raster.getNumBands() == 1 && + cm.getComponentSize(0) == 8 && + ((ByteComponentRaster)raster).getPixelStride() == 1) { + imageType = TYPE_BYTE_GRAY; + } else if (raster instanceof ShortComponentRaster && +- PixelInterleavedSampleModel.class.equals(sm.getClass()) && + raster.getNumBands() == 1 && + cm.getComponentSize(0) == 16 && + ((ShortComponentRaster)raster).getPixelStride() == 1) { +@@ -686,8 +688,8 @@ + // are correct + int pixSize = cm.getPixelSize(); + if (iraster.getPixelStride() == 1 && +- DirectColorModel.class.equals(cm.getClass()) && +- SinglePixelPackedSampleModel.class.equals(sm.getClass()) && ++ isStandard && ++ cm instanceof DirectColorModel && + (pixSize == 32 || pixSize == 24)) + { + // Now check on the DirectColorModel params +@@ -718,21 +720,17 @@ + } // if (rmask == DCM_BGR_RED_MASK && + } // if (iraster.getPixelStride() == 1 + } // ((raster instanceof IntegerComponentRaster) && +- else if ((IndexColorModel.class.equals(cm.getClass())) && +- (numBands == 1) && ++ else if ((cm instanceof IndexColorModel) && (numBands == 1) && ++ isStandard && + (!cm.hasAlpha() || !isAlphaPre)) + { + IndexColorModel icm = (IndexColorModel) cm; + int pixSize = icm.getPixelSize(); + +- if (raster instanceof BytePackedRaster && +- MultiPixelPackedSampleModel.class.equals(sm.getClass())) +- { ++ if (raster instanceof BytePackedRaster) { + imageType = TYPE_BYTE_BINARY; + } // if (raster instanceof BytePackedRaster) +- else if (raster instanceof ByteComponentRaster && +- PixelInterleavedSampleModel.class.equals(sm.getClass())) +- { ++ else if (raster instanceof ByteComponentRaster) { + ByteComponentRaster braster = (ByteComponentRaster) raster; + if (braster.getPixelStride() == 1 && pixSize <= 8) { + imageType = TYPE_BYTE_INDEXED; +@@ -740,8 +738,8 @@ + } + } // else if (cm instanceof IndexColorModel) && (numBands == 1)) + else if ((raster instanceof ShortComponentRaster) +- && (DirectColorModel.class.equals(cm.getClass())) +- && (SinglePixelPackedSampleModel.class.equals(sm.getClass())) ++ && (cm instanceof DirectColorModel) ++ && isStandard + && (numBands == 3) + && !cm.hasAlpha()) + { +@@ -761,6 +759,7 @@ + } // else if ((cm instanceof IndexColorModel) && (numBands == 1)) + else if ((raster instanceof ByteComponentRaster) + && (cm instanceof ComponentColorModel) ++ && isStandard + && (raster.getSampleModel() instanceof PixelInterleavedSampleModel) + && (numBands == 3 || numBands == 4)) + { +@@ -788,9 +787,7 @@ + braster.getPixelStride() == numBands && + offs[0] == numBands-1 && + offs[1] == numBands-2 && +- offs[2] == numBands-3 && +- ComponentColorModel.class.equals(ccm.getClass()) && +- PixelInterleavedSampleModel.class.equals(csm.getClass())) ++ offs[2] == numBands-3) + { + if (numBands == 3 && !ccm.hasAlpha()) { + imageType = TYPE_3BYTE_BGR; +@@ -804,6 +801,27 @@ + } // else if ((raster instanceof ByteComponentRaster) && + } + ++ private static boolean isStandard(ColorModel cm, WritableRaster wr) { ++ final Class cmClass = cm.getClass(); ++ final Class wrClass = wr.getClass(); ++ final Class smClass = wr.getSampleModel().getClass(); ++ ++ final PrivilegedAction checkClassLoadersAction = ++ new PrivilegedAction() ++ { ++ ++ @Override ++ public Boolean run() { ++ final ClassLoader std = System.class.getClassLoader(); ++ ++ return (cmClass.getClassLoader() == std) && ++ (smClass.getClassLoader() == std) && ++ (wrClass.getClassLoader() == std); ++ } ++ }; ++ return AccessController.doPrivileged(checkClassLoadersAction); ++ } ++ + /** + * Returns the image type. If it is not one of the known types, + * TYPE_CUSTOM is returned. diff -r a6de0621a57b -r ce5dbd04cea5 patches/openjdk/8014427-raster_regresssion.patch --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/patches/openjdk/8014427-raster_regresssion.patch Wed Jul 10 13:59:14 2013 +0100 @@ -0,0 +1,20 @@ +# HG changeset patch +# User bae +# Date 1368551120 -14400 +# Node ID 9c9dc3220f0a857385242ad77a10f0b5caa3f861 +# Parent 683f472433103a1aaee0bbee21814328fecd91a6 +8014427: REGRESSION: closed/javax/imageio/plugins/bmp/Write3ByteBgrTest.java fails since 7u25 b09 +Reviewed-by: prr, vadim + +--- openjdk/jdk/src/share/classes/java/awt/image/Raster.java ++++ openjdk/jdk/src/share/classes/java/awt/image/Raster.java +@@ -392,7 +392,8 @@ + } + } + int banks = maxBank + 1; +- int size = scanlineStride * (h - 1) + // fisrt (h - 1) scans ++ int size = maxBandOff + ++ scanlineStride * (h - 1) + // fisrt (h - 1) scans + w; // last scan + + switch(dataType) { diff -r a6de0621a57b -r ce5dbd04cea5 patches/openjdk/8014618-strip_leading_zeros_premastersecret.patch --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/patches/openjdk/8014618-strip_leading_zeros_premastersecret.patch Wed Jul 10 13:59:14 2013 +0100 @@ -0,0 +1,149 @@ +# HG changeset patch +# User andrew +# Date 1371046686 -3600 +# Node ID 27e8f5644011928af792f6b99cc11308f21f5c32 +# Parent b56b4751faf02f4c3fcb0588e5d76a53d391e099 +8014618: Need to strip leading zeros in TlsPremasterSecret of DHKeyAgreement +Reviewed-by: xuelei +Contributed-by: Pasi Eronen + +--- openjdk/jdk/src/share/classes/com/sun/crypto/provider/DHKeyAgreement.java ++++ openjdk/jdk/src/share/classes/com/sun/crypto/provider/DHKeyAgreement.java +@@ -1,5 +1,5 @@ + /* +- * Copyright (c) 1997, 2012, 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 +@@ -407,8 +407,9 @@ + } + return skey; + } else if (algorithm.equals("TlsPremasterSecret")) { +- // return entire secret +- return new SecretKeySpec(secret, "TlsPremasterSecret"); ++ // remove leading zero bytes per RFC 5246 Section 8.1.2 ++ return new SecretKeySpec( ++ KeyUtil.trimZeroes(secret), "TlsPremasterSecret"); + } else { + throw new NoSuchAlgorithmException("Unsupported secret key " + + "algorithm: "+ algorithm); +--- openjdk/jdk/src/share/classes/sun/security/pkcs11/P11KeyAgreement.java ++++ openjdk/jdk/src/share/classes/sun/security/pkcs11/P11KeyAgreement.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 +@@ -208,7 +208,7 @@ + byte[] secret = attributes[0].getByteArray(); + token.p11.C_DestroyObject(session.id(), keyID); + // trim leading 0x00 bytes per JCE convention +- return P11Util.trimZeroes(secret); ++ return KeyUtil.trimZeroes(secret); + } catch (PKCS11Exception e) { + throw new ProviderException("Could not derive key", e); + } finally { +@@ -316,7 +316,7 @@ + // as here we always retrieve the CKA_VALUE even for tokens + // that do not have that bug. + byte[] keyBytes = key.getEncoded(); +- byte[] newBytes = P11Util.trimZeroes(keyBytes); ++ byte[] newBytes = KeyUtil.trimZeroes(keyBytes); + if (keyBytes != newBytes) { + key = new SecretKeySpec(newBytes, algorithm); + } +--- openjdk/jdk/src/share/classes/sun/security/pkcs11/P11Signature.java ++++ openjdk/jdk/src/share/classes/sun/security/pkcs11/P11Signature.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 +@@ -41,6 +41,7 @@ + + import sun.security.pkcs11.wrapper.*; + import static sun.security.pkcs11.wrapper.PKCS11Constants.*; ++import sun.security.util.KeyUtil; + + /** + * Signature implementation class. This class currently supports the +@@ -687,8 +688,8 @@ + BigInteger r = values[0].getPositiveBigInteger(); + BigInteger s = values[1].getPositiveBigInteger(); + // trim leading zeroes +- byte[] br = P11Util.trimZeroes(r.toByteArray()); +- byte[] bs = P11Util.trimZeroes(s.toByteArray()); ++ byte[] br = KeyUtil.trimZeroes(r.toByteArray()); ++ byte[] bs = KeyUtil.trimZeroes(s.toByteArray()); + int k = Math.max(br.length, bs.length); + // r and s each occupy half the array + byte[] res = new byte[k << 1]; +--- openjdk/jdk/src/share/classes/sun/security/pkcs11/P11Util.java ++++ openjdk/jdk/src/share/classes/sun/security/pkcs11/P11Util.java +@@ -1,5 +1,5 @@ + /* +- * Copyright (c) 2003, 2006, 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 +@@ -131,20 +131,6 @@ + return b; + } + +- // trim leading (most significant) zeroes from the result +- static byte[] trimZeroes(byte[] b) { +- int i = 0; +- while ((i < b.length - 1) && (b[i] == 0)) { +- i++; +- } +- if (i == 0) { +- return b; +- } +- byte[] t = new byte[b.length - i]; +- System.arraycopy(b, i, t, 0, t.length); +- return t; +- } +- + public static byte[] getMagnitude(BigInteger bi) { + byte[] b = bi.toByteArray(); + if ((b.length > 1) && (b[0] == 0)) { +--- openjdk/jdk/src/share/classes/sun/security/util/KeyUtil.java ++++ openjdk/jdk/src/share/classes/sun/security/util/KeyUtil.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 +@@ -200,5 +200,24 @@ + + // Don't bother to check against the y^q mod p if safe primes are used. + } ++ ++ /** ++ * Trim leading (most significant) zeroes from the result. ++ * ++ * @throws NullPointerException if {@code b} is null ++ */ ++ public static byte[] trimZeroes(byte[] b) { ++ int i = 0; ++ while ((i < b.length - 1) && (b[i] == 0)) { ++ i++; ++ } ++ if (i == 0) { ++ return b; ++ } ++ byte[] t = new byte[b.length - i]; ++ System.arraycopy(b, i, t, 0, t.length); ++ return t; ++ } ++ + } + diff -r a6de0621a57b -r ce5dbd04cea5 patches/openjdk/8014676-javadebugger_space_in_paths.patch --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/patches/openjdk/8014676-javadebugger_space_in_paths.patch Wed Jul 10 13:59:14 2013 +0100 @@ -0,0 +1,32 @@ +# HG changeset patch +# User dmeetry +# Date 1368806389 -14400 +# Node ID 529e737ece0c08c9de2aa4f3faa1a5e3887ee51e +# Parent 9c9dc3220f0a857385242ad77a10f0b5caa3f861 +8014676: Java debugger may fail to run +Summary: The problem is observed when the binaries for windows are placed under a path which contains a space +Reviewed-by: alanb +Contributed-by: ivan.gerasimov@oracle.com + +--- openjdk/jdk/src/share/classes/com/sun/tools/jdi/AbstractLauncher.java ++++ openjdk/jdk/src/share/classes/com/sun/tools/jdi/AbstractLauncher.java +@@ -142,7 +142,7 @@ + * This class simply provides a context for a single launch and + * accept. It provides instance fields that can be used by + * all threads involved. This stuff can't be in the Connector proper +- * because the connector is is a singleton and not specific to any ++ * because the connector is a singleton and is not specific to any + * one launch. + */ + private class Helper { +--- openjdk/jdk/src/share/classes/com/sun/tools/jdi/SunCommandLineLauncher.java ++++ openjdk/jdk/src/share/classes/com/sun/tools/jdi/SunCommandLineLauncher.java +@@ -213,7 +213,7 @@ + exePath = exe; + } + // Quote only if necessary in case the quote arg value is bogus +- if (hasWhitespace(exe)) { ++ if (hasWhitespace(exePath)) { + exePath = quote + exePath + quote; + } + diff -r a6de0621a57b -r ce5dbd04cea5 patches/openjdk/8014968-OCSP_timeout_default.patch --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/patches/openjdk/8014968-OCSP_timeout_default.patch Wed Jul 10 13:59:14 2013 +0100 @@ -0,0 +1,19 @@ +# HG changeset patch +# User ngthomas +# Date 1369157140 25200 +# Node ID 66420635ccfc7338d509979aee871b85d085529e +# Parent c655aca607b16492caf7f89b3e2592c4b0c71e34 +8014968: OCSP and CRL connection timeout is set to four hours by default +Reviewed-by: mullan + +--- openjdk/jdk/src/share/classes/sun/security/provider/certpath/OCSP.java ++++ openjdk/jdk/src/share/classes/sun/security/provider/certpath/OCSP.java +@@ -84,7 +84,7 @@ + Integer tmp = java.security.AccessController.doPrivileged( + new GetIntegerAction("com.sun.security.ocsp.timeout")); + if (tmp == null || tmp < 0) { +- tmp = DEFAULT_CONNECT_TIMEOUT; ++ return DEFAULT_CONNECT_TIMEOUT; + } + // Convert to milliseconds, as the system property will be + // specified in seconds