Mercurial > hg > icedtea8-forest > jdk
changeset 11846:10f96be3009c icedtea-3.1.0pre01
Merge jdk8u92-b14
line wrap: on
line diff
--- a/.hgtags Mon May 09 02:48:06 2016 +0100 +++ b/.hgtags Mon May 09 04:37:12 2016 +0100 @@ -449,6 +449,7 @@ f94ea276f608b22d78281d70361092ba4864038e jdk8u51-b31 887dde3afb3bb233958775de22eafb3328af6437 jdk8u51-b32 dc7b827522bc3a804f7e8951cc27414f19a7c427 jdk8u51-b33 +55ecfc5067721bd27282a14419e5784f7c7d212d jdk8u51-b34 5c31204d19e5976f025026db3d5c17331e8c44db jdk8u60-b00 c46daef6edb5385d11876ed40f292a4b62e96867 jdk8u60-b01 c10fd784956cc7099657181029ac3e790267b678 jdk8u60-b02 @@ -518,6 +519,11 @@ e6d562c0f079dfd1e21c3734b2dca16f4b2e2494 jdk8u66-b17 fd2fe69089aca0f187901a5f6f8bfe261ff17f5b jdk8u66-b18 f712dceafb546ea5833aeea507b5736e7e45f1ae jdk8u66-b31 +74cfe16ae44c1c6d511dbeabf13a516da3799d55 jdk8u66-b32 +ea7a705eab9e6495d08a92ff21e0370b68374c54 jdk8u66-b33 +72ab45285f0e8293aa63e889bc75f0287b6e0436 jdk8u66-b34 +e169a214f1f096af6b57169eeb0ba66ee5e9caa3 jdk8u66-b35 +430a8d04d8358206b682323f61405f951f43c773 jdk8u66-b36 9a2747ef337bdee71bc8225dea77eb403cca1179 jdk8u71-b00 e8b5e10a19d66a77d04f12d4677e6fec66f79651 jdk8u71-b01 25d689a73bc037e1710f95f6d4acf0671d22047d jdk8u71-b02 @@ -557,9 +563,41 @@ 9a843dc6f959f62c61014a3a71ec9aa329f1daf1 jdk8u74-b00 e829ab80dfd828803aa8837411900faeaa1254a5 jdk8u74-b01 32c49f4a16599e376e4e46bb33c7bcc486e52ff3 jdk8u74-b02 +1d4b343084874b1afa1cdd504b9b1e50bab7f121 jdk8u72-b31 +7cfd2c51c501df909833aa0fb6e40c50c61621ed jdk8u75-b00 +9e00a43602f87930c2318b2567002871ad9c59dd jdk8u75-b01 +9de301db625bb1b462aad3ebd8347118b94bb728 jdk8u75-b02 +dcacefa73649a2d821267b6bff1d70aa10a06801 jdk8u75-b03 +de91f05824c5398cb2d2f666ff404aaa165498de jdk8u75-b04 +4138b3f27ffea524185a604c3f4f149c7e5ba780 jdk8u75-b05 +32f64c19b5fba8beeae5236ca6e480bd8e99698a jdk8u75-b06 +d6b69f2ba2a9fe49ff5aa5c03c923e6caf4ef459 jdk8u75-b07 +ecf980386508e3c74319172e2da9ffedacbb42e2 jdk8u75-b08 +e6f4eb91a1fa895c2f4520e4cca0ae6f2ca14fbb jdk8u75-b09 +93ea7fd6a5a26940d5a2b020c4e9012a85685a5a jdk8u75-b10 +748ca164767d268e1739748f4df02b623397446c jdk8u75-b12 02e1209648050922a5a9f2789d9d359795f6f834 jdk8u77-b00 f08584a0fde9344b0aa4766984266ca68b9a5018 jdk8u77-b01 1a3e81c05703bb36def80a57681e1692c866f621 jdk8u77-b02 e917bc6b356bcb5ea6cc5d15cb3a94183e8581ea icedtea-3.0.0pre10 3334efeacd8327a14b7d2f392f4546e3c29c594b icedtea-3.0.0 4a8297aeb8a980ce4a22f7434f92f2b2ea0f726e icedtea-3.0-branchpoint +c44179bce874a97e93ffd7b76a226af417e017a4 jdk8u77-b03 +71f59a00df6c8f3bd5c6d6631a4988a431adab56 jdk8u91-b00 +7ade7a1ab10ff893f62cce9440b4a839aa19c250 jdk8u91-b13 +f8725698a870b6be82fad578e78a55910b259975 jdk8u91-b14 +39baa472e20c13c0eb1243eb5dce589e82f78143 jdk8u76-b00 +6ea3aea950d19d803475b3f4d704a2942e71b302 jdk8u76-b01 +4de4cffb5988cd68959ce4bbd14c6d4547078c91 jdk8u76-b02 +8bef978e2374604f449b4d1d7f90cb26618540d7 jdk8u76-b03 +e057622070e5415c13b6d8511b97dce8bd2e398d jdk8u76-b04 +b3128c272f8d1684303975795687fd2e9cb87ddf jdk8u76-b05 +06c922a192a822b6a76516d114bfb6979fab03bf jdk8u76-b06 +0022766a3b8e40ab4df6a9b3732facd24ad3beb0 jdk8u76-b07 +74aa3fb974fcb80a0981c1e91eae9b25174135c6 jdk8u76-b08 +cbafa4c725f9d80fd369dd7979dd97682ae284e6 jdk8u76-b09 +8274df0f06623726ff62324671a4ea24a4c3bfc5 jdk8u76-b10 +17f5065e3873fe409bff8c026fa5fe6349b08157 jdk8u76-b11 +0ca25fdd520a0a74f0a488de263641d9f76b8664 jdk8u76-b12 +ea965fea71f612d65013192aa637d88e05915b10 jdk8u92-b00 +cc8d0d6c6f9543120836e70e0aa3fa9c9b6fe0f3 jdk8u92-b13
--- a/make/CompileLaunchers.gmk Mon May 09 02:48:06 2016 +0100 +++ b/make/CompileLaunchers.gmk Mon May 09 04:37:12 2016 +0100 @@ -443,11 +443,6 @@ endif -ifeq ($(OPENJDK_TARGET_CPU_ARCH), sparc) - UNPACKEXE_CFLAGS += -xregs=no%appl - UNPACKEXE_LDFLAGS_solaris += -xmemalign=4s -endif - UNPACKEXE_LANG := C ifeq ($(OPENJDK_TARGET_OS), solaris) UNPACKEXE_LANG := C++
--- a/make/data/tzdata/VERSION Mon May 09 02:48:06 2016 +0100 +++ b/make/data/tzdata/VERSION Mon May 09 04:37:12 2016 +0100 @@ -21,4 +21,4 @@ # or visit www.oracle.com if you need additional information or have any # questions. # -tzdata2015g +tzdata2016a
--- a/make/data/tzdata/asia Mon May 09 02:48:06 2016 +0100 +++ b/make/data/tzdata/asia Mon May 09 04:37:12 2016 +0100 @@ -897,6 +897,15 @@ 9:00 - TLT # India + +# From Ian P. Beacock, in "A brief history of (modern) time", The Atlantic +# http://www.theatlantic.com/technology/archive/2015/12/the-creation-of-modern-time/421419/ +# (2015-12-22): +# In January 1906, several thousand cotton-mill workers rioted on the +# outskirts of Bombay.... They were protesting the proposed abolition of +# local time in favor of Indian Standard Time.... Journalists called this +# dispute the "Battle of the Clocks." It lasted nearly half a century. + # Zone NAME GMTOFF RULES FORMAT [UNTIL] Zone Asia/Kolkata 5:53:28 - LMT 1880 # Kolkata 5:53:20 - HMT 1941 Oct # Howrah Mean Time? @@ -1107,8 +1116,15 @@ Rule Iran 2032 2033 - Sep 21 0:00 0 S Rule Iran 2034 2035 - Mar 22 0:00 1:00 D Rule Iran 2034 2035 - Sep 22 0:00 0 S -Rule Iran 2036 2037 - Mar 21 0:00 1:00 D -Rule Iran 2036 2037 - Sep 21 0:00 0 S +# +# The following rules are approximations starting in the year 2038. +# These are the best post-2037 approximations available, given the +# restrictions of a single rule using a Gregorian-based data format. +# At some point this table will need to be extended, though quite +# possibly Iran will change the rules first. +Rule Iran 2036 max - Mar 21 0:00 1:00 D +Rule Iran 2036 max - Sep 21 0:00 0 S + # Zone NAME GMTOFF RULES FORMAT [UNTIL] Zone Asia/Tehran 3:25:44 - LMT 1916 3:25:44 - TMT 1946 # Tehran Mean Time @@ -2134,8 +2150,8 @@ # http://www.app.com.pk/en_/index.php?option=com_content&task=view&id=99374&Itemid=2 # Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S -Rule Pakistan 2002 only - Apr Sun>=2 0:01 1:00 S -Rule Pakistan 2002 only - Oct Sun>=2 0:01 0 - +Rule Pakistan 2002 only - Apr Sun>=2 0:00 1:00 S +Rule Pakistan 2002 only - Oct Sun>=2 0:00 0 - Rule Pakistan 2008 only - Jun 1 0:00 1:00 S Rule Pakistan 2008 2009 - Nov 1 0:00 0 - Rule Pakistan 2009 only - Apr 15 0:00 1:00 S
--- a/make/data/tzdata/backward Mon May 09 02:48:06 2016 +0100 +++ b/make/data/tzdata/backward Mon May 09 04:37:12 2016 +0100 @@ -46,6 +46,7 @@ Link America/Toronto America/Montreal Link America/Rio_Branco America/Porto_Acre Link America/Argentina/Cordoba America/Rosario +Link America/Tijuana America/Santa_Isabel Link America/Denver America/Shiprock Link America/Port_of_Spain America/Virgin Link Pacific/Auckland Antarctica/South_Pole
--- a/make/data/tzdata/europe Mon May 09 02:48:06 2016 +0100 +++ b/make/data/tzdata/europe Mon May 09 04:37:12 2016 +0100 @@ -2616,13 +2616,20 @@ # Note: Effective 2008-03-01, (75) Chita Oblast and (80) Agin-Buryat # Autonomous Okrug merged to form (92, RU-ZAB) Zabaykalsky Krai. +# From Alexander Krivenyshev (2016-01-02): +# [The] time zone in the Trans-Baikal Territory (Zabaykalsky Krai) - +# Asia/Chita [is changing] from UTC+8 to UTC+9. Effective date will +# be March 27, 2016 at 2:00am.... +# http://publication.pravo.gov.ru/Document/View/000120151230010 + Zone Asia/Chita 7:33:52 - LMT 1919 Dec 15 8:00 - YAKT 1930 Jun 21 # Yakutsk Time 9:00 Russia YAK%sT 1991 Mar 31 2:00s 8:00 Russia YAK%sT 1992 Jan 19 2:00s 9:00 Russia YAK%sT 2011 Mar 27 2:00s 10:00 - YAKT 2014 Oct 26 2:00s - 8:00 - IRKT + 8:00 - IRKT 2016 Mar 27 2:00 + 9:00 - YAKT # From Tim Parenti (2014-07-03), per Oscar van Vlijmen (2009-11-29): @@ -3177,6 +3184,12 @@ # It's officially announced now by the Ministry of Energy. # Turkey delays winter time to 8th of November 04:00 # http://www.aa.com.tr/tr/turkiye/yaz-saati-uygulamasi-8-kasimda-sona-erecek/362217 +# +# From BBC News (2015-10-25): +# Confused Turks are asking "what's the time?" after automatic clocks defied a +# government decision ... "For the next two weeks #Turkey is on EEST... Erdogan +# Engineered Standard Time," said Twitter user @aysekarahasan. +# http://www.bbc.com/news/world-europe-34631326 # Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S Rule Turkey 1916 only - May 1 0:00 1:00 S
--- a/make/data/tzdata/northamerica Mon May 09 02:48:06 2016 +0100 +++ b/make/data/tzdata/northamerica Mon May 09 04:37:12 2016 +0100 @@ -348,6 +348,16 @@ # Statue 175 closer in synch with the US Congress' intent.... # http://www.legis.state.wi.us/2007/data/acts/07Act3.pdf +# From an email administrator of the City of Fort Pierre, SD (2015-12-21): +# Fort Pierre is technically located in the Mountain time zone as is +# the rest of Stanley County. Most of Stanley County and Fort Pierre +# uses the Central time zone due to doing most of their business in +# Pierre so it simplifies schedules. I have lived in Stanley County +# all my life and it has been that way since I can remember. (43 years!) +# +# From Paul Eggert (2015-12-25): +# Assume this practice predates 1970, so Fort Pierre can use America/Chicago. + # Rule NAME FROM TO TYPE IN ON AT SAVE LETTER Rule Chicago 1920 only - Jun 13 2:00 1:00 D Rule Chicago 1920 1921 - Oct lastSun 2:00 0 S @@ -504,6 +514,12 @@ # For lack of better information, assume that Metlakatla's # abandonment of use of daylight saving resulted from the 1983 vote. +# From Steffen Thorsen (2015-11-09): +# It seems Metlakatla did go off PST on Sunday, November 1, changing +# their time to AKST and are going to follow Alaska's DST, switching +# between AKST and AKDT from now on.... +# http://www.krbd.org/2015/10/30/annette-island-times-they-are-a-changing/ + # Zone NAME GMTOFF RULES FORMAT [UNTIL] Zone America/Juneau 15:02:19 - LMT 1867 Oct 18 -8:57:41 - LMT 1900 Aug 20 12:00 @@ -529,7 +545,8 @@ -8:00 US P%sT 1946 -8:00 - PST 1969 -8:00 US P%sT 1983 Oct 30 2:00 - -8:00 - PST + -8:00 - PST 2015 Nov 1 2:00 + -9:00 US AK%sT Zone America/Yakutat 14:41:05 - LMT 1867 Oct 18 -9:18:55 - LMT 1900 Aug 20 12:00 -9:00 - YST 1942 @@ -2610,25 +2627,6 @@ -8:00 US P%sT 2002 Feb 20 -8:00 Mexico P%sT 2010 -8:00 US P%sT -# Baja California (away from US border) -Zone America/Santa_Isabel -7:39:28 - LMT 1922 Jan 1 0:20:32 - -7:00 - MST 1924 - -8:00 - PST 1927 Jun 10 23:00 - -7:00 - MST 1930 Nov 15 - -8:00 - PST 1931 Apr 1 - -8:00 1:00 PDT 1931 Sep 30 - -8:00 - PST 1942 Apr 24 - -8:00 1:00 PWT 1945 Aug 14 23:00u - -8:00 1:00 PPT 1945 Nov 12 # Peace - -8:00 - PST 1948 Apr 5 - -8:00 1:00 PDT 1949 Jan 14 - -8:00 - PST 1954 - -8:00 CA P%sT 1961 - -8:00 - PST 1976 - -8:00 US P%sT 1996 - -8:00 Mexico P%sT 2001 - -8:00 US P%sT 2002 Feb 20 - -8:00 Mexico P%sT # From Paul Eggert (2006-03-22): # Formerly there was an America/Ensenada zone, which differed from # America/Tijuana only in that it did not observe DST from 1976 @@ -2641,6 +2639,13 @@ # other than America/Tijuana for Baja, but it's not clear yet what its # name or contents should be. # +# From Paul Eggert (2015-10-08): +# Formerly there was an America/Santa_Isabel zone, but this appears to +# have come from a misreading of +# http://dof.gob.mx/nota_detalle.php?codigo=5127480&fecha=06/01/2010 +# It has been moved to the 'backward' file. +# +# # Revillagigedo Is # no information @@ -2715,17 +2720,7 @@ -4:00 US A%sT # Cayman Is - -# From Paul Eggert (2015-05-15): -# The Cayman government has decided to introduce DST in 2016, the idea being -# to keep in sync with New York. The legislation hasn't passed but the change -# seems quite likely. See: Meade B. Cayman 27. -# http://www.cayman27.com.ky/2015/05/15/clock-ticks-toward-daylight-saving-time-in-cayman - -Zone America/Cayman -5:25:32 - LMT 1890 # Georgetown - -5:07:11 - KMT 1912 Feb # Kingston Mean Time - -5:00 - EST 2016 - -5:00 US E%sT +# See America/Panama. # Costa Rica @@ -3248,6 +3243,7 @@ Zone America/Panama -5:18:08 - LMT 1890 -5:19:36 - CMT 1908 Apr 22 # Colón Mean Time -5:00 - EST +Link America/Panama America/Cayman # Puerto Rico # There are too many San Juans elsewhere, so we'll use 'Puerto_Rico'.
--- a/make/data/tzdata/zone.tab Mon May 09 02:48:06 2016 +0100 +++ b/make/data/tzdata/zone.tab Mon May 09 04:37:12 2016 +0100 @@ -306,8 +306,7 @@ MX +2838-10605 America/Chihuahua Mexican Mountain Time - Chihuahua away from US border MX +2934-10425 America/Ojinaga US Mountain Time - Chihuahua near US border MX +2904-11058 America/Hermosillo Mountain Standard Time - Sonora -MX +3232-11701 America/Tijuana US Pacific Time - Baja California near US border -MX +3018-11452 America/Santa_Isabel Mexican Pacific Time - Baja California away from US border +MX +3232-11701 America/Tijuana US Pacific Time - Baja California state MX +2048-10515 America/Bahia_Banderas Mexican Central Time - Bahia de Banderas MY +0310+10142 Asia/Kuala_Lumpur peninsular Malaysia MY +0133+11020 Asia/Kuching Sabah & Sarawak @@ -437,10 +436,10 @@ US +433649-1161209 America/Boise Mountain Time - south Idaho & east Oregon US +332654-1120424 America/Phoenix Mountain Standard Time - Arizona (except Navajo) US +340308-1181434 America/Los_Angeles Pacific Time -US +550737-1313435 America/Metlakatla Pacific Standard Time - Annette Island, Alaska US +611305-1495401 America/Anchorage Alaska Time US +581807-1342511 America/Juneau Alaska Time - Alaska panhandle US +571035-1351807 America/Sitka Alaska Time - southeast Alaska panhandle +US +550737-1313435 America/Metlakatla Alaska Time - Annette Island US +593249-1394338 America/Yakutat Alaska Time - Alaska panhandle neck US +643004-1652423 America/Nome Alaska Time - west Alaska US +515248-1763929 America/Adak Aleutian Islands
--- a/src/macosx/bin/java_md_macosx.c Mon May 09 02:48:06 2016 +0100 +++ b/src/macosx/bin/java_md_macosx.c Mon May 09 04:37:12 2016 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 2015, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -1068,6 +1068,7 @@ void PostJVMInit(JNIEnv *env, jstring mainClass, JavaVM *vm) { jvmInstance = vm; SetMainClassForAWT(env, mainClass); + CHECK_EXCEPTION_RETURN(); ShowSplashScreen(); }
--- a/src/macosx/native/sun/awt/AWTView.m Mon May 09 02:48:06 2016 +0100 +++ b/src/macosx/native/sun/awt/AWTView.m Mon May 09 04:37:12 2016 +0100 @@ -46,6 +46,7 @@ -(void) deliverResize: (NSRect) rect; -(void) resetTrackingArea; -(void) deliverJavaKeyEventHelper: (NSEvent*) event; +-(BOOL) isCodePointInUnicodeBlockNeedingIMEvent: (unichar) codePoint; @end // Uncomment this line to see fprintfs of each InputMethod API being called on this View @@ -513,6 +514,14 @@ } } +-(BOOL) isCodePointInUnicodeBlockNeedingIMEvent: (unichar) codePoint { + if ((codePoint >= 0x3000) && (codePoint <= 0x303F)) { + // Code point is in 'CJK Symbols and Punctuation' Unicode block. + return YES; + } + return NO; +} + // NSAccessibility support - (jobject)awtComponent:(JNIEnv*)env { @@ -893,8 +902,14 @@ // (i.e., when the user uses the Character palette or Inkwell), or when the string to insert is a complex // Unicode value. NSUInteger utf16Length = [aString lengthOfBytesUsingEncoding:NSUTF16StringEncoding]; + NSUInteger utf8Length = [aString lengthOfBytesUsingEncoding:NSUTF8StringEncoding]; + BOOL aStringIsComplex = NO; + if ((utf16Length > 2) || + ((utf8Length > 1) && [self isCodePointInUnicodeBlockNeedingIMEvent:[aString characterAtIndex:0]])) { + aStringIsComplex = YES; + } - if ([self hasMarkedText] || !fProcessingKeystroke || (utf16Length > 2)) { + if ([self hasMarkedText] || !fProcessingKeystroke || aStringIsComplex) { JNIEnv *env = [ThreadUtilities getJNIEnv]; static JNF_MEMBER_CACHE(jm_selectPreviousGlyph, jc_CInputMethod, "selectPreviousGlyph", "()V");
--- a/src/macosx/native/sun/awt/CGraphicsEnv.m Mon May 09 02:48:06 2016 +0100 +++ b/src/macosx/native/sun/awt/CGraphicsEnv.m Mon May 09 04:37:12 2016 +0100 @@ -26,6 +26,7 @@ #import <JavaNativeFoundation/JavaNativeFoundation.h> #import "jni_util.h" +#import "ThreadUtilities.h" #import "LWCToolkit.h" #import "AWT_debug.h" @@ -133,17 +134,20 @@ { if (flags == kCGDisplayBeginConfigurationFlag) return; - JNFPerformEnvBlock(JNFThreadDetachImmediately, ^(JNIEnv *env) { - JNFWeakJObjectWrapper *wrapper = (JNFWeakJObjectWrapper *)userInfo; + [ThreadUtilities performOnMainThreadWaiting:NO block:^() { + + JNFPerformEnvBlock(JNFThreadDetachImmediately, ^(JNIEnv *env) { + JNFWeakJObjectWrapper *wrapper = (JNFWeakJObjectWrapper *)userInfo; - jobject graphicsEnv = [wrapper jObjectWithEnv:env]; - if (graphicsEnv == NULL) return; // ref already GC'd - static JNF_CLASS_CACHE(jc_CGraphicsEnvironment, "sun/awt/CGraphicsEnvironment"); - static JNF_MEMBER_CACHE(jm_displayReconfiguration, jc_CGraphicsEnvironment, "_displayReconfiguration", "(IZ)V"); - JNFCallVoidMethod(env, graphicsEnv, jm_displayReconfiguration, - (jint) display, - (jboolean) flags & kCGDisplayRemoveFlag); - }); + jobject graphicsEnv = [wrapper jObjectWithEnv:env]; + if (graphicsEnv == NULL) return; // ref already GC'd + static JNF_CLASS_CACHE(jc_CGraphicsEnvironment, "sun/awt/CGraphicsEnvironment"); + static JNF_MEMBER_CACHE(jm_displayReconfiguration, + jc_CGraphicsEnvironment, "_displayReconfiguration","(IZ)V"); + JNFCallVoidMethod(env, graphicsEnv, jm_displayReconfiguration, + (jint) display, (jboolean) flags & kCGDisplayRemoveFlag); + }); + }]; } /*
--- a/src/macosx/native/sun/java2d/opengl/CGLGraphicsConfig.m Mon May 09 02:48:06 2016 +0100 +++ b/src/macosx/native/sun/java2d/opengl/CGLGraphicsConfig.m Mon May 09 04:37:12 2016 +0100 @@ -236,6 +236,7 @@ } NSOpenGLPixelFormatAttribute attrs[] = { + NSOpenGLPFAAllowOfflineRenderers, NSOpenGLPFAClosestPolicy, NSOpenGLPFAWindow, NSOpenGLPFAPixelBuffer,
--- a/src/share/bin/java.c Mon May 09 02:48:06 2016 +0100 +++ b/src/share/bin/java.c Mon May 09 04:37:12 2016 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1995, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1995, 2015, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -459,6 +459,7 @@ * of the application class. */ PostJVMInit(env, appClass, vm); + CHECK_EXCEPTION_LEAVE(1); /* * The LoadMainClass not only loads the main class, it will also ensure * that the main method's signature is correct, therefore further checking
--- a/src/share/bin/java.h Mon May 09 02:48:06 2016 +0100 +++ b/src/share/bin/java.h Mon May 09 04:37:12 2016 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2015, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -256,6 +256,13 @@ #define NULL_CHECK(NC_check_pointer) \ NULL_CHECK_RETURN_VALUE(NC_check_pointer, ) +#define CHECK_EXCEPTION_RETURN() \ + do { \ + if ((*env)->ExceptionOccurred(env)) { \ + return; \ + } \ + } while (JNI_FALSE) + /* * For JNI calls : * - check for thrown exceptions
--- a/src/share/classes/com/sun/crypto/provider/GaloisCounterMode.java Mon May 09 02:48:06 2016 +0100 +++ b/src/share/classes/com/sun/crypto/provider/GaloisCounterMode.java Mon May 09 04:37:12 2016 +0100 @@ -519,11 +519,17 @@ byte[] sOut = new byte[s.length]; GCTR gctrForSToTag = new GCTR(embeddedCipher, this.preCounterBlock); gctrForSToTag.doFinal(s, 0, s.length, sOut, 0); + + // check entire authentication tag for time-consistency + int mismatch = 0; for (int i = 0; i < tagLenBytes; i++) { - if (tag[i] != sOut[i]) { - throw new AEADBadTagException("Tag mismatch!"); - } + mismatch |= tag[i] ^ sOut[i]; } + + if (mismatch != 0) { + throw new AEADBadTagException("Tag mismatch!"); + } + return len; }
--- a/src/share/classes/com/sun/java/swing/plaf/gtk/resources/gtk_ko.properties Mon May 09 02:48:06 2016 +0100 +++ b/src/share/classes/com/sun/java/swing/plaf/gtk/resources/gtk_ko.properties Mon May 09 04:37:12 2016 +0100 @@ -39,7 +39,7 @@ FileChooser.openButton.textAndMnemonic=\uD655\uC778 FileChooser.saveDialogTitle.textAndMnemonic=\uC800\uC7A5 FileChooser.openDialogTitle.textAndMnemonic=\uC5F4\uAE30 -FileChooser.pathLabel.textAndMnemonic=\uC120\uD0DD \uC0AC\uD56D(&S): +FileChooser.pathLabel.textAndMnemonic=\uC120\uD0DD\uC0AC\uD56D(&S): FileChooser.filterLabel.textAndMnemonic=\uD544\uD130: FileChooser.foldersLabel.textAndMnemonic=\uD3F4\uB354(&D) FileChooser.filesLabel.textAndMnemonic=\uD30C\uC77C(&F)
--- a/src/share/classes/com/sun/java/swing/plaf/windows/resources/windows_ko.properties Mon May 09 02:48:06 2016 +0100 +++ b/src/share/classes/com/sun/java/swing/plaf/windows/resources/windows_ko.properties Mon May 09 04:37:12 2016 +0100 @@ -33,11 +33,11 @@ FileChooser.listViewButtonToolTip.textAndMnemonic=\uBAA9\uB85D FileChooser.listViewButtonAccessibleName=\uBAA9\uB85D FileChooser.listViewActionLabel.textAndMnemonic=\uBAA9\uB85D -FileChooser.detailsViewButtonToolTip.textAndMnemonic=\uC138\uBD80 \uC815\uBCF4 -FileChooser.detailsViewButtonAccessibleName=\uC138\uBD80 \uC815\uBCF4 +FileChooser.detailsViewButtonToolTip.textAndMnemonic=\uC138\uBD80\uC815\uBCF4 +FileChooser.detailsViewButtonAccessibleName=\uC138\uBD80\uC815\uBCF4 FileChooser.viewMenuButtonToolTipText = \uBCF4\uAE30 \uBA54\uB274 FileChooser.viewMenuButtonAccessibleName = \uBCF4\uAE30 \uBA54\uB274 -FileChooser.detailsViewActionLabel.textAndMnemonic=\uC138\uBD80 \uC815\uBCF4 +FileChooser.detailsViewActionLabel.textAndMnemonic=\uC138\uBD80\uC815\uBCF4 FileChooser.refreshActionLabel.textAndMnemonic=\uC0C8\uB85C \uACE0\uCE68 FileChooser.viewMenuLabel.textAndMnemonic=\uBCF4\uAE30 FileChooser.fileNameHeader.textAndMnemonic=\uC774\uB984
--- a/src/share/classes/com/sun/jmx/remote/util/EnvHelp.java Mon May 09 02:48:06 2016 +0100 +++ b/src/share/classes/com/sun/jmx/remote/util/EnvHelp.java Mon May 09 04:37:12 2016 +0100 @@ -1,6 +1,6 @@ /* - * Copyright (c) 2003, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2016, 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 @@ -55,6 +55,21 @@ public class EnvHelp { /** + * Name of the attribute that specifies a list of class names acceptable + * as parameters to the {@link RMIServer#newClient(java.lang.Object) RMIServer.newClient()} + * remote method call. + * <p> + * This list of classes should correspond to the transitive closure of the + * credentials class (or classes) used by the installed {@linkplain JMXAuthenticator} + * associated with the {@linkplain RMIServer} implementation. + * <p> + * If the attribute is not set, or is null, then any class is + * deemed acceptable. + */ + public static final String CREDENTIAL_TYPES = + "jmx.remote.rmi.server.credential.types"; + + /** * <p>Name of the attribute that specifies a default class loader * object. * The value associated with this attribute is a ClassLoader object</p>
--- a/src/share/classes/com/sun/org/apache/xml/internal/security/algorithms/JCEMapper.java Mon May 09 02:48:06 2016 +0100 +++ b/src/share/classes/com/sun/org/apache/xml/internal/security/algorithms/JCEMapper.java Mon May 09 04:37:12 2016 +0100 @@ -91,6 +91,10 @@ new Algorithm("", "SHA1withDSA", "Signature") ); algorithmsMap.put( + XMLSignature.ALGO_ID_SIGNATURE_DSA_SHA256, + new Algorithm("", "SHA256withDSA", "Signature") + ); + algorithmsMap.put( XMLSignature.ALGO_ID_SIGNATURE_NOT_RECOMMENDED_RSA_MD5, new Algorithm("", "MD5withRSA", "Signature") );
--- a/src/share/classes/com/sun/org/apache/xml/internal/security/algorithms/SignatureAlgorithm.java Mon May 09 02:48:06 2016 +0100 +++ b/src/share/classes/com/sun/org/apache/xml/internal/security/algorithms/SignatureAlgorithm.java Mon May 09 04:37:12 2016 +0100 @@ -387,7 +387,12 @@ * This method registers the default algorithms. */ public static void registerDefaultAlgorithms() { - algorithmHash.put(SignatureDSA.URI, SignatureDSA.class); + algorithmHash.put( + XMLSignature.ALGO_ID_SIGNATURE_DSA, SignatureDSA.class + ); + algorithmHash.put( + XMLSignature.ALGO_ID_SIGNATURE_DSA_SHA256, SignatureDSA.SHA256.class + ); algorithmHash.put( XMLSignature.ALGO_ID_SIGNATURE_RSA_SHA1, SignatureBaseRSA.SignatureRSASHA1.class );
--- a/src/share/classes/com/sun/org/apache/xml/internal/security/algorithms/implementations/SignatureDSA.java Mon May 09 02:48:06 2016 +0100 +++ b/src/share/classes/com/sun/org/apache/xml/internal/security/algorithms/implementations/SignatureDSA.java Mon May 09 04:37:12 2016 +0100 @@ -31,13 +31,15 @@ import java.security.SecureRandom; import java.security.Signature; import java.security.SignatureException; +import java.security.interfaces.DSAKey; import java.security.spec.AlgorithmParameterSpec; import com.sun.org.apache.xml.internal.security.algorithms.JCEMapper; import com.sun.org.apache.xml.internal.security.algorithms.SignatureAlgorithmSpi; +import com.sun.org.apache.xml.internal.security.signature.XMLSignature; import com.sun.org.apache.xml.internal.security.signature.XMLSignatureException; import com.sun.org.apache.xml.internal.security.utils.Base64; -import com.sun.org.apache.xml.internal.security.utils.Constants; +import com.sun.org.apache.xml.internal.security.utils.JavaUtils; public class SignatureDSA extends SignatureAlgorithmSpi { @@ -45,19 +47,19 @@ private static java.util.logging.Logger log = java.util.logging.Logger.getLogger(SignatureDSA.class.getName()); - /** Field URI */ - public static final String URI = Constants.SignatureSpecNS + "dsa-sha1"; - /** Field algorithm */ private java.security.Signature signatureAlgorithm = null; + /** size of Q */ + private int size; + /** * Method engineGetURI * * @inheritDoc */ protected String engineGetURI() { - return SignatureDSA.URI; + return XMLSignature.ALGO_ID_SIGNATURE_DSA; } /** @@ -66,7 +68,7 @@ * @throws XMLSignatureException */ public SignatureDSA() throws XMLSignatureException { - String algorithmID = JCEMapper.translateURItoJCEID(SignatureDSA.URI); + String algorithmID = JCEMapper.translateURItoJCEID(engineGetURI()); if (log.isLoggable(java.util.logging.Level.FINE)) { log.log(java.util.logging.Level.FINE, "Created SignatureDSA using " + algorithmID); } @@ -110,7 +112,8 @@ log.log(java.util.logging.Level.FINE, "Called DSA.verify() on " + Base64.encode(signature)); } - byte[] jcebytes = SignatureDSA.convertXMLDSIGtoASN1(signature); + byte[] jcebytes = JavaUtils.convertDsaXMLDSIGtoASN1(signature, + size/8); return this.signatureAlgorithm.verify(jcebytes); } catch (SignatureException ex) { @@ -150,6 +153,7 @@ } throw new XMLSignatureException("empty", ex); } + size = ((DSAKey)publicKey).getParams().getQ().bitLength(); } /** @@ -159,7 +163,7 @@ try { byte jcebytes[] = this.signatureAlgorithm.sign(); - return SignatureDSA.convertASN1toXMLDSIG(jcebytes); + return JavaUtils.convertDsaASN1toXMLDSIG(jcebytes, size/8); } catch (IOException ex) { throw new XMLSignatureException("empty", ex); } catch (SignatureException ex) { @@ -185,6 +189,7 @@ } catch (InvalidKeyException ex) { throw new XMLSignatureException("empty", ex); } + size = ((DSAKey)privateKey).getParams().getQ().bitLength(); } /** @@ -204,6 +209,7 @@ } catch (InvalidKeyException ex) { throw new XMLSignatureException("empty", ex); } + size = ((DSAKey)privateKey).getParams().getQ().bitLength(); } /** @@ -258,100 +264,6 @@ } /** - * Converts an ASN.1 DSA value to a XML Signature DSA Value. - * - * The JAVA JCE DSA Signature algorithm creates ASN.1 encoded (r,s) value - * pairs; the XML Signature requires the core BigInteger values. - * - * @param asn1Bytes - * @return the decode bytes - * - * @throws IOException - * @see <A HREF="http://www.w3.org/TR/xmldsig-core/#dsa-sha1">6.4.1 DSA</A> - */ - private static byte[] convertASN1toXMLDSIG(byte asn1Bytes[]) throws IOException { - - byte rLength = asn1Bytes[3]; - int i; - - for (i = rLength; (i > 0) && (asn1Bytes[(4 + rLength) - i] == 0); i--); - - byte sLength = asn1Bytes[5 + rLength]; - int j; - - for (j = sLength; - (j > 0) && (asn1Bytes[(6 + rLength + sLength) - j] == 0); j--); - - if ((asn1Bytes[0] != 48) || (asn1Bytes[1] != asn1Bytes.length - 2) - || (asn1Bytes[2] != 2) || (i > 20) - || (asn1Bytes[4 + rLength] != 2) || (j > 20)) { - throw new IOException("Invalid ASN.1 format of DSA signature"); - } - byte xmldsigBytes[] = new byte[40]; - - System.arraycopy(asn1Bytes, (4 + rLength) - i, xmldsigBytes, 20 - i, i); - System.arraycopy(asn1Bytes, (6 + rLength + sLength) - j, xmldsigBytes, - 40 - j, j); - - return xmldsigBytes; - } - - /** - * Converts a XML Signature DSA Value to an ASN.1 DSA value. - * - * The JAVA JCE DSA Signature algorithm creates ASN.1 encoded (r,s) value - * pairs; the XML Signature requires the core BigInteger values. - * - * @param xmldsigBytes - * @return the encoded ASN.1 bytes - * - * @throws IOException - * @see <A HREF="http://www.w3.org/TR/xmldsig-core/#dsa-sha1">6.4.1 DSA</A> - */ - private static byte[] convertXMLDSIGtoASN1(byte xmldsigBytes[]) throws IOException { - - if (xmldsigBytes.length != 40) { - throw new IOException("Invalid XMLDSIG format of DSA signature"); - } - - int i; - - for (i = 20; (i > 0) && (xmldsigBytes[20 - i] == 0); i--); - - int j = i; - - if (xmldsigBytes[20 - i] < 0) { - j += 1; - } - - int k; - - for (k = 20; (k > 0) && (xmldsigBytes[40 - k] == 0); k--); - - int l = k; - - if (xmldsigBytes[40 - k] < 0) { - l += 1; - } - - byte asn1Bytes[] = new byte[6 + j + l]; - - asn1Bytes[0] = 48; - asn1Bytes[1] = (byte) (4 + j + l); - asn1Bytes[2] = 2; - asn1Bytes[3] = (byte) j; - - System.arraycopy(xmldsigBytes, 20 - i, asn1Bytes, (4 + j) - i, i); - - asn1Bytes[4 + j] = 2; - asn1Bytes[5 + j] = (byte) l; - - System.arraycopy(xmldsigBytes, 40 - k, asn1Bytes, (6 + j + l) - k, k); - - return asn1Bytes; - } - - /** * Method engineSetHMACOutputLength * * @param HMACOutputLength @@ -373,4 +285,15 @@ ) throws XMLSignatureException { throw new XMLSignatureException("algorithms.CannotUseAlgorithmParameterSpecOnDSA"); } + + public static class SHA256 extends SignatureDSA { + + public SHA256() throws XMLSignatureException { + super(); + } + + public String engineGetURI() { + return XMLSignature.ALGO_ID_SIGNATURE_DSA_SHA256; + } + } }
--- a/src/share/classes/com/sun/org/apache/xml/internal/security/signature/XMLSignature.java Mon May 09 02:48:06 2016 +0100 +++ b/src/share/classes/com/sun/org/apache/xml/internal/security/signature/XMLSignature.java Mon May 09 04:37:12 2016 +0100 @@ -85,6 +85,10 @@ public static final String ALGO_ID_SIGNATURE_DSA = Constants.SignatureSpecNS + "dsa-sha1"; + /** Signature - Optional DSAwithSHA256 */ + public static final String ALGO_ID_SIGNATURE_DSA_SHA256 = + Constants.SignatureSpec11NS + "dsa-sha256"; + /** Signature - Recommended RSAwithSHA1 */ public static final String ALGO_ID_SIGNATURE_RSA = Constants.SignatureSpecNS + "rsa-sha1";
--- a/src/share/classes/com/sun/org/apache/xml/internal/security/utils/JavaUtils.java Mon May 09 02:48:06 2016 +0100 +++ b/src/share/classes/com/sun/org/apache/xml/internal/security/utils/JavaUtils.java Mon May 09 04:37:12 2016 +0100 @@ -152,6 +152,100 @@ } /** + * Converts an ASN.1 DSA value to a XML Signature DSA Value. + * + * The JCE DSA Signature algorithm creates ASN.1 encoded (r,s) value + * pairs (see section 2.2.2 of RFC 3279); the XML Signature requires the + * core BigInteger values. + * + * @param asn1Bytes the ASN.1 encoded bytes + * @param size size of r and s in bytes + * @return the XML Signature encoded bytes + * @throws IOException if the bytes are not encoded correctly + * @see <A HREF="http://www.w3.org/TR/xmldsig-core1/#sec-DSA">6.4.1 DSA</A> + */ + public static byte[] convertDsaASN1toXMLDSIG(byte[] asn1Bytes, int size) + throws IOException + { + if (asn1Bytes[0] != 48 || asn1Bytes[1] != asn1Bytes.length - 2 + || asn1Bytes[2] != 2) { + throw new IOException("Invalid ASN.1 format of DSA signature"); + } + + byte rLength = asn1Bytes[3]; + int i; + for (i = rLength; i > 0 && asn1Bytes[4 + rLength - i] == 0; i--); + + byte sLength = asn1Bytes[5 + rLength]; + int j; + for (j = sLength; + j > 0 && asn1Bytes[6 + rLength + sLength - j] == 0; j--); + + if (i > size || asn1Bytes[4 + rLength] != 2 || j > size) { + throw new IOException("Invalid ASN.1 format of DSA signature"); + } else { + byte[] xmldsigBytes = new byte[size * 2]; + System.arraycopy(asn1Bytes, 4 + rLength - i, xmldsigBytes, + size - i, i); + System.arraycopy(asn1Bytes, 6 + rLength + sLength - j, + xmldsigBytes, size * 2 - j, j); + return xmldsigBytes; + } + } + + /** + * Converts an XML Signature DSA Value to a ASN.1 DSA value. + * + * The JCE DSA Signature algorithm creates ASN.1 encoded (r,s) value + * pairs (see section 2.2.2 of RFC 3279); the XML Signature requires the + * core BigInteger values. + * + * @param xmldsigBytes the XML Signature encoded bytes + * @param size size of r and s in bytes + * @return the ASN.1 encoded bytes + * @throws IOException if the bytes are not encoded correctly + * @see <A HREF="http://www.w3.org/TR/xmldsig-core1/#sec-DSA">6.4.1 DSA</A> + */ + public static byte[] convertDsaXMLDSIGtoASN1(byte[] xmldsigBytes, int size) + throws IOException + { + int totalSize = size * 2; + if (xmldsigBytes.length != totalSize) { + throw new IOException("Invalid XMLDSIG format of DSA signature"); + } + + int i; + for (i = size; i > 0 && xmldsigBytes[size - i] == 0; i--); + + int j = i; + if (xmldsigBytes[size - i] < 0) { + j++; + } + + int k; + for (k = size; k > 0 && xmldsigBytes[totalSize - k] == 0; k--); + + int l = k; + if (xmldsigBytes[totalSize - k] < 0) { + l++; + } + + byte[] asn1Bytes = new byte[6 + j + l]; + asn1Bytes[0] = 48; + asn1Bytes[1] = (byte)(4 + j + l); + asn1Bytes[2] = 2; + asn1Bytes[3] = (byte)j; + System.arraycopy(xmldsigBytes, size - i, asn1Bytes, 4 + j - i, i); + + asn1Bytes[4 + j] = 2; + asn1Bytes[5 + j] = (byte) l; + System.arraycopy(xmldsigBytes, totalSize - k, asn1Bytes, + 6 + j + l - k, k); + + return asn1Bytes; + } + + /** * Throws a {@code SecurityException} if a security manager is installed * and the caller is not allowed to register an implementation of an * algorithm, transform, or other security sensitive XML Signature function.
--- a/src/share/classes/com/sun/org/apache/xml/internal/security/utils/XMLUtils.java Mon May 09 02:48:06 2016 +0100 +++ b/src/share/classes/com/sun/org/apache/xml/internal/security/utils/XMLUtils.java Mon May 09 04:37:12 2016 +0100 @@ -934,7 +934,7 @@ Element foundElement = null; String id = value.trim(); - if (id.charAt(0) == '#') { + if (!id.isEmpty() && id.charAt(0) == '#') { id = id.substring(1); } @@ -994,7 +994,7 @@ Node processedNode = null; String id = value.trim(); - if (id.charAt(0) == '#') { + if (!id.isEmpty() && id.charAt(0) == '#') { id = id.substring(1); }
--- a/src/share/classes/com/sun/rowset/RowSetResourceBundle_de.properties Mon May 09 02:48:06 2016 +0100 +++ b/src/share/classes/com/sun/rowset/RowSetResourceBundle_de.properties Mon May 09 04:37:12 2016 +0100 @@ -1,5 +1,5 @@ # -# Copyright (c) 2005, 2014, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2005, 2016, Oracle and/or its affiliates. All rights reserved. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # # This code is free software; you can redistribute it and/or modify it @@ -31,7 +31,7 @@ cachedrowsetimpl.accfailed = acceptChanges nicht erfolgreich cachedrowsetimpl.invalidcp = Ung\u00FCltige Cursorposition cachedrowsetimpl.illegalop = Ung\u00FCltiger Vorgang bei nicht eingef\u00FCgter Zeile -cachedrowsetimpl.clonefail = Clonen nicht erfolgreich: {0} +cachedrowsetimpl.clonefail = Klonen nicht erfolgreich: {0} cachedrowsetimpl.invalidcol = Ung\u00FCltiger Spaltenindex cachedrowsetimpl.invalcolnm = Ung\u00FCltiger Spaltenname cachedrowsetimpl.boolfail = getBoolen bei Wert ( {0} ) in Spalte {1} nicht erfolgreich
--- a/src/share/classes/com/sun/rowset/RowSetResourceBundle_ko.properties Mon May 09 02:48:06 2016 +0100 +++ b/src/share/classes/com/sun/rowset/RowSetResourceBundle_ko.properties Mon May 09 04:37:12 2016 +0100 @@ -1,5 +1,5 @@ # -# Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2005, 2016, 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 @@ -52,11 +52,11 @@ cachedrowsetimpl.absolute = \uC808\uB300: \uCEE4\uC11C \uC704\uCE58\uAC00 \uBD80\uC801\uD569\uD569\uB2C8\uB2E4. cachedrowsetimpl.relative = \uC0C1\uB300: \uCEE4\uC11C \uC704\uCE58\uAC00 \uBD80\uC801\uD569\uD569\uB2C8\uB2E4. cachedrowsetimpl.asciistream = ASCII \uC2A4\uD2B8\uB9BC\uC5D0 \uB300\uD55C \uC77D\uAE30\uB97C \uC2E4\uD328\uD588\uC2B5\uB2C8\uB2E4. -cachedrowsetimpl.binstream = \uC774\uC9C4 \uC2A4\uD2B8\uB9BC\uC5D0\uC11C \uC77D\uAE30\uB97C \uC2E4\uD328\uD588\uC2B5\uB2C8\uB2E4. +cachedrowsetimpl.binstream = \uBC14\uC774\uB108\uB9AC \uC2A4\uD2B8\uB9BC\uC5D0\uC11C \uC77D\uAE30\uB97C \uC2E4\uD328\uD588\uC2B5\uB2C8\uB2E4. cachedrowsetimpl.failedins = \uD589 \uC0BD\uC785\uC744 \uC2E4\uD328\uD588\uC2B5\uB2C8\uB2E4. cachedrowsetimpl.updateins = \uD589\uC744 \uC0BD\uC785\uD558\uB294 \uC911 updateRow\uAC00 \uD638\uCD9C\uB418\uC5C8\uC2B5\uB2C8\uB2E4. cachedrowsetimpl.movetoins = moveToInsertRow: CONCUR_READ_ONLY -cachedrowsetimpl.movetoins1 = moveToInsertRow: \uBA54\uD0C0 \uB370\uC774\uD130\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4. +cachedrowsetimpl.movetoins1 = moveToInsertRow: \uBA54\uD0C0\uB370\uC774\uD130\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4. cachedrowsetimpl.movetoins2 = moveToInsertRow: \uC5F4 \uC218\uAC00 \uBD80\uC801\uD569\uD569\uB2C8\uB2E4. cachedrowsetimpl.tablename = \uD14C\uC774\uBE14 \uC774\uB984\uC740 \uB110\uC77C \uC218 \uC5C6\uC2B5\uB2C8\uB2E4. cachedrowsetimpl.keycols = \uD0A4 \uC5F4\uC774 \uBD80\uC801\uD569\uD569\uB2C8\uB2E4. @@ -150,7 +150,7 @@ #XmlReaderContentHandler exceptions xmlrch.errmap = \uB9F5\uC744 \uC124\uC815\uD558\uB294 \uC911 \uC624\uB958 \uBC1C\uC0DD: {0} -xmlrch.errmetadata = \uBA54\uD0C0 \uB370\uC774\uD130\uB97C \uC124\uC815\uD558\uB294 \uC911 \uC624\uB958 \uBC1C\uC0DD: {0} +xmlrch.errmetadata = \uBA54\uD0C0\uB370\uC774\uD130\uB97C \uC124\uC815\uD558\uB294 \uC911 \uC624\uB958 \uBC1C\uC0DD: {0} xmlrch.errinsertval = \uAC12\uC744 \uC0BD\uC785\uD558\uB294 \uC911 \uC624\uB958 \uBC1C\uC0DD: {0} xmlrch.errconstr = \uD589\uC744 \uC0DD\uC131\uD558\uB294 \uC911 \uC624\uB958 \uBC1C\uC0DD: {0} xmlrch.errdel = \uD589\uC744 \uC0AD\uC81C\uD558\uB294 \uC911 \uC624\uB958 \uBC1C\uC0DD: {0} @@ -160,7 +160,7 @@ xmlrch.errupdrow = \uD589\uC744 \uC5C5\uB370\uC774\uD2B8\uD558\uB294 \uC911 \uC624\uB958 \uBC1C\uC0DD: {0} xmlrch.chars = \uBB38\uC790: xmlrch.badvalue = \uC798\uBABB\uB41C \uAC12: \uB110\uC77C \uC218 \uC5C6\uB294 \uC18D\uC131\uC785\uB2C8\uB2E4. -xmlrch.badvalue1 = \uC798\uBABB\uB41C \uAC12: \uB110\uC77C \uC218 \uC5C6\uB294 \uBA54\uD0C0 \uB370\uC774\uD130\uC785\uB2C8\uB2E4. +xmlrch.badvalue1 = \uC798\uBABB\uB41C \uAC12: \uB110\uC77C \uC218 \uC5C6\uB294 \uBA54\uD0C0\uB370\uC774\uD130\uC785\uB2C8\uB2E4. xmlrch.warning = ** \uACBD\uACE0: {0}, \uD589: {1}, URI: {2} #RIOptimisticProvider Exceptions
--- a/src/share/classes/com/sun/swing/internal/plaf/basic/resources/basic_ko.properties Mon May 09 02:48:06 2016 +0100 +++ b/src/share/classes/com/sun/swing/internal/plaf/basic/resources/basic_ko.properties Mon May 09 04:37:12 2016 +0100 @@ -71,7 +71,7 @@ FileChooser.directoryOpenButtonToolTip.textAndMnemonic=\uC120\uD0DD\uB41C \uB514\uB809\uD1A0\uB9AC \uC5F4\uAE30 FileChooser.filesListAccessibleName=\uD30C\uC77C \uBAA9\uB85D -FileChooser.filesDetailsAccessibleName=\uD30C\uC77C \uC138\uBD80 \uC815\uBCF4 +FileChooser.filesDetailsAccessibleName=\uD30C\uC77C \uC138\uBD80\uC815\uBCF4 ############ COLOR CHOOSER STRINGS ############# ColorChooser.preview.textAndMnemonic=\uBBF8\uB9AC\uBCF4\uAE30
--- a/src/share/classes/com/sun/swing/internal/plaf/metal/resources/metal_ko.properties Mon May 09 02:48:06 2016 +0100 +++ b/src/share/classes/com/sun/swing/internal/plaf/metal/resources/metal_ko.properties Mon May 09 04:37:12 2016 +0100 @@ -33,9 +33,9 @@ FileChooser.listViewButtonToolTip.textAndMnemonic=\uBAA9\uB85D FileChooser.listViewButtonAccessibleName=\uBAA9\uB85D FileChooser.listViewActionLabel.textAndMnemonic=\uBAA9\uB85D -FileChooser.detailsViewButtonToolTip.textAndMnemonic=\uC138\uBD80 \uC815\uBCF4 -FileChooser.detailsViewButtonAccessibleName=\uC138\uBD80 \uC815\uBCF4 -FileChooser.detailsViewActionLabel.textAndMnemonic=\uC138\uBD80 \uC815\uBCF4 +FileChooser.detailsViewButtonToolTip.textAndMnemonic=\uC138\uBD80\uC815\uBCF4 +FileChooser.detailsViewButtonAccessibleName=\uC138\uBD80\uC815\uBCF4 +FileChooser.detailsViewActionLabel.textAndMnemonic=\uC138\uBD80\uC815\uBCF4 FileChooser.refreshActionLabel.textAndMnemonic=\uC0C8\uB85C \uACE0\uCE68 FileChooser.viewMenuLabel.textAndMnemonic=\uBCF4\uAE30 FileChooser.fileNameHeader.textAndMnemonic=\uC774\uB984
--- a/src/share/classes/com/sun/swing/internal/plaf/synth/resources/synth_ko.properties Mon May 09 02:48:06 2016 +0100 +++ b/src/share/classes/com/sun/swing/internal/plaf/synth/resources/synth_ko.properties Mon May 09 04:37:12 2016 +0100 @@ -33,9 +33,9 @@ FileChooser.listViewButtonToolTip.textAndMnemonic=\uBAA9\uB85D FileChooser.listViewButtonAccessibleName=\uBAA9\uB85D FileChooser.listViewActionLabel.textAndMnemonic=\uBAA9\uB85D -FileChooser.detailsViewButtonToolTip.textAndMnemonic=\uC138\uBD80 \uC815\uBCF4 -FileChooser.detailsViewButtonAccessibleName=\uC138\uBD80 \uC815\uBCF4 -FileChooser.detailsViewActionLabel.textAndMnemonic=\uC138\uBD80 \uC815\uBCF4 +FileChooser.detailsViewButtonToolTip.textAndMnemonic=\uC138\uBD80\uC815\uBCF4 +FileChooser.detailsViewButtonAccessibleName=\uC138\uBD80\uC815\uBCF4 +FileChooser.detailsViewActionLabel.textAndMnemonic=\uC138\uBD80\uC815\uBCF4 FileChooser.refreshActionLabel.textAndMnemonic=\uC0C8\uB85C \uACE0\uCE68 FileChooser.viewMenuLabel.textAndMnemonic=\uBCF4\uAE30 FileChooser.fileNameHeader.textAndMnemonic=\uC774\uB984
--- a/src/share/classes/com/sun/tools/jdi/InvokableTypeImpl.java Mon May 09 02:48:06 2016 +0100 +++ b/src/share/classes/com/sun/tools/jdi/InvokableTypeImpl.java Mon May 09 04:37:12 2016 +0100 @@ -236,6 +236,15 @@ final MethodImpl method, final ValueImpl[] args, final int options) { + /* + * Cache the values of args when TRACE_SENDS is enabled, for later printing. + * If not cached, printing causes a remote call while synchronized, and deadlock. + */ + if ((vm.traceFlags & VirtualMachineImpl.TRACE_SENDS) != 0) { + for (ValueImpl arg: args) { + arg.toString(); + } + } CommandSender sender = getInvokeMethodSender(thread, method, args, options); PacketStream stream; if ((options & ClassType.INVOKE_SINGLE_THREADED) != 0) {
--- a/src/share/classes/java/awt/Component.java Mon May 09 02:48:06 2016 +0100 +++ b/src/share/classes/java/awt/Component.java Mon May 09 04:37:12 2016 +0100 @@ -312,7 +312,7 @@ * @see GraphicsConfiguration * @see #getGraphicsConfiguration */ - private transient GraphicsConfiguration graphicsConfig = null; + private transient volatile GraphicsConfiguration graphicsConfig; /** * A reference to a <code>BufferStrategy</code> object @@ -1141,9 +1141,7 @@ * @since 1.3 */ public GraphicsConfiguration getGraphicsConfiguration() { - synchronized(getTreeLock()) { - return getGraphicsConfiguration_NoClientCode(); - } + return getGraphicsConfiguration_NoClientCode(); } final GraphicsConfiguration getGraphicsConfiguration_NoClientCode() {
--- a/src/share/classes/java/awt/Window.java Mon May 09 02:48:06 2016 +0100 +++ b/src/share/classes/java/awt/Window.java Mon May 09 04:37:12 2016 +0100 @@ -348,7 +348,7 @@ * @see #getOpacity() * @since 1.7 */ - private float opacity = 1.0f; + private volatile float opacity = 1.0f; /** * The shape assigned to this window. This field is set to {@code null} if @@ -1040,9 +1040,7 @@ closeSplashScreen(); Dialog.checkShouldBeBlocked(this); super.show(); - synchronized (getTreeLock()) { - this.locationByPlatform = false; - } + locationByPlatform = false; for (int i = 0; i < ownedWindowList.size(); i++) { Window child = ownedWindowList.elementAt(i).get(); if ((child != null) && child.showWithParent) { @@ -1115,9 +1113,7 @@ modalBlocker.unblockWindow(this); } super.hide(); - synchronized (getTreeLock()) { - this.locationByPlatform = false; - } + locationByPlatform = false; } final void clearMostRecentFocusOwnerOnHide() { @@ -3398,7 +3394,7 @@ return super.canContainFocusOwner(focusOwnerCandidate) && isFocusableWindow(); } - private boolean locationByPlatform = locationByPlatformProp; + private volatile boolean locationByPlatform = locationByPlatformProp; /** @@ -3469,9 +3465,7 @@ * @since 1.5 */ public boolean isLocationByPlatform() { - synchronized (getTreeLock()) { - return locationByPlatform; - } + return locationByPlatform; } /** @@ -3560,9 +3554,7 @@ * @since 1.7 */ public float getOpacity() { - synchronized (getTreeLock()) { - return opacity; - } + return opacity; } /**
--- a/src/share/classes/java/io/ObjectInputStream.java Mon May 09 02:48:06 2016 +0100 +++ b/src/share/classes/java/io/ObjectInputStream.java Mon May 09 04:37:12 2016 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1996, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1996, 2016, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -39,8 +39,10 @@ import java.util.HashMap; import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.ConcurrentMap; -import java.util.concurrent.atomic.AtomicBoolean; import static java.io.ObjectStreamClass.processQueue; +import sun.misc.ObjectStreamClassValidator; +import sun.misc.SharedSecrets; +import sun.misc.Unsafe; import sun.reflect.misc.ReflectUtil; /** @@ -1504,23 +1506,28 @@ throws IOException { byte tc = bin.peekByte(); + ObjectStreamClass descriptor; switch (tc) { case TC_NULL: - return (ObjectStreamClass) readNull(); - + descriptor = (ObjectStreamClass) readNull(); + break; case TC_REFERENCE: - return (ObjectStreamClass) readHandle(unshared); - + descriptor = (ObjectStreamClass) readHandle(unshared); + break; case TC_PROXYCLASSDESC: - return readProxyDesc(unshared); - + descriptor = readProxyDesc(unshared); + break; case TC_CLASSDESC: - return readNonProxyDesc(unshared); - + descriptor = readNonProxyDesc(unshared); + break; default: throw new StreamCorruptedException( String.format("invalid type code: %02X", tc)); } + if (descriptor != null) { + validateDescriptor(descriptor); + } + return descriptor; } private boolean isCustomSubclass() { @@ -1890,6 +1897,8 @@ if (obj == null || handles.lookupException(passHandle) != null) { defaultReadFields(null, slotDesc); // skip field values } else if (slotDesc.hasReadObjectMethod()) { + ThreadDeath t = null; + boolean reset = false; SerialCallbackContext oldContext = curContext; if (oldContext != null) oldContext.check(); @@ -1908,10 +1917,19 @@ */ handles.markException(passHandle, ex); } finally { - curContext.setUsed(); - if (oldContext!= null) - oldContext.check(); - curContext = oldContext; + do { + try { + curContext.setUsed(); + if (oldContext!= null) + oldContext.check(); + curContext = oldContext; + reset = true; + } catch (ThreadDeath x) { + t = x; // defer until reset is true + } + } while (!reset); + if (t != null) + throw t; } /* @@ -1922,7 +1940,7 @@ defaultDataEnd = false; } else { defaultReadFields(obj, slotDesc); - } + } if (slotDesc.hasWriteObjectData()) { skipCustomData(); @@ -1938,7 +1956,7 @@ } } } - } + } /** * Skips over all block data and objects until TC_ENDBLOCKDATA is @@ -1986,27 +2004,27 @@ if (primVals == null || primVals.length < primDataSize) { primVals = new byte[primDataSize]; } - bin.readFully(primVals, 0, primDataSize, false); + bin.readFully(primVals, 0, primDataSize, false); if (obj != null) { desc.setPrimFieldValues(obj, primVals); } - int objHandle = passHandle; - ObjectStreamField[] fields = desc.getFields(false); + int objHandle = passHandle; + ObjectStreamField[] fields = desc.getFields(false); Object[] objVals = new Object[desc.getNumObjFields()]; - int numPrimFields = fields.length - objVals.length; - for (int i = 0; i < objVals.length; i++) { - ObjectStreamField f = fields[numPrimFields + i]; - objVals[i] = readObject0(f.isUnshared()); - if (f.getField() != null) { - handles.markDependency(objHandle, passHandle); + int numPrimFields = fields.length - objVals.length; + for (int i = 0; i < objVals.length; i++) { + ObjectStreamField f = fields[numPrimFields + i]; + objVals[i] = readObject0(f.isUnshared()); + if (f.getField() != null) { + handles.markDependency(objHandle, passHandle); + } } - } if (obj != null) { desc.setObjFieldValues(obj, objVals); } - passHandle = objHandle; - } + passHandle = objHandle; + } /** * Reads in and returns IOException that caused serialization to abort. @@ -3543,4 +3561,20 @@ } } + private void validateDescriptor(ObjectStreamClass descriptor) { + ObjectStreamClassValidator validating = validator; + if (validating != null) { + validating.validateDescriptor(descriptor); + } + } + + // controlled access to ObjectStreamClassValidator + private volatile ObjectStreamClassValidator validator; + + private static void setValidator(ObjectInputStream ois, ObjectStreamClassValidator validator) { + ois.validator = validator; + } + static { + SharedSecrets.setJavaObjectInputStreamAccess(ObjectInputStream::setValidator); + } }
--- a/src/share/classes/java/lang/invoke/BoundMethodHandle.java Mon May 09 02:48:06 2016 +0100 +++ b/src/share/classes/java/lang/invoke/BoundMethodHandle.java Mon May 09 04:37:12 2016 +0100 @@ -34,14 +34,16 @@ import java.lang.invoke.MethodHandles.Lookup; import java.lang.reflect.Field; import java.util.Arrays; -import java.util.HashMap; +import java.util.function.Function; +import java.util.concurrent.ConcurrentMap; +import java.util.concurrent.ConcurrentHashMap; +import jdk.internal.org.objectweb.asm.FieldVisitor; import sun.invoke.util.ValueConversions; import sun.invoke.util.Wrapper; import jdk.internal.org.objectweb.asm.ClassWriter; import jdk.internal.org.objectweb.asm.MethodVisitor; -import jdk.internal.org.objectweb.asm.Type; /** * The flavor of method handle which emulates an invoke instruction @@ -217,7 +219,7 @@ /*non-public*/ int fieldCount() { return 1; } - /*non-public*/ static final SpeciesData SPECIES_DATA = SpeciesData.getForClass("L", Species_L.class); + /*non-public*/ static final SpeciesData SPECIES_DATA = new SpeciesData("L", Species_L.class); /*non-public*/ static BoundMethodHandle make(MethodType mt, LambdaForm lf, Object argL0) { return new Species_L(mt, lf, argL0); } @@ -335,7 +337,7 @@ static final SpeciesData EMPTY = new SpeciesData("", BoundMethodHandle.class); - private SpeciesData(String types, Class<? extends BoundMethodHandle> clazz) { + SpeciesData(String types, Class<? extends BoundMethodHandle> clazz) { this.typeChars = types; this.typeCodes = basicTypes(types); this.clazz = clazz; @@ -355,26 +357,14 @@ assert(!INIT_DONE); if (constructor() == null) { String types = typeChars; + CACHE.put(types, this); Factory.makeCtors(clazz, types, this.constructor); Factory.makeGetters(clazz, types, this.getters); Factory.makeNominalGetters(types, this.nominalGetters, this.getters); } } - private SpeciesData(String typeChars) { - // Placeholder only. - this.typeChars = typeChars; - this.typeCodes = basicTypes(typeChars); - this.clazz = null; - this.constructor = null; - this.getters = null; - this.nominalGetters = null; - this.extensions = null; - } - private boolean isPlaceholder() { return clazz == null; } - - private static final HashMap<String, SpeciesData> CACHE = new HashMap<>(); - static { CACHE.put("", EMPTY); } // make bootstrap predictable + private static final ConcurrentMap<String, SpeciesData> CACHE = new ConcurrentHashMap<>(); private static final boolean INIT_DONE; // set after <clinit> finishes... SpeciesData extendWith(byte type) { @@ -390,62 +380,52 @@ } private static SpeciesData get(String types) { - // Acquire cache lock for query. - SpeciesData d = lookupCache(types); - if (!d.isPlaceholder()) - return d; - synchronized (d) { - // Use synch. on the placeholder to prevent multiple instantiation of one species. - // Creating this class forces a recursive call to getForClass. - if (lookupCache(types).isPlaceholder()) - Factory.generateConcreteBMHClass(types); - } - // Reacquire cache lock. - d = lookupCache(types); - // Class loading must have upgraded the cache. - assert(d != null && !d.isPlaceholder()); - return d; - } - static SpeciesData getForClass(String types, Class<? extends BoundMethodHandle> clazz) { - // clazz is a new class which is initializing its SPECIES_DATA field - return updateCache(types, new SpeciesData(types, clazz)); - } - private static synchronized SpeciesData lookupCache(String types) { - SpeciesData d = CACHE.get(types); - if (d != null) return d; - d = new SpeciesData(types); - assert(d.isPlaceholder()); - CACHE.put(types, d); - return d; - } - private static synchronized SpeciesData updateCache(String types, SpeciesData d) { - SpeciesData d2; - assert((d2 = CACHE.get(types)) == null || d2.isPlaceholder()); - assert(!d.isPlaceholder()); - CACHE.put(types, d); - return d; + return CACHE.computeIfAbsent(types, new Function<String, SpeciesData>() { + @Override + public SpeciesData apply(String types) { + Class<? extends BoundMethodHandle> bmhcl = Factory.getConcreteBMHClass(types); + // SpeciesData instantiation may throw VirtualMachineError because of + // code cache overflow... + SpeciesData speciesData = new SpeciesData(types, bmhcl); + // CHM.computeIfAbsent ensures only one SpeciesData will be set + // successfully on the concrete BMH class if ever + Factory.setSpeciesDataToConcreteBMHClass(bmhcl, speciesData); + // the concrete BMH class is published via SpeciesData instance + // returned here only after it's SPECIES_DATA field is set + return speciesData; + } + }); } - static { - // pre-fill the BMH speciesdata cache with BMH's inner classes - final Class<BoundMethodHandle> rootCls = BoundMethodHandle.class; + /** + * This is to be called when assertions are enabled. It checks whether SpeciesData for all of the statically + * defined species subclasses of BoundMethodHandle has been added to the SpeciesData cache. See below in the + * static initializer for + */ + static boolean speciesDataCachePopulated() { + Class<BoundMethodHandle> rootCls = BoundMethodHandle.class; try { for (Class<?> c : rootCls.getDeclaredClasses()) { if (rootCls.isAssignableFrom(c)) { final Class<? extends BoundMethodHandle> cbmh = c.asSubclass(BoundMethodHandle.class); - SpeciesData d = Factory.speciesDataFromConcreteBMHClass(cbmh); + SpeciesData d = Factory.getSpeciesDataFromConcreteBMHClass(cbmh); assert(d != null) : cbmh.getName(); assert(d.clazz == cbmh); - assert(d == lookupCache(d.typeChars)); + assert(CACHE.get(d.typeChars) == d); } } } catch (Throwable e) { throw newInternalError(e); } + return true; + } - for (SpeciesData d : CACHE.values()) { - d.initForBootstrap(); - } + static { + // Pre-fill the BMH species-data cache with EMPTY and all BMH's inner subclasses. + EMPTY.initForBootstrap(); + Species_L.SPECIES_DATA.initForBootstrap(); + // check that all static SpeciesData instances have been initialized + assert speciesDataCachePopulated(); // Note: Do not simplify this, because INIT_DONE must not be // a compile-time constant during bootstrapping. INIT_DONE = Boolean.TRUE; @@ -479,6 +459,7 @@ static final String BMH_SIG = "L"+BMH+";"; static final String SPECIES_DATA = "java/lang/invoke/BoundMethodHandle$SpeciesData"; static final String SPECIES_DATA_SIG = "L"+SPECIES_DATA+";"; + static final String STABLE_SIG = "Ljava/lang/invoke/Stable;"; static final String SPECIES_PREFIX_NAME = "Species_"; static final String SPECIES_PREFIX_PATH = BMH + "$" + SPECIES_PREFIX_NAME; @@ -493,6 +474,26 @@ static final String[] E_THROWABLE = new String[] { "java/lang/Throwable" }; + static final ConcurrentMap<String, Class<? extends BoundMethodHandle>> CLASS_CACHE = new ConcurrentHashMap<>(); + + /** + * Get a concrete subclass of BMH for a given combination of bound types. + * + * @param types the type signature, wherein reference types are erased to 'L' + * @return the concrete BMH class + */ + static Class<? extends BoundMethodHandle> getConcreteBMHClass(String types) { + // CHM.computeIfAbsent ensures generateConcreteBMHClass is called + // only once per key. + return CLASS_CACHE.computeIfAbsent( + types, new Function<String, Class<? extends BoundMethodHandle>>() { + @Override + public Class<? extends BoundMethodHandle> apply(String types) { + return generateConcreteBMHClass(types); + } + }); + } + /** * Generate a concrete subclass of BMH for a given combination of bound types. * @@ -529,7 +530,7 @@ * } * final SpeciesData speciesData() { return SPECIES_DATA; } * final int fieldCount() { return 3; } - * static final SpeciesData SPECIES_DATA = SpeciesData.getForClass("LLI", Species_LLI.class); + * @Stable static SpeciesData SPECIES_DATA; // injected afterwards * static BoundMethodHandle make(MethodType mt, LambdaForm lf, Object argL0, Object argL1, int argI2) { * return new Species_LLI(mt, lf, argL0, argL1, argI2); * } @@ -568,7 +569,9 @@ cw.visitSource(sourceFile, null); // emit static types and SPECIES_DATA fields - cw.visitField(NOT_ACC_PUBLIC + ACC_STATIC, "SPECIES_DATA", SPECIES_DATA_SIG, null, null).visitEnd(); + FieldVisitor fw = cw.visitField(NOT_ACC_PUBLIC + ACC_STATIC, "SPECIES_DATA", SPECIES_DATA_SIG, null, null); + fw.visitAnnotation(STABLE_SIG, true); + fw.visitEnd(); // emit bound argument fields for (int i = 0; i < types.length(); ++i) { @@ -694,17 +697,6 @@ mv.visitEnd(); } - // emit class initializer - mv = cw.visitMethod(NOT_ACC_PUBLIC | ACC_STATIC, "<clinit>", VOID_SIG, null, null); - mv.visitCode(); - mv.visitLdcInsn(types); - mv.visitLdcInsn(Type.getObjectType(className)); - mv.visitMethodInsn(INVOKESTATIC, SPECIES_DATA, "getForClass", BMHSPECIES_DATA_GFC_SIG, false); - mv.visitFieldInsn(PUTSTATIC, className, "SPECIES_DATA", SPECIES_DATA_SIG); - mv.visitInsn(RETURN); - mv.visitMaxs(0, 0); - mv.visitEnd(); - cw.visitEnd(); // load class @@ -715,7 +707,6 @@ UNSAFE.defineClass(className, classFile, 0, classFile.length, BoundMethodHandle.class.getClassLoader(), null) .asSubclass(BoundMethodHandle.class); - UNSAFE.ensureClassInitialized(bmhClass); return bmhClass; } @@ -785,7 +776,7 @@ // Auxiliary methods. // - static SpeciesData speciesDataFromConcreteBMHClass(Class<? extends BoundMethodHandle> cbmh) { + static SpeciesData getSpeciesDataFromConcreteBMHClass(Class<? extends BoundMethodHandle> cbmh) { try { Field F_SPECIES_DATA = cbmh.getDeclaredField("SPECIES_DATA"); return (SpeciesData) F_SPECIES_DATA.get(null); @@ -794,6 +785,16 @@ } } + static void setSpeciesDataToConcreteBMHClass(Class<? extends BoundMethodHandle> cbmh, SpeciesData speciesData) { + try { + Field F_SPECIES_DATA = cbmh.getDeclaredField("SPECIES_DATA"); + assert F_SPECIES_DATA.getDeclaredAnnotation(Stable.class) != null; + F_SPECIES_DATA.set(null, speciesData); + } catch (ReflectiveOperationException ex) { + throw newInternalError(ex); + } + } + /** * Field names in concrete BMHs adhere to this pattern: * arg + type + index
--- a/src/share/classes/java/time/chrono/HijrahChronology.java Mon May 09 02:48:06 2016 +0100 +++ b/src/share/classes/java/time/chrono/HijrahChronology.java Mon May 09 04:37:12 2016 +0100 @@ -545,9 +545,8 @@ @Override public boolean isLeapYear(long prolepticYear) { checkCalendarInit(); - int epochMonth = yearToEpochMonth((int) prolepticYear); - if (epochMonth < 0 || epochMonth > maxEpochDay) { - throw new DateTimeException("Hijrah date out of range"); + if (prolepticYear < getMinimumYear() || prolepticYear > getMaximumYear()) { + return false; } int len = getYearLength((int) prolepticYear); return (len > 354);
--- a/src/share/classes/java/util/AbstractMap.java Mon May 09 02:48:06 2016 +0100 +++ b/src/share/classes/java/util/AbstractMap.java Mon May 09 04:37:12 2016 +0100 @@ -304,9 +304,28 @@ * Each of these fields are initialized to contain an instance of the * appropriate view the first time this view is requested. The views are * stateless, so there's no reason to create more than one of each. + * + * <p>Since there is no synchronization performed while accessing these fields, + * it is expected that java.util.Map view classes using these fields have + * no non-final fields (or any fields at all except for outer-this). Adhering + * to this rule would make the races on these fields benign. + * + * <p>It is also imperative that implementations read the field only once, + * as in: + * + * <pre> {@code + * public Set<K> keySet() { + * Set<K> ks = keySet; // single racy read + * if (ks == null) { + * ks = new KeySet(); + * keySet = ks; + * } + * return ks; + * } + *}</pre> */ - transient volatile Set<K> keySet; - transient volatile Collection<V> values; + transient Set<K> keySet; + transient Collection<V> values; /** * {@inheritDoc} @@ -325,8 +344,9 @@ * method will not all return the same set. */ public Set<K> keySet() { - if (keySet == null) { - keySet = new AbstractSet<K>() { + Set<K> ks = keySet; + if (ks == null) { + ks = new AbstractSet<K>() { public Iterator<K> iterator() { return new Iterator<K>() { private Iterator<Entry<K,V>> i = entrySet().iterator(); @@ -361,8 +381,9 @@ return AbstractMap.this.containsKey(k); } }; + keySet = ks; } - return keySet; + return ks; } /** @@ -382,8 +403,9 @@ * method will not all return the same collection. */ public Collection<V> values() { - if (values == null) { - values = new AbstractCollection<V>() { + Collection<V> vals = values; + if (vals == null) { + vals = new AbstractCollection<V>() { public Iterator<V> iterator() { return new Iterator<V>() { private Iterator<Entry<K,V>> i = entrySet().iterator(); @@ -418,8 +440,9 @@ return AbstractMap.this.containsValue(v); } }; + values = vals; } - return values; + return vals; } public abstract Set<Entry<K,V>> entrySet();
--- a/src/share/classes/java/util/EnumMap.java Mon May 09 02:48:06 2016 +0100 +++ b/src/share/classes/java/util/EnumMap.java Mon May 09 04:37:12 2016 +0100 @@ -380,10 +380,11 @@ */ public Set<K> keySet() { Set<K> ks = keySet; - if (ks != null) - return ks; - else - return keySet = new KeySet(); + if (ks == null) { + ks = new KeySet(); + keySet = ks; + } + return ks; } private class KeySet extends AbstractSet<K> { @@ -418,10 +419,11 @@ */ public Collection<V> values() { Collection<V> vs = values; - if (vs != null) - return vs; - else - return values = new Values(); + if (vs == null) { + vs = new Values(); + values = vs; + } + return vs; } private class Values extends AbstractCollection<V> {
--- a/src/share/classes/java/util/HashMap.java Mon May 09 02:48:06 2016 +0100 +++ b/src/share/classes/java/util/HashMap.java Mon May 09 04:37:12 2016 +0100 @@ -902,8 +902,12 @@ * @return a set view of the keys contained in this map */ public Set<K> keySet() { - Set<K> ks; - return (ks = keySet) == null ? (keySet = new KeySet()) : ks; + Set<K> ks = keySet; + if (ks == null) { + ks = new KeySet(); + keySet = ks; + } + return ks; } final class KeySet extends AbstractSet<K> { @@ -949,8 +953,12 @@ * @return a view of the values contained in this map */ public Collection<V> values() { - Collection<V> vs; - return (vs = values) == null ? (values = new Values()) : vs; + Collection<V> vs = values; + if (vs == null) { + vs = new Values(); + values = vs; + } + return vs; } final class Values extends AbstractCollection<V> {
--- a/src/share/classes/java/util/IdentityHashMap.java Mon May 09 02:48:06 2016 +0100 +++ b/src/share/classes/java/util/IdentityHashMap.java Mon May 09 04:37:12 2016 +0100 @@ -964,10 +964,11 @@ */ public Set<K> keySet() { Set<K> ks = keySet; - if (ks != null) - return ks; - else - return keySet = new KeySet(); + if (ks == null) { + ks = new KeySet(); + keySet = ks; + } + return ks; } private class KeySet extends AbstractSet<K> { @@ -1069,10 +1070,11 @@ */ public Collection<V> values() { Collection<V> vs = values; - if (vs != null) - return vs; - else - return values = new Values(); + if (vs == null) { + vs = new Values(); + values = vs; + } + return vs; } private class Values extends AbstractCollection<V> {
--- a/src/share/classes/java/util/LinkedHashMap.java Mon May 09 02:48:06 2016 +0100 +++ b/src/share/classes/java/util/LinkedHashMap.java Mon May 09 04:37:12 2016 +0100 @@ -528,8 +528,12 @@ * @return a set view of the keys contained in this map */ public Set<K> keySet() { - Set<K> ks; - return (ks = keySet) == null ? (keySet = new LinkedKeySet()) : ks; + Set<K> ks = keySet; + if (ks == null) { + ks = new LinkedKeySet(); + keySet = ks; + } + return ks; } final class LinkedKeySet extends AbstractSet<K> { @@ -577,8 +581,12 @@ * @return a view of the values contained in this map */ public Collection<V> values() { - Collection<V> vs; - return (vs = values) == null ? (values = new LinkedValues()) : vs; + Collection<V> vs = values; + if (vs == null) { + vs = new LinkedValues(); + values = vs; + } + return vs; } final class LinkedValues extends AbstractCollection<V> {
--- a/src/share/classes/java/util/Spliterator.java Mon May 09 02:48:06 2016 +0100 +++ b/src/share/classes/java/util/Spliterator.java Mon May 09 04:37:12 2016 +0100 @@ -125,7 +125,7 @@ * are encountered. * * @apiNote - * <p>Spliterators, like {@code Iterators}s, are for traversing the elements of + * <p>Spliterators, like {@code Iterator}s, are for traversing the elements of * a source. The {@code Spliterator} API was designed to support efficient * parallel traversal in addition to sequential traversal, by supporting * decomposition as well as single-element iteration. In addition, the
--- a/src/share/classes/java/util/TreeMap.java Mon May 09 02:48:06 2016 +0100 +++ b/src/share/classes/java/util/TreeMap.java Mon May 09 04:37:12 2016 +0100 @@ -855,7 +855,11 @@ */ public Collection<V> values() { Collection<V> vs = values; - return (vs != null) ? vs : (values = new Values()); + if (vs == null) { + vs = new Values(); + values = vs; + } + return vs; } /**
--- a/src/share/classes/java/util/WeakHashMap.java Mon May 09 02:48:06 2016 +0100 +++ b/src/share/classes/java/util/WeakHashMap.java Mon May 09 04:37:12 2016 +0100 @@ -865,7 +865,11 @@ */ public Set<K> keySet() { Set<K> ks = keySet; - return (ks != null ? ks : (keySet = new KeySet())); + if (ks == null) { + ks = new KeySet(); + keySet = ks; + } + return ks; } private class KeySet extends AbstractSet<K> { @@ -914,7 +918,11 @@ */ public Collection<V> values() { Collection<V> vs = values; - return (vs != null) ? vs : (values = new Values()); + if (vs == null) { + vs = new Values(); + values = vs; + } + return vs; } private class Values extends AbstractCollection<V> {
--- a/src/share/classes/java/util/concurrent/atomic/AtomicIntegerFieldUpdater.java Mon May 09 02:48:06 2016 +0100 +++ b/src/share/classes/java/util/concurrent/atomic/AtomicIntegerFieldUpdater.java Mon May 09 04:37:12 2016 +0100 @@ -34,14 +34,14 @@ */ package java.util.concurrent.atomic; -import java.util.function.IntUnaryOperator; -import java.util.function.IntBinaryOperator; -import sun.misc.Unsafe; + import java.lang.reflect.Field; import java.lang.reflect.Modifier; import java.security.AccessController; +import java.security.PrivilegedActionException; import java.security.PrivilegedExceptionAction; -import java.security.PrivilegedActionException; +import java.util.function.IntBinaryOperator; +import java.util.function.IntUnaryOperator; import sun.reflect.CallerSensitive; import sun.reflect.Reflection; @@ -363,14 +363,19 @@ } /** - * Standard hotspot implementation using intrinsics + * Standard hotspot implementation using intrinsics. */ - private static class AtomicIntegerFieldUpdaterImpl<T> - extends AtomicIntegerFieldUpdater<T> { - private static final Unsafe unsafe = Unsafe.getUnsafe(); + private static final class AtomicIntegerFieldUpdaterImpl<T> + extends AtomicIntegerFieldUpdater<T> { + private static final sun.misc.Unsafe U = sun.misc.Unsafe.getUnsafe(); private final long offset; + /** + * if field is protected, the subclass constructing updater, else + * the same as tclass + */ + private final Class<?> cclass; + /** class holding the field */ private final Class<T> tclass; - private final Class<?> cclass; AtomicIntegerFieldUpdaterImpl(final Class<T> tclass, final String fieldName, @@ -391,7 +396,7 @@ ClassLoader ccl = caller.getClassLoader(); if ((ccl != null) && (ccl != cl) && ((cl == null) || !isAncestor(cl, ccl))) { - sun.reflect.misc.ReflectUtil.checkPackageAccess(tclass); + sun.reflect.misc.ReflectUtil.checkPackageAccess(tclass); } } catch (PrivilegedActionException pae) { throw new RuntimeException(pae.getException()); @@ -399,17 +404,15 @@ throw new RuntimeException(ex); } - Class<?> fieldt = field.getType(); - if (fieldt != int.class) + if (field.getType() != int.class) throw new IllegalArgumentException("Must be integer type"); if (!Modifier.isVolatile(modifiers)) throw new IllegalArgumentException("Must be volatile type"); - this.cclass = (Modifier.isProtected(modifiers) && - caller != tclass) ? caller : null; + this.cclass = (Modifier.isProtected(modifiers)) ? caller : tclass; this.tclass = tclass; - offset = unsafe.objectFieldOffset(field); + this.offset = U.objectFieldOffset(field); } /** @@ -428,81 +431,87 @@ return false; } - private void fullCheck(T obj) { - if (!tclass.isInstance(obj)) - throw new ClassCastException(); - if (cclass != null) - ensureProtectedAccess(obj); - } - - public boolean compareAndSet(T obj, int expect, int update) { - if (obj == null || obj.getClass() != tclass || cclass != null) fullCheck(obj); - return unsafe.compareAndSwapInt(obj, offset, expect, update); + /** + * Checks that target argument is instance of cclass. On + * failure, throws cause. + */ + private final void accessCheck(T obj) { + if (!cclass.isInstance(obj)) + throwAccessCheckException(obj); } - public boolean weakCompareAndSet(T obj, int expect, int update) { - if (obj == null || obj.getClass() != tclass || cclass != null) fullCheck(obj); - return unsafe.compareAndSwapInt(obj, offset, expect, update); + /** + * Throws access exception if accessCheck failed due to + * protected access, else ClassCastException. + */ + private final void throwAccessCheckException(T obj) { + if (cclass == tclass) + throw new ClassCastException(); + else + throw new RuntimeException( + new IllegalAccessException( + "Class " + + cclass.getName() + + " can not access a protected member of class " + + tclass.getName() + + " using an instance of " + + obj.getClass().getName())); } - public void set(T obj, int newValue) { - if (obj == null || obj.getClass() != tclass || cclass != null) fullCheck(obj); - unsafe.putIntVolatile(obj, offset, newValue); + public final boolean compareAndSet(T obj, int expect, int update) { + accessCheck(obj); + return U.compareAndSwapInt(obj, offset, expect, update); } - public void lazySet(T obj, int newValue) { - if (obj == null || obj.getClass() != tclass || cclass != null) fullCheck(obj); - unsafe.putOrderedInt(obj, offset, newValue); + public final boolean weakCompareAndSet(T obj, int expect, int update) { + accessCheck(obj); + return U.compareAndSwapInt(obj, offset, expect, update); + } + + public final void set(T obj, int newValue) { + accessCheck(obj); + U.putIntVolatile(obj, offset, newValue); + } + + public final void lazySet(T obj, int newValue) { + accessCheck(obj); + U.putOrderedInt(obj, offset, newValue); } public final int get(T obj) { - if (obj == null || obj.getClass() != tclass || cclass != null) fullCheck(obj); - return unsafe.getIntVolatile(obj, offset); + accessCheck(obj); + return U.getIntVolatile(obj, offset); } - public int getAndSet(T obj, int newValue) { - if (obj == null || obj.getClass() != tclass || cclass != null) fullCheck(obj); - return unsafe.getAndSetInt(obj, offset, newValue); + public final int getAndSet(T obj, int newValue) { + accessCheck(obj); + return U.getAndSetInt(obj, offset, newValue); } - public int getAndIncrement(T obj) { + public final int getAndAdd(T obj, int delta) { + accessCheck(obj); + return U.getAndAddInt(obj, offset, delta); + } + + public final int getAndIncrement(T obj) { return getAndAdd(obj, 1); } - public int getAndDecrement(T obj) { + public final int getAndDecrement(T obj) { return getAndAdd(obj, -1); } - public int getAndAdd(T obj, int delta) { - if (obj == null || obj.getClass() != tclass || cclass != null) fullCheck(obj); - return unsafe.getAndAddInt(obj, offset, delta); - } - - public int incrementAndGet(T obj) { + public final int incrementAndGet(T obj) { return getAndAdd(obj, 1) + 1; } - public int decrementAndGet(T obj) { - return getAndAdd(obj, -1) - 1; + public final int decrementAndGet(T obj) { + return getAndAdd(obj, -1) - 1; } - public int addAndGet(T obj, int delta) { + public final int addAndGet(T obj, int delta) { return getAndAdd(obj, delta) + delta; } - private void ensureProtectedAccess(T obj) { - if (cclass.isInstance(obj)) { - return; - } - throw new RuntimeException( - new IllegalAccessException("Class " + - cclass.getName() + - " can not access a protected member of class " + - tclass.getName() + - " using an instance of " + - obj.getClass().getName() - ) - ); - } } }
--- a/src/share/classes/java/util/concurrent/atomic/AtomicLongFieldUpdater.java Mon May 09 02:48:06 2016 +0100 +++ b/src/share/classes/java/util/concurrent/atomic/AtomicLongFieldUpdater.java Mon May 09 04:37:12 2016 +0100 @@ -34,14 +34,14 @@ */ package java.util.concurrent.atomic; -import java.util.function.LongUnaryOperator; -import java.util.function.LongBinaryOperator; -import sun.misc.Unsafe; + import java.lang.reflect.Field; import java.lang.reflect.Modifier; import java.security.AccessController; +import java.security.PrivilegedActionException; import java.security.PrivilegedExceptionAction; -import java.security.PrivilegedActionException; +import java.util.function.LongBinaryOperator; +import java.util.function.LongUnaryOperator; import sun.reflect.CallerSensitive; import sun.reflect.Reflection; @@ -365,11 +365,16 @@ return next; } - private static class CASUpdater<T> extends AtomicLongFieldUpdater<T> { - private static final Unsafe unsafe = Unsafe.getUnsafe(); + private static final class CASUpdater<T> extends AtomicLongFieldUpdater<T> { + private static final sun.misc.Unsafe U = sun.misc.Unsafe.getUnsafe(); private final long offset; + /** + * if field is protected, the subclass constructing updater, else + * the same as tclass + */ + private final Class<?> cclass; + /** class holding the field */ private final Class<T> tclass; - private final Class<?> cclass; CASUpdater(final Class<T> tclass, final String fieldName, final Class<?> caller) { @@ -389,7 +394,7 @@ ClassLoader ccl = caller.getClassLoader(); if ((ccl != null) && (ccl != cl) && ((cl == null) || !isAncestor(cl, ccl))) { - sun.reflect.misc.ReflectUtil.checkPackageAccess(tclass); + sun.reflect.misc.ReflectUtil.checkPackageAccess(tclass); } } catch (PrivilegedActionException pae) { throw new RuntimeException(pae.getException()); @@ -397,103 +402,110 @@ throw new RuntimeException(ex); } - Class<?> fieldt = field.getType(); - if (fieldt != long.class) + if (field.getType() != long.class) throw new IllegalArgumentException("Must be long type"); if (!Modifier.isVolatile(modifiers)) throw new IllegalArgumentException("Must be volatile type"); - this.cclass = (Modifier.isProtected(modifiers) && - caller != tclass) ? caller : null; + this.cclass = (Modifier.isProtected(modifiers)) ? caller : tclass; this.tclass = tclass; - offset = unsafe.objectFieldOffset(field); + this.offset = U.objectFieldOffset(field); + } + + /** + * Checks that target argument is instance of cclass. On + * failure, throws cause. + */ + private final void accessCheck(T obj) { + if (!cclass.isInstance(obj)) + throwAccessCheckException(obj); } - private void fullCheck(T obj) { - if (!tclass.isInstance(obj)) + /** + * Throws access exception if accessCheck failed due to + * protected access, else ClassCastException. + */ + private final void throwAccessCheckException(T obj) { + if (cclass == tclass) throw new ClassCastException(); - if (cclass != null) - ensureProtectedAccess(obj); - } - - public boolean compareAndSet(T obj, long expect, long update) { - if (obj == null || obj.getClass() != tclass || cclass != null) fullCheck(obj); - return unsafe.compareAndSwapLong(obj, offset, expect, update); + else + throw new RuntimeException( + new IllegalAccessException( + "Class " + + cclass.getName() + + " can not access a protected member of class " + + tclass.getName() + + " using an instance of " + + obj.getClass().getName())); } - public boolean weakCompareAndSet(T obj, long expect, long update) { - if (obj == null || obj.getClass() != tclass || cclass != null) fullCheck(obj); - return unsafe.compareAndSwapLong(obj, offset, expect, update); + public final boolean compareAndSet(T obj, long expect, long update) { + accessCheck(obj); + return U.compareAndSwapLong(obj, offset, expect, update); } - public void set(T obj, long newValue) { - if (obj == null || obj.getClass() != tclass || cclass != null) fullCheck(obj); - unsafe.putLongVolatile(obj, offset, newValue); + public final boolean weakCompareAndSet(T obj, long expect, long update) { + accessCheck(obj); + return U.compareAndSwapLong(obj, offset, expect, update); + } + + public final void set(T obj, long newValue) { + accessCheck(obj); + U.putLongVolatile(obj, offset, newValue); } - public void lazySet(T obj, long newValue) { - if (obj == null || obj.getClass() != tclass || cclass != null) fullCheck(obj); - unsafe.putOrderedLong(obj, offset, newValue); + public final void lazySet(T obj, long newValue) { + accessCheck(obj); + U.putOrderedLong(obj, offset, newValue); + } + + public final long get(T obj) { + accessCheck(obj); + return U.getLongVolatile(obj, offset); } - public long get(T obj) { - if (obj == null || obj.getClass() != tclass || cclass != null) fullCheck(obj); - return unsafe.getLongVolatile(obj, offset); + public final long getAndSet(T obj, long newValue) { + accessCheck(obj); + return U.getAndSetLong(obj, offset, newValue); } - public long getAndSet(T obj, long newValue) { - if (obj == null || obj.getClass() != tclass || cclass != null) fullCheck(obj); - return unsafe.getAndSetLong(obj, offset, newValue); + public final long getAndAdd(T obj, long delta) { + accessCheck(obj); + return U.getAndAddLong(obj, offset, delta); } - public long getAndIncrement(T obj) { + public final long getAndIncrement(T obj) { return getAndAdd(obj, 1); } - public long getAndDecrement(T obj) { + public final long getAndDecrement(T obj) { return getAndAdd(obj, -1); } - public long getAndAdd(T obj, long delta) { - if (obj == null || obj.getClass() != tclass || cclass != null) fullCheck(obj); - return unsafe.getAndAddLong(obj, offset, delta); - } - - public long incrementAndGet(T obj) { + public final long incrementAndGet(T obj) { return getAndAdd(obj, 1) + 1; } - public long decrementAndGet(T obj) { - return getAndAdd(obj, -1) - 1; - } - - public long addAndGet(T obj, long delta) { - return getAndAdd(obj, delta) + delta; + public final long decrementAndGet(T obj) { + return getAndAdd(obj, -1) - 1; } - private void ensureProtectedAccess(T obj) { - if (cclass.isInstance(obj)) { - return; - } - throw new RuntimeException( - new IllegalAccessException("Class " + - cclass.getName() + - " can not access a protected member of class " + - tclass.getName() + - " using an instance of " + - obj.getClass().getName() - ) - ); + public final long addAndGet(T obj, long delta) { + return getAndAdd(obj, delta) + delta; } } - - private static class LockedUpdater<T> extends AtomicLongFieldUpdater<T> { - private static final Unsafe unsafe = Unsafe.getUnsafe(); + private static final class LockedUpdater<T> extends AtomicLongFieldUpdater<T> { + private static final sun.misc.Unsafe U = sun.misc.Unsafe.getUnsafe(); private final long offset; + /** + * if field is protected, the subclass constructing updater, else + * the same as tclass + */ + private final Class<?> cclass; + /** class holding the field */ private final Class<T> tclass; - private final Class<?> cclass; LockedUpdater(final Class<T> tclass, final String fieldName, final Class<?> caller) { @@ -513,7 +525,7 @@ ClassLoader ccl = caller.getClassLoader(); if ((ccl != null) && (ccl != cl) && ((cl == null) || !isAncestor(cl, ccl))) { - sun.reflect.misc.ReflectUtil.checkPackageAccess(tclass); + sun.reflect.misc.ReflectUtil.checkPackageAccess(tclass); } } catch (PrivilegedActionException pae) { throw new RuntimeException(pae.getException()); @@ -521,73 +533,76 @@ throw new RuntimeException(ex); } - Class<?> fieldt = field.getType(); - if (fieldt != long.class) + if (field.getType() != long.class) throw new IllegalArgumentException("Must be long type"); if (!Modifier.isVolatile(modifiers)) throw new IllegalArgumentException("Must be volatile type"); - this.cclass = (Modifier.isProtected(modifiers) && - caller != tclass) ? caller : null; + this.cclass = (Modifier.isProtected(modifiers)) ? caller : tclass; this.tclass = tclass; - offset = unsafe.objectFieldOffset(field); + this.offset = U.objectFieldOffset(field); + } + + /** + * Checks that target argument is instance of cclass. On + * failure, throws cause. + */ + private final void accessCheck(T obj) { + if (!cclass.isInstance(obj)) + throw accessCheckException(obj); } - private void fullCheck(T obj) { - if (!tclass.isInstance(obj)) - throw new ClassCastException(); - if (cclass != null) - ensureProtectedAccess(obj); + /** + * Returns access exception if accessCheck failed due to + * protected access, else ClassCastException. + */ + private final RuntimeException accessCheckException(T obj) { + if (cclass == tclass) + return new ClassCastException(); + else + return new RuntimeException( + new IllegalAccessException( + "Class " + + cclass.getName() + + " can not access a protected member of class " + + tclass.getName() + + " using an instance of " + + obj.getClass().getName())); } - public boolean compareAndSet(T obj, long expect, long update) { - if (obj == null || obj.getClass() != tclass || cclass != null) fullCheck(obj); + public final boolean compareAndSet(T obj, long expect, long update) { + accessCheck(obj); synchronized (this) { - long v = unsafe.getLong(obj, offset); + long v = U.getLong(obj, offset); if (v != expect) return false; - unsafe.putLong(obj, offset, update); + U.putLong(obj, offset, update); return true; } } - public boolean weakCompareAndSet(T obj, long expect, long update) { + public final boolean weakCompareAndSet(T obj, long expect, long update) { return compareAndSet(obj, expect, update); } - public void set(T obj, long newValue) { - if (obj == null || obj.getClass() != tclass || cclass != null) fullCheck(obj); + public final void set(T obj, long newValue) { + accessCheck(obj); synchronized (this) { - unsafe.putLong(obj, offset, newValue); + U.putLong(obj, offset, newValue); } } - public void lazySet(T obj, long newValue) { + public final void lazySet(T obj, long newValue) { set(obj, newValue); } - public long get(T obj) { - if (obj == null || obj.getClass() != tclass || cclass != null) fullCheck(obj); + public final long get(T obj) { + accessCheck(obj); synchronized (this) { - return unsafe.getLong(obj, offset); + return U.getLong(obj, offset); } } - - private void ensureProtectedAccess(T obj) { - if (cclass.isInstance(obj)) { - return; - } - throw new RuntimeException( - new IllegalAccessException("Class " + - cclass.getName() + - " can not access a protected member of class " + - tclass.getName() + - " using an instance of " + - obj.getClass().getName() - ) - ); - } } /** @@ -595,7 +610,7 @@ * classloader's delegation chain. * Equivalent to the inaccessible: first.isAncestor(second). */ - private static boolean isAncestor(ClassLoader first, ClassLoader second) { + static boolean isAncestor(ClassLoader first, ClassLoader second) { ClassLoader acl = first; do { acl = acl.getParent();
--- a/src/share/classes/java/util/concurrent/atomic/AtomicReferenceFieldUpdater.java Mon May 09 02:48:06 2016 +0100 +++ b/src/share/classes/java/util/concurrent/atomic/AtomicReferenceFieldUpdater.java Mon May 09 04:37:12 2016 +0100 @@ -34,14 +34,14 @@ */ package java.util.concurrent.atomic; -import java.util.function.UnaryOperator; -import java.util.function.BinaryOperator; -import sun.misc.Unsafe; + import java.lang.reflect.Field; import java.lang.reflect.Modifier; import java.security.AccessController; +import java.security.PrivilegedActionException; import java.security.PrivilegedExceptionAction; -import java.security.PrivilegedActionException; +import java.util.function.BinaryOperator; +import java.util.function.UnaryOperator; import sun.reflect.CallerSensitive; import sun.reflect.Reflection; @@ -53,7 +53,7 @@ * independently subject to atomic updates. For example, a tree node * might be declared as * - * <pre> {@code + * <pre> {@code * class Node { * private volatile Node left, right; * @@ -62,7 +62,7 @@ * private static AtomicReferenceFieldUpdater<Node, Node> rightUpdater = * AtomicReferenceFieldUpdater.newUpdater(Node.class, Node.class, "right"); * - * Node getLeft() { return left; } + * Node getLeft() { return left; } * boolean compareAndSetLeft(Node expect, Node update) { * return leftUpdater.compareAndSet(this, expect, update); * } @@ -284,11 +284,17 @@ private static final class AtomicReferenceFieldUpdaterImpl<T,V> extends AtomicReferenceFieldUpdater<T,V> { - private static final Unsafe unsafe = Unsafe.getUnsafe(); + private static final sun.misc.Unsafe U = sun.misc.Unsafe.getUnsafe(); private final long offset; + /** + * if field is protected, the subclass constructing updater, else + * the same as tclass + */ + private final Class<?> cclass; + /** class holding the field */ private final Class<T> tclass; + /** field value type */ private final Class<V> vclass; - private final Class<?> cclass; /* * Internal type checks within all update methods contain @@ -323,7 +329,7 @@ ClassLoader ccl = caller.getClassLoader(); if ((ccl != null) && (ccl != cl) && ((cl == null) || !isAncestor(cl, ccl))) { - sun.reflect.misc.ReflectUtil.checkPackageAccess(tclass); + sun.reflect.misc.ReflectUtil.checkPackageAccess(tclass); } fieldClass = field.getType(); } catch (PrivilegedActionException pae) { @@ -340,14 +346,10 @@ if (!Modifier.isVolatile(modifiers)) throw new IllegalArgumentException("Must be volatile type"); - this.cclass = (Modifier.isProtected(modifiers) && - caller != tclass) ? caller : null; + this.cclass = (Modifier.isProtected(modifiers)) ? caller : tclass; this.tclass = tclass; - if (vclass == Object.class) - this.vclass = null; - else - this.vclass = vclass; - offset = unsafe.objectFieldOffset(field); + this.vclass = vclass; + this.offset = U.objectFieldOffset(field); } /** @@ -366,83 +368,78 @@ return false; } - void targetCheck(T obj) { - if (!tclass.isInstance(obj)) - throw new ClassCastException(); - if (cclass != null) - ensureProtectedAccess(obj); + /** + * Checks that target argument is instance of cclass. On + * failure, throws cause. + */ + private final void accessCheck(T obj) { + if (!cclass.isInstance(obj)) + throwAccessCheckException(obj); } - void updateCheck(T obj, V update) { - if (!tclass.isInstance(obj) || - (update != null && vclass != null && !vclass.isInstance(update))) + /** + * Throws access exception if accessCheck failed due to + * protected access, else ClassCastException. + */ + private final void throwAccessCheckException(T obj) { + if (cclass == tclass) throw new ClassCastException(); - if (cclass != null) - ensureProtectedAccess(obj); - } - - public boolean compareAndSet(T obj, V expect, V update) { - if (obj == null || obj.getClass() != tclass || cclass != null || - (update != null && vclass != null && - vclass != update.getClass())) - updateCheck(obj, update); - return unsafe.compareAndSwapObject(obj, offset, expect, update); + else + throw new RuntimeException( + new IllegalAccessException( + "Class " + + cclass.getName() + + " can not access a protected member of class " + + tclass.getName() + + " using an instance of " + + obj.getClass().getName())); } - public boolean weakCompareAndSet(T obj, V expect, V update) { - // same implementation as strong form for now - if (obj == null || obj.getClass() != tclass || cclass != null || - (update != null && vclass != null && - vclass != update.getClass())) - updateCheck(obj, update); - return unsafe.compareAndSwapObject(obj, offset, expect, update); + private final void valueCheck(V v) { + if (v != null && !(vclass.isInstance(v))) + throwCCE(); + } + + static void throwCCE() { + throw new ClassCastException(); + } + + public final boolean compareAndSet(T obj, V expect, V update) { + accessCheck(obj); + valueCheck(update); + return U.compareAndSwapObject(obj, offset, expect, update); } - public void set(T obj, V newValue) { - if (obj == null || obj.getClass() != tclass || cclass != null || - (newValue != null && vclass != null && - vclass != newValue.getClass())) - updateCheck(obj, newValue); - unsafe.putObjectVolatile(obj, offset, newValue); + public final boolean weakCompareAndSet(T obj, V expect, V update) { + // same implementation as strong form for now + accessCheck(obj); + valueCheck(update); + return U.compareAndSwapObject(obj, offset, expect, update); } - public void lazySet(T obj, V newValue) { - if (obj == null || obj.getClass() != tclass || cclass != null || - (newValue != null && vclass != null && - vclass != newValue.getClass())) - updateCheck(obj, newValue); - unsafe.putOrderedObject(obj, offset, newValue); + public final void set(T obj, V newValue) { + accessCheck(obj); + valueCheck(newValue); + U.putObjectVolatile(obj, offset, newValue); + } + + public final void lazySet(T obj, V newValue) { + accessCheck(obj); + valueCheck(newValue); + U.putOrderedObject(obj, offset, newValue); } @SuppressWarnings("unchecked") - public V get(T obj) { - if (obj == null || obj.getClass() != tclass || cclass != null) - targetCheck(obj); - return (V)unsafe.getObjectVolatile(obj, offset); + public final V get(T obj) { + accessCheck(obj); + return (V)U.getObjectVolatile(obj, offset); } @SuppressWarnings("unchecked") - public V getAndSet(T obj, V newValue) { - if (obj == null || obj.getClass() != tclass || cclass != null || - (newValue != null && vclass != null && - vclass != newValue.getClass())) - updateCheck(obj, newValue); - return (V)unsafe.getAndSetObject(obj, offset, newValue); - } - - private void ensureProtectedAccess(T obj) { - if (cclass.isInstance(obj)) { - return; - } - throw new RuntimeException( - new IllegalAccessException("Class " + - cclass.getName() + - " can not access a protected member of class " + - tclass.getName() + - " using an instance of " + - obj.getClass().getName() - ) - ); + public final V getAndSet(T obj, V newValue) { + accessCheck(obj); + valueCheck(newValue); + return (V)U.getAndSetObject(obj, offset, newValue); } } }
--- a/src/share/classes/javax/management/remote/rmi/RMIConnector.java Mon May 09 02:48:06 2016 +0100 +++ b/src/share/classes/javax/management/remote/rmi/RMIConnector.java Mon May 09 04:37:12 2016 +0100 @@ -2639,7 +2639,7 @@ return attributes != null ? attributes.asList().stream() .map(Attribute::getName) - .collect(Collectors.joining("[", ", ", "]")) + .collect(Collectors.joining(", ", "[", "]")) : "[]"; } }
--- a/src/share/classes/javax/management/remote/rmi/RMIJRMPServerImpl.java Mon May 09 02:48:06 2016 +0100 +++ b/src/share/classes/javax/management/remote/rmi/RMIJRMPServerImpl.java Mon May 09 04:37:12 2016 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2016, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -39,6 +39,12 @@ import com.sun.jmx.remote.internal.RMIExporter; import com.sun.jmx.remote.util.EnvHelp; +import java.io.ObjectStreamClass; +import java.lang.reflect.Method; +import java.util.ArrayList; +import java.util.List; +import sun.reflect.misc.ReflectUtil; +import sun.rmi.server.DeserializationChecker; import sun.rmi.server.UnicastServerRef; import sun.rmi.server.UnicastServerRef2; @@ -52,6 +58,9 @@ * @since 1.5 */ public class RMIJRMPServerImpl extends RMIServerImpl { + + private final ExportedWrapper exportedWrapper; + /** * <p>Creates a new {@link RMIServer} object that will be exported * on the given port using the given socket factories.</p> @@ -89,10 +98,31 @@ this.csf = csf; this.ssf = ssf; this.env = (env == null) ? Collections.<String, Object>emptyMap() : env; + + String[] credentialsTypes + = (String[]) this.env.get(EnvHelp.CREDENTIAL_TYPES); + List<String> types = null; + if (credentialsTypes != null) { + types = new ArrayList<>(); + for (String type : credentialsTypes) { + if (type == null) { + throw new IllegalArgumentException("A credential type is null."); + } + ReflectUtil.checkPackageAccess(type); + types.add(type); + } + } + exportedWrapper = types != null ? + new ExportedWrapper(this, types) : + null; } protected void export() throws IOException { - export(this); + if (exportedWrapper != null) { + export(exportedWrapper); + } else { + export(this); + } } private void export(Remote obj) throws RemoteException { @@ -142,7 +172,11 @@ * RMIJRMPServerImpl has not been exported yet. */ public Remote toStub() throws IOException { - return RemoteObject.toStub(this); + if (exportedWrapper != null) { + return RemoteObject.toStub(exportedWrapper); + } else { + return RemoteObject.toStub(this); + } } /** @@ -189,11 +223,56 @@ * server failed. */ protected void closeServer() throws IOException { - unexport(this, true); + if (exportedWrapper != null) { + unexport(exportedWrapper, true); + } else { + unexport(this, true); + } } private final int port; private final RMIClientSocketFactory csf; private final RMIServerSocketFactory ssf; private final Map<String, ?> env; + + private static class ExportedWrapper implements RMIServer, DeserializationChecker { + private final RMIServer impl; + private final List<String> allowedTypes; + private ExportedWrapper(RMIServer impl, List<String> credentialsTypes) { + this.impl = impl; + allowedTypes = credentialsTypes; + } + + @Override + public String getVersion() throws RemoteException { + return impl.getVersion(); + } + + @Override + public RMIConnection newClient(Object credentials) throws IOException { + return impl.newClient(credentials); + } + + @Override + public void check(Method method, ObjectStreamClass descriptor, + int paramIndex, int callID) { + + String type = descriptor.getName(); + if (!allowedTypes.contains(type)) { + throw new ClassCastException("Unsupported type: " + type); + } + } + + @Override + public void checkProxyClass(Method method, String[] ifaces, + int paramIndex, int callID) { + if (ifaces != null && ifaces.length > 0) { + for (String iface : ifaces) { + if (!allowedTypes.contains(iface)) { + throw new ClassCastException("Unsupported type: " + iface); + } + } + } + } + } }
--- a/src/share/classes/org/jcp/xml/dsig/internal/dom/DOMSignatureMethod.java Mon May 09 02:48:06 2016 +0100 +++ b/src/share/classes/org/jcp/xml/dsig/internal/dom/DOMSignatureMethod.java Mon May 09 04:37:12 2016 +0100 @@ -21,7 +21,7 @@ * under the License. */ /* - * Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2014, Oracle and/or its affiliates. All rights reserved. */ /* * $Id: DOMSignatureMethod.java 1333415 2012-05-03 12:03:51Z coheigea $ @@ -34,10 +34,12 @@ import java.io.IOException; import java.security.*; +import java.security.interfaces.DSAKey; import java.security.spec.AlgorithmParameterSpec; import org.w3c.dom.Element; import com.sun.org.apache.xml.internal.security.algorithms.implementations.SignatureECDSA; +import com.sun.org.apache.xml.internal.security.utils.JavaUtils; import org.jcp.xml.dsig.internal.SignerOutputStream; /** @@ -68,6 +70,8 @@ "http://www.w3.org/2001/04/xmldsig-more#ecdsa-sha384"; static final String ECDSA_SHA512 = "http://www.w3.org/2001/04/xmldsig-more#ecdsa-sha512"; + static final String DSA_SHA256 = + "http://www.w3.org/2009/xmldsig11#dsa-sha256"; /** * Creates a <code>DOMSignatureMethod</code>. @@ -119,6 +123,8 @@ return new SHA512withRSA(smElem); } else if (alg.equals(SignatureMethod.DSA_SHA1)) { return new SHA1withDSA(smElem); + } else if (alg.equals(DSA_SHA256)) { + return new SHA256withDSA(smElem); } else if (alg.equals(ECDSA_SHA1)) { return new SHA1withECDSA(smElem); } else if (alg.equals(ECDSA_SHA256)) { @@ -178,7 +184,9 @@ try { Type type = getAlgorithmType(); if (type == Type.DSA) { - return signature.verify(convertXMLDSIGtoASN1(sig)); + int size = ((DSAKey)key).getParams().getQ().bitLength(); + return signature.verify(JavaUtils.convertDsaXMLDSIGtoASN1(sig, + size/8)); } else if (type == Type.ECDSA) { return signature.verify(SignatureECDSA.convertXMLDSIGtoASN1(sig)); } else { @@ -222,7 +230,9 @@ try { Type type = getAlgorithmType(); if (type == Type.DSA) { - return convertASN1toXMLDSIG(signature.sign()); + int size = ((DSAKey)key).getParams().getQ().bitLength(); + return JavaUtils.convertDsaASN1toXMLDSIG(signature.sign(), + size/8); } else if (type == Type.ECDSA) { return SignatureECDSA.convertASN1toXMLDSIG(signature.sign()); } else { @@ -235,101 +245,6 @@ } } - /** - * Converts an ASN.1 DSA value to a XML Signature DSA Value. - * - * The JAVA JCE DSA Signature algorithm creates ASN.1 encoded (r,s) value - * pairs; the XML Signature requires the core BigInteger values. - * - * @param asn1Bytes - * - * @throws IOException - * @see <A HREF="http://www.w3.org/TR/xmldsig-core/#dsa-sha1">6.4.1 DSA</A> - */ - private static byte[] convertASN1toXMLDSIG(byte asn1Bytes[]) - throws IOException - { - byte rLength = asn1Bytes[3]; - int i; - - for (i = rLength; (i > 0) && (asn1Bytes[(4 + rLength) - i] == 0); i--); - - byte sLength = asn1Bytes[5 + rLength]; - int j; - - for (j = sLength; - (j > 0) && (asn1Bytes[(6 + rLength + sLength) - j] == 0); j--); - - if ((asn1Bytes[0] != 48) || (asn1Bytes[1] != asn1Bytes.length - 2) - || (asn1Bytes[2] != 2) || (i > 20) - || (asn1Bytes[4 + rLength] != 2) || (j > 20)) { - throw new IOException("Invalid ASN.1 format of DSA signature"); - } else { - byte xmldsigBytes[] = new byte[40]; - - System.arraycopy(asn1Bytes, (4+rLength)-i, xmldsigBytes, 20-i, i); - System.arraycopy(asn1Bytes, (6+rLength+sLength)-j, xmldsigBytes, - 40 - j, j); - - return xmldsigBytes; - } - } - - /** - * Converts a XML Signature DSA Value to an ASN.1 DSA value. - * - * The JAVA JCE DSA Signature algorithm creates ASN.1 encoded (r,s) value - * pairs; the XML Signature requires the core BigInteger values. - * - * @param xmldsigBytes - * - * @throws IOException - * @see <A HREF="http://www.w3.org/TR/xmldsig-core/#dsa-sha1">6.4.1 DSA</A> - */ - private static byte[] convertXMLDSIGtoASN1(byte xmldsigBytes[]) - throws IOException - { - if (xmldsigBytes.length != 40) { - throw new IOException("Invalid XMLDSIG format of DSA signature"); - } - - int i; - - for (i = 20; (i > 0) && (xmldsigBytes[20 - i] == 0); i--); - - int j = i; - - if (xmldsigBytes[20 - i] < 0) { - j += 1; - } - - int k; - - for (k = 20; (k > 0) && (xmldsigBytes[40 - k] == 0); k--); - - int l = k; - - if (xmldsigBytes[40 - k] < 0) { - l += 1; - } - - byte asn1Bytes[] = new byte[6 + j + l]; - - asn1Bytes[0] = 48; - asn1Bytes[1] = (byte)(4 + j + l); - asn1Bytes[2] = 2; - asn1Bytes[3] = (byte)j; - - System.arraycopy(xmldsigBytes, 20 - i, asn1Bytes, (4 + j) - i, i); - - asn1Bytes[4 + j] = 2; - asn1Bytes[5 + j] = (byte) l; - - System.arraycopy(xmldsigBytes, 40 - k, asn1Bytes, (6 + j + l) - k, k); - - return asn1Bytes; - } - static final class SHA1withRSA extends DOMSignatureMethod { SHA1withRSA(AlgorithmParameterSpec params) throws InvalidAlgorithmParameterException { @@ -425,6 +340,25 @@ } } + static final class SHA256withDSA extends DOMSignatureMethod { + SHA256withDSA(AlgorithmParameterSpec params) + throws InvalidAlgorithmParameterException { + super(params); + } + SHA256withDSA(Element dmElem) throws MarshalException { + super(dmElem); + } + public String getAlgorithm() { + return DSA_SHA256; + } + String getJCAAlgorithm() { + return "SHA256withDSA"; + } + Type getAlgorithmType() { + return Type.DSA; + } + } + static final class SHA1withECDSA extends DOMSignatureMethod { SHA1withECDSA(AlgorithmParameterSpec params) throws InvalidAlgorithmParameterException {
--- a/src/share/classes/org/jcp/xml/dsig/internal/dom/DOMXMLSignatureFactory.java Mon May 09 02:48:06 2016 +0100 +++ b/src/share/classes/org/jcp/xml/dsig/internal/dom/DOMXMLSignatureFactory.java Mon May 09 04:37:12 2016 +0100 @@ -21,7 +21,7 @@ * under the License. */ /* - * Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2014, Oracle and/or its affiliates. All rights reserved. */ /* * $Id: DOMXMLSignatureFactory.java 1333869 2012-05-04 10:42:44Z coheigea $ @@ -239,6 +239,8 @@ return new DOMSignatureMethod.SHA512withRSA(params); } else if (algorithm.equals(SignatureMethod.DSA_SHA1)) { return new DOMSignatureMethod.SHA1withDSA(params); + } else if (algorithm.equals(DOMSignatureMethod.DSA_SHA256)) { + return new DOMSignatureMethod.SHA256withDSA(params); } else if (algorithm.equals(SignatureMethod.HMAC_SHA1)) { return new DOMHMACSignatureMethod.SHA1(params); } else if (algorithm.equals(DOMHMACSignatureMethod.HMAC_SHA256)) {
--- a/src/share/classes/sun/applet/resources/MsgAppletViewer_de.java Mon May 09 02:48:06 2016 +0100 +++ b/src/share/classes/sun/applet/resources/MsgAppletViewer_de.java Mon May 09 04:37:12 2016 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1996, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1996, 2016, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -38,7 +38,7 @@ {"appletviewer.menuitem.stop", "Stoppen"}, {"appletviewer.menuitem.save", "Speichern..."}, {"appletviewer.menuitem.start", "Starten..."}, - {"appletviewer.menuitem.clone", "Clonen..."}, + {"appletviewer.menuitem.clone", "Klonen..."}, {"appletviewer.menuitem.tag", "Tag..."}, {"appletviewer.menuitem.info", "Informationen..."}, {"appletviewer.menuitem.edit", "Bearbeiten"},
--- a/src/share/classes/sun/applet/resources/MsgAppletViewer_ko.java Mon May 09 02:48:06 2016 +0100 +++ b/src/share/classes/sun/applet/resources/MsgAppletViewer_ko.java Mon May 09 04:37:12 2016 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1996, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1996, 2016, 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 @@ -79,7 +79,7 @@ {"appletviewer.main.err.dupoption", "\uC911\uBCF5\uB41C \uC635\uC158 \uC0AC\uC6A9: {0}"}, {"appletviewer.main.err.inputfile", "\uC9C0\uC815\uB41C \uC785\uB825 \uD30C\uC77C\uC774 \uC5C6\uC2B5\uB2C8\uB2E4."}, {"appletviewer.main.err.badurl", "\uC798\uBABB\uB41C URL: {0}({1})"}, - {"appletviewer.main.err.io", "\uC77D\uB294 \uC911 I/O \uC608\uC678 \uC0AC\uD56D \uBC1C\uC0DD: {0}"}, + {"appletviewer.main.err.io", "\uC77D\uB294 \uC911 I/O \uC608\uC678\uC0AC\uD56D \uBC1C\uC0DD: {0}"}, {"appletviewer.main.err.readablefile", "{0}\uC774(\uAC00) \uD30C\uC77C\uC774\uBA70 \uC77D\uAE30 \uAC00\uB2A5\uD55C \uC0C1\uD0DC\uC778\uC9C0 \uD655\uC778\uD558\uC2ED\uC2DC\uC624."}, {"appletviewer.main.err.correcturl", "{0}\uC774(\uAC00) \uC62C\uBC14\uB978 URL\uC785\uB2C8\uAE4C?"}, {"appletviewer.main.prop.store", "\uC0AC\uC6A9\uC790 \uAD00\uB828 AppletViewer \uC18D\uC131"}, @@ -88,7 +88,7 @@ {"appletviewer.main.warn.nosecmgr", "\uACBD\uACE0: \uBCF4\uC548\uC744 \uC0AC\uC6A9 \uC548\uD568\uC73C\uB85C \uC124\uC815\uD558\uB294 \uC911\uC785\uB2C8\uB2E4."}, {"appletviewer.main.debug.cantfinddebug", "\uB514\uBC84\uAC70\uB97C \uCC3E\uC744 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4!"}, {"appletviewer.main.debug.cantfindmain", "\uB514\uBC84\uAC70\uC5D0\uC11C \uAE30\uBCF8 \uBA54\uC18C\uB4DC\uB97C \uCC3E\uC744 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4!"}, - {"appletviewer.main.debug.exceptionindebug", "\uB514\uBC84\uAC70\uC5D0 \uC608\uC678 \uC0AC\uD56D\uC774 \uBC1C\uC0DD\uD588\uC2B5\uB2C8\uB2E4!"}, + {"appletviewer.main.debug.exceptionindebug", "\uB514\uBC84\uAC70\uC5D0 \uC608\uC678\uC0AC\uD56D\uC774 \uBC1C\uC0DD\uD588\uC2B5\uB2C8\uB2E4!"}, {"appletviewer.main.debug.cantaccess", "\uB514\uBC84\uAC70\uC5D0 \uC561\uC138\uC2A4\uD560 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4!"}, {"appletviewer.main.nosecmgr", "\uACBD\uACE0: SecurityManager\uAC00 \uC124\uCE58\uB418\uC9C0 \uC54A\uC558\uC2B5\uB2C8\uB2E4!"}, {"appletviewer.main.warning", "\uACBD\uACE0: \uC2DC\uC791\uB41C \uC560\uD50C\uB9BF\uC774 \uC5C6\uC2B5\uB2C8\uB2E4. <applet> \uD0DC\uADF8\uAC00 \uC785\uB825\uB418\uC5C8\uB294\uC9C0 \uD655\uC778\uD558\uC2ED\uC2DC\uC624."}, @@ -98,9 +98,9 @@ {"appletioexception.loadclass.throw.notloaded", "\uD074\uB798\uC2A4\uAC00 \uB85C\uB4DC\uB418\uC9C0 \uC54A\uC74C: {0}"}, {"appletclassloader.loadcode.verbose", "{1}\uC744(\uB97C) \uAC00\uC838\uC624\uAE30 \uC704\uD574 {0}\uC5D0 \uB300\uD55C \uC2A4\uD2B8\uB9BC\uC744 \uC5EC\uB294 \uC911"}, {"appletclassloader.filenotfound", "{0}\uC744(\uB97C) \uAC80\uC0C9\uD558\uB294 \uC911 \uD30C\uC77C\uC744 \uCC3E\uC9C0 \uBABB\uD588\uC2B5\uB2C8\uB2E4."}, - {"appletclassloader.fileformat", "\uB85C\uB4DC \uC911 \uD30C\uC77C \uD615\uC2DD \uC608\uC678 \uC0AC\uD56D \uBC1C\uC0DD: {0}"}, - {"appletclassloader.fileioexception", "\uB85C\uB4DC \uC911 I/O \uC608\uC678 \uC0AC\uD56D \uBC1C\uC0DD: {0}"}, - {"appletclassloader.fileexception", "\uB85C\uB4DC \uC911 {0} \uC608\uC678 \uC0AC\uD56D \uBC1C\uC0DD: {1}"}, + {"appletclassloader.fileformat", "\uB85C\uB4DC \uC911 \uD30C\uC77C \uD615\uC2DD \uC608\uC678\uC0AC\uD56D \uBC1C\uC0DD: {0}"}, + {"appletclassloader.fileioexception", "\uB85C\uB4DC \uC911 I/O \uC608\uC678\uC0AC\uD56D \uBC1C\uC0DD: {0}"}, + {"appletclassloader.fileexception", "\uB85C\uB4DC \uC911 {0} \uC608\uC678\uC0AC\uD56D \uBC1C\uC0DD: {1}"}, {"appletclassloader.filedeath", "\uB85C\uB4DC \uC911 {0}\uC774(\uAC00) \uC885\uB8CC\uB428: {1}"}, {"appletclassloader.fileerror", "\uB85C\uB4DC \uC911 {0} \uC624\uB958 \uBC1C\uC0DD: {1}"}, {"appletclassloader.findclass.verbose.openstream", "{1}\uC744(\uB97C) \uAC00\uC838\uC624\uAE30 \uC704\uD574 {0}\uC5D0 \uB300\uD55C \uC2A4\uD2B8\uB9BC\uC744 \uC5EC\uB294 \uC911"}, @@ -108,7 +108,7 @@ {"appletclassloader.getresource.verbose.found", "\uC2DC\uC2A4\uD15C \uB9AC\uC18C\uC2A4\uB85C {0} \uB9AC\uC18C\uC2A4\uB97C \uCC3E\uC558\uC2B5\uB2C8\uB2E4."}, {"appletclassloader.getresourceasstream.verbose", "\uC2DC\uC2A4\uD15C \uB9AC\uC18C\uC2A4\uB85C {0} \uB9AC\uC18C\uC2A4\uB97C \uCC3E\uC558\uC2B5\uB2C8\uB2E4."}, {"appletpanel.runloader.err", "\uAC1D\uCCB4 \uB610\uB294 \uCF54\uB4DC \uB9E4\uAC1C\uBCC0\uC218\uC785\uB2C8\uB2E4!"}, - {"appletpanel.runloader.exception", "{0}\uC758 \uC9C1\uB82C\uD654\uB97C \uD574\uC81C\uD558\uB294 \uC911 \uC608\uC678 \uC0AC\uD56D\uC774 \uBC1C\uC0DD\uD588\uC2B5\uB2C8\uB2E4."}, + {"appletpanel.runloader.exception", "{0}\uC758 \uC9C1\uB82C\uD654\uB97C \uD574\uC81C\uD558\uB294 \uC911 \uC608\uC678\uC0AC\uD56D\uC774 \uBC1C\uC0DD\uD588\uC2B5\uB2C8\uB2E4."}, {"appletpanel.destroyed", "\uC560\uD50C\uB9BF\uC774 \uC0AD\uC81C\uB418\uC5C8\uC2B5\uB2C8\uB2E4."}, {"appletpanel.loaded", "\uC560\uD50C\uB9BF\uC774 \uB85C\uB4DC\uB418\uC5C8\uC2B5\uB2C8\uB2E4."}, {"appletpanel.started", "\uC560\uD50C\uB9BF\uC774 \uC2DC\uC791\uB418\uC5C8\uC2B5\uB2C8\uB2E4."}, @@ -120,8 +120,8 @@ {"appletpanel.nocreate", "\uB85C\uB4DC: {0}\uC744(\uB97C) \uC778\uC2A4\uD134\uC2A4\uD654\uD560 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4."}, {"appletpanel.noconstruct", "\uB85C\uB4DC: {0}\uC740(\uB294) \uACF5\uC6A9\uC774 \uC544\uB2C8\uAC70\uB098 \uACF5\uC6A9 \uC0DD\uC131\uC790\uB97C \uD3EC\uD568\uD558\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4."}, {"appletpanel.death", "\uC885\uB8CC\uB428"}, - {"appletpanel.exception", "\uC608\uC678 \uC0AC\uD56D: {0}."}, - {"appletpanel.exception2", "\uC608\uC678 \uC0AC\uD56D: {0}: {1}."}, + {"appletpanel.exception", "\uC608\uC678\uC0AC\uD56D: {0}."}, + {"appletpanel.exception2", "\uC608\uC678\uC0AC\uD56D: {0}: {1}."}, {"appletpanel.error", "\uC624\uB958: {0}."}, {"appletpanel.error2", "\uC624\uB958: {0}: {1}."}, {"appletpanel.notloaded", "\uCD08\uAE30\uD654: \uC560\uD50C\uB9BF\uC774 \uB85C\uB4DC\uB418\uC9C0 \uC54A\uC558\uC2B5\uB2C8\uB2E4."}, @@ -132,9 +132,9 @@ {"appletpanel.notdisposed", "\uB85C\uB4DC: \uC560\uD50C\uB9BF\uC774 \uBC30\uCE58\uB418\uC9C0 \uC54A\uC558\uC2B5\uB2C8\uB2E4."}, {"appletpanel.bail", "\uC911\uB2E8\uB428: \uC911\uB2E8\uD558\uB294 \uC911\uC785\uB2C8\uB2E4."}, {"appletpanel.filenotfound", "{0}\uC744(\uB97C) \uAC80\uC0C9\uD558\uB294 \uC911 \uD30C\uC77C\uC744 \uCC3E\uC9C0 \uBABB\uD588\uC2B5\uB2C8\uB2E4."}, - {"appletpanel.fileformat", "\uB85C\uB4DC \uC911 \uD30C\uC77C \uD615\uC2DD \uC608\uC678 \uC0AC\uD56D \uBC1C\uC0DD: {0}"}, - {"appletpanel.fileioexception", "\uB85C\uB4DC \uC911 I/O \uC608\uC678 \uC0AC\uD56D \uBC1C\uC0DD: {0}"}, - {"appletpanel.fileexception", "\uB85C\uB4DC \uC911 {0} \uC608\uC678 \uC0AC\uD56D \uBC1C\uC0DD: {1}"}, + {"appletpanel.fileformat", "\uB85C\uB4DC \uC911 \uD30C\uC77C \uD615\uC2DD \uC608\uC678\uC0AC\uD56D \uBC1C\uC0DD: {0}"}, + {"appletpanel.fileioexception", "\uB85C\uB4DC \uC911 I/O \uC608\uC678\uC0AC\uD56D \uBC1C\uC0DD: {0}"}, + {"appletpanel.fileexception", "\uB85C\uB4DC \uC911 {0} \uC608\uC678\uC0AC\uD56D \uBC1C\uC0DD: {1}"}, {"appletpanel.filedeath", "\uB85C\uB4DC \uC911 {0}\uC774(\uAC00) \uC885\uB8CC\uB428: {1}"}, {"appletpanel.fileerror", "\uB85C\uB4DC \uC911 {0} \uC624\uB958 \uBC1C\uC0DD: {1}"}, {"appletpanel.badattribute.exception", "HTML \uAD6C\uBB38 \uBD84\uC11D \uC911: width/height \uC18D\uC131\uC5D0 \uB300\uD55C \uAC12\uC774 \uC62C\uBC14\uB974\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4."}, @@ -162,36 +162,36 @@ {"appletprops.button.ok", "\uD655\uC778"}, /* end 4066432 */ {"appletprops.prop.store", "\uC0AC\uC6A9\uC790 \uAD00\uB828 AppletViewer \uC18D\uC131"}, - {"appletsecurityexception.checkcreateclassloader", "\uBCF4\uC548 \uC608\uC678 \uC0AC\uD56D: \uD074\uB798\uC2A4 \uB85C\uB354"}, - {"appletsecurityexception.checkaccess.thread", "\uBCF4\uC548 \uC608\uC678 \uC0AC\uD56D: \uC2A4\uB808\uB4DC"}, - {"appletsecurityexception.checkaccess.threadgroup", "\uBCF4\uC548 \uC608\uC678 \uC0AC\uD56D: \uC2A4\uB808\uB4DC \uADF8\uB8F9: {0}"}, - {"appletsecurityexception.checkexit", "\uBCF4\uC548 \uC608\uC678 \uC0AC\uD56D: \uC885\uB8CC: {0}"}, - {"appletsecurityexception.checkexec", "\uBCF4\uC548 \uC608\uC678 \uC0AC\uD56D: \uC2E4\uD589: {0}"}, - {"appletsecurityexception.checklink", "\uBCF4\uC548 \uC608\uC678 \uC0AC\uD56D: \uB9C1\uD06C: {0}"}, - {"appletsecurityexception.checkpropsaccess", "\uBCF4\uC548 \uC608\uC678 \uC0AC\uD56D: \uC18D\uC131"}, - {"appletsecurityexception.checkpropsaccess.key", "\uBCF4\uC548 \uC608\uC678 \uC0AC\uD56D: \uC18D\uC131 \uC561\uC138\uC2A4 {0}"}, - {"appletsecurityexception.checkread.exception1", "\uBCF4\uC548 \uC608\uC678 \uC0AC\uD56D: {0}, {1}"}, - {"appletsecurityexception.checkread.exception2", "\uBCF4\uC548 \uC608\uC678 \uC0AC\uD56D: file.read: {0}"}, - {"appletsecurityexception.checkread", "\uBCF4\uC548 \uC608\uC678 \uC0AC\uD56D: file.read: {0} == {1}"}, - {"appletsecurityexception.checkwrite.exception", "\uBCF4\uC548 \uC608\uC678 \uC0AC\uD56D: {0}, {1}"}, - {"appletsecurityexception.checkwrite", "\uBCF4\uC548 \uC608\uC678 \uC0AC\uD56D: file.write: {0} == {1}"}, - {"appletsecurityexception.checkread.fd", "\uBCF4\uC548 \uC608\uC678 \uC0AC\uD56D: fd.read"}, - {"appletsecurityexception.checkwrite.fd", "\uBCF4\uC548 \uC608\uC678 \uC0AC\uD56D: fd.write"}, - {"appletsecurityexception.checklisten", "\uBCF4\uC548 \uC608\uC678 \uC0AC\uD56D: socket.listen: {0}"}, - {"appletsecurityexception.checkaccept", "\uBCF4\uC548 \uC608\uC678 \uC0AC\uD56D: socket.accept: {0}:{1}"}, - {"appletsecurityexception.checkconnect.networknone", "\uBCF4\uC548 \uC608\uC678 \uC0AC\uD56D: socket.connect: {0}->{1}"}, - {"appletsecurityexception.checkconnect.networkhost1", "\uBCF4\uC548 \uC608\uC678 \uC0AC\uD56D: {1}\uC5D0\uC11C {0}\uC5D0 \uC811\uC18D\uD560 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4."}, - {"appletsecurityexception.checkconnect.networkhost2", "\uBCF4\uC548 \uC608\uC678 \uC0AC\uD56D: {0} \uD638\uC2A4\uD2B8 \uB610\uB294 {1}\uC5D0 \uB300\uD55C IP\uB97C \uBD84\uC11D\uD560 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4. "}, - {"appletsecurityexception.checkconnect.networkhost3", "\uBCF4\uC548 \uC608\uC678 \uC0AC\uD56D: {0} \uD638\uC2A4\uD2B8\uC5D0 \uB300\uD55C IP\uB97C \uBD84\uC11D\uD560 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4. trustProxy \uC18D\uC131\uC744 \uCC38\uC870\uD558\uC2ED\uC2DC\uC624."}, - {"appletsecurityexception.checkconnect", "\uBCF4\uC548 \uC608\uC678 \uC0AC\uD56D: \uC811\uC18D: {0}->{1}"}, - {"appletsecurityexception.checkpackageaccess", "\uBCF4\uC548 \uC608\uC678 \uC0AC\uD56D: \uD328\uD0A4\uC9C0\uC5D0 \uC561\uC138\uC2A4\uD560 \uC218 \uC5C6\uC74C: {0}"}, - {"appletsecurityexception.checkpackagedefinition", "\uBCF4\uC548 \uC608\uC678 \uC0AC\uD56D: \uD328\uD0A4\uC9C0\uB97C \uC815\uC758\uD560 \uC218 \uC5C6\uC74C: {0}"}, - {"appletsecurityexception.cannotsetfactory", "\uBCF4\uC548 \uC608\uC678 \uC0AC\uD56D: \uD329\uD1A0\uB9AC\uB97C \uC124\uC815\uD560 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4."}, - {"appletsecurityexception.checkmemberaccess", "\uBCF4\uC548 \uC608\uC678 \uC0AC\uD56D: \uBA64\uBC84 \uC561\uC138\uC2A4\uB97C \uD655\uC778\uD558\uC2ED\uC2DC\uC624."}, - {"appletsecurityexception.checkgetprintjob", "\uBCF4\uC548 \uC608\uC678 \uC0AC\uD56D: getPrintJob"}, - {"appletsecurityexception.checksystemclipboardaccess", "\uBCF4\uC548 \uC608\uC678 \uC0AC\uD56D: getSystemClipboard"}, - {"appletsecurityexception.checkawteventqueueaccess", "\uBCF4\uC548 \uC608\uC678 \uC0AC\uD56D: getEventQueue"}, - {"appletsecurityexception.checksecurityaccess", "\uBCF4\uC548 \uC608\uC678 \uC0AC\uD56D: \uBCF4\uC548 \uC791\uC5C5: {0}"}, + {"appletsecurityexception.checkcreateclassloader", "\uBCF4\uC548 \uC608\uC678\uC0AC\uD56D: \uD074\uB798\uC2A4 \uB85C\uB354"}, + {"appletsecurityexception.checkaccess.thread", "\uBCF4\uC548 \uC608\uC678\uC0AC\uD56D: \uC2A4\uB808\uB4DC"}, + {"appletsecurityexception.checkaccess.threadgroup", "\uBCF4\uC548 \uC608\uC678\uC0AC\uD56D: \uC2A4\uB808\uB4DC \uADF8\uB8F9: {0}"}, + {"appletsecurityexception.checkexit", "\uBCF4\uC548 \uC608\uC678\uC0AC\uD56D: \uC885\uB8CC: {0}"}, + {"appletsecurityexception.checkexec", "\uBCF4\uC548 \uC608\uC678\uC0AC\uD56D: \uC2E4\uD589: {0}"}, + {"appletsecurityexception.checklink", "\uBCF4\uC548 \uC608\uC678\uC0AC\uD56D: \uB9C1\uD06C: {0}"}, + {"appletsecurityexception.checkpropsaccess", "\uBCF4\uC548 \uC608\uC678\uC0AC\uD56D: \uC18D\uC131"}, + {"appletsecurityexception.checkpropsaccess.key", "\uBCF4\uC548 \uC608\uC678\uC0AC\uD56D: \uC18D\uC131 \uC561\uC138\uC2A4 {0}"}, + {"appletsecurityexception.checkread.exception1", "\uBCF4\uC548 \uC608\uC678\uC0AC\uD56D: {0}, {1}"}, + {"appletsecurityexception.checkread.exception2", "\uBCF4\uC548 \uC608\uC678\uC0AC\uD56D: file.read: {0}"}, + {"appletsecurityexception.checkread", "\uBCF4\uC548 \uC608\uC678\uC0AC\uD56D: file.read: {0} == {1}"}, + {"appletsecurityexception.checkwrite.exception", "\uBCF4\uC548 \uC608\uC678\uC0AC\uD56D: {0}, {1}"}, + {"appletsecurityexception.checkwrite", "\uBCF4\uC548 \uC608\uC678\uC0AC\uD56D: file.write: {0} == {1}"}, + {"appletsecurityexception.checkread.fd", "\uBCF4\uC548 \uC608\uC678\uC0AC\uD56D: fd.read"}, + {"appletsecurityexception.checkwrite.fd", "\uBCF4\uC548 \uC608\uC678\uC0AC\uD56D: fd.write"}, + {"appletsecurityexception.checklisten", "\uBCF4\uC548 \uC608\uC678\uC0AC\uD56D: socket.listen: {0}"}, + {"appletsecurityexception.checkaccept", "\uBCF4\uC548 \uC608\uC678\uC0AC\uD56D: socket.accept: {0}:{1}"}, + {"appletsecurityexception.checkconnect.networknone", "\uBCF4\uC548 \uC608\uC678\uC0AC\uD56D: socket.connect: {0}->{1}"}, + {"appletsecurityexception.checkconnect.networkhost1", "\uBCF4\uC548 \uC608\uC678\uC0AC\uD56D: {1}\uC5D0\uC11C {0}\uC5D0 \uC811\uC18D\uD560 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4."}, + {"appletsecurityexception.checkconnect.networkhost2", "\uBCF4\uC548 \uC608\uC678\uC0AC\uD56D: {0} \uD638\uC2A4\uD2B8 \uB610\uB294 {1}\uC5D0 \uB300\uD55C IP\uB97C \uBD84\uC11D\uD560 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4. "}, + {"appletsecurityexception.checkconnect.networkhost3", "\uBCF4\uC548 \uC608\uC678\uC0AC\uD56D: {0} \uD638\uC2A4\uD2B8\uC5D0 \uB300\uD55C IP\uB97C \uBD84\uC11D\uD560 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4. trustProxy \uC18D\uC131\uC744 \uCC38\uC870\uD558\uC2ED\uC2DC\uC624."}, + {"appletsecurityexception.checkconnect", "\uBCF4\uC548 \uC608\uC678\uC0AC\uD56D: \uC811\uC18D: {0}->{1}"}, + {"appletsecurityexception.checkpackageaccess", "\uBCF4\uC548 \uC608\uC678\uC0AC\uD56D: \uD328\uD0A4\uC9C0\uC5D0 \uC561\uC138\uC2A4\uD560 \uC218 \uC5C6\uC74C: {0}"}, + {"appletsecurityexception.checkpackagedefinition", "\uBCF4\uC548 \uC608\uC678\uC0AC\uD56D: \uD328\uD0A4\uC9C0\uB97C \uC815\uC758\uD560 \uC218 \uC5C6\uC74C: {0}"}, + {"appletsecurityexception.cannotsetfactory", "\uBCF4\uC548 \uC608\uC678\uC0AC\uD56D: \uD329\uD1A0\uB9AC\uB97C \uC124\uC815\uD560 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4."}, + {"appletsecurityexception.checkmemberaccess", "\uBCF4\uC548 \uC608\uC678\uC0AC\uD56D: \uBA64\uBC84 \uC561\uC138\uC2A4\uB97C \uD655\uC778\uD558\uC2ED\uC2DC\uC624."}, + {"appletsecurityexception.checkgetprintjob", "\uBCF4\uC548 \uC608\uC678\uC0AC\uD56D: getPrintJob"}, + {"appletsecurityexception.checksystemclipboardaccess", "\uBCF4\uC548 \uC608\uC678\uC0AC\uD56D: getSystemClipboard"}, + {"appletsecurityexception.checkawteventqueueaccess", "\uBCF4\uC548 \uC608\uC678\uC0AC\uD56D: getEventQueue"}, + {"appletsecurityexception.checksecurityaccess", "\uBCF4\uC548 \uC608\uC678\uC0AC\uD56D: \uBCF4\uC548 \uC791\uC5C5: {0}"}, {"appletsecurityexception.getsecuritycontext.unknown", "\uC54C \uC218 \uC5C6\uB294 \uD074\uB798\uC2A4 \uB85C\uB354 \uC720\uD615\uC785\uB2C8\uB2E4. getContext\uB97C \uD655\uC778\uD560 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4."}, {"appletsecurityexception.checkread.unknown", "\uC54C \uC218 \uC5C6\uB294 \uD074\uB798\uC2A4 \uB85C\uB354 \uC720\uD615\uC785\uB2C8\uB2E4. {0} \uC77D\uAE30\uB97C \uD655\uC778\uD560 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4."}, {"appletsecurityexception.checkconnect.unknown", "\uC54C \uC218 \uC5C6\uB294 \uD074\uB798\uC2A4 \uB85C\uB354 \uC720\uD615\uC785\uB2C8\uB2E4. \uC811\uC18D\uC744 \uD655\uC778\uD560 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4."},
--- a/src/share/classes/sun/awt/resources/awt_de.properties Mon May 09 02:48:06 2016 +0100 +++ b/src/share/classes/sun/awt/resources/awt_de.properties Mon May 09 04:37:12 2016 +0100 @@ -44,7 +44,7 @@ AWT.subtract=NumPad - AWT.decimal=NumPad . AWT.divide=NumPad / -AWT.delete=Entf +AWT.delete=L\u00F6schen AWT.numLock=Num AWT.scrollLock=Rollen AWT.f1=F1
--- a/src/share/classes/sun/font/FileFontStrike.java Mon May 09 02:48:06 2016 +0100 +++ b/src/share/classes/sun/font/FileFontStrike.java Mon May 09 04:37:12 2016 +0100 @@ -453,6 +453,17 @@ /* Only look in the cache */ long getCachedGlyphPtr(int glyphCode) { + try { + return getCachedGlyphPtrInternal(glyphCode); + } catch (Exception e) { + NullFontScaler nullScaler = + (NullFontScaler)FontScaler.getNullScaler(); + long nullSC = NullFontScaler.getNullScalerContext(); + return nullScaler.getGlyphImage(nullSC, glyphCode); + } + } + + private long getCachedGlyphPtrInternal(int glyphCode) { switch (glyphCacheFormat) { case INTARRAY: return intGlyphImages[glyphCode] & INTMASK; @@ -480,6 +491,27 @@ } private synchronized long setCachedGlyphPtr(int glyphCode, long glyphPtr) { + try { + return setCachedGlyphPtrInternal(glyphCode, glyphPtr); + } catch (Exception e) { + switch (glyphCacheFormat) { + case INTARRAY: + case SEGINTARRAY: + StrikeCache.freeIntPointer((int)glyphPtr); + break; + case LONGARRAY: + case SEGLONGARRAY: + StrikeCache.freeLongPointer(glyphPtr); + break; + } + NullFontScaler nullScaler = + (NullFontScaler)FontScaler.getNullScaler(); + long nullSC = NullFontScaler.getNullScalerContext(); + return nullScaler.getGlyphImage(nullSC, glyphCode); + } + } + + private long setCachedGlyphPtrInternal(int glyphCode, long glyphPtr) { switch (glyphCacheFormat) { case INTARRAY: if (intGlyphImages[glyphCode] == 0) {
--- a/src/share/classes/sun/font/TrueTypeGlyphMapper.java Mon May 09 02:48:06 2016 +0100 +++ b/src/share/classes/sun/font/TrueTypeGlyphMapper.java Mon May 09 04:37:12 2016 +0100 @@ -59,7 +59,11 @@ } missingGlyph = 0; /* standard for TrueType fonts */ ByteBuffer buffer = font.getTableBuffer(TrueTypeFont.maxpTag); - numGlyphs = buffer.getChar(4); // offset 4 bytes in MAXP table. + if (buffer != null && buffer.capacity() >= 6) { + numGlyphs = buffer.getChar(4); // offset 4 bytes in MAXP table. + } else { + handleBadCMAP(); + } if (FontUtilities.isSolaris && isJAlocale && font.supportsJA()) { needsJAremapping = true; if (FontUtilities.isSolaris8 &&
--- a/src/share/classes/sun/launcher/resources/launcher_ko.properties Mon May 09 02:48:06 2016 +0100 +++ b/src/share/classes/sun/launcher/resources/launcher_ko.properties Mon May 09 04:37:12 2016 +0100 @@ -1,5 +1,5 @@ # -# Copyright (c) 2007, 2015, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2007, 2016, 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,13 +41,13 @@ \uC788\uC2B5\uB2C8\uB2E4.\n # Translators please note do not translate the options themselves -java.launcher.X.macosx.usage=\n\uB2E4\uC74C\uC740 Mac OS X\uC5D0 \uD2B9\uC815\uB41C \uC635\uC158\uC785\uB2C8\uB2E4.\n -XstartOnFirstThread\n \uCCAB\uBC88\uC9F8 (AppKit) \uC2A4\uB808\uB4DC\uC5D0 main() \uBA54\uC18C\uB4DC\uB97C \uC2E4\uD589\uD569\uB2C8\uB2E4.\n -Xdock:name=<application name>"\n \uACE0\uC815\uC73C\uB85C \uD45C\uC2DC\uB41C \uAE30\uBCF8 \uC751\uC6A9 \uD504\uB85C\uADF8\uB7A8 \uC774\uB984\uC744 \uBB34\uD6A8\uD654\uD569\uB2C8\uB2E4.\n -Xdock:icon=<path to icon file>\n \uACE0\uC815\uC73C\uB85C \uD45C\uC2DC\uB41C \uAE30\uBCF8 \uC544\uC774\uCF58\uC744 \uBB34\uD6A8\uD654\uD569\uB2C8\uB2E4.\n\n +java.launcher.X.macosx.usage=\n\uB2E4\uC74C\uC740 Mac OS X\uC5D0 \uD2B9\uC815\uB41C \uC635\uC158\uC785\uB2C8\uB2E4.\n -XstartOnFirstThread\n \uCCAB\uBC88\uC9F8 (AppKit) \uC2A4\uB808\uB4DC\uC5D0 main() \uBA54\uC18C\uB4DC\uB97C \uC2E4\uD589\uD569\uB2C8\uB2E4.\n -Xdock:name=<application name>"\n \uACE0\uC815\uC73C\uB85C \uD45C\uC2DC\uB41C \uAE30\uBCF8 \uC560\uD50C\uB9AC\uCF00\uC774\uC158 \uC774\uB984\uC744 \uBB34\uD6A8\uD654\uD569\uB2C8\uB2E4.\n -Xdock:icon=<path to icon file>\n \uACE0\uC815\uC73C\uB85C \uD45C\uC2DC\uB41C \uAE30\uBCF8 \uC544\uC774\uCF58\uC744 \uBB34\uD6A8\uD654\uD569\uB2C8\uB2E4.\n\n java.launcher.cls.error1=\uC624\uB958: \uAE30\uBCF8 \uD074\uB798\uC2A4 {0}\uC744(\uB97C) \uCC3E\uAC70\uB098 \uB85C\uB4DC\uD560 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4. java.launcher.cls.error2=\uC624\uB958: {1} \uD074\uB798\uC2A4\uC5D0\uC11C \uAE30\uBCF8 \uBA54\uC18C\uB4DC\uAC00 {0}\uC774(\uAC00) \uC544\uB2D9\uB2C8\uB2E4. \uB2E4\uC74C \uD615\uC2DD\uC73C\uB85C \uAE30\uBCF8 \uBA54\uC18C\uB4DC\uB97C \uC815\uC758\uD558\uC2ED\uC2DC\uC624.\n public static void main(String[] args) java.launcher.cls.error3=\uC624\uB958: \uAE30\uBCF8 \uBA54\uC18C\uB4DC\uB294 {0} \uD074\uB798\uC2A4\uC5D0\uC11C void \uC720\uD615\uC758 \uAC12\uC744 \uBC18\uD658\uD574\uC57C \uD569\uB2C8\uB2E4. \n\uB2E4\uC74C \uD615\uC2DD\uC73C\uB85C \uAE30\uBCF8 \uBA54\uC18C\uB4DC\uB97C \uC815\uC758\uD558\uC2ED\uC2DC\uC624.\n public static void main(String[] args) -java.launcher.cls.error4=\uC624\uB958: {0} \uD074\uB798\uC2A4\uC5D0\uC11C \uAE30\uBCF8 \uBA54\uC18C\uB4DC\uB97C \uCC3E\uC744 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4. \uB2E4\uC74C \uD615\uC2DD\uC73C\uB85C \uAE30\uBCF8 \uBA54\uC18C\uB4DC\uB97C \uC815\uC758\uD558\uC2ED\uC2DC\uC624.\r\n public static void main(String[] args)\r\n\uB610\uB294 JavaFX \uC751\uC6A9 \uD504\uB85C\uADF8\uB7A8 \uD074\uB798\uC2A4\uB294 {1}\uC744(\uB97C) \uD655\uC7A5\uD574\uC57C \uD569\uB2C8\uB2E4. -java.launcher.cls.error5=\uC624\uB958: \uC774 \uC751\uC6A9 \uD504\uB85C\uADF8\uB7A8\uC744 \uC2E4\uD589\uD558\uB294 \uB370 \uD544\uC694\uD55C JavaFX \uB7F0\uD0C0\uC784 \uAD6C\uC131 \uC694\uC18C\uAC00 \uB204\uB77D\uB418\uC5C8\uC2B5\uB2C8\uB2E4. +java.launcher.cls.error4=\uC624\uB958: {0} \uD074\uB798\uC2A4\uC5D0\uC11C \uAE30\uBCF8 \uBA54\uC18C\uB4DC\uB97C \uCC3E\uC744 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4. \uB2E4\uC74C \uD615\uC2DD\uC73C\uB85C \uAE30\uBCF8 \uBA54\uC18C\uB4DC\uB97C \uC815\uC758\uD558\uC2ED\uC2DC\uC624.\r\n public static void main(String[] args)\r\n\uB610\uB294 JavaFX \uC560\uD50C\uB9AC\uCF00\uC774\uC158 \uD074\uB798\uC2A4\uB294 {1}\uC744(\uB97C) \uD655\uC7A5\uD574\uC57C \uD569\uB2C8\uB2E4. +java.launcher.cls.error5=\uC624\uB958: \uC774 \uC560\uD50C\uB9AC\uCF00\uC774\uC158\uC744 \uC2E4\uD589\uD558\uB294 \uB370 \uD544\uC694\uD55C JavaFX \uB7F0\uD0C0\uC784 \uAD6C\uC131 \uC694\uC18C\uAC00 \uB204\uB77D\uB418\uC5C8\uC2B5\uB2C8\uB2E4. java.launcher.jar.error1=\uC624\uB958: {0} \uD30C\uC77C\uC744 \uC5F4\uB824\uACE0 \uC2DC\uB3C4\uD558\uB294 \uC911 \uC608\uC0C1\uCE58 \uC54A\uC740 \uC624\uB958\uAC00 \uBC1C\uC0DD\uD588\uC2B5\uB2C8\uB2E4. java.launcher.jar.error2={0}\uC5D0\uC11C Manifest\uB97C \uCC3E\uC744 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4. java.launcher.jar.error3={0}\uC5D0 \uAE30\uBCF8 Manifest \uC18D\uC131\uC774 \uC5C6\uC2B5\uB2C8\uB2E4.
--- a/src/share/classes/sun/management/jmxremote/ConnectorBootstrap.java Mon May 09 02:48:06 2016 +0100 +++ b/src/share/classes/sun/management/jmxremote/ConnectorBootstrap.java Mon May 09 04:37:12 2016 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2016, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -50,7 +50,6 @@ import java.security.Principal; import java.util.HashMap; import java.util.HashSet; -import java.util.Iterator; import java.util.Map; import java.util.Properties; import java.util.Set; @@ -74,6 +73,7 @@ import com.sun.jmx.remote.internal.RMIExporter; import com.sun.jmx.remote.security.JMXPluggableAuthenticator; import com.sun.jmx.remote.util.ClassLogger; +import com.sun.jmx.remote.util.EnvHelp; import sun.management.Agent; import sun.management.AgentConfigurationError; @@ -510,6 +510,9 @@ // This RMI server should not keep the VM alive Map<String, Object> env = new HashMap<>(); env.put(RMIExporter.EXPORTER_ATTRIBUTE, new PermanentExporter()); + env.put(EnvHelp.CREDENTIAL_TYPES, new String[]{ + String[].class.getName(), String.class.getName() + }); // The local connector server need only be available via the // loopback connection. @@ -740,6 +743,9 @@ PermanentExporter exporter = new PermanentExporter(); env.put(RMIExporter.EXPORTER_ATTRIBUTE, exporter); + env.put(EnvHelp.CREDENTIAL_TYPES, new String[]{ + String[].class.getName(), String.class.getName() + }); boolean useSocketFactory = bindAddress != null && !useSsl;
--- a/src/share/classes/sun/management/resources/agent_ko.properties Mon May 09 02:48:06 2016 +0100 +++ b/src/share/classes/sun/management/resources/agent_ko.properties Mon May 09 04:37:12 2016 +0100 @@ -1,6 +1,6 @@ # # -# Copyright (c) 2004, 2013, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2004, 2016, Oracle and/or its affiliates. All rights reserved. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # # This code is free software; you can redistribute it and/or modify it @@ -28,7 +28,7 @@ # these are the same as the non-localized level name. agent.err.error = \uC624\uB958 -agent.err.exception = \uC5D0\uC774\uC804\uD2B8\uC5D0 \uC608\uC678 \uC0AC\uD56D\uC774 \uBC1C\uC0DD\uD588\uC2B5\uB2C8\uB2E4. +agent.err.exception = \uC5D0\uC774\uC804\uD2B8\uC5D0 \uC608\uC678\uC0AC\uD56D\uC774 \uBC1C\uC0DD\uD588\uC2B5\uB2C8\uB2E4. agent.err.warning = \uACBD\uACE0 agent.err.configfile.notfound = \uAD6C\uC131 \uD30C\uC77C\uC744 \uCC3E\uC744 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4.
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/share/classes/sun/misc/JavaObjectInputStreamAccess.java Mon May 09 04:37:12 2016 +0100 @@ -0,0 +1,41 @@ +/* + * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package sun.misc; + +import java.io.ObjectInputStream; + +/** + * The interface to specify methods for accessing {@code ObjectInputStream} + * @author sjiang + */ +public interface JavaObjectInputStreamAccess { + /** + * Sets a descriptor validating. + * @param ois stream to have the descriptors validated + * @param validator validator used to validate a descriptor. + */ + public void setValidator(ObjectInputStream ois, ObjectStreamClassValidator validator); +}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/share/classes/sun/misc/ObjectStreamClassValidator.java Mon May 09 04:37:12 2016 +0100 @@ -0,0 +1,43 @@ +/* + * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package sun.misc; + +import java.io.ObjectStreamClass; + +/** + * A callback used by {@code ObjectInputStream} to do descriptor validation. + * + * @author sjiang + */ +public interface ObjectStreamClassValidator { + /** + * This method will be called by ObjectInputStream to + * check a descriptor just before creating an object described by this descriptor. + * The object will not be created if this method throws a {@code RuntimeException}. + * @param descriptor descriptor to be checked. + */ + public void validateDescriptor(ObjectStreamClass descriptor); +}
--- a/src/share/classes/sun/misc/SharedSecrets.java Mon May 09 02:48:06 2016 +0100 +++ b/src/share/classes/sun/misc/SharedSecrets.java Mon May 09 04:37:12 2016 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2016, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -28,6 +28,7 @@ import java.util.jar.JarFile; import java.io.Console; import java.io.FileDescriptor; +import java.io.ObjectInputStream; import java.security.ProtectionDomain; import java.security.AccessController; @@ -55,6 +56,7 @@ private static JavaSecurityAccess javaSecurityAccess; private static JavaUtilZipFileAccess javaUtilZipFileAccess; private static JavaAWTAccess javaAWTAccess; + private static JavaObjectInputStreamAccess javaObjectInputStreamAccess; public static JavaUtilJarAccess javaUtilJarAccess() { if (javaUtilJarAccess == null) { @@ -184,4 +186,15 @@ } return javaAWTAccess; } + + public static JavaObjectInputStreamAccess getJavaObjectInputStreamAccess() { + if (javaObjectInputStreamAccess == null) { + unsafe.ensureClassInitialized(ObjectInputStream.class); + } + return javaObjectInputStreamAccess; + } + + public static void setJavaObjectInputStreamAccess(JavaObjectInputStreamAccess access) { + javaObjectInputStreamAccess = access; + } }
--- a/src/share/classes/sun/misc/Version.java.template Mon May 09 02:48:06 2016 +0100 +++ b/src/share/classes/sun/misc/Version.java.template Mon May 09 04:37:12 2016 +0100 @@ -320,15 +320,24 @@ jvm_minor_version = Character.digit(cs.charAt(2), 10); jvm_micro_version = Character.digit(cs.charAt(4), 10); cs = cs.subSequence(5, cs.length()); - if (cs.charAt(0) == '_' && cs.length() >= 3 && - Character.isDigit(cs.charAt(1)) && - Character.isDigit(cs.charAt(2))) { - int nextChar = 3; + if (cs.charAt(0) == '_' && cs.length() >= 3) { + int nextChar = 0; + if (Character.isDigit(cs.charAt(1)) && + Character.isDigit(cs.charAt(2)) && + Character.isDigit(cs.charAt(3))) + { + nextChar = 4; + } else if (Character.isDigit(cs.charAt(1)) && + Character.isDigit(cs.charAt(2))) + { + nextChar = 3; + } + try { - String uu = cs.subSequence(1, 3).toString(); + String uu = cs.subSequence(1, nextChar).toString(); jvm_update_version = Integer.valueOf(uu).intValue(); - if (cs.length() >= 4) { - char c = cs.charAt(3); + if (cs.length() >= nextChar + 1) { + char c = cs.charAt(nextChar); if (c >= 'a' && c <= 'z') { jvm_special_version = Character.toString(c); nextChar++;
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/share/classes/sun/rmi/server/DeserializationChecker.java Mon May 09 04:37:12 2016 +0100 @@ -0,0 +1,93 @@ +/* + * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package sun.rmi.server; + +import java.io.ObjectStreamClass; +import java.lang.reflect.Method; + +/** + * Implementing this interface to have a deserialization control when RMI + * dispatches a remote request. If an exported object implements this interface, + * RMI dispatching mechanism will call the method {@code check} every time + * deserialising a remote object for invoking a method of the exported object. + * + * @author sjiang + */ +public interface DeserializationChecker { + /** + * Will be called to check a descriptor. + * This method may be called 2 times, the first time is when a descriptor is read + * from the stream, the second is just before creating an object described + * by this descriptor. + * + * @param method the method invoked from a remote request. + * @param descriptor The descriptor of the class of any object deserialised + * while deserialising the parameter. The first descriptor will be that of + * the top level object (the concrete class of the parameter itself); + * Subsequent calls with the same {@code method}, {@code paramIndex} and + * {@code callID} will correspond to objects contained in the parameter. + * @param paramIndex an index indicates the position of a parameter in the + * method. This index will be reused for deserialising all + * objects contained in the parameter object. For example, the parameter + * being deserialised is a {@code List}, all deserialisation calls for its + * elements will have same index. + * @param callID a unique ID identifying one + * time method invocation, the same ID is used for deserialization call of + * all parameters within the method. + */ + public void check(Method method, + ObjectStreamClass descriptor, + int paramIndex, + int callID); + + /** + * Will be called to validate a Proxy interfaces from a remote user before loading it. + * @param method the method invoked from a remote request. + * @param ifaces a string table of all interfaces implemented by the proxy to be checked. + * @param paramIndex an index indicates the position of a parameter in the + * method. This index will be reused for deserialising all + * objects contained in the parameter object. For example, the parameter + * being deserialised is a {@code List}, all deserialisation calls for its + * elements will have same index. + * @param callID a unique ID identifying one + * time method invocation, the same ID is used for deserialization call of + * all parameters within the method. + */ + public void checkProxyClass(Method method, + String[] ifaces, + int paramIndex, + int callID); + + /** + * Inform of the completion of parameter deserialisation for a method invocation. + * This is useful if the last parameter is a complex object, like a {@code List} + * which elements are complex object too. + * + * The default implementation does nothing. + * @param callID the ID identifying a method invocation. + */ + public default void end(int callID) {} +}
--- a/src/share/classes/sun/rmi/server/MarshalInputStream.java Mon May 09 02:48:06 2016 +0100 +++ b/src/share/classes/sun/rmi/server/MarshalInputStream.java Mon May 09 04:37:12 2016 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1996, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1996, 2016, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -30,12 +30,12 @@ import java.io.ObjectInputStream; import java.io.ObjectStreamClass; import java.io.StreamCorruptedException; -import java.net.URL; import java.util.*; import java.security.AccessControlException; import java.security.Permission; - import java.rmi.server.RMIClassLoader; +import sun.misc.ObjectStreamClassValidator; +import sun.misc.SharedSecrets; /** * MarshalInputStream is an extension of ObjectInputStream. When resolving @@ -53,6 +53,11 @@ * @author Peter Jones */ public class MarshalInputStream extends ObjectInputStream { + interface StreamChecker extends ObjectStreamClassValidator { + void checkProxyInterfaceNames(String[] ifaces); + } + + private volatile StreamChecker streamChecker = null; /** * Value of "java.rmi.server.useCodebaseOnly" property, @@ -122,7 +127,7 @@ throws IOException, StreamCorruptedException { super(in); - } + } /** * Returns a callback previously registered via the setDoneCallback @@ -239,6 +244,11 @@ protected Class<?> resolveProxyClass(String[] interfaces) throws IOException, ClassNotFoundException { + StreamChecker checker = streamChecker; + if (checker != null) { + checker.checkProxyInterfaceNames(interfaces); + } + /* * Always read annotation written by MarshalOutputStream. */ @@ -318,4 +328,28 @@ void useCodebaseOnly() { useCodebaseOnly = true; } + + synchronized void setStreamChecker(StreamChecker checker) { + streamChecker = checker; + SharedSecrets.getJavaObjectInputStreamAccess().setValidator(this, checker); + } + @Override + protected ObjectStreamClass readClassDescriptor() throws IOException, + ClassNotFoundException { + ObjectStreamClass descriptor = super.readClassDescriptor(); + + validateDesc(descriptor); + + return descriptor; + } + + private void validateDesc(ObjectStreamClass descriptor) { + StreamChecker checker; + synchronized (this) { + checker = streamChecker; + } + if (checker != null) { + checker.validateDescriptor(descriptor); + } + } }
--- a/src/share/classes/sun/rmi/server/UnicastServerRef.java Mon May 09 02:48:06 2016 +0100 +++ b/src/share/classes/sun/rmi/server/UnicastServerRef.java Mon May 09 04:37:12 2016 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1996, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1996, 2016, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -28,7 +28,7 @@ import java.io.IOException; import java.io.ObjectInput; import java.io.ObjectOutput; -import java.io.PrintStream; +import java.io.ObjectStreamClass; import java.lang.reflect.InvocationTargetException; import java.lang.reflect.Method; import java.rmi.MarshalException; @@ -52,7 +52,9 @@ import java.util.HashMap; import java.util.Map; import java.util.WeakHashMap; +import java.util.concurrent.atomic.AtomicInteger; import sun.rmi.runtime.Log; +import static sun.rmi.server.UnicastRef.marshalValue; import sun.rmi.transport.LiveRef; import sun.rmi.transport.Target; import sun.rmi.transport.tcp.TCPTransport; @@ -118,6 +120,8 @@ private static final Map<Class<?>,?> withoutSkeletons = Collections.synchronizedMap(new WeakHashMap<Class<?>,Void>()); + private final AtomicInteger methodCallIDCount = new AtomicInteger(0); + /** * Create a new (empty) Unicast server remote reference. */ @@ -299,14 +303,11 @@ logCall(obj, method); // unmarshal parameters - Class<?>[] types = method.getParameterTypes(); - Object[] params = new Object[types.length]; + Object[] params = null; try { unmarshalCustomCallData(in); - for (int i = 0; i < types.length; i++) { - params[i] = unmarshalValue(types[i], in); - } + params = unmarshalParameters(obj, method, marshalStream); } catch (java.io.IOException e) { throw new UnmarshalException( "error unmarshalling arguments", e); @@ -567,4 +568,85 @@ return map; } } + + /** + * Unmarshal parameters for the given method of the given instance over + * the given marshalinputstream. Perform any necessary checks. + */ + private Object[] unmarshalParameters(Object obj, Method method, MarshalInputStream in) + throws IOException, ClassNotFoundException { + return (obj instanceof DeserializationChecker) ? + unmarshalParametersChecked((DeserializationChecker)obj, method, in) : + unmarshalParametersUnchecked(method, in); + } + + /** + * Unmarshal parameters for the given method of the given instance over + * the given marshalinputstream. Do not perform any additional checks. + */ + private Object[] unmarshalParametersUnchecked(Method method, ObjectInput in) + throws IOException, ClassNotFoundException { + Class<?>[] types = method.getParameterTypes(); + Object[] params = new Object[types.length]; + for (int i = 0; i < types.length; i++) { + params[i] = unmarshalValue(types[i], in); + } + return params; + } + + /** + * Unmarshal parameters for the given method of the given instance over + * the given marshalinputstream. Do perform all additional checks. + */ + private Object[] unmarshalParametersChecked( + DeserializationChecker checker, + Method method, MarshalInputStream in) + throws IOException, ClassNotFoundException { + int callID = methodCallIDCount.getAndIncrement(); + MyChecker myChecker = new MyChecker(checker, method, callID); + in.setStreamChecker(myChecker); + try { + Class<?>[] types = method.getParameterTypes(); + Object[] values = new Object[types.length]; + for (int i = 0; i < types.length; i++) { + myChecker.setIndex(i); + values[i] = unmarshalValue(types[i], in); + } + myChecker.end(callID); + return values; + } finally { + in.setStreamChecker(null); + } + } + + private static class MyChecker implements MarshalInputStream.StreamChecker { + private final DeserializationChecker descriptorCheck; + private final Method method; + private final int callID; + private int parameterIndex; + + MyChecker(DeserializationChecker descriptorCheck, Method method, int callID) { + this.descriptorCheck = descriptorCheck; + this.method = method; + this.callID = callID; + } + + @Override + public void validateDescriptor(ObjectStreamClass descriptor) { + descriptorCheck.check(method, descriptor, parameterIndex, callID); + } + + @Override + public void checkProxyInterfaceNames(String[] ifaces) { + descriptorCheck.checkProxyClass(method, ifaces, parameterIndex, callID); + } + + void setIndex(int parameterIndex) { + this.parameterIndex = parameterIndex; + } + + void end(int callId) { + descriptorCheck.end(callId); + } + } }
--- a/src/share/classes/sun/rmi/server/resources/rmid_ko.properties Mon May 09 02:48:06 2016 +0100 +++ b/src/share/classes/sun/rmi/server/resources/rmid_ko.properties Mon May 09 04:37:12 2016 +0100 @@ -1,6 +1,6 @@ # # -# Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 1998, 2016, 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 @@ -47,7 +47,7 @@ # {0} = the (string) reason text that came with a thrown exception # "Activation.main" should not be translated, because it's a codepoint -rmid.unexpected.exception=Activation.main: \uC608\uC678 \uC0AC\uD56D \uBC1C\uC0DD: {0} +rmid.unexpected.exception=Activation.main: \uC608\uC678\uC0AC\uD56D \uBC1C\uC0DD: {0} # "java.home" should not be translated, because it's a property name # "ActivatorImpl" should not be translated, because it's a codepoint @@ -60,7 +60,7 @@ rmid.exec.policy.invalid=Activation.main: \uC2E4\uD589 \uC815\uCC45 \uD074\uB798\uC2A4\uAC00 \uBD80\uC801\uD569\uD569\uB2C8\uB2E4. # "rmid" should not be translated -rmid.exec.policy.exception=rmid: \uC2E4\uD589 \uC815\uCC45\uC744 \uAC00\uC838\uC624\uB824\uB294 \uC2DC\uB3C4\uB85C \uBC1C\uC0DD\uD55C \uC608\uC678 \uC0AC\uD56D: +rmid.exec.policy.exception=rmid: \uC2E4\uD589 \uC815\uCC45\uC744 \uAC00\uC838\uC624\uB824\uB294 \uC2DC\uB3C4\uB85C \uBC1C\uC0DD\uD55C \uC608\uC678\uC0AC\uD56D: # "rmid" should not be translated rmid.exec.command=rmid: debugExec: "{0}" \uC2E4\uD589 \uC911
--- a/src/share/classes/sun/security/jgss/wrapper/GSSNameElement.java Mon May 09 02:48:06 2016 +0100 +++ b/src/share/classes/sun/security/jgss/wrapper/GSSNameElement.java Mon May 09 04:37:12 2016 +0100 @@ -159,7 +159,9 @@ int atPos = krbName.lastIndexOf('@'); if (atPos != -1) { String atRealm = krbName.substring(atPos); - if (nameType.equals(GSSUtil.NT_GSS_KRB5_PRINCIPAL) + // getNativeNameType() can modify NT_GSS_KRB5_PRINCIPAL to null + if ((nameType == null + || nameType.equals(GSSUtil.NT_GSS_KRB5_PRINCIPAL)) && new String(nameBytes).endsWith(atRealm)) { // Created from Kerberos name with realm, no need to check } else {
--- a/src/share/classes/sun/security/pkcs10/PKCS10.java Mon May 09 02:48:06 2016 +0100 +++ b/src/share/classes/sun/security/pkcs10/PKCS10.java Mon May 09 04:37:12 2016 +0100 @@ -290,8 +290,9 @@ throw new SignatureException("Cert request was not signed"); + byte[] CRLF = new byte[] {'\r', '\n'}; out.println("-----BEGIN NEW CERTIFICATE REQUEST-----"); - out.println(Base64.getMimeEncoder().encodeToString(encoded)); + out.println(Base64.getMimeEncoder(64, CRLF).encodeToString(encoded)); out.println("-----END NEW CERTIFICATE REQUEST-----"); }
--- a/src/share/classes/sun/security/provider/DSA.java Mon May 09 02:48:06 2016 +0100 +++ b/src/share/classes/sun/security/provider/DSA.java Mon May 09 04:37:12 2016 +0100 @@ -94,6 +94,18 @@ this.md = md; } + private static void checkKey(DSAParams params, int digestLen, String mdAlgo) + throws InvalidKeyException { + // FIPS186-3 states in sec4.2 that a hash function which provides + // a lower security strength than the (L, N) pair ordinarily should + // not be used. + int valueN = params.getQ().bitLength(); + if (valueN > digestLen) { + throw new InvalidKeyException("The security strength of " + + mdAlgo + " digest algorithm is not sufficient for this key size"); + } + } + /** * Initialize the DSA object with a DSA private key. * @@ -118,6 +130,12 @@ throw new InvalidKeyException("DSA private key lacks parameters"); } + // check key size against hash output size for signing + // skip this check for verification to minimize impact on existing apps + if (md.getAlgorithm() != "NullDigest20") { + checkKey(params, md.getDigestLength()*8, md.getAlgorithm()); + } + this.params = params; this.presetX = priv.getX(); this.presetY = null; @@ -148,7 +166,6 @@ if (params == null) { throw new InvalidKeyException("DSA public key lacks parameters"); } - this.params = params; this.presetY = pub.getY(); this.presetX = null; @@ -349,20 +366,13 @@ return t5.mod(q); } - // NOTE: This following impl is defined in FIPS 186-3 AppendixB.2.2. - // Original DSS algos such as SHA1withDSA and RawDSA uses a different - // algorithm defined in FIPS 186-1 Sec3.2, and thus need to override this. + // NOTE: This following impl is defined in FIPS 186-4 AppendixB.2.1. protected BigInteger generateK(BigInteger q) { SecureRandom random = getSigningRandom(); - byte[] kValue = new byte[q.bitLength()/8]; + byte[] kValue = new byte[(q.bitLength() + 7)/8 + 8]; - while (true) { - random.nextBytes(kValue); - BigInteger k = new BigInteger(1, kValue).mod(q); - if (k.signum() > 0 && k.compareTo(q) < 0) { - return k; - } - } + random.nextBytes(kValue); + return new BigInteger(1, kValue).mod(q.subtract(BigInteger.ONE)).add(BigInteger.ONE); } // Use the application-specified SecureRandom Object if provided. @@ -429,214 +439,10 @@ } } - static class LegacyDSA extends DSA { - /* The random seed used to generate k */ - private int[] kSeed; - /* The random seed used to generate k (specified by application) */ - private byte[] kSeedAsByteArray; - /* - * The random seed used to generate k - * (prevent the same Kseed from being used twice in a row - */ - private int[] kSeedLast; - - public LegacyDSA(MessageDigest md) throws NoSuchAlgorithmException { - super(md); - } - - @Deprecated - protected void engineSetParameter(String key, Object param) { - if (key.equals("KSEED")) { - if (param instanceof byte[]) { - kSeed = byteArray2IntArray((byte[])param); - kSeedAsByteArray = (byte[])param; - } else { - debug("unrecognized param: " + key); - throw new InvalidParameterException("kSeed not a byte array"); - } - } else { - throw new InvalidParameterException("Unsupported parameter"); - } - } - - @Deprecated - protected Object engineGetParameter(String key) { - if (key.equals("KSEED")) { - return kSeedAsByteArray; - } else { - return null; - } - } - - /* - * Please read bug report 4044247 for an alternative, faster, - * NON-FIPS approved method to generate K - */ - @Override - protected BigInteger generateK(BigInteger q) { - BigInteger k = null; - - // The application specified a kSeed for us to use. - // Note: we dis-allow usage of the same Kseed twice in a row - if (kSeed != null && !Arrays.equals(kSeed, kSeedLast)) { - k = generateKUsingKSeed(kSeed, q); - if (k.signum() > 0 && k.compareTo(q) < 0) { - kSeedLast = kSeed.clone(); - return k; - } - } - - // The application did not specify a Kseed for us to use. - // We'll generate a new Kseed by getting random bytes from - // a SecureRandom object. - SecureRandom random = getSigningRandom(); - - while (true) { - int[] seed = new int[5]; - - for (int i = 0; i < 5; i++) seed[i] = random.nextInt(); - - k = generateKUsingKSeed(seed, q); - if (k.signum() > 0 && k.compareTo(q) < 0) { - kSeedLast = seed; - return k; - } - } - } - - /** - * Compute k for the DSA signature as defined in the original DSS, - * i.e. FIPS186. - * - * @param seed the seed for generating k. This seed should be - * secure. This is what is referred to as the KSEED in the DSA - * specification. - * - * @param g the g parameter from the DSA key pair. - */ - private BigInteger generateKUsingKSeed(int[] seed, BigInteger q) { - - // check out t in the spec. - int[] t = { 0xEFCDAB89, 0x98BADCFE, 0x10325476, - 0xC3D2E1F0, 0x67452301 }; - // - int[] tmp = SHA_7(seed, t); - byte[] tmpBytes = new byte[tmp.length * 4]; - for (int i = 0; i < tmp.length; i++) { - int k = tmp[i]; - for (int j = 0; j < 4; j++) { - tmpBytes[(i * 4) + j] = (byte) (k >>> (24 - (j * 8))); - } - } - BigInteger k = new BigInteger(1, tmpBytes).mod(q); - return k; - } - - // Constants for each round - private static final int round1_kt = 0x5a827999; - private static final int round2_kt = 0x6ed9eba1; - private static final int round3_kt = 0x8f1bbcdc; - private static final int round4_kt = 0xca62c1d6; - - /** - * Computes set 1 thru 7 of SHA-1 on m1. */ - static int[] SHA_7(int[] m1, int[] h) { - - int[] W = new int[80]; - System.arraycopy(m1,0,W,0,m1.length); - int temp = 0; - - for (int t = 16; t <= 79; t++){ - temp = W[t-3] ^ W[t-8] ^ W[t-14] ^ W[t-16]; - W[t] = ((temp << 1) | (temp >>>(32 - 1))); - } - - int a = h[0],b = h[1],c = h[2], d = h[3], e = h[4]; - for (int i = 0; i < 20; i++) { - temp = ((a<<5) | (a>>>(32-5))) + - ((b&c)|((~b)&d))+ e + W[i] + round1_kt; - e = d; - d = c; - c = ((b<<30) | (b>>>(32-30))); - b = a; - a = temp; - } - - // Round 2 - for (int i = 20; i < 40; i++) { - temp = ((a<<5) | (a>>>(32-5))) + - (b ^ c ^ d) + e + W[i] + round2_kt; - e = d; - d = c; - c = ((b<<30) | (b>>>(32-30))); - b = a; - a = temp; - } - - // Round 3 - for (int i = 40; i < 60; i++) { - temp = ((a<<5) | (a>>>(32-5))) + - ((b&c)|(b&d)|(c&d)) + e + W[i] + round3_kt; - e = d; - d = c; - c = ((b<<30) | (b>>>(32-30))); - b = a; - a = temp; - } - - // Round 4 - for (int i = 60; i < 80; i++) { - temp = ((a<<5) | (a>>>(32-5))) + - (b ^ c ^ d) + e + W[i] + round4_kt; - e = d; - d = c; - c = ((b<<30) | (b>>>(32-30))); - b = a; - a = temp; - } - int[] md = new int[5]; - md[0] = h[0] + a; - md[1] = h[1] + b; - md[2] = h[2] + c; - md[3] = h[3] + d; - md[4] = h[4] + e; - return md; - } - - /* - * Utility routine for converting a byte array into an int array - */ - private int[] byteArray2IntArray(byte[] byteArray) { - - int j = 0; - byte[] newBA; - int mod = byteArray.length % 4; - - // guarantee that the incoming byteArray is a multiple of 4 - // (pad with 0's) - switch (mod) { - case 3: newBA = new byte[byteArray.length + 1]; break; - case 2: newBA = new byte[byteArray.length + 2]; break; - case 1: newBA = new byte[byteArray.length + 3]; break; - default: newBA = new byte[byteArray.length + 0]; break; - } - System.arraycopy(byteArray, 0, newBA, 0, byteArray.length); - - // copy each set of 4 bytes in the byte array into an integer - int[] newSeed = new int[newBA.length / 4]; - for (int i = 0; i < newBA.length; i += 4) { - newSeed[j] = newBA[i + 3] & 0xFF; - newSeed[j] |= (newBA[i + 2] << 8) & 0xFF00; - newSeed[j] |= (newBA[i + 1] << 16) & 0xFF0000; - newSeed[j] |= (newBA[i + 0] << 24) & 0xFF000000; - j++; - } - - return newSeed; - } - } - - public static final class SHA1withDSA extends LegacyDSA { + /** + * Standard SHA1withDSA implementation. + */ + public static final class SHA1withDSA extends DSA { public SHA1withDSA() throws NoSuchAlgorithmException { super(MessageDigest.getInstance("SHA-1")); } @@ -649,7 +455,7 @@ * not, a SignatureException is thrown when sign()/verify() is called * per JCA spec. */ - public static final class RawDSA extends LegacyDSA { + public static final class RawDSA extends DSA { // Internal special-purpose MessageDigest impl for RawDSA // Only override whatever methods used // NOTE: no clone support
--- a/src/share/classes/sun/security/provider/X509Factory.java Mon May 09 02:48:06 2016 +0100 +++ b/src/share/classes/sun/security/provider/X509Factory.java Mon May 09 04:37:12 2016 +0100 @@ -28,6 +28,8 @@ import java.io.*; import java.util.*; import java.security.cert.*; + +import sun.security.util.Pem; import sun.security.x509.X509CertImpl; import sun.security.x509.X509CRLImpl; import sun.security.pkcs.PKCS7; @@ -633,7 +635,7 @@ checkHeaderFooter(header.toString(), footer.toString()); - return Base64.getMimeDecoder().decode(new String(data, 0, pos)); + return Pem.decode(new String(data, 0, pos)); } }
--- a/src/share/classes/sun/security/ssl/HandshakeHash.java Mon May 09 02:48:06 2016 +0100 +++ b/src/share/classes/sun/security/ssl/HandshakeHash.java Mon May 09 04:37:12 2016 +0100 @@ -246,7 +246,7 @@ try { return cloneDigest(finMD).digest(); } catch (Exception e) { - throw new Error("BAD"); + throw new Error("Error during hash calculation", e); } } }
--- a/src/share/classes/sun/security/ssl/ServerHandshaker.java Mon May 09 02:48:06 2016 +0100 +++ b/src/share/classes/sun/security/ssl/ServerHandshaker.java Mon May 09 04:37:12 2016 +0100 @@ -1259,8 +1259,8 @@ } } - // need EC cert signed using EC - if (setupPrivateKeyAndChain("EC_EC") == false) { + // need EC cert + if (setupPrivateKeyAndChain("EC") == false) { return false; } if (setupEphemeralECDHKeys() == false) { @@ -1268,15 +1268,15 @@ } break; case K_ECDH_RSA: - // need EC cert signed using RSA - if (setupPrivateKeyAndChain("EC_RSA") == false) { + // need EC cert + if (setupPrivateKeyAndChain("EC") == false) { return false; } setupStaticECDHKeys(); break; case K_ECDH_ECDSA: - // need EC cert signed using EC - if (setupPrivateKeyAndChain("EC_EC") == false) { + // need EC cert + if (setupPrivateKeyAndChain("EC") == false) { return false; } setupStaticECDHKeys();
--- a/src/share/classes/sun/security/ssl/SignatureAndHashAlgorithm.java Mon May 09 02:48:06 2016 +0100 +++ b/src/share/classes/sun/security/ssl/SignatureAndHashAlgorithm.java Mon May 09 04:37:12 2016 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2010, 2016, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -28,6 +28,7 @@ import java.security.AlgorithmConstraints; import java.security.CryptoPrimitive; import java.security.PrivateKey; +import java.security.Security; import java.util.Set; import java.util.HashSet; @@ -152,13 +153,11 @@ getSupportedAlgorithms(AlgorithmConstraints constraints) { Collection<SignatureAndHashAlgorithm> supported = new ArrayList<>(); - synchronized (priorityMap) { - for (SignatureAndHashAlgorithm sigAlg : priorityMap.values()) { - if (sigAlg.priority <= SUPPORTED_ALG_PRIORITY_MAX_NUM && - constraints.permits(SIGNATURE_PRIMITIVE_SET, - sigAlg.algorithm, null)) { - supported.add(sigAlg); - } + for (SignatureAndHashAlgorithm sigAlg : priorityMap.values()) { + if (sigAlg.priority <= SUPPORTED_ALG_PRIORITY_MAX_NUM && + constraints.permits(SIGNATURE_PRIMITIVE_SET, + sigAlg.algorithm, null)) { + supported.add(sigAlg); } } @@ -412,10 +411,14 @@ "SHA1withRSA", --p); supports(HashAlgorithm.SHA1, SignatureAlgorithm.ECDSA, "SHA1withECDSA", --p); - supports(HashAlgorithm.SHA224, SignatureAlgorithm.RSA, - "SHA224withRSA", --p); - supports(HashAlgorithm.SHA224, SignatureAlgorithm.ECDSA, - "SHA224withECDSA", --p); + + if (Security.getProvider("SunMSCAPI") == null) { + supports(HashAlgorithm.SHA224, SignatureAlgorithm.RSA, + "SHA224withRSA", --p); + supports(HashAlgorithm.SHA224, SignatureAlgorithm.ECDSA, + "SHA224withECDSA", --p); + } + supports(HashAlgorithm.SHA256, SignatureAlgorithm.RSA, "SHA256withRSA", --p); supports(HashAlgorithm.SHA256, SignatureAlgorithm.ECDSA,
--- a/src/share/classes/sun/security/tools/keytool/Main.java Mon May 09 02:48:06 2016 +0100 +++ b/src/share/classes/sun/security/tools/keytool/Main.java Mon May 09 04:37:12 2016 +0100 @@ -79,6 +79,7 @@ import sun.security.tools.KeyStoreUtil; import sun.security.tools.PathList; import sun.security.util.DerValue; +import sun.security.util.Pem; import sun.security.x509.*; import static java.security.KeyStore.*; @@ -99,6 +100,8 @@ */ public final class Main { + private static final byte[] CRLF = new byte[] {'\r', '\n'}; + private boolean debug = false; private Command command = null; private String sigAlgName = null; @@ -1205,7 +1208,7 @@ sb.append(s); } } - byte[] rawReq = Base64.getMimeDecoder().decode(new String(sb)); + byte[] rawReq = Pem.decode(new String(sb)); PKCS10 req = new PKCS10(rawReq); info.set(X509CertInfo.KEY, new CertificateX509Key(req.getSubjectPublicKeyInfo())); @@ -1282,7 +1285,7 @@ crl.sign(privateKey, sigAlgName); if (rfc) { out.println("-----BEGIN X509 CRL-----"); - out.println(Base64.getMimeEncoder().encodeToString(crl.getEncodedInternal())); + out.println(Base64.getMimeEncoder(64, CRLF).encodeToString(crl.getEncodedInternal())); out.println("-----END X509 CRL-----"); } else { out.write(crl.getEncodedInternal()); @@ -2251,7 +2254,7 @@ if (rfc) { X509CRL xcrl = (X509CRL)crl; out.println("-----BEGIN X509 CRL-----"); - out.println(Base64.getMimeEncoder().encodeToString(xcrl.getEncoded())); + out.println(Base64.getMimeEncoder(64, CRLF).encodeToString(xcrl.getEncoded())); out.println("-----END X509 CRL-----"); } else { out.println(crl.toString()); @@ -2278,7 +2281,7 @@ sb.append(s); } } - PKCS10 req = new PKCS10(Base64.getMimeDecoder().decode(new String(sb))); + PKCS10 req = new PKCS10(Pem.decode(new String(sb))); PublicKey pkey = req.getSubjectPublicKeyInfo(); out.printf(rb.getString("PKCS.10.Certificate.Request.Version.1.0.Subject.s.Public.Key.s.format.s.key."), @@ -3059,7 +3062,7 @@ { if (rfc) { out.println(X509Factory.BEGIN_CERT); - out.println(Base64.getMimeEncoder().encodeToString(cert.getEncoded())); + out.println(Base64.getMimeEncoder(64, CRLF).encodeToString(cert.getEncoded())); out.println(X509Factory.END_CERT); } else { out.write(cert.getEncoded()); // binary
--- a/src/share/classes/sun/security/tools/keytool/Resources_de.java Mon May 09 02:48:06 2016 +0100 +++ b/src/share/classes/sun/security/tools/keytool/Resources_de.java Mon May 09 04:37:12 2016 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2016, 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 @@ -367,7 +367,7 @@ {"Alias.alias.has.no.key", "Alias <{0}> verf\u00FCgt \u00FCber keinen Schl\u00FCssel"}, {"Alias.alias.references.an.entry.type.that.is.not.a.private.key.entry.The.keyclone.command.only.supports.cloning.of.private.key", - "Alias <{0}> verweist auf einen Eintragstyp, der kein Private Key-Eintrag ist. Der Befehl -keyclone unterst\u00FCtzt nur das Clonen von Private Key-Eintr\u00E4gen"}, + "Alias <{0}> verweist auf einen Eintragstyp, der kein Private Key-Eintrag ist. Der Befehl -keyclone unterst\u00FCtzt nur das Klonen von Private Key-Eintr\u00E4gen"}, {".WARNING.WARNING.WARNING.", "***************** WARNING WARNING WARNING *****************"},
--- a/src/share/classes/sun/security/tools/policytool/Resources_ko.java Mon May 09 02:48:06 2016 +0100 +++ b/src/share/classes/sun/security/tools/policytool/Resources_ko.java Mon May 09 04:37:12 2016 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2016, 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 @@ -116,11 +116,11 @@ {"Policy.successfully.written.to.filename", "{0}\uC5D0 \uC131\uACF5\uC801\uC73C\uB85C \uC815\uCC45\uC744 \uC37C\uC2B5\uB2C8\uB2E4."}, {"null.filename", "\uB110 \uD30C\uC77C \uC774\uB984"}, - {"Save.changes.", "\uBCC0\uACBD \uC0AC\uD56D\uC744 \uC800\uC7A5\uD558\uACA0\uC2B5\uB2C8\uAE4C?"}, + {"Save.changes.", "\uBCC0\uACBD\uC0AC\uD56D\uC744 \uC800\uC7A5\uD558\uACA0\uC2B5\uB2C8\uAE4C?"}, {"Yes", "\uC608(&Y)"}, {"No", "\uC544\uB2C8\uC624(&N)"}, {"Policy.Entry", "\uC815\uCC45 \uD56D\uBAA9"}, - {"Save.Changes", "\uBCC0\uACBD \uC0AC\uD56D \uC800\uC7A5"}, + {"Save.Changes", "\uBCC0\uACBD\uC0AC\uD56D \uC800\uC7A5"}, {"No.Policy.Entry.selected", "\uC120\uD0DD\uB41C \uC815\uCC45 \uD56D\uBAA9\uC774 \uC5C6\uC2B5\uB2C8\uB2E4."}, {"Unable.to.open.KeyStore.ex.toString.", "\uD0A4 \uC800\uC7A5\uC18C\uB97C \uC5F4 \uC218 \uC5C6\uC74C: {0}"},
--- a/src/share/classes/sun/security/util/AuthResources_ko.java Mon May 09 02:48:06 2016 +0100 +++ b/src/share/classes/sun/security/util/AuthResources_ko.java Mon May 09 04:37:12 2016 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2016, 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 @@ -88,7 +88,7 @@ {"Keystore.alias.","\uD0A4 \uC800\uC7A5\uC18C \uBCC4\uCE6D: "}, {"Keystore.password.","\uD0A4 \uC800\uC7A5\uC18C \uBE44\uBC00\uBC88\uD638: "}, {"Private.key.password.optional.", - "\uC804\uC6A9 \uD0A4 \uBE44\uBC00\uBC88\uD638(\uC120\uD0DD \uC0AC\uD56D): "}, + "\uC804\uC6A9 \uD0A4 \uBE44\uBC00\uBC88\uD638(\uC120\uD0DD\uC0AC\uD56D): "}, // com.sun.security.auth.module.Krb5LoginModule {"Kerberos.username.defUsername.",
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/share/classes/sun/security/util/Pem.java Mon May 09 04:37:12 2016 +0100 @@ -0,0 +1,52 @@ +/* + * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package sun.security.util; + +import java.io.IOException; +import java.util.Base64; + +/** + * The Length interface defines the length of an object + */ +public class Pem { + + /** + * Decodes a PEM-encoded block. + * + * @param input the input string, according to RFC 1421, can only contain + * characters in the base-64 alphabet and whitespaces. + * @return the decoded bytes + * @throws java.io.IOException if input is invalid + */ + public static byte[] decode(String input) throws IOException { + byte[] src = input.replaceAll("\\s+", "").getBytes(); + try { + return Base64.getDecoder().decode(src); + } catch (IllegalArgumentException e) { + throw new IOException(e); + } + } +}
--- a/src/share/classes/sun/security/x509/X509CertImpl.java Mon May 09 02:48:06 2016 +0100 +++ b/src/share/classes/sun/security/x509/X509CertImpl.java Mon May 09 04:37:12 2016 +0100 @@ -271,7 +271,7 @@ der = new DerValue(decstream.toByteArray()); break; } else { - decstream.write(Base64.getMimeDecoder().decode(line)); + decstream.write(Pem.decode(line)); } } } catch (IOException ioe2) {
--- a/src/share/classes/sun/swing/CachedPainter.java Mon May 09 02:48:06 2016 +0100 +++ b/src/share/classes/sun/swing/CachedPainter.java Mon May 09 04:37:12 2016 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2004, 2006, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2004, 2015, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -53,9 +53,7 @@ */ public abstract class CachedPainter { // CacheMap maps from class to ImageCache. - private static final Map<Object,ImageCache> cacheMap = - new HashMap<Object,ImageCache>(); - + private static final Map<Object,ImageCache> cacheMap = new HashMap<>(); private static ImageCache getCache(Object key) { synchronized(CachedPainter.class) { @@ -96,20 +94,8 @@ if (w <= 0 || h <= 0) { return; } - if (c != null) { - synchronized(c.getTreeLock()) { - synchronized(CachedPainter.class) { - // If c is non-null, synchronize on the tree lock. - // This is necessary because asking for the - // GraphicsConfiguration will grab a tree lock. - paint0(c, g, x, y, w, h, args); - } - } - } - else { - synchronized(CachedPainter.class) { - paint0(c, g, x, y, w, h, args); - } + synchronized (CachedPainter.class) { + paint0(c, g, x, y, w, h, args); } }
--- a/src/share/classes/sun/tools/jar/resources/jar_ko.properties Mon May 09 02:48:06 2016 +0100 +++ b/src/share/classes/sun/tools/jar/resources/jar_ko.properties Mon May 09 04:37:12 2016 +0100 @@ -1,5 +1,5 @@ # -# Copyright (c) 1999, 2015, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 1999, 2016, 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 @@ -45,4 +45,4 @@ out.inflated=\ \uC99D\uAC00\uB428: {0} out.size=(\uC785\uB825 = {0}) (\uCD9C\uB825 = {1}) -usage=\uC0AC\uC6A9\uBC95: jar {ctxui}[vfmn0PMe] [jar-file] [manifest-file] [entry-point] [-C dir] files ...\n\uC635\uC158:\n -c \uC0C8 \uC544\uCE74\uC774\uBE0C\uB97C \uC0DD\uC131\uD569\uB2C8\uB2E4.\n -t \uC544\uCE74\uC774\uBE0C\uC5D0 \uB300\uD55C \uBAA9\uCC28\uB97C \uB098\uC5F4\uD569\uB2C8\uB2E4.\n -x \uBA85\uBA85\uB41C(\uB610\uB294 \uBAA8\uB4E0) \uD30C\uC77C\uC744 \uC544\uCE74\uC774\uBE0C\uC5D0\uC11C \uCD94\uCD9C\uD569\uB2C8\uB2E4.\n -u \uAE30\uC874 \uC544\uCE74\uC774\uBE0C\uB97C \uC5C5\uB370\uC774\uD2B8\uD569\uB2C8\uB2E4.\n -v \uD45C\uC900 \uCD9C\uB825\uC5D0 \uC0C1\uC138 \uC815\uBCF4 \uCD9C\uB825\uC744 \uC0DD\uC131\uD569\uB2C8\uB2E4.\n -f \uC544\uCE74\uC774\uBE0C \uD30C\uC77C \uC774\uB984\uC744 \uC9C0\uC815\uD569\uB2C8\uB2E4.\n -m \uC9C0\uC815\uB41C Manifest \uD30C\uC77C\uC758 Manifest \uC815\uBCF4\uB97C \uD3EC\uD568\uD569\uB2C8\uB2E4.\n -n \uC0C8 \uC544\uCE74\uC774\uBE0C\uB97C \uC0DD\uC131\uD55C \uD6C4 Pack200 \uC815\uADDC\uD654\uB97C \uC218\uD589\uD569\uB2C8\uB2E4.\n -e jar \uC2E4\uD589 \uD30C\uC77C\uC5D0 \uBC88\uB4E4\uB85C \uC81C\uACF5\uB41C \uB3C5\uB9BD\uD615 \uC751\uC6A9 \uD504\uB85C\uADF8\uB7A8\uC758 \n \uC751\uC6A9 \uD504\uB85C\uADF8\uB7A8 \uC2DC\uC791 \uC9C0\uC810\uC744 \uC9C0\uC815\uD569\uB2C8\uB2E4.\n -0 \uC800\uC7A5 \uC804\uC6A9: ZIP \uC555\uCD95\uC744 \uC0AC\uC6A9\uD558\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4.\n -P \uD30C\uC77C \uC774\uB984\uC5D0\uC11C \uC120\uD589 '/'(\uC808\uB300 \uACBD\uB85C) \uBC0F ".."(\uC0C1\uC704 \uB514\uB809\uD1A0\uB9AC) \uAD6C\uC131 \uC694\uC18C\uB97C \uC720\uC9C0\uD569\uB2C8\uB2E4.\n -M \uD56D\uBAA9\uC5D0 \uB300\uD574 Manifest \uD30C\uC77C\uC744 \uC0DD\uC131\uD558\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4.\n -i \uC9C0\uC815\uB41C jar \uD30C\uC77C\uC5D0 \uB300\uD55C \uC778\uB371\uC2A4 \uC815\uBCF4\uB97C \uC0DD\uC131\uD569\uB2C8\uB2E4.\n -C \uC9C0\uC815\uB41C \uB514\uB809\uD1A0\uB9AC\uB85C \uBCC0\uACBD\uD558\uACE0 \uB2E4\uC74C \uD30C\uC77C\uC744 \uD3EC\uD568\uD569\uB2C8\uB2E4.\n\uD2B9\uC815 \uD30C\uC77C\uC774 \uB514\uB809\uD1A0\uB9AC\uC77C \uACBD\uC6B0 \uC21C\uD658\uC801\uC73C\uB85C \uCC98\uB9AC\uB429\uB2C8\uB2E4.\nManifest \uD30C\uC77C \uC774\uB984, \uC544\uCE74\uC774\uBE0C \uD30C\uC77C \uC774\uB984 \uBC0F \uC2DC\uC791 \uC9C0\uC810 \uC774\uB984\uC740\n'm', 'f' \uBC0F 'e' \uD50C\uB798\uADF8\uC640 \uB3D9\uC77C\uD55C \uC21C\uC11C\uB85C \uC9C0\uC815\uB429\uB2C8\uB2E4.\n\n\uC608 1: classes.jar\uB77C\uB294 \uC544\uCE74\uC774\uBE0C\uC5D0 \uB450 \uD074\uB798\uC2A4 \uD30C\uC77C\uC744 \uC544\uCE74\uC774\uBE0C\uD558\uB294 \uBC29\uBC95: \n jar cvf classes.jar Foo.class Bar.class \n\uC608 2: \uAE30\uC874 Manifest \uD30C\uC77C 'mymanifest'\uB97C \uC0AC\uC6A9\uD558\uC5EC\n foo/ \uB514\uB809\uD1A0\uB9AC\uC758 \uBAA8\uB4E0 \uD30C\uC77C\uC744 'classes.jar'\uB85C \uC544\uCE74\uC774\uBE0C\uD558\uB294 \uBC29\uBC95: \n jar cvfm classes.jar mymanifest -C foo/ . +usage=\uC0AC\uC6A9\uBC95: jar {ctxui}[vfmn0PMe] [jar-file] [manifest-file] [entry-point] [-C dir] files ...\n\uC635\uC158:\n -c \uC0C8 \uC544\uCE74\uC774\uBE0C\uB97C \uC0DD\uC131\uD569\uB2C8\uB2E4.\n -t \uC544\uCE74\uC774\uBE0C\uC5D0 \uB300\uD55C \uBAA9\uCC28\uB97C \uB098\uC5F4\uD569\uB2C8\uB2E4.\n -x \uBA85\uBA85\uB41C(\uB610\uB294 \uBAA8\uB4E0) \uD30C\uC77C\uC744 \uC544\uCE74\uC774\uBE0C\uC5D0\uC11C \uCD94\uCD9C\uD569\uB2C8\uB2E4.\n -u \uAE30\uC874 \uC544\uCE74\uC774\uBE0C\uB97C \uC5C5\uB370\uC774\uD2B8\uD569\uB2C8\uB2E4.\n -v \uD45C\uC900 \uCD9C\uB825\uC5D0 \uC0C1\uC138 \uC815\uBCF4 \uCD9C\uB825\uC744 \uC0DD\uC131\uD569\uB2C8\uB2E4.\n -f \uC544\uCE74\uC774\uBE0C \uD30C\uC77C \uC774\uB984\uC744 \uC9C0\uC815\uD569\uB2C8\uB2E4.\n -m \uC9C0\uC815\uB41C Manifest \uD30C\uC77C\uC758 Manifest \uC815\uBCF4\uB97C \uD3EC\uD568\uD569\uB2C8\uB2E4.\n -n \uC0C8 \uC544\uCE74\uC774\uBE0C\uB97C \uC0DD\uC131\uD55C \uD6C4 Pack200 \uC815\uADDC\uD654\uB97C \uC218\uD589\uD569\uB2C8\uB2E4.\n -e jar \uC2E4\uD589 \uD30C\uC77C\uC5D0 \uBC88\uB4E4\uB85C \uC81C\uACF5\uB41C \uB3C5\uB9BD\uD615 \uC560\uD50C\uB9AC\uCF00\uC774\uC158\uC758 \n \uC560\uD50C\uB9AC\uCF00\uC774\uC158 \uC2DC\uC791 \uC9C0\uC810\uC744 \uC9C0\uC815\uD569\uB2C8\uB2E4.\n -0 \uC800\uC7A5 \uC804\uC6A9: ZIP \uC555\uCD95\uC744 \uC0AC\uC6A9\uD558\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4.\n -P \uD30C\uC77C \uC774\uB984\uC5D0\uC11C \uC120\uD589 '/'(\uC808\uB300 \uACBD\uB85C) \uBC0F ".."(\uC0C1\uC704 \uB514\uB809\uD1A0\uB9AC) \uAD6C\uC131 \uC694\uC18C\uB97C \uC720\uC9C0\uD569\uB2C8\uB2E4.\n -M \uD56D\uBAA9\uC5D0 \uB300\uD574 Manifest \uD30C\uC77C\uC744 \uC0DD\uC131\uD558\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4.\n -i \uC9C0\uC815\uB41C jar \uD30C\uC77C\uC5D0 \uB300\uD55C \uC778\uB371\uC2A4 \uC815\uBCF4\uB97C \uC0DD\uC131\uD569\uB2C8\uB2E4.\n -C \uC9C0\uC815\uB41C \uB514\uB809\uD1A0\uB9AC\uB85C \uBCC0\uACBD\uD558\uACE0 \uB2E4\uC74C \uD30C\uC77C\uC744 \uD3EC\uD568\uD569\uB2C8\uB2E4.\n\uD2B9\uC815 \uD30C\uC77C\uC774 \uB514\uB809\uD1A0\uB9AC\uC77C \uACBD\uC6B0 \uC21C\uD658\uC801\uC73C\uB85C \uCC98\uB9AC\uB429\uB2C8\uB2E4.\nManifest \uD30C\uC77C \uC774\uB984, \uC544\uCE74\uC774\uBE0C \uD30C\uC77C \uC774\uB984 \uBC0F \uC2DC\uC791 \uC9C0\uC810 \uC774\uB984\uC740\n'm', 'f' \uBC0F 'e' \uD50C\uB798\uADF8\uC640 \uB3D9\uC77C\uD55C \uC21C\uC11C\uB85C \uC9C0\uC815\uB429\uB2C8\uB2E4.\n\n\uC608 1: classes.jar\uB77C\uB294 \uC544\uCE74\uC774\uBE0C\uC5D0 \uB450 \uD074\uB798\uC2A4 \uD30C\uC77C\uC744 \uC544\uCE74\uC774\uBE0C\uD558\uB294 \uBC29\uBC95: \n jar cvf classes.jar Foo.class Bar.class \n\uC608 2: \uAE30\uC874 Manifest \uD30C\uC77C 'mymanifest'\uB97C \uC0AC\uC6A9\uD558\uC5EC\n foo/ \uB514\uB809\uD1A0\uB9AC\uC758 \uBAA8\uB4E0 \uD30C\uC77C\uC744 'classes.jar'\uB85C \uC544\uCE74\uC774\uBE0C\uD558\uB294 \uBC29\uBC95: \n jar cvfm classes.jar mymanifest -C foo/ .
--- a/src/share/classes/sun/util/resources/TimeZoneNames.java Mon May 09 02:48:06 2016 +0100 +++ b/src/share/classes/sun/util/resources/TimeZoneNames.java Mon May 09 04:37:12 2016 +0100 @@ -275,6 +275,9 @@ String XJT[] = new String[] {"Xinjiang Standard Time", "XJT", "Xinjiang Daylight Time", "XJDT", "Xinjiang Time", "XJT"}; + String YAKT[] = new String[] {"Yakutsk Time", "YAKT", + "Yakutsk Summer Time", "YAKST", + "Yakutsk Time", "YAKT"}; return new Object[][] { {"America/Los_Angeles", PST}, @@ -485,7 +488,7 @@ {"America/Mendoza", AGT}, {"America/Menominee", CST}, {"America/Merida", CST}, - {"America/Metlakatla", PST}, + {"America/Metlakatla", AKST}, {"America/Mexico_City", CST}, {"America/Miquelon", new String[] {"Pierre & Miquelon Standard Time", "PMST", "Pierre & Miquelon Daylight Time", "PMDT", @@ -606,7 +609,7 @@ "Brunei Summer Time", "BNST", "Brunei Time", "BNT"}}, {"Asia/Calcutta", IST}, - {"Asia/Chita", IRKT}, + {"Asia/Chita", YAKT}, {"Asia/Choibalsan", new String[] {"Choibalsan Time", "CHOT", "Choibalsan Summer Time", "CHOST", "Choibalsan Time", "CHOT"}}, @@ -647,10 +650,7 @@ {"Asia/Kashgar", XJT}, {"Asia/Kathmandu", NPT}, {"Asia/Katmandu", NPT}, - {"Asia/Khandyga", new String[] {"Khandyga Time", "YAKT", - "Khandyga Summer Time", "YAKST", - "Khandyga Time", "YAKT"}}, - + {"Asia/Khandyga", YAKT}, {"Asia/Kolkata", IST}, {"Asia/Krasnoyarsk", KRAT}, {"Asia/Kuala_Lumpur", MYT}, @@ -716,9 +716,7 @@ {"Asia/Vladivostok", new String[] {"Vladivostok Time", "VLAT", "Vladivostok Summer Time", "VLAST", "Vladivostok Time", "VLAT"}}, - {"Asia/Yakutsk", new String[] {"Yakutsk Time", "YAKT", - "Yakutsk Summer Time", "YAKST", - "Yakutsk Time", "YAKT"}}, + {"Asia/Yakutsk", YAKT}, {"Asia/Yekaterinburg", new String[] {"Yekaterinburg Time", "YEKT", "Yekaterinburg Summer Time", "YEKST", "Yekaterinburg Time", "YEKT"}},
--- a/src/share/classes/sun/util/resources/de/TimeZoneNames_de.java Mon May 09 02:48:06 2016 +0100 +++ b/src/share/classes/sun/util/resources/de/TimeZoneNames_de.java Mon May 09 04:37:12 2016 +0100 @@ -276,6 +276,9 @@ String XJT[] = new String[] {"Chinesische Normalzeit", "XJT", "Chinesische Sommerzeit", "XJDT", "Zeitzone f\u00FCr China", "XJT"}; + String YAKT[] = new String[] {"Jakutsk Zeit", "YAKT", + "Jakutsk Sommerzeit", "YAKST", + "Jakutsk Zeit", "YAKT"}; return new Object[][] { {"America/Los_Angeles", PST}, @@ -486,7 +489,7 @@ {"America/Mendoza", AGT}, {"America/Menominee", CST}, {"America/Merida", CST}, - {"America/Metlakatla", PST}, + {"America/Metlakatla", AKST}, {"America/Mexico_City", CST}, {"America/Miquelon", new String[] {"Pierre & Miquelon Normalzeit", "PMST", "Pierre & Miquelon Sommerzeit", "PMDT", @@ -607,7 +610,7 @@ "Brunei Sommerzeit", "BNST", "Brunei Zeit", "BNT"}}, {"Asia/Calcutta", IST}, - {"Asia/Chita", IRKT}, + {"Asia/Chita", YAKT}, {"Asia/Choibalsan", new String[] {"Choibalsan Zeit", "CHOT", "Choibalsan Sommerzeit", "CHOST", "Choibalsan Zeit", "CHOT"}}, @@ -648,9 +651,7 @@ {"Asia/Kashgar", XJT}, {"Asia/Kathmandu", NPT}, {"Asia/Katmandu", NPT}, - {"Asia/Khandyga", new String[] {"Chandyga Zeit", "YAKT", - "Chandyga Sommerzeit", "YAKST", - "Chandyga Zeit", "YAKT"}}, + {"Asia/Khandyga", YAKT}, {"Asia/Kolkata", IST}, {"Asia/Krasnoyarsk", KRAT}, {"Asia/Kuala_Lumpur", MYT}, @@ -716,9 +717,7 @@ {"Asia/Vladivostok", new String[] {"Wladiwostok Zeit", "VLAT", "Wladiwostok Sommerzeit", "VLAST", "Wladiwostok Zeit", "VLAT"}}, - {"Asia/Yakutsk", new String[] {"Jakutsk Zeit", "YAKT", - "Jakutsk Sommerzeit", "YAKST", - "Jakutsk Zeit", "YAKT"}}, + {"Asia/Yakutsk", YAKT}, {"Asia/Yekaterinburg", new String[] {"Jekaterinburger Zeit", "YEKT", "Jekaterinburger Sommerzeit", "YEKST", "Jekaterinburger Zeit", "YEKT"}},
--- a/src/share/classes/sun/util/resources/es/TimeZoneNames_es.java Mon May 09 02:48:06 2016 +0100 +++ b/src/share/classes/sun/util/resources/es/TimeZoneNames_es.java Mon May 09 04:37:12 2016 +0100 @@ -276,6 +276,9 @@ String XJT[] = new String[] {"Hora est\u00e1ndar de China", "XJT", "Hora de verano de China", "XJDT", "Hora de China", "XJT"}; + String YAKT[] = new String[] {"Hora de Yakutsk", "YAKT", + "Hora de verano de Yakutsk", "YAKST", + "Hora de Yakutsk", "YAKT"}; return new Object[][] { {"America/Los_Angeles", PST}, @@ -486,7 +489,7 @@ {"America/Mendoza", AGT}, {"America/Menominee", CST}, {"America/Merida", CST}, - {"America/Metlakatla", PST}, + {"America/Metlakatla", AKST}, {"America/Mexico_City", CST}, {"America/Miquelon", new String[] {"Hora est\u00e1ndar de Pierre & Miquelon", "PMST", "Hora de verano de Pierre & Miquelon", "PMDT", @@ -607,7 +610,7 @@ "Hora de verano de Brunei", "BNST", "Hora de Brunei", "BNT"}}, {"Asia/Calcutta", IST}, - {"Asia/Chita", IRKT}, + {"Asia/Chita", YAKT}, {"Asia/Choibalsan", new String[] {"Hora de Choibalsan", "CHOT", "Hora de verano de Choibalsan", "CHOST", "Hora de Choibalsan", "CHOT"}}, @@ -648,9 +651,7 @@ {"Asia/Kashgar", XJT}, {"Asia/Kathmandu", NPT}, {"Asia/Katmandu", NPT}, - {"Asia/Khandyga", new String[] {"Hora de Khandyga", "YAKT", - "Hora de verano de Khandyga", "YAKST", - "Hora de Khandyga", "YAKT"}}, + {"Asia/Khandyga", YAKT}, {"Asia/Kolkata", IST}, {"Asia/Krasnoyarsk", KRAT}, {"Asia/Kuala_Lumpur", MYT}, @@ -716,9 +717,7 @@ {"Asia/Vladivostok", new String[] {"Hora de Vladivostok", "VLAT", "Hora de verano de Vladivostok", "VLAST", "Hora de Vladivostok", "VLAT"}}, - {"Asia/Yakutsk", new String[] {"Hora de Yakutsk", "YAKT", - "Hora de verano de Yakutsk", "YAKST", - "Hora de Yakutsk", "YAKT"}}, + {"Asia/Yakutsk", YAKT}, {"Asia/Yekaterinburg", new String[] {"Hora de Ekaterinburgo", "YEKT", "Hora de verano de Ekaterinburgo", "YEKST", "Hora de Ekaterinburgo", "YEKT"}},
--- a/src/share/classes/sun/util/resources/fr/TimeZoneNames_fr.java Mon May 09 02:48:06 2016 +0100 +++ b/src/share/classes/sun/util/resources/fr/TimeZoneNames_fr.java Mon May 09 04:37:12 2016 +0100 @@ -276,6 +276,9 @@ String XJT[] = new String[] {"Heure normale de Chine", "XJT", "Heure avanc\u00e9e de Chine", "XJDT", "Chine", "XJT"}; + String YAKT[] = new String[] {"Heure du Iakoutsk", "YAKT", + "Heure d'\u00e9t\u00e9 du Iakoutsk", "YAKST", + "Heure du Iakoutsk", "YAKT"}; return new Object[][] { {"America/Los_Angeles", PST}, @@ -486,7 +489,7 @@ {"America/Mendoza", AGT}, {"America/Menominee", CST}, {"America/Merida", CST}, - {"America/Metlakatla", PST}, + {"America/Metlakatla", AKST}, {"America/Mexico_City", CST}, {"America/Miquelon", new String[] {"Heure normale de Saint-Pierre et Miquelon", "PMST", "Heure avanc\u00e9e de Saint-Pierre et Miquelon", "PMDT", @@ -607,7 +610,7 @@ "Heure d'\u00e9t\u00e9 du Brunei", "BNST", "Heure du Brunei", "BNT"}}, {"Asia/Calcutta", IST}, - {"Asia/Chita", IRKT}, + {"Asia/Chita", YAKT}, {"Asia/Choibalsan", new String[] {"Heure de Choibalsan", "CHOT", "Heure d'\u00e9t\u00e9 de Choibalsan", "CHOST", "Heure de Choibalsan", "CHOT"}}, @@ -648,9 +651,7 @@ {"Asia/Kashgar", XJT}, {"Asia/Kathmandu", NPT}, {"Asia/Katmandu", NPT}, - {"Asia/Khandyga", new String[] {"Heure de Khandyga", "YAKT", - "Heure d'\u00E9t\u00E9 de Khandyga", "YAKST", - "Heure de Khandyga", "YAKT"}}, + {"Asia/Khandyga", YAKT}, {"Asia/Kolkata", IST}, {"Asia/Krasnoyarsk", KRAT}, {"Asia/Kuala_Lumpur", MYT}, @@ -716,9 +717,7 @@ {"Asia/Vladivostok", new String[] {"Heure de Vladivostok", "VLAT", "Heure d'\u00e9t\u00e9 de Vladivostok", "VLAST", "Heure de Vladivostok", "VLAT"}}, - {"Asia/Yakutsk", new String[] {"Heure du Iakoutsk", "YAKT", - "Heure d'\u00e9t\u00e9 du Iakoutsk", "YAKST", - "Heure du Iakoutsk", "YAKT"}}, + {"Asia/Yakutsk", YAKT}, {"Asia/Yekaterinburg", new String[] {"Heure de Yekaterinburg", "YEKT", "Heure d'\u00e9t\u00e9 de Yekaterinburg", "YEKST", "Heure de Yekaterinburg", "YEKT"}},
--- a/src/share/classes/sun/util/resources/it/TimeZoneNames_it.java Mon May 09 02:48:06 2016 +0100 +++ b/src/share/classes/sun/util/resources/it/TimeZoneNames_it.java Mon May 09 04:37:12 2016 +0100 @@ -276,6 +276,9 @@ String XJT[] = new String[] {"Ora solare della Cina", "XJT", "Ora legale della Cina", "XJDT", "Ora Cina", "XJT"}; + String YAKT[] = new String[] {"Ora di Jakutsk", "YAKT", + "Ora estiva di Jakutsk", "YAKST", + "Ora di Yakutsk", "YAKT"}; return new Object[][] { {"America/Los_Angeles", PST}, @@ -486,7 +489,7 @@ {"America/Mendoza", AGT}, {"America/Menominee", CST}, {"America/Merida", CST}, - {"America/Metlakatla", PST}, + {"America/Metlakatla", AKST}, {"America/Mexico_City", CST}, {"America/Miquelon", new String[] {"Ora solare di Saint-Pierre e Miquelon", "PMST", "Ora legale di Saint-Pierre e Miquelon", "PMDT", @@ -607,7 +610,7 @@ "Ora estiva del Brunei", "BNST", "Ora del Brunei", "BNT"}}, {"Asia/Calcutta", IST}, - {"Asia/Chita", IRKT}, + {"Asia/Chita", YAKT}, {"Asia/Choibalsan", new String[] {"Ora di Choibalsan", "CHOT", "Ora estiva di Choibalsan", "CHOST", "Ora di Choibalsan", "CHOT"}}, @@ -649,9 +652,7 @@ {"Asia/Kathmandu", NPT}, {"Asia/Katmandu", NPT}, {"Asia/Kolkata", IST}, - {"Asia/Khandyga", new String[] {"Ora di Khandyga", "YAKT", - "Ora estiva di Khandyga", "YAKST", - "Ora di Khandyga", "YAKT"}}, + {"Asia/Khandyga", YAKT}, {"Asia/Krasnoyarsk", KRAT}, {"Asia/Kuala_Lumpur", MYT}, {"Asia/Kuching", MYT}, @@ -716,9 +717,7 @@ {"Asia/Vladivostok", new String[] {"Ora di Vladivostok", "VLAT", "Ora estiva di Vladivostok", "VLAST", "Ora di Vladivostok", "VLAT"}}, - {"Asia/Yakutsk", new String[] {"Ora di Jakutsk", "YAKT", - "Ora estiva di Jakutsk", "YAKST", - "Ora di Yakutsk", "YAKT"}}, + {"Asia/Yakutsk", YAKT}, {"Asia/Yekaterinburg", new String[] {"Ora di Ekaterinburg", "YEKT", "Ora estiva di Ekaterinburg", "YEKST", "Ora di Ekaterinburg", "YEKT"}},
--- a/src/share/classes/sun/util/resources/ja/TimeZoneNames_ja.java Mon May 09 02:48:06 2016 +0100 +++ b/src/share/classes/sun/util/resources/ja/TimeZoneNames_ja.java Mon May 09 04:37:12 2016 +0100 @@ -276,6 +276,9 @@ String XJT[] = new String[] {"\u4e2d\u56fd\u6a19\u6e96\u6642", "XJT", "\u4e2d\u56fd\u590f\u6642\u9593", "XJDT", "\u4E2D\u56FD\u6642\u9593", "XJT"}; + String YAKT[] = new String[] {"\u30e4\u30af\u30fc\u30c4\u30af\u6642\u9593", "YAKT", + "\u30e4\u30af\u30fc\u30c4\u30af\u590f\u6642\u9593", "YAKST", + "\u30E4\u30AF\u30FC\u30C4\u30AF\u6642\u9593", "YAKT"}; return new Object[][] { {"America/Los_Angeles", PST}, @@ -486,7 +489,7 @@ {"America/Mendoza", AGT}, {"America/Menominee", CST}, {"America/Merida", CST}, - {"America/Metlakatla", PST}, + {"America/Metlakatla", AKST}, {"America/Mexico_City", CST}, {"America/Miquelon", new String[] {"\u30b5\u30f3\u30d4\u30a8\u30fc\u30eb\u30fb\u30df\u30af\u30ed\u30f3\u8af8\u5cf6\u6a19\u6e96\u6642", "PMST", "\u30b5\u30f3\u30d4\u30a8\u30fc\u30eb\u30fb\u30df\u30af\u30ed\u30f3\u8af8\u5cf6\u590f\u6642\u9593", "PMDT", @@ -607,7 +610,7 @@ "\u30d6\u30eb\u30cd\u30a4\u590f\u6642\u9593", "BNST", "\u30D6\u30EB\u30CD\u30A4\u6642\u9593", "BNT"}}, {"Asia/Calcutta", IST}, - {"Asia/Chita", IRKT}, + {"Asia/Chita", YAKT}, {"Asia/Choibalsan", new String[] {"\u30c1\u30e7\u30a4\u30d0\u30eb\u30b5\u30f3\u6642\u9593", "CHOT", "\u30c1\u30e7\u30a4\u30d0\u30eb\u30b5\u30f3\u590f\u6642\u9593", "CHOST", "\u30C1\u30E7\u30A4\u30D0\u30EB\u30B5\u30F3\u6642\u9593", "CHOT"}}, @@ -648,9 +651,7 @@ {"Asia/Kashgar", XJT}, {"Asia/Kathmandu", NPT}, {"Asia/Katmandu", NPT}, - {"Asia/Khandyga", new String[] {"\u30CF\u30F3\u30C9\u30A5\u30A4\u30AC\u6642\u9593", "YAKT", - "\u30CF\u30F3\u30C9\u30A5\u30A4\u30AC\u590F\u6642\u9593", "YAKST", - "\u30CF\u30F3\u30C9\u30A5\u30A4\u30AC\u6642\u9593", "YAKT"}}, + {"Asia/Khandyga", YAKT}, {"Asia/Kolkata", IST}, {"Asia/Krasnoyarsk", KRAT}, {"Asia/Kuala_Lumpur", MYT}, @@ -716,9 +717,7 @@ {"Asia/Vladivostok", new String[] {"\u30a6\u30e9\u30b8\u30aa\u30b9\u30c8\u30af\u6642\u9593", "VLAT", "\u30a6\u30e9\u30b8\u30aa\u30b9\u30c8\u30af\u590f\u6642\u9593", "VLAST", "\u30A6\u30E9\u30B8\u30AA\u30B9\u30C8\u30AF\u6642\u9593", "VLAT"}}, - {"Asia/Yakutsk", new String[] {"\u30e4\u30af\u30fc\u30c4\u30af\u6642\u9593", "YAKT", - "\u30e4\u30af\u30fc\u30c4\u30af\u590f\u6642\u9593", "YAKST", - "\u30E4\u30AF\u30FC\u30C4\u30AF\u6642\u9593", "YAKT"}}, + {"Asia/Yakutsk", YAKT}, {"Asia/Yekaterinburg", new String[] {"\u30a8\u30ab\u30c6\u30ea\u30f3\u30d6\u30eb\u30b0\u6642\u9593", "YEKT", "\u30a8\u30ab\u30c6\u30ea\u30f3\u30d6\u30eb\u30b0\u590f\u6642\u9593", "YEKST", "\u30A8\u30AB\u30C6\u30EA\u30F3\u30D6\u30EB\u30AF\u6642\u9593", "YEKT"}},
--- a/src/share/classes/sun/util/resources/ko/TimeZoneNames_ko.java Mon May 09 02:48:06 2016 +0100 +++ b/src/share/classes/sun/util/resources/ko/TimeZoneNames_ko.java Mon May 09 04:37:12 2016 +0100 @@ -276,6 +276,9 @@ String XJT[] = new String[] {"\uc911\uad6d \ud45c\uc900\uc2dc", "XJT", "\uc911\uad6d \uc77c\uad11\uc808\uc57d\uc2dc\uac04", "XJDT", "\uC911\uAD6D \uD45C\uC900\uC2DC", "XJT"}; + String YAKT[] = new String[] {"\uc57c\uce20\ud06c \uc2dc\uac04", "YAKT", + "\uc57c\uce20\ud06c \uc77c\uad11\uc808\uc57d\uc2dc\uac04", "YAKST", + "\uC57C\uCFE0\uCE20\uD06C \uD45C\uC900\uC2DC", "YAKT"}; return new Object[][] { {"America/Los_Angeles", PST}, @@ -486,7 +489,7 @@ {"America/Mendoza", AGT}, {"America/Menominee", CST}, {"America/Merida", CST}, - {"America/Metlakatla", PST}, + {"America/Metlakatla", AKST}, {"America/Mexico_City", CST}, {"America/Miquelon", new String[] {"\ud53c\uc5d0\ub974 \ubbf8\ud06c\ub860 \ud45c\uc900\uc2dc", "PMST", "\ud53c\uc5d0\ub974 \ubbf8\ud06c\ub860 \uc77c\uad11\uc808\uc57d\uc2dc\uac04", "PMDT", @@ -607,7 +610,7 @@ "\ube0c\ub8e8\ub098\uc774 \uc77c\uad11\uc808\uc57d\uc2dc\uac04", "BNST", "\uBE0C\uB8E8\uB098\uC774 \uD45C\uC900\uC2DC", "BNT"}}, {"Asia/Calcutta", IST}, - {"Asia/Chita", IRKT}, + {"Asia/Chita", YAKT}, {"Asia/Choibalsan", new String[] {"Choibalsan \uc2dc\uac04", "CHOT", "Choibalsan \uc77c\uad11\uc808\uc57d\uc2dc\uac04", "CHOST", "\uCD08\uC774\uBC1C\uC0B0 \uD45C\uC900\uC2DC", "CHOT"}}, @@ -648,9 +651,7 @@ {"Asia/Kashgar", XJT}, {"Asia/Kathmandu", NPT}, {"Asia/Katmandu", NPT}, - {"Asia/Khandyga", new String[] {"\uD55C\uB514\uAC00 \uD45C\uC900\uC2DC", "YAKT", - "\uD55C\uB514\uAC00 \uC77C\uAD11 \uC808\uC57D \uC2DC\uAC04", "YAKST", - "\uD55C\uB514\uAC00 \uD45C\uC900\uC2DC", "YAKT"}}, + {"Asia/Khandyga", YAKT}, {"Asia/Kolkata", IST}, {"Asia/Krasnoyarsk", KRAT}, {"Asia/Kuala_Lumpur", MYT}, @@ -716,9 +717,7 @@ {"Asia/Vladivostok", new String[] {"\ube14\ub77c\ub514\ubcf4\uc2a4\ud1a1 \uc2dc\uac04", "VLAT", "\ube14\ub77c\ub514\ubcf4\uc2a4\ud1a1 \uc77c\uad11\uc808\uc57d\uc2dc\uac04", "VLAST", "\uBE14\uB77C\uB514\uBCF4\uC2A4\uD1A1 \uD45C\uC900\uC2DC", "VLAT"}}, - {"Asia/Yakutsk", new String[] {"\uc57c\uce20\ud06c \uc2dc\uac04", "YAKT", - "\uc57c\uce20\ud06c \uc77c\uad11\uc808\uc57d\uc2dc\uac04", "YAKST", - "\uC57C\uCFE0\uCE20\uD06C \uD45C\uC900\uC2DC", "YAKT"}}, + {"Asia/Yakutsk", YAKT}, {"Asia/Yekaterinburg", new String[] {"\uc608\uce74\ud14c\ub9b0\ubc84\uadf8 \uc2dc\uac04", "YEKT", "\uc608\uce74\ud14c\ub9b0\ubc84\uadf8 \uc77c\uad11\uc808\uc57d\uc2dc\uac04", "YEKST", "\uC608\uCE74\uD14C\uB9B0\uBD80\uB974\uD06C \uD45C\uC900\uC2DC", "YEKT"}},
--- a/src/share/classes/sun/util/resources/pt/TimeZoneNames_pt_BR.java Mon May 09 02:48:06 2016 +0100 +++ b/src/share/classes/sun/util/resources/pt/TimeZoneNames_pt_BR.java Mon May 09 04:37:12 2016 +0100 @@ -276,6 +276,9 @@ String XJT[] = new String[] {"Fuso hor\u00e1rio padr\u00e3o da China", "XJT", "Hor\u00e1rio de luz natural da China", "XJDT", "Hor\u00E1rio da China", "XJT"}; + String YAKT[] = new String[] {"Fuso hor\u00e1rio de Yakutsk", "YAKT", + "Fuso hor\u00e1rio de ver\u00e3o de Yakutsk", "YAKST", + "Hor\u00E1rio de Yakutsk", "YAKT"}; return new Object[][] { {"America/Los_Angeles", PST}, @@ -486,7 +489,7 @@ {"America/Mendoza", AGT}, {"America/Menominee", CST}, {"America/Merida", CST}, - {"America/Metlakatla", PST}, + {"America/Metlakatla", AKST}, {"America/Mexico_City", CST}, {"America/Miquelon", new String[] {"Fuso hor\u00e1rio padr\u00e3o de S\u00e3o Pedro e Miquelon", "PMST", "Hor\u00e1rio de luz natural de S\u00e3o Pedro e Miquelon", "PMDT", @@ -607,7 +610,7 @@ "Fuso hor\u00e1rio de ver\u00e3o de Brunei", "BNST", "Hor\u00E1rio de Brunei", "BNT"}}, {"Asia/Calcutta", IST}, - {"Asia/Chita", IRKT}, + {"Asia/Chita", YAKT}, {"Asia/Choibalsan", new String[] {"Fuso hor\u00e1rio de Choibalsan", "CHOT", "Fuso hor\u00e1rio de ver\u00e3o de Choibalsan", "CHOST", "Hor\u00E1rio de Choibalsan", "CHOT"}}, @@ -648,9 +651,7 @@ {"Asia/Kashgar", XJT}, {"Asia/Kathmandu", NPT}, {"Asia/Katmandu", NPT}, - {"Asia/Khandyga", new String[] {"Hor\u00E1rio de Khandyga", "YAKT", - "Hor\u00E1rio de Ver\u00E3o de Khandyga", "YAKST", - "Hor\u00E1rio de Khandyga", "YAKT"}}, + {"Asia/Khandyga", YAKT}, {"Asia/Kolkata", IST}, {"Asia/Krasnoyarsk", KRAT}, {"Asia/Kuala_Lumpur", MYT}, @@ -716,9 +717,7 @@ {"Asia/Vladivostok", new String[] {"Fuso hor\u00e1rio de Vladivostok", "VLAT", "Fuso hor\u00e1rio de ver\u00e3o de Vladivostok", "VLAST", "Hor\u00E1rio de Vladivostok", "VLAT"}}, - {"Asia/Yakutsk", new String[] {"Fuso hor\u00e1rio de Yakutsk", "YAKT", - "Fuso hor\u00e1rio de ver\u00e3o de Yakutsk", "YAKST", - "Hor\u00E1rio de Yakutsk", "YAKT"}}, + {"Asia/Yakutsk", YAKT}, {"Asia/Yekaterinburg", new String[] {"Fuso hor\u00e1rio de Yekaterinburgo", "YEKT", "Fuso hor\u00e1rio de ver\u00e3o de Yekaterinburgo", "YEKST", "Hor\u00E1rio de Yekaterinburg", "YEKT"}},
--- a/src/share/classes/sun/util/resources/sv/TimeZoneNames_sv.java Mon May 09 02:48:06 2016 +0100 +++ b/src/share/classes/sun/util/resources/sv/TimeZoneNames_sv.java Mon May 09 04:37:12 2016 +0100 @@ -276,6 +276,9 @@ String XJT[] = new String[] {"Kina, normaltid", "XJT", "Kina, sommartid", "XJDT", "Kinesisk tid", "XJT"}; + String YAKT[] = new String[] {"Jakutsk, normaltid", "YAKT", + "Jakutsk, sommartid", "YAKST", + "Jakutsk-tid", "YAKT"}; return new Object[][] { {"America/Los_Angeles", PST}, @@ -486,7 +489,7 @@ {"America/Mendoza", AGT}, {"America/Menominee", CST}, {"America/Merida", CST}, - {"America/Metlakatla", PST}, + {"America/Metlakatla", AKST}, {"America/Mexico_City", CST}, {"America/Miquelon", new String[] {"Saint-Pierre-et-Miquelon, normaltid", "PMST", "Saint-Pierre-et-Miquelon, sommartid", "PMDT", @@ -612,7 +615,7 @@ "Choibalsan-tid", "CHOT"}}, {"Asia/Chongqing", CTT}, {"Asia/Chungking", CTT}, - {"Asia/Chita", IRKT}, + {"Asia/Chita", YAKT}, {"Asia/Colombo", IST}, {"Asia/Dacca", BDT}, {"Asia/Dhaka", BDT}, @@ -648,9 +651,7 @@ {"Asia/Kashgar", XJT}, {"Asia/Kathmandu", NPT}, {"Asia/Katmandu", NPT}, - {"Asia/Khandyga", new String[] {"Khandyga, normaltid", "YAKT", - "Khandyga, sommartid", "YAKST", - "Khandyga, normaltid", "YAKT"}}, + {"Asia/Khandyga", YAKT}, {"Asia/Kolkata", IST}, {"Asia/Krasnoyarsk", KRAT}, {"Asia/Kuala_Lumpur", MYT}, @@ -716,9 +717,7 @@ {"Asia/Vladivostok", new String[] {"Vladivostok, normaltid", "VLAT", "Vladivostok, sommartid", "VLAST", "Vladivostok-tid", "VLAT"}}, - {"Asia/Yakutsk", new String[] {"Jakutsk, normaltid", "YAKT", - "Jakutsk, sommartid", "YAKST", - "Jakutsk-tid", "YAKT"}}, + {"Asia/Yakutsk", YAKT}, {"Asia/Yekaterinburg", new String[] {"Jekaterinburg, normaltid", "YEKT", "Jekaterinburg, sommartid", "YEKST", "Jekaterinburg-tid", "YEKT"}},
--- a/src/share/classes/sun/util/resources/zh/TimeZoneNames_zh_CN.java Mon May 09 02:48:06 2016 +0100 +++ b/src/share/classes/sun/util/resources/zh/TimeZoneNames_zh_CN.java Mon May 09 04:37:12 2016 +0100 @@ -276,6 +276,9 @@ String XJT[] = new String[] {"\u4e2d\u56fd\u6807\u51c6\u65f6\u95f4", "XJT", "\u4e2d\u56fd\u590f\u4ee4\u65f6", "XJDT", "\u4E2D\u56FD\u65F6\u95F4", "XJT"}; + String YAKT[] = new String[] {"\u4e9a\u5e93\u6b21\u514b\u65f6\u95f4", "YAKT", + "\u4e9a\u5e93\u6b21\u514b\u590f\u4ee4\u65f6", "YAKST", + "\u4E9A\u5E93\u6B21\u514B\u65F6\u95F4", "YAKT"}; return new Object[][] { {"America/Los_Angeles", PST}, @@ -486,7 +489,7 @@ {"America/Mendoza", AGT}, {"America/Menominee", CST}, {"America/Merida", CST}, - {"America/Metlakatla", PST}, + {"America/Metlakatla", AKST}, {"America/Mexico_City", CST}, {"America/Miquelon", new String[] {"\u76ae\u57c3\u5c14\u5c9b\u53ca\u5bc6\u514b\u9686\u5c9b\u6807\u51c6\u65f6\u95f4", "PMST", "\u76ae\u57c3\u5c14\u5c9b\u53ca\u5bc6\u514b\u9686\u5c9b\u590f\u4ee4\u65f6", "PMDT", @@ -607,7 +610,7 @@ "\u6587\u83b1\u590f\u4ee4\u65f6", "BNST", "\u6587\u83B1\u65F6\u95F4", "BNT"}}, {"Asia/Calcutta", IST}, - {"Asia/Chita", IRKT}, + {"Asia/Chita", YAKT}, {"Asia/Choibalsan", new String[] {"Choibalsan \u65f6\u95f4", "CHOT", "Choibalsan \u590f\u4ee4\u65f6", "CHOST", "Choibalsan \u65F6\u95F4", "CHOT"}}, @@ -648,9 +651,7 @@ {"Asia/Kashgar", XJT}, {"Asia/Kathmandu", NPT}, {"Asia/Katmandu", NPT}, - {"Asia/Khandyga", new String[] {"\u6C49\u5FB7\u52A0\u65F6\u95F4", "YAKT", - "\u6C49\u5FB7\u52A0\u590F\u4EE4\u65F6", "YAKST", - "\u6C49\u5FB7\u52A0\u65F6\u95F4", "YAKT"}}, + {"Asia/Khandyga", YAKT}, {"Asia/Kolkata", IST}, {"Asia/Krasnoyarsk", KRAT}, {"Asia/Kuala_Lumpur", MYT}, @@ -716,9 +717,7 @@ {"Asia/Vladivostok", new String[] {"\u6d77\u53c2\u5d34\u65f6\u95f4", "VLAT", "\u6d77\u53c2\u5d34\u590f\u4ee4\u65f6", "VLAST", "\u6D77\u53C2\u5D34\u65F6\u95F4", "VLAT"}}, - {"Asia/Yakutsk", new String[] {"\u4e9a\u5e93\u6b21\u514b\u65f6\u95f4", "YAKT", - "\u4e9a\u5e93\u6b21\u514b\u590f\u4ee4\u65f6", "YAKST", - "\u4E9A\u5E93\u6B21\u514B\u65F6\u95F4", "YAKT"}}, + {"Asia/Yakutsk", YAKT}, {"Asia/Yekaterinburg", new String[] {"Yekaterinburg \u65f6\u95f4", "YEKT", "Yekaterinburg \u590f\u4ee4\u65f6", "YEKST", "Yekaterinburg \u65F6\u95F4", "YEKT"}},
--- a/src/share/classes/sun/util/resources/zh/TimeZoneNames_zh_TW.java Mon May 09 02:48:06 2016 +0100 +++ b/src/share/classes/sun/util/resources/zh/TimeZoneNames_zh_TW.java Mon May 09 04:37:12 2016 +0100 @@ -276,6 +276,9 @@ String XJT[] = new String[] {"\u4e2d\u570b\u6a19\u6e96\u6642\u9593", "XJT", "\u4e2d\u570b\u65e5\u5149\u7bc0\u7d04\u6642\u9593", "XJDT", "\u4E2D\u570B\u6642\u9593", "XJT"}; + String YAKT[] = new String[] {"\u4e9e\u5eab\u6b21\u514b\u6642\u9593", "YAKT", + "\u4e9e\u5eab\u6b21\u514b\u590f\u4ee4\u6642\u9593", "YAKST", + "\u4E9E\u5EAB\u6B21\u514B\u6642\u9593", "YAKT"}; return new Object[][] { {"America/Los_Angeles", PST}, @@ -486,7 +489,7 @@ {"America/Mendoza", AGT}, {"America/Menominee", CST}, {"America/Merida", CST}, - {"America/Metlakatla", PST}, + {"America/Metlakatla", AKST}, {"America/Mexico_City", CST}, {"America/Miquelon", new String[] {"\u76ae\u57c3\u723e\u5cf6\u53ca\u5bc6\u514b\u9686\u5cf6\u6a19\u6e96\u6642\u9593", "PMST", "\u76ae\u57c3\u723e\u5cf6\u53ca\u5bc6\u514b\u9686\u5cf6\u65e5\u5149\u7bc0\u7d04\u6642\u9593", "PMDT", @@ -607,7 +610,7 @@ "\u6c76\u840a\u590f\u4ee4\u6642\u9593", "BNST", "\u6C76\u840A\u6642\u9593", "BNT"}}, {"Asia/Calcutta", IST}, - {"Asia/Chita", IRKT}, + {"Asia/Chita", YAKT}, {"Asia/Choibalsan", new String[] {"\u5de7\u5df4\u5c71 (Choibalsan) \u6642\u9593", "CHOT", "\u5de7\u5df4\u5c71 (Choibalsan) \u590f\u4ee4\u6642\u9593", "CHOST", "\u5DE7\u5DF4\u5C71 (Choibalsan) \u6642\u9593", "CHOT"}}, @@ -648,9 +651,7 @@ {"Asia/Kashgar", XJT}, {"Asia/Kathmandu", NPT}, {"Asia/Katmandu", NPT}, - {"Asia/Khandyga", new String[] {"\u6F22\u5730\u52A0 (Khandyga) \u6642\u9593", "YAKT", - "\u6F22\u5730\u52A0 (Khandyga) \u590F\u4EE4\u6642\u9593", "YAKST", - "\u6F22\u5730\u52A0 (Khandyga) \u6642\u9593", "YAKT"}}, + {"Asia/Khandyga", YAKT}, {"Asia/Kolkata", IST}, {"Asia/Krasnoyarsk", KRAT}, {"Asia/Kuala_Lumpur", MYT}, @@ -718,9 +719,7 @@ {"Asia/Vladivostok", new String[] {"\u6d77\u53c3\u5d34\u6642\u9593", "VLAT", "\u6d77\u53c3\u5d34\u590f\u4ee4\u6642\u9593", "VLAST", "\u6D77\u53C3\u5D34\u6642\u9593", "VLAT"}}, - {"Asia/Yakutsk", new String[] {"\u4e9e\u5eab\u6b21\u514b\u6642\u9593", "YAKT", - "\u4e9e\u5eab\u6b21\u514b\u590f\u4ee4\u6642\u9593", "YAKST", - "\u4E9E\u5EAB\u6B21\u514B\u6642\u9593", "YAKT"}}, + {"Asia/Yakutsk", YAKT}, {"Asia/Yekaterinburg", new String[] {"Yekaterinburg \u6642\u9593", "YEKT", "Yekaterinburg \u590f\u4ee4\u6642\u9593", "YEKST", "\u8449\u5361\u6377\u7433\u5821\u6642\u9593", "YEKT"}},
--- a/src/share/demo/jvmti/hprof/hprof_class.c Mon May 09 02:48:06 2016 +0100 +++ b/src/share/demo/jvmti/hprof/hprof_class.c Mon May 09 04:37:12 2016 +0100 @@ -529,6 +529,11 @@ info = get_info(index); if (mnum >= info->method_count) { jclass newExcCls = (*env)->FindClass(env, "java/lang/IllegalArgumentException"); + if ((*env)->ExceptionCheck(env)) { + (*env)->ExceptionClear(env); + HPROF_ERROR(JNI_TRUE, + "Could not find the java/lang/IllegalArgumentException class"); + } (*env)->ThrowNew(env, newExcCls, "Illegal mnum"); return NULL; @@ -542,6 +547,11 @@ name = (char *)string_get(info->method[mnum].name_index); if (name==NULL) { jclass newExcCls = (*env)->FindClass(env, "java/lang/IllegalArgumentException"); + if ((*env)->ExceptionCheck(env)) { + (*env)->ExceptionClear(env); + HPROF_ERROR(JNI_TRUE, + "Could not find the java/lang/IllegalArgumentException class"); + } (*env)->ThrowNew(env, newExcCls, "Name not found"); return NULL;
--- a/src/share/demo/jvmti/hprof/hprof_event.c Mon May 09 02:48:06 2016 +0100 +++ b/src/share/demo/jvmti/hprof/hprof_event.c Mon May 09 04:37:12 2016 +0100 @@ -197,6 +197,11 @@ HPROF_ASSERT(thread!=NULL); if (cnum == 0 || cnum == gdata->tracker_cnum) { jclass newExcCls = (*env)->FindClass(env, "java/lang/IllegalArgumentException"); + if ((*env)->ExceptionCheck(env)) { + (*env)->ExceptionClear(env); + HPROF_ERROR(JNI_TRUE, + "Could not find the java/lang/IllegalArgumentException class"); + } (*env)->ThrowNew(env, newExcCls, "Illegal cnum."); return; @@ -258,6 +263,11 @@ if (cnum == 0 || cnum == gdata->tracker_cnum) { jclass newExcCls = (*env)->FindClass(env, "java/lang/IllegalArgumentException"); + if ((*env)->ExceptionCheck(env)) { + (*env)->ExceptionClear(env); + HPROF_ERROR(JNI_TRUE, + "Could not find the java/lang/IllegalArgumentException class"); + } (*env)->ThrowNew(env, newExcCls, "Illegal cnum."); return;
--- a/src/share/demo/jvmti/hprof/hprof_util.c Mon May 09 02:48:06 2016 +0100 +++ b/src/share/demo/jvmti/hprof/hprof_util.c Mon May 09 04:37:12 2016 +0100 @@ -374,7 +374,10 @@ HPROF_ASSERT(env!=NULL); HPROF_ASSERT(object!=NULL); - gref = JNI_FUNC_PTR(env,NewWeakGlobalRef)(env, object); + CHECK_EXCEPTIONS (env) { + gref = JNI_FUNC_PTR(env,NewWeakGlobalRef)(env, object); + } END_CHECK_EXCEPTIONS; + HPROF_ASSERT(gref!=NULL); return gref; }
--- a/src/share/native/common/jdk_util.c Mon May 09 02:48:06 2016 +0100 +++ b/src/share/native/common/jdk_util.c Mon May 09 04:37:12 2016 +0100 @@ -52,7 +52,8 @@ const char* jdk_update_string = JDK_UPDATE_VERSION; unsigned int jdk_update_version = 0; - char update_ver[3]; + int len_update_ver = 0; + char update_ver[5]; char jdk_special_version = '\0'; /* If the JDK_BUILD_NUMBER is of format bXX and XX is an integer @@ -78,16 +79,17 @@ assert(jdk_build_number >= 0 && jdk_build_number <= 255); - if (strlen(jdk_update_string) == 2 || strlen(jdk_update_string) == 3) { - if (isdigit(jdk_update_string[0]) && isdigit(jdk_update_string[1])) { - update_ver[0] = jdk_update_string[0]; - update_ver[1] = jdk_update_string[1]; - update_ver[2] = '\0'; - jdk_update_version = (unsigned int) atoi(update_ver); - if (strlen(jdk_update_string) == 3) { - jdk_special_version = jdk_update_string[2]; - } + len_update_ver = strlen(jdk_update_string); + if (len_update_ver >= 2 && len_update_ver <= 4) { + int update_digits = len_update_ver; + + if (!isdigit(jdk_update_string[len_update_ver - 1])) { + jdk_special_version = jdk_update_string[len_update_ver -1]; + update_digits = len_update_ver - 1; } + strncpy(update_ver, jdk_update_string, update_digits); + update_ver[update_digits] = '\0'; + jdk_update_version = (unsigned int) atoi(update_ver); } memset(info, 0, info_size);
--- a/src/share/native/sun/awt/image/jpeg/imageioJPEG.c Mon May 09 02:48:06 2016 +0100 +++ b/src/share/native/sun/awt/image/jpeg/imageioJPEG.c Mon May 09 04:37:12 2016 +0100 @@ -1610,6 +1610,7 @@ int ret; int h_samp0, h_samp1, h_samp2; int v_samp0, v_samp1, v_samp2; + int cid0, cid1, cid2; jboolean retval = JNI_FALSE; imageIODataPtr data = (imageIODataPtr)jlong_to_ptr(ptr); j_decompress_ptr cinfo; @@ -1711,17 +1712,15 @@ } } else if (!cinfo->saw_JFIF_marker && !IS_EXIF(cinfo)) { /* - * IJG assumes all unidentified 3-channels are YCbCr. - * We assume that only if the second two channels are - * subsampled (either horizontally or vertically). If not, - * we assume RGB. - * - * 4776576: Some digital cameras output YCbCr JPEG images - * that do not contain a JFIF APP0 marker but are only - * vertically subsampled (no horizontal subsampling). - * We should only assume this is RGB data if the subsampling - * factors for the second two channels are the same as the - * first (check both horizontal and vertical factors). + * In the absence of certain markers, IJG has interpreted + * component id's of [1,2,3] as meaning YCbCr.We follow that + * interpretation, which is additionally described in the Image + * I/O JPEG metadata spec.If that condition is not met here the + * next step will be to examine the subsampling factors, if + * there is any difference in subsampling factors we also assume + * YCbCr, only if both horizontal and vertical subsampling + * is same we assume JPEG color space as RGB. + * This is also described in the Image I/O JPEG metadata spec. */ h_samp0 = cinfo->comp_info[0].h_samp_factor; h_samp1 = cinfo->comp_info[1].h_samp_factor; @@ -1731,8 +1730,13 @@ v_samp1 = cinfo->comp_info[1].v_samp_factor; v_samp2 = cinfo->comp_info[2].v_samp_factor; - if ((h_samp1 == h_samp0) && (h_samp2 == h_samp0) && - (v_samp1 == v_samp0) && (v_samp2 == v_samp0)) + cid0 = cinfo->comp_info[0].component_id; + cid1 = cinfo->comp_info[1].component_id; + cid2 = cinfo->comp_info[2].component_id; + + if ((!(cid0 == 1 && cid1 == 2 && cid2 == 3)) && + ((h_samp1 == h_samp0) && (h_samp2 == h_samp0) && + (v_samp1 == v_samp0) && (v_samp2 == v_samp0))) { cinfo->jpeg_color_space = JCS_RGB; /* output is already RGB, so it stays the same */
--- a/src/share/native/sun/font/layout/DeviceTables.cpp Mon May 09 02:48:06 2016 +0100 +++ b/src/share/native/sun/font/layout/DeviceTables.cpp Mon May 09 04:37:12 2016 +0100 @@ -45,9 +45,12 @@ le_int16 DeviceTable::getAdjustment(const LEReferenceTo<DeviceTable>&base, le_uint16 ppem, LEErrorCode &success) const { + le_int16 result = 0; + if (LE_FAILURE(success)) { + return result; + } le_uint16 start = SWAPW(startSize); le_uint16 format = SWAPW(deltaFormat) - 1; - le_int16 result = 0; if (ppem >= start && ppem <= SWAPW(endSize) && format < FORMAT_COUNT) { le_uint16 sizeIndex = ppem - start;
--- a/src/share/native/sun/font/layout/LigatureSubstProc.cpp Mon May 09 02:48:06 2016 +0100 +++ b/src/share/native/sun/font/layout/LigatureSubstProc.cpp Mon May 09 04:37:12 2016 +0100 @@ -71,6 +71,10 @@ { LEErrorCode success = LE_NO_ERROR; const LigatureSubstitutionStateEntry *entry = entryTable.getAlias(index, success); + if (LE_FAILURE(success)) { + currGlyph++; + return 0; + } ByteOffset newState = SWAPW(entry->newStateOffset); le_uint16 flags = SWAPW(entry->flags); @@ -91,6 +95,10 @@ if (actionOffset != 0) { LEReferenceTo<LigatureActionEntry> ap(stHeader, success, actionOffset); + if (LE_FAILURE(success)) { + currGlyph++; + return newState; + } LigatureActionEntry action; le_int32 offset, i = 0, j = 0; le_int32 stack[nComponents]; @@ -101,6 +109,10 @@ if (j++ > 0) { ap.addObject(success); + if (LE_FAILURE(success)) { + currGlyph++; + return newState; + } } action = SWAPL(*ap.getAlias()); @@ -124,9 +136,17 @@ return newState; // get out! bad font } i += SWAPW(offsetTable.getObject(LE_GET_GLYPH(glyphStorage[componentGlyph]), success)); + if (LE_FAILURE(success)) { + currGlyph++; + return newState; + } if (action & (lafLast | lafStore)) { LEReferenceTo<TTGlyphID> ligatureOffset(stHeader, success, i); + if (LE_FAILURE(success)) { + currGlyph++; + return newState; + } TTGlyphID ligatureGlyph = SWAPW(*ligatureOffset.getAlias()); glyphStorage[componentGlyph] = LE_SET_GLYPH(glyphStorage[componentGlyph], ligatureGlyph);
--- a/src/share/native/sun/font/layout/LigatureSubstProc2.cpp Mon May 09 02:48:06 2016 +0100 +++ b/src/share/native/sun/font/layout/LigatureSubstProc2.cpp Mon May 09 04:37:12 2016 +0100 @@ -95,6 +95,10 @@ if (actionOffset != 0) { LEReferenceTo<LigatureActionEntry> ap(stHeader, success, ligActionOffset); // byte offset + if (LE_FAILURE(success)) { + currGlyph+= dir; + return nextStateIndex; + } ap.addObject(ligActionIndex, success); LEReferenceToArrayOf<TTGlyphID> ligatureTable(stHeader, success, ligatureOffset, LE_UNBOUNDED_ARRAY); LigatureActionEntry action; @@ -114,6 +118,10 @@ if (j++ > 0) { ap.addObject(success); } + if (LE_FAILURE(success)) { + currGlyph+= dir; + return nextStateIndex; + } action = SWAPL(*ap.getAlias()); @@ -129,9 +137,17 @@ return nextStateIndex; // get out! bad font } i += SWAPW(componentTable(LE_GET_GLYPH(glyphStorage[componentGlyph]) + (SignExtend(offset, lafComponentOffsetMask)),success)); + if (LE_FAILURE(success)) { + currGlyph+= dir; + return nextStateIndex; + } if (action & (lafLast | lafStore)) { TTGlyphID ligatureGlyph = SWAPW(ligatureTable(i,success)); + if (LE_FAILURE(success)) { + currGlyph+= dir; + return nextStateIndex; + } glyphStorage[componentGlyph] = LE_SET_GLYPH(glyphStorage[componentGlyph], ligatureGlyph); if(mm==nComponents) { LE_DEBUG_BAD_FONT("exceeded nComponents");
--- a/src/share/native/sun/font/layout/StateTableProcessor2.cpp Mon May 09 02:48:06 2016 +0100 +++ b/src/share/native/sun/font/layout/StateTableProcessor2.cpp Mon May 09 04:37:12 2016 +0100 @@ -60,6 +60,7 @@ entryTableOffset = SWAPL(stHeader->entryTableOffset); classTable = LEReferenceTo<LookupTable>(stHeader, success, classTableOffset); + if (LE_FAILURE(success)) return; format = SWAPW(classTable->format); stateArray = LEReferenceToArrayOf<EntryTableIndex2>(stHeader, success, stateArrayOffset, LE_UNBOUNDED_ARRAY);
--- a/src/share/native/sun/java2d/cmm/lcms/cmscgats.c Mon May 09 02:48:06 2016 +0100 +++ b/src/share/native/sun/java2d/cmm/lcms/cmscgats.c Mon May 09 04:37:12 2016 +0100 @@ -2545,9 +2545,11 @@ for (i=0; i < t->nSamples; i++) { fld = GetDataFormat(it8, i); + if (fld != NULL) { if (cmsstrcasecmp(fld, cSample) == 0) return i; } + } return -1;
--- a/src/share/native/sun/misc/URLClassPath.c Mon May 09 02:48:06 2016 +0100 +++ b/src/share/native/sun/misc/URLClassPath.c Mon May 09 04:37:12 2016 +0100 @@ -52,7 +52,7 @@ clname = getUTF(env, classname, buf, sizeof(buf)); if (clname == NULL) { - JNU_ThrowOutOfMemoryError(env, NULL); + // getUTF() throws OOME before returning NULL, no need to throw OOME here return result; } VerifyFixClassname(clname); @@ -94,7 +94,7 @@ resname = getUTF(env, resource_name, buf, sizeof(buf)); if (resname == NULL) { - JNU_ThrowOutOfMemoryError(env, NULL); + // getUTF() throws OOME before returning NULL, no need to throw OOME here return result; } result = JVM_GetResourceLookupCache(env, loader, resname);
--- a/src/solaris/native/sun/awt/fontpath.c Mon May 09 02:48:06 2016 +0100 +++ b/src/solaris/native/sun/awt/fontpath.c Mon May 09 04:37:12 2016 +0100 @@ -1155,8 +1155,8 @@ continue; } pattern = (*FcNameParse)((FcChar8 *)fcName); + (*env)->ReleaseStringUTFChars(env, fcNameStr, (const char*)fcName); if (pattern == NULL) { - (*env)->ReleaseStringUTFChars(env, fcNameStr, (const char*)fcName); closeFontConfig(libfontconfig, JNI_FALSE); return; } @@ -1174,7 +1174,6 @@ fontset = (*FcFontSort)(NULL, pattern, FcTrue, NULL, &result); if (fontset == NULL) { (*FcPatternDestroy)(pattern); - (*env)->ReleaseStringUTFChars(env, fcNameStr, (const char*)fcName); closeFontConfig(libfontconfig, JNI_FALSE); return; } @@ -1206,7 +1205,6 @@ } (*FcPatternDestroy)(pattern); (*FcFontSetDestroy)(fontset); - (*env)->ReleaseStringUTFChars(env, fcNameStr, (const char*)fcName); closeFontConfig(libfontconfig, JNI_FALSE); return; } @@ -1248,8 +1246,6 @@ free(file); (*FcPatternDestroy)(pattern); (*FcFontSetDestroy)(fontset); - (*env)->ReleaseStringUTFChars(env, - fcNameStr, (const char*)fcName); closeFontConfig(libfontconfig, JNI_FALSE); return; } @@ -1297,6 +1293,16 @@ if (includeFallbacks) { fcFontArr = (*env)->NewObjectArray(env, fontCount, fcFontClass, NULL); + if (IS_NULL(fcFontArr)) { + free(family); + free(fullname); + free(styleStr); + free(file); + (*FcPatternDestroy)(pattern); + (*FcFontSetDestroy)(fontset); + closeFontConfig(libfontconfig, JNI_FALSE); + return; + } (*env)->SetObjectField(env,fcCompFontObj, fcAllFontsID, fcFontArr); } fn=0; @@ -1305,18 +1311,23 @@ if (family[j] != NULL) { jobject fcFont = (*env)->NewObject(env, fcFontClass, fcFontCons); + if (IS_NULL(fcFont)) break; jstr = (*env)->NewStringUTF(env, (const char*)family[j]); + if (IS_NULL(jstr)) break; (*env)->SetObjectField(env, fcFont, familyNameID, jstr); if (file[j] != NULL) { jstr = (*env)->NewStringUTF(env, (const char*)file[j]); + if (IS_NULL(jstr)) break; (*env)->SetObjectField(env, fcFont, fontFileID, jstr); } if (styleStr[j] != NULL) { jstr = (*env)->NewStringUTF(env, (const char*)styleStr[j]); + if (IS_NULL(jstr)) break; (*env)->SetObjectField(env, fcFont, styleNameID, jstr); } if (fullname[j] != NULL) { jstr = (*env)->NewStringUTF(env, (const char*)fullname[j]); + if (IS_NULL(jstr)) break; (*env)->SetObjectField(env, fcFont, fullNameID, jstr); } if (fn==0) { @@ -1330,7 +1341,6 @@ } } } - (*env)->ReleaseStringUTFChars (env, fcNameStr, (const char*)fcName); (*FcFontSetDestroy)(fontset); (*FcPatternDestroy)(pattern); free(family);
--- a/src/windows/classes/sun/awt/windows/WPathGraphics.java Mon May 09 02:48:06 2016 +0100 +++ b/src/windows/classes/sun/awt/windows/WPathGraphics.java Mon May 09 04:37:12 2016 +0100 @@ -494,24 +494,48 @@ */ float fontSize = font.getSize2D(); + double devResX = wPrinterJob.getXRes(); + double devResY = wPrinterJob.getYRes(); + + double fontDevScaleY = devResY / DEFAULT_USER_RES; + + int orient = getPageFormat().getOrientation(); + if (orient == PageFormat.LANDSCAPE || + orient == PageFormat.REVERSE_LANDSCAPE) + { + double tmp = devResX; + devResX = devResY; + devResY = tmp; + } + + double devScaleX = devResX / DEFAULT_USER_RES; + double devScaleY = devResY / DEFAULT_USER_RES; + fontTransform.scale(1.0/devScaleX, 1.0/devScaleY); + Point2D.Double pty = new Point2D.Double(0.0, 1.0); fontTransform.deltaTransform(pty, pty); double scaleFactorY = Math.sqrt(pty.x*pty.x+pty.y*pty.y); - float scaledFontSizeY = (float)(fontSize * scaleFactorY); + float scaledFontSizeY = (float)(fontSize * scaleFactorY * fontDevScaleY); Point2D.Double ptx = new Point2D.Double(1.0, 0.0); fontTransform.deltaTransform(ptx, ptx); double scaleFactorX = Math.sqrt(ptx.x*ptx.x+ptx.y*ptx.y); - float scaledFontSizeX = (float)(fontSize * scaleFactorX); float awScale = getAwScale(scaleFactorX, scaleFactorY); int iangle = getAngle(ptx); + ptx = new Point2D.Double(1.0, 0.0); + deviceTransform.deltaTransform(ptx, ptx); + double advanceScaleX = Math.sqrt(ptx.x*ptx.x+ptx.y*ptx.y); + pty = new Point2D.Double(0.0, 1.0); + deviceTransform.deltaTransform(pty, pty); + double advanceScaleY = Math.sqrt(pty.x*pty.x+pty.y*pty.y); + Font2D font2D = FontUtilities.getFont2D(font); if (font2D instanceof TrueTypeFont) { textOut(str, font, (TrueTypeFont)font2D, frc, scaledFontSizeY, iangle, awScale, - deviceTransform, scaleFactorX, + advanceScaleX, advanceScaleY, x, y, devpos.x, devpos.y, targetW); } else if (font2D instanceof CompositeFont) { /* Composite fonts are made up of multiple fonts and each @@ -542,7 +566,7 @@ PhysicalFont slotFont = compFont.getSlotFont(slot); textOut(substr, font, slotFont, frc, scaledFontSizeY, iangle, awScale, - deviceTransform, scaleFactorX, + advanceScaleX, advanceScaleY, userx, usery, devx, devy, 0f); Rectangle2D bds = font.getStringBounds(substr, frc); float xAdvance = (float)bds.getWidth(); @@ -635,18 +659,42 @@ */ float fontSize = font.getSize2D(); + double devResX = wPrinterJob.getXRes(); + double devResY = wPrinterJob.getYRes(); + + double fontDevScaleY = devResY / DEFAULT_USER_RES; + + int orient = getPageFormat().getOrientation(); + if (orient == PageFormat.LANDSCAPE || + orient == PageFormat.REVERSE_LANDSCAPE) + { + double tmp = devResX; + devResX = devResY; + devResY = tmp; + } + + double devScaleX = devResX / DEFAULT_USER_RES; + double devScaleY = devResY / DEFAULT_USER_RES; + fontTransform.scale(1.0/devScaleX, 1.0/devScaleY); + Point2D.Double pty = new Point2D.Double(0.0, 1.0); fontTransform.deltaTransform(pty, pty); double scaleFactorY = Math.sqrt(pty.x*pty.x+pty.y*pty.y); - float scaledFontSizeY = (float)(fontSize * scaleFactorY); + float scaledFontSizeY = (float)(fontSize * scaleFactorY * fontDevScaleY); - Point2D.Double pt = new Point2D.Double(1.0, 0.0); - fontTransform.deltaTransform(pt, pt); - double scaleFactorX = Math.sqrt(pt.x*pt.x+pt.y*pt.y); - float scaledFontSizeX = (float)(fontSize * scaleFactorX); + Point2D.Double ptx = new Point2D.Double(1.0, 0.0); + fontTransform.deltaTransform(ptx, ptx); + double scaleFactorX = Math.sqrt(ptx.x*ptx.x+ptx.y*ptx.y); float awScale = getAwScale(scaleFactorX, scaleFactorY); - int iangle = getAngle(pt); + int iangle = getAngle(ptx); + + ptx = new Point2D.Double(1.0, 0.0); + deviceTransform.deltaTransform(ptx, ptx); + double advanceScaleX = Math.sqrt(ptx.x*ptx.x+ptx.y*ptx.y); + pty = new Point2D.Double(0.0, 1.0); + deviceTransform.deltaTransform(pty, pty); + double advanceScaleY = Math.sqrt(pty.x*pty.x+pty.y*pty.y); int numGlyphs = gv.getNumGlyphs(); int[] glyphCodes = gv.getGlyphCodes(0, numGlyphs, null); @@ -705,8 +753,7 @@ * rotation element of the deviceTransform. */ AffineTransform advanceTransform = - new AffineTransform(deviceTransform); - advanceTransform.rotate(iangle*Math.PI/1800.0); + AffineTransform.getScaleInstance(advanceScaleX, advanceScaleY); float[] glyphAdvPos = new float[glyphPos.length]; advanceTransform.transform(glyphPos, 0, //source @@ -784,8 +831,7 @@ Font font, PhysicalFont font2D, FontRenderContext frc, float deviceSize, int rotation, float awScale, - AffineTransform deviceTransform, - double scaleFactorX, + double scaleFactorX, double scaleFactorY, float userx, float usery, float devx, float devy, float targetW) { @@ -826,8 +872,7 @@ * See earlier comment in printGlyphVector() for details. */ AffineTransform advanceTransform = - new AffineTransform(deviceTransform); - advanceTransform.rotate(rotation*Math.PI/1800.0); + AffineTransform.getScaleInstance(scaleFactorX, scaleFactorY); float[] glyphAdvPos = new float[glyphPos.length]; advanceTransform.transform(glyphPos, 0, //source @@ -841,11 +886,11 @@ /* If 2D and GDI agree on the advance of the string we do not * need to explicitly assign glyph positions. * If we are to use the GDI advance, require it to agree with - * JDK to a precision of <= 0.2% - ie 1 pixel in 500 + * JDK to a precision of <= 1.0% - ie 1 pixel in 100 * discrepancy after rounding the 2D advance to the * nearest pixel and is greater than one pixel in total. - * ie strings < 500 pixels in length will be OK so long - * as they differ by only 1 pixel even though that is > 0.02% + * ie strings < 100 pixels in length will be OK so long + * as they differ by only 1 pixel even though that is > 1% * The bounds from 2D are in user space so need to * be scaled to device space for comparison with GDI. * scaleX is the scale from user space to device space needed for this. @@ -863,7 +908,7 @@ if (ratio < 1) { ratio = 1/ratio; } - return diff <= 1 || ratio < 1.002; + return diff <= 1 || ratio < 1.01; } return true; }
--- a/src/windows/classes/sun/security/mscapi/KeyStore.java Mon May 09 02:48:06 2016 +0100 +++ b/src/windows/classes/sun/security/mscapi/KeyStore.java Mon May 09 04:37:12 2016 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2015, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -312,7 +312,7 @@ if (alias.equals(entry.getAlias())) { X509Certificate[] certChain = entry.getCertificateChain(); - return certChain[0]; + return certChain.length == 0 ? null : certChain[0]; } } @@ -842,7 +842,7 @@ // Obtain certificate factory if (certificateFactory == null) { - certificateFactory = CertificateFactory.getInstance("X.509"); + certificateFactory = CertificateFactory.getInstance("X.509", "SUN"); } // Generate certificate
--- a/src/windows/native/sun/java2d/d3d/D3DBlitLoops.cpp Mon May 09 02:48:06 2016 +0100 +++ b/src/windows/native/sun/java2d/d3d/D3DBlitLoops.cpp Mon May 09 04:37:12 2016 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2007, 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2007, 2016, 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 @@ -508,8 +508,10 @@ RETURN_STATUS_IF_NULL(srcOps->pResource, E_FAIL); RETURN_STATUS_IF_NULL(dstOps->pResource, E_FAIL); - if ((pSrc = srcOps->pResource->GetTexture()) == NULL || - FAILED(res = d3dc->BeginScene(STATE_TEXTUREOP) || + pSrc = srcOps->pResource->GetTexture(); + RETURN_STATUS_IF_NULL(pSrc, E_FAIL); + + if (FAILED(res = d3dc->BeginScene(STATE_TEXTUREOP) || FAILED(res = d3dc->SetTexture(pSrc)))) { J2dRlsTraceLn(J2D_TRACE_ERROR,
--- a/src/windows/native/sun/java2d/d3d/D3DTextRenderer.cpp Mon May 09 02:48:06 2016 +0100 +++ b/src/windows/native/sun/java2d/d3d/D3DTextRenderer.cpp Mon May 09 04:37:12 2016 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2007, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2007, 2016, 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 @@ -355,7 +355,7 @@ jint dx1, dy1, dx2, dy2; D3DResource *pCachedDestTexRes; IDirect3DSurface9 *pCachedDestSurface, *pDst; - HRESULT res; + HRESULT res = S_OK; if (isCachedDestValid && INSIDE(gx1, gy1, gx2, gy2, cachedDestBounds)) { // glyph is already within the cached destination bounds; no need
--- a/src/windows/native/sun/windows/ShellFolder2.cpp Mon May 09 02:48:06 2016 +0100 +++ b/src/windows/native/sun/windows/ShellFolder2.cpp Mon May 09 04:37:12 2016 +0100 @@ -673,6 +673,9 @@ case STRRET_WSTR : wstr = strret.pOleStr; break; + + default: + return NULL; } IShellLinkW* psl;
--- a/src/windows/native/sun/windows/awt_Component.cpp Mon May 09 02:48:06 2016 +0100 +++ b/src/windows/native/sun/windows/awt_Component.cpp Mon May 09 04:37:12 2016 +0100 @@ -5200,6 +5200,8 @@ message = WM_MBUTTONDOWN; break; case java_awt_event_MouseEvent_BUTTON2: message = WM_RBUTTONDOWN; break; + default: + return; } break; } @@ -5211,6 +5213,8 @@ message = WM_MBUTTONUP; break; case java_awt_event_MouseEvent_BUTTON2: message = WM_RBUTTONUP; break; + default: + return; } break; }
--- a/src/windows/native/sun/windows/awt_DesktopProperties.cpp Mon May 09 02:48:06 2016 +0100 +++ b/src/windows/native/sun/windows/awt_DesktopProperties.cpp Mon May 09 04:37:12 2016 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2016, 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 @@ -388,7 +388,7 @@ } BOOL fontSmoothing = FALSE, settingsChanged; - UINT fontSmoothingType=0, fontSmoothingContrast=0, subPixelOrder; + UINT fontSmoothingType=0, fontSmoothingContrast=0, subPixelOrder=0; if (firstTime) { SystemParametersInfo(SPI_GETFONTSMOOTHING, 0, &fontSmoothing, 0);
--- a/src/windows/native/sun/windows/awt_Font.cpp Mon May 09 02:48:06 2016 +0100 +++ b/src/windows/native/sun/windows/awt_Font.cpp Mon May 09 04:37:12 2016 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1996, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1996, 2015, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -270,7 +270,7 @@ cfnum = 0; } - LPCWSTR wName; + LPCWSTR wName = NULL; awtFont = new AwtFont(cfnum, env, font); @@ -1168,7 +1168,7 @@ } LONG AwtFontCache::IncRefCount(Item* item){ - LONG newVal; + LONG newVal = 0; if(NULL != item){ newVal = InterlockedIncrement((long*)&item->refCount); @@ -1177,7 +1177,7 @@ } LONG AwtFontCache::DecRefCount(Item* item){ - LONG newVal; + LONG newVal = 0; if(NULL != item){ newVal = InterlockedDecrement((long*)&item->refCount);
--- a/src/windows/native/sun/windows/awt_Frame.cpp Mon May 09 02:48:06 2016 +0100 +++ b/src/windows/native/sun/windows/awt_Frame.cpp Mon May 09 04:37:12 2016 +0100 @@ -156,7 +156,7 @@ PDATA pData; HWND hwndParent = NULL; - AwtFrame* frame; + AwtFrame* frame = NULL; jclass cls = NULL; jclass inputMethodWindowCls = NULL; jobject target = NULL; @@ -993,7 +993,9 @@ AwtComponent::SetFocusedWindow(GetHWnd()); } else { - if (!::IsWindow(AwtWindow::GetModalBlocker(opposite))) { + if (::IsWindow(AwtWindow::GetModalBlocker(opposite))) { + return mrConsume; + } else { // If deactivation happens because of press on grabbing // window - this is nonsense, since grabbing window is // assumed to have focus and watch for deactivation. But
--- a/src/windows/native/sun/windows/awt_Label.cpp Mon May 09 02:48:06 2016 +0100 +++ b/src/windows/native/sun/windows/awt_Label.cpp Mon May 09 04:37:12 2016 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1996, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1996, 2016, 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 @@ -146,15 +146,16 @@ jint alignment = env->GetIntField(target, AwtLabel::alignmentID); switch (alignment) { - case java_awt_Label_LEFT: - x = r.left + 2; - break; case java_awt_Label_CENTER: x = (r.left + r.right - size.cx) / 2; break; case java_awt_Label_RIGHT: x = r.right - 2 - size.cx; break; + case java_awt_Label_LEFT: + default: + x = r.left + 2; + break; } /* draw string */ if (isEnabled()) {
--- a/src/windows/native/sun/windows/awt_PrintJob.cpp Mon May 09 02:48:06 2016 +0100 +++ b/src/windows/native/sun/windows/awt_PrintJob.cpp Mon May 09 04:37:12 2016 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1996, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1996, 2016, 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 @@ -1108,7 +1108,7 @@ // check for collation HGLOBAL hDevNames = AwtPrintControl::getPrintHDName(env, self); if (hDevNames != NULL) { - DWORD dmFields; + DWORD dmFields = 0; DEVNAMES *devnames = (DEVNAMES *)::GlobalLock(hDevNames); if (devnames != NULL) {
--- a/src/windows/native/sun/windows/awt_TextComponent.cpp Mon May 09 02:48:06 2016 +0100 +++ b/src/windows/native/sun/windows/awt_TextComponent.cpp Mon May 09 04:37:12 2016 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1996, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1996, 2016, 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 @@ -129,6 +129,7 @@ scroll_style = WS_HSCROLL | ES_AUTOHSCROLL | ES_AUTOVSCROLL; break; case java_awt_TextArea_SCROLLBARS_BOTH: + default: scroll_style = WS_VSCROLL | WS_HSCROLL | ES_AUTOVSCROLL | ES_AUTOHSCROLL; break;
--- a/test/TEST.groups Mon May 09 02:48:06 2016 +0100 +++ b/test/TEST.groups Mon May 09 04:37:12 2016 +0100 @@ -287,7 +287,7 @@ # - compact1, compact2, compact3, full JRE, JDK # # In addition they support testing of the minimal VM on compact1 and compact2. -# Essentially this defines groups based around the specified API's and VM +# Essentially this defines groups based around the specified API's and VM # services available in the runtime. # # The groups are defined hierarchically in two forms: @@ -342,13 +342,17 @@ sun/management/jmxremote/bootstrap/JvmstatCountersTest.java \ sun/management/jmxremote/bootstrap/LocalManagementTest.java \ sun/management/jmxremote/bootstrap/CustomLauncherTest.java \ + sun/management/jmxremote/startstop \ sun/misc/JarIndex/metaInfFilenames/Basic.java \ sun/misc/JarIndex/JarIndexMergeForClassLoaderTest.java \ sun/reflect/CallerSensitive/CallerSensitiveFinder.java \ sun/reflect/CallerSensitive/MissingCallerSensitive.java \ sun/security/util/Resources/NewNamesFormat.java \ vm/verifier/defaultMethods/DefaultMethodRegressionTestsRun.java \ - javax/xml/ws/clientjar/TestWsImport.java + javax/xml/bind/jxc \ + javax/xml/ws/8033113 \ + javax/xml/ws/clientjar/TestWsImport.java \ + javax/xml/ws/ebcdic # JRE adds further tests to compact3 # @@ -389,8 +393,10 @@ javax/management/mxbean/LeakTest.java \ javax/management/mxbean/MXBeanTest.java \ javax/management/mxbean/PropertyNamesTest.java \ + javax/xml/ws/8043129 \ jdk/lambda/vm/InterfaceAccessFlagsTest.java \ - sun/misc/URLClassPath/ClassnameCharTest.java + sun/misc/URLClassPath/ClassnameCharTest.java \ + sun/security/pkcs11/Provider/Login.sh # Tests dependent on the optional charsets.jar # These are isolated for easy exclusions @@ -517,7 +523,7 @@ -:needs_jdk # Tests that require compact2 API's and a full VM -# +# needs_full_vm_compact2 = # Minimal VM on Compact 2 adds in some compact2 tests @@ -538,7 +544,9 @@ com/sun/net/httpserver \ java/sql \ javax/sql \ - javax/xml \ + javax/xml/bind \ + javax/xml/jaxp \ + javax/xml/ws/xsanymixed \ jdk/lambda \ sun/net/www/http \ sun/net/www/protocol/http \ @@ -601,7 +609,7 @@ java/util/zip/ZipFile/DeleteTempJar.java \ javax/crypto/Cipher/CipherStreamClose.java \ sun/security/ssl/sun/net/www/protocol/https/HttpsURLConnection/HttpsCreateSockTest.java \ - sun/security/ssl/sun/net/www/protocol/https/HttpsURLConnection/HttpsSocketFacTest.java + sun/security/ssl/sun/net/www/protocol/https/HttpsURLConnection/HttpsSocketFacTest.java # Compact 1 adds full VM tests #
--- a/test/com/sun/jdi/CatchPatternTest.sh Mon May 09 02:48:06 2016 +0100 +++ b/test/com/sun/jdi/CatchPatternTest.sh Mon May 09 04:37:12 2016 +0100 @@ -35,44 +35,44 @@ cat <<EOF > $classname.java.1 public class $classname { public void bark(int i) { - System.out.println(" bark: " + i); - switch (i) { - case 0: - throw new IllegalArgumentException("IllegalArgumentException"); - case 1: - throw new ArithmeticException("ArithmeticException"); - case 2: - throw new IllegalMonitorStateException("IllegalMonitorStateException"); - case 3: - throw new IndexOutOfBoundsException("IndexOutOfBoundsException"); - default: - throw new Error("should not happen"); - } + System.out.println(" bark: " + i); + switch (i) { + case 0: + throw new IllegalArgumentException("IllegalArgumentException"); + case 1: + throw new ArithmeticException("ArithmeticException"); + case 2: + throw new IllegalMonitorStateException("IllegalMonitorStateException"); + case 3: + throw new IndexOutOfBoundsException("IndexOutOfBoundsException"); + default: + throw new Error("should not happen"); + } } public void loop(int max) { - for (int i = 0; i <= max; i++) { - try { - bark(i); - } catch(RuntimeException re) { - System.out.println(" loop: " + re.getMessage() + - " caught and ignored."); - } - } + for (int i = 0; i <= max; i++) { + try { + bark(i); + } catch(RuntimeException re) { + System.out.println(" loop: " + re.getMessage() + + " caught and ignored."); + } + } } public void partOne() { loop(2); - System.out.println("partOne completed"); + System.out.println("partOne completed"); } public void partTwo() { loop(3); - System.out.println("partTwo completed"); + System.out.println("partTwo completed"); } public static void main(String[] args) { - System.out.println("Howdy!"); + System.out.println("Howdy!"); $classname my = new $classname(); - my.partOne(); - my.partTwo(); - System.out.println("Goodbye from $classname!"); + my.partOne(); + my.partTwo(); + System.out.println("Goodbye from $classname!"); } } EOF
--- a/test/com/sun/jdi/GetLocalVariables4Test.sh Mon May 09 02:48:06 2016 +0100 +++ b/test/com/sun/jdi/GetLocalVariables4Test.sh Mon May 09 04:37:12 2016 +0100 @@ -39,12 +39,12 @@ public class GetLocalVariables4Targ { public static void main(String[] args) { System.out.println("Howdy!"); - int i = 0; - try { - i = 16 / i; - } catch(Exception e) { - System.out.println("e should be visible"); // @1 breakpoint - } + int i = 0; + try { + i = 16 / i; + } catch(Exception e) { + System.out.println("e should be visible"); // @1 breakpoint + } System.out.println("Goodbye from GetLocalVariables4Targ!"); } }
--- a/test/com/sun/jdi/JdbReadTwiceTest.sh Mon May 09 02:48:06 2016 +0100 +++ b/test/com/sun/jdi/JdbReadTwiceTest.sh Mon May 09 04:37:12 2016 +0100 @@ -204,22 +204,6 @@ clean fi - -if [ ! -r c:/ ] ; then - # Can't make a file unreadable under MKS. - echo - echo "+++++++++++++++++++++++++++++++++++" - echo "Read an unreadable file - verify the read fails." - # If the file exists, we try to read it. The - # read will fail. - mkFiles $HOME/jdb.ini - chmod a-r $HOME/jdb.ini - doit - failIfNot 1 "open: $HOME/jdb.ini" - clean -fi - - echo echo "+++++++++++++++++++++++++++++++++++" echo "Read a directory - verify the read fails" @@ -239,8 +223,8 @@ doit failIfNot 1 "from $fred" - if [ ! -r c:/ ] ; then - # Can't make a file unreadable under MKS + if [ "$canMakeUnreadable" = "Yes" ] + then chmod a-r $fred doit failIfNot 1 "open: $fred"
--- a/test/com/sun/jdi/NullLocalVariable.sh Mon May 09 02:48:06 2016 +0100 +++ b/test/com/sun/jdi/NullLocalVariable.sh Mon May 09 04:37:12 2016 +0100 @@ -40,10 +40,10 @@ public static final void main(String args[]) { try { System.out.println("hi!"); // @1 breakpoint - } catch (Exception e) { + } catch (Exception e) { e.printStackTrace(); } finally { - System.out.println("done"); + System.out.println("done"); } } } @@ -54,11 +54,11 @@ dojdbCmds() { #set -x - cmd stop at badscope:4 ; $sleepcmd - runToBkpt ; $sleepcmd - cmd next ; $sleepcmd - cmd next ; $sleepcmd - cmd locals ; $sleepcmd + cmd stop at badscope:4 ; $sleepcmd + runToBkpt ; $sleepcmd + cmd next ; $sleepcmd + cmd next ; $sleepcmd + cmd locals ; $sleepcmd cmd cont } @@ -71,7 +71,7 @@ for ii in . $TESTSRC $TESTSRC/.. ; do if [ -r "$ii/ShellScaffold.sh" ] ; then - . $ii/ShellScaffold.sh + . $ii/ShellScaffold.sh break fi done
--- a/test/com/sun/jdi/PrivateTransportTest.sh Mon May 09 02:48:06 2016 +0100 +++ b/test/com/sun/jdi/PrivateTransportTest.sh Mon May 09 04:37:12 2016 +0100 @@ -67,9 +67,9 @@ # is given on the command line, tell the user that and use a default. # THIS IS THE JDK BEING TESTED. if [ -n "$1" ] ; then - TESTJAVA=$1 + TESTJAVA=$1 else - TESTJAVA=$JAVA_HOME + TESTJAVA=$JAVA_HOME fi TESTSRC=. TESTCLASSES=.
--- a/test/com/sun/jdi/RedefineFinal.sh Mon May 09 02:48:06 2016 +0100 +++ b/test/com/sun/jdi/RedefineFinal.sh Mon May 09 04:37:12 2016 +0100 @@ -42,15 +42,15 @@ public final class $1 { public int m1(int i) { - // @1 uncomment System.out.println("I'm here"); - return m2(i, 1000); + // @1 uncomment System.out.println("I'm here"); + return m2(i, 1000); } public int m2(int i, int j) { - if (i < 0 || j < 0) { // @1 breakpoint + if (i < 0 || j < 0) { // @1 breakpoint throw new IllegalArgumentException(); - } - return i+j; + } + return i+j; } $1() { @@ -59,7 +59,7 @@ } public static void main(String args[]) { - new $1(); + new $1(); } } EOF
--- a/test/com/sun/jdi/RedefineIntConstantToLong.sh Mon May 09 02:48:06 2016 +0100 +++ b/test/com/sun/jdi/RedefineIntConstantToLong.sh Mon May 09 04:37:12 2016 +0100 @@ -44,18 +44,18 @@ public long m1(int i) { long r=0; r = m2(i * 2); // @1 commentout - // @1 uncomment r =m2(i * 2L); + // @1 uncomment r =m2(i * 2L); return r; } public long m2(int j) { - System.out.println(System.getProperty("line.separator") + + System.out.println(System.getProperty("line.separator") + "**** public long m2(int j) with value: " + j); return j; } public long m2(long j) { - System.out.println(System.getProperty("line.separator") + + System.out.println(System.getProperty("line.separator") + "**** public long m2(long j) with value: " + j); return j; } @@ -66,7 +66,7 @@ r1 = m1(1000); r2 = 0; // @1 breakpoint r2 = m1(1000); - if (r1 != r2) { // @1 breakpoint + if (r1 != r2) { // @1 breakpoint throw new Exception("FAILURE: Expected value: " + r1 + " Actual value: " + r2); } else { System.out.println("SUCCESS: Expected value: " + r1 + " Actual value: " + r2); @@ -74,7 +74,7 @@ } public static void main(String args[]) throws Exception { - new $1().doit(); + new $1().doit(); } } EOF
--- a/test/com/sun/jdi/ShellScaffold.sh Mon May 09 02:48:06 2016 +0100 +++ b/test/com/sun/jdi/ShellScaffold.sh Mon May 09 04:37:12 2016 +0100 @@ -43,11 +43,11 @@ # in your java file # classname=<classnam> Omit this to use the default class name, 'shtest'. -# compileOptions=<string> compile options for at least the first compile, +# compileOptions=<string> compile options for at least the first compile, # eg, compileOptions=-g # compileOptions2=<string> Options for the 2nd, ..., compile. compileOptions1 # is used if this is not set. To use no compile -# options for the 2nd ... compiles, do +# options for the 2nd ... compiles, do # compileOptions2=none # # mode=-Xcomp or mode=-Xint to run in these modes. These should not @@ -88,12 +88,12 @@ # # The only other tag supported is @1 breakpoint. The setbkpts function # sets bkpts at all lines that contain this string. -# +# # Currently, all these tags are start with @1. It is envisioned that this script # could be ehanced to allow multiple cycles of redefines by allowing # @2, @3, ... tags. IE, processing the @i tags in the ith version of # the file will produce the i+1th version of the file. -# +# # There are problem with jtreg leaving behind orphan java and jdb processes # when this script is run. Sometimes, on some platforms, it just doesn't # get them all killed properly. @@ -110,7 +110,7 @@ # # mks 6.2a on win 98 presents two problems: # $! returns the PID as a negative number whereas ps returns -# it in the form 0xFFF.... This means our trick of +# it in the form 0xFFF.... This means our trick of # of using $! to get the PIDs of the jdb and debuggee processes # doesn't work. This will cause some error cases to fail # with a jtreg timeout instead of failing more gracefully. @@ -167,7 +167,7 @@ # then use ps to find the cygwin pid to be killed. # The form of a ps output line is # ^ ddddd dddd dddd dddd.* - # where the 4th digits are the win pid and the first + # where the 4th digits are the win pid and the first # are the cygwin pid. if [ -r "$jdk/bin/$jstack" ] ; then winPid=`$jdk/bin/jps -v | $grep -i $str | sed -e 's@ .*@@'` @@ -181,7 +181,7 @@ awk '{print $1}' | tr '\n\r' ' '` fi else - # Well, too bad - we can't find what to kill. + # Well, too bad - we can't find what to kill. toBeKilled= fi fi @@ -190,35 +190,31 @@ echo "$1: kill -9 $toBeKilled" >& 2 kill -9 $toBeKilled fi -} +} findPid() { # Return 0 if $1 is the pid of a running process. - if [ -z "$isWin98" ] ; then - if [ "$osname" = SunOS ] ; then - # Solaris and OpenSolaris use pgrep and not ps in psCmd - findPidCmd="$psCmd" - elif [ "$osname" = AIX ] ; then - findPidCmd="$psCmd" - else + case "$osname" in + SunOS | AIX) + $psCmd | $grep '^ *'"$1 " > $devnull 2>&1 + res=$? + ;; + Windows* | CYGWIN*) + # Don't use ps on cygwin since it sometimes misses + # some processes (!). + tasklist /NH | $grep " $1 " > $devnull 2>&1 + res=$? + ;; + *) # Never use plain 'ps', which requires a "controlling terminal" # and will fail with a "ps: no controlling terminal" error. # Running under 'rsh' will cause this ps error. - # cygwin ps puts an I in column 1 for some reason. - findPidCmd="$psCmd -e" - fi - $findPidCmd | $grep '^I* *'"$1 " > $devnull 2>&1 - return $? - fi - - # mks 6.2a on win98 has $! getting a negative - # number and in ps, it shows up as 0x... - # Thus, we can't search in ps output for - # PIDs gotten via $! - # We don't know if it is running or not - assume it is. - # We don't really care about win98 anymore. - return 0 + $psCmd -e | $grep '^ *'"$1 " > $devnull 2>&1 + res=$? + ;; + esac + return $res } setup() @@ -245,20 +241,13 @@ echo "--Error: TESTJAVA must be defined as the pathname of a jdk to test." exit 1 fi - + ulimitCmd= osname=`uname -s` - isWin98= isCygwin= case "$osname" in - Windows* | CYGWIN*) + Windows* | CYGWIN*) devnull=NUL - if [ "$osname" = Windows_98 -o "$osname" = Windows_ME ]; then - isWin98=1 - debuggeeKeyword='we_cant_kill_debuggees_on_win98' - jdbKeyword='jdb\.exe' - fi - case "$osname" in CYGWIN*) isCygwin=1 @@ -373,12 +362,12 @@ ####################################################3 ####################################################3 ####################################################3 -# sol: this gets all processes killed but +# sol: this gets all processes killed but # no jstack # linux same as above # win mks: No dice; processes still running trap "cleanup" 0 1 2 3 4 6 9 10 15 - + jdbOptions="$jdbOptions -J-D${jdbKeyword}" } @@ -397,7 +386,7 @@ cp $classname.java.1 $classname.java echo "--Compiling first version of `pwd`/$classname.java with options: $compileOptions" # Result is in $pkgSlash$classname.class - + if [ -z "$javacCmd" ] ; then javacCmd=$jdk/bin/javac fi @@ -435,7 +424,7 @@ if [ $? = 0 ] ; then break fi - echo + echo echo "--Compiling second version of `pwd`/$classname.java with $compileOptions" $javacCmd $compileOptions -d . $classname.java if [ $? != 0 ] ; then @@ -464,7 +453,7 @@ if [ $? = 0 ] ; then break fi - echo + echo echo "--Compiling third version of `pwd`/$classname.java with $compileOptions" $javacCmd $compileOptions -d . $classname.java if [ $? != 0 ] ; then @@ -490,7 +479,7 @@ if [ $? = 0 ] ; then break fi - echo + echo echo "--Compiling fourth version of `pwd`/$classname.java with $compileOptions" $javacCmd $compileOptions -d . $classname.java if [ $? != 0 ] ; then @@ -523,7 +512,7 @@ # If it ever becomes necessary to send a jdb command before # a main[10] form of prompt appears, then this # code will have to be modified. -cmd() +cmd() { if [ $1 = quit -o -r "$failFile" ] ; then # if jdb got a cont cmd that caused the debuggee @@ -540,21 +529,21 @@ # in the pipeline. exit 1 fi - + # $jdbOutFile always exists here and is non empty - # because after starting jdb, we waited + # because after starting jdb, we waited # for the prompt. fileSize=`wc -c $jdbOutFile | awk '{ print $1 }'` echo "--Sending cmd: " $* >&2 # jjh: We have a few intermittent failures here. # It is as if every so often, jdb doesn't - # get the first cmd that is sent to it here. + # get the first cmd that is sent to it here. # (actually, I have seen it get the first cmd ok, # but then not get some subsequent cmd). # It seems like jdb really doesn't get the cmd; jdb's response # does not appear in the jxdboutput file. It contains: - # main[1] + # main[1] # The application has been disconnected # Is it possible @@ -569,7 +558,7 @@ # msg output below after the timeout. # And, we know jdb is started because the main[1] output is in the .jtr # file. And, we wouldn't have gotten here if mydojdbcmds hadn't - # seen the ]. + # seen the ]. echo $* # Now we have to wait for the next jdb prompt. We wait for a pattern @@ -605,7 +594,7 @@ # i.e., the > prompt comes out AFTER the prompt we we need to wait for. # # So, how do we know when the next prompt has appeared?? - # 1. Search for + # 1. Search for # main[89] $ # This will handle cases 1, 2, 3 # 2. This leaves cases 4 and 5. @@ -715,7 +704,7 @@ allowExit="$3" myCount=0 timeLimit=40 # wait a max of this many secs for a response from a jdb command - while [ 1 = 1 ] ; do + while [ 1 = 1 ] ; do if [ -r $jdbOutFile ] ; then # Something here causes jdb to complain about Unrecognized cmd on x86. tail -$nlines $jdbOutFile | $grep -s "$1" > $devnull 2>&1 @@ -723,27 +712,27 @@ # Found desired string break fi - fi - tail -2 $jdbOutFile | $grep -s "The application exited" > $devnull 2>&1 - if [ $? = 0 ] ; then + fi + tail -2 $jdbOutFile | $grep -s "The application exited" > $devnull 2>&1 + if [ $? = 0 ] ; then # Found 'The application exited' if [ ! -z "$allowExit" ] ; then break fi # Otherwise, it is an error if we don't find $1 - if [ -r $jdbOutFile ] ; then - tail -$nlines $jdbOutFile | $grep -s "$1" > $devnull 2>&1 + if [ -r $jdbOutFile ] ; then + tail -$nlines $jdbOutFile | $grep -s "$1" > $devnull 2>&1 if [ $? = 0 ] ; then - break - fi - fi - dofail "Waited for jdb msg $1, but it never appeared" - fi + break + fi + fi + dofail "Waited for jdb msg $1, but it never appeared" + fi sleep ${sleep_seconds} findPid $topPid if [ $? != 0 ] ; then - # Top process is dead. We better die too + echo "--Top process ($topPid) is dead. We better die too" >&2 dojstack exit 1 fi @@ -788,7 +777,7 @@ } -redefineClass() +redefineClass() { if [ -z "$1" ] ; then vers=2 @@ -796,7 +785,7 @@ vers=`echo $1 | sed -e 's/@//'` vers=`expr $vers + 1` fi - + cmd redefine $pkgDot$classname $tmpFileDir/vers$vers/$classname.class cp $tmpFileDir/$classname.java.$vers \ @@ -853,7 +842,7 @@ if [ -r $TESTCLASSES/../@debuggeeVMOptions ] ; then args=`cat $TESTCLASSES/../@debuggeeVMOptions` fi - + if [ ! -z "$args" ] ; then echo "--Starting debuggee with args from @debuggeeVMOptions: $args" else @@ -931,12 +920,6 @@ if [ $? != 0 ] ; then break fi - if [ ! -z "$isWin98" ] ; then - $psCmd | $grep -i 'JDB\.EXE' >$devnull 2>&1 - if [ $? != 0 ] ; then - break; - fi - fi $grep -s 'Input stream closed' $jdbOutFile > $devnull 2>&1 if [ $? = 0 ] ; then #something went wrong @@ -970,7 +953,7 @@ theCmd="tail -$3" fi - case "$2" in + case "$2" in *\>*) # Target string contains a '>' so we better not ignore it $theCmd $1 | $grep -s "$2" > $devnull 2>&1 @@ -1016,7 +999,7 @@ theCmd="tail -$3" fi - case "$2" in + case "$2" in *\>*) # Target string contains a '>' so we better not ignore it res=`$theCmd $1 | sed -e "$2"` @@ -1136,7 +1119,7 @@ runitAfterSetup() { docompile - startJdb + startJdb startDebuggee waitForFinish
--- a/test/com/sun/jdi/StringConvertTest.sh Mon May 09 02:48:06 2016 +0100 +++ b/test/com/sun/jdi/StringConvertTest.sh Mon May 09 04:37:12 2016 +0100 @@ -23,7 +23,7 @@ # questions. # -# @test @(#)StringConvertTest.sh 1.6 03/04/09 +# @test # @bug 4511950 4843082 # @summary 1. jdb's expression evaluation doesn't perform string conversion properly # 2. TTY: run on expression evaluation
--- a/test/com/sun/jdi/SuspendNoFlagTest.sh Mon May 09 02:48:06 2016 +0100 +++ b/test/com/sun/jdi/SuspendNoFlagTest.sh Mon May 09 04:37:12 2016 +0100 @@ -68,9 +68,9 @@ # is given on the command line, tell the user that and use a default. # THIS IS THE JDK BEING TESTED. if [ -n "$1" ] ; then - TESTJAVA=$1 + TESTJAVA=$1 else - TESTJAVA=$JAVA_HOME + TESTJAVA=$JAVA_HOME fi TESTSRC=. TESTCLASSES=.
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test/java/awt/Component/TreeLockDeadlock/TreeLockDeadlock.java Mon May 09 04:37:12 2016 +0100 @@ -0,0 +1,88 @@ +/* + * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +import java.awt.Frame; +import java.awt.GraphicsConfiguration; +import java.awt.Window; + +import static java.util.concurrent.TimeUnit.MINUTES; +import static java.util.concurrent.TimeUnit.NANOSECONDS; + +/** + * @test + * @bug 8138764 + */ +public final class TreeLockDeadlock extends Frame { + + @Override + public synchronized GraphicsConfiguration getGraphicsConfiguration() { + return super.getGraphicsConfiguration(); + } + + @Override + public synchronized void reshape(int x, int y, int width, int height) { + super.reshape(x, y, width, height); + } + + @Override + public synchronized float getOpacity() { + return super.getOpacity(); + } + + public static void main(final String[] args) throws Exception { + final Window window = new TreeLockDeadlock(); + window.setSize(300, 300); + test(window); + } + + private static void test(final Window window) throws Exception { + final long start = System.nanoTime(); + final long end = start + NANOSECONDS.convert(1, MINUTES); + + final Runnable r1 = () -> { + while (System.nanoTime() < end) { + window.setBounds(window.getBounds()); + } + }; + final Runnable r2 = () -> { + while (System.nanoTime() < end) { + window.getGraphicsConfiguration(); + window.getOpacity(); + } + }; + + final Thread t1 = new Thread(r1); + final Thread t2 = new Thread(r1); + final Thread t3 = new Thread(r2); + final Thread t4 = new Thread(r2); + + t1.start(); + t2.start(); + t3.start(); + t4.start(); + t1.join(); + t2.join(); + t3.join(); + t4.join(); + } +}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test/java/awt/im/8132503/bug8132503.html Mon May 09 04:37:12 2016 +0100 @@ -0,0 +1,38 @@ +<!-- + Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + + This code is free software; you can redistribute it and/or modify it + under the terms of the GNU General Public License version 2 only, as + published by the Free Software Foundation. + + This code is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + version 2 for more details (a copy is included in the LICENSE file that + accompanied this code). + + You should have received a copy of the GNU General Public License version + 2 along with this work; if not, write to the Free Software Foundation, + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + + Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + or visit www.oracle.com if you need additional information or have any + questions. +--> + +<html> +<body> +Verify that Chinese full stop symbol can be entered in JTextArea with Pinyin input method (IM). + +This test is for OS X only. For other platforms please simply press "Pass". + +1. Go to "System Preferences -> Keyboard -> Input Sources" and add "Pinyin – Traditional" or "Pinyin – Simplified" IM from Chinese language group. +2. Set current IM to "Pinyin". +3. Set focus to the text area of the test and press "dot" character on the keyboard. +4. Set current IM to the IM used before "Pinyin" was set. +5. If "。" character is displayed in the text area, press "Pass", if "." character is displayed, press "Fail". + +<applet code="bug8132503.class" width=400 height=400></applet> +</body> +</html>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test/java/awt/im/8132503/bug8132503.java Mon May 09 04:37:12 2016 +0100 @@ -0,0 +1,47 @@ +/* + * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* @test + @bug 8132503 + @summary [macosx] Chinese full stop symbol cannot be entered with Pinyin IM on OS X + @author Anton Litvinov + @run applet/manual=yesno bug8132503.html + */ + +import javax.swing.JApplet; +import javax.swing.JScrollPane; +import javax.swing.JTextArea; +import javax.swing.SwingUtilities; + +public class bug8132503 extends JApplet { + @Override + public void init() { + SwingUtilities.invokeLater(new Runnable() { + @Override + public void run() { + JTextArea textArea = new JTextArea("Text area of the test.", 40, 40); + add(new JScrollPane(textArea)); + } + }); + } +}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test/java/awt/print/PrinterJob/PrintTextTest.html Mon May 09 04:37:12 2016 +0100 @@ -0,0 +1,46 @@ +<!-- + Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + + This code is free software; you can redistribute it and/or modify it + under the terms of the GNU General Public License version 2 only, as + published by the Free Software Foundation. + + This code is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + version 2 for more details (a copy is included in the LICENSE file that + accompanied this code). + + You should have received a copy of the GNU General Public License version + 2 along with this work; if not, write to the Free Software Foundation, + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + + Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + or visit www.oracle.com if you need additional information or have any + questions. +--> + +<html> +<body> +<applet code="PrintTextTest.class" width=400 height=100></applet> +This tests that printed text renders similarly to on-screen, +under a variety of APIs and graphics and font transforms +Print to your preferred printer. Collect the output. +Refer to the onscreen buttons to cycle through the on-screen +content +For each page, confirm that the printed content corresponds to +the on-screen rendering for that *same* page. +Some cases may look odd but its intentional. Verify +it looks the same on screen and on the printer. +Note that text does not scale linearly from screen to printer +so some differences are normal and not a bug. +The easiest way to spot real problems is to check that +any underlines are the same length as the underlined text +and that any rotations are the same in each case. +Note that each on-screen page is printed in both portrait +and landscape mode +So for example, Page 1/Portrait, and Page 1/Landscape when +rotated to view properly, should both match Page 1 on screen.; +</body> +</html>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test/java/awt/print/PrinterJob/PrintTextTest.java Mon May 09 04:37:12 2016 +0100 @@ -0,0 +1,395 @@ +/* + * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + + +/** + * @test + * @bug 6425068 7157659 8132890 + * @summary Confirm that text prints where we expect to the length we expect. + * @run applet/manual=yesno PrintTextTest.html + */ + +import java.awt.*; +import java.awt.event.*; +import java.text.*; +import java.util.*; +import java.awt.font.*; +import java.awt.geom.*; +import java.awt.print.*; +import javax.swing.*; + +public class PrintTextTest extends JApplet { + public void start() { + StandalonePrintTextTest.main(null); + } +} + +class StandalonePrintTextTest extends Component implements Printable { + + static int preferredSize; + Font textFont; + AffineTransform gxTx; + String page; + boolean useFM; + + public static void main(String args[]) { + + PrinterJob pjob = PrinterJob.getPrinterJob(); + PageFormat portrait = pjob.defaultPage(); + portrait.setOrientation(PageFormat.PORTRAIT); + preferredSize = (int)portrait.getImageableWidth(); + + PageFormat landscape = pjob.defaultPage(); + landscape.setOrientation(PageFormat.LANDSCAPE); + + Book book = new Book(); + + JTabbedPane p = new JTabbedPane(); + + int page = 1; + Font font = new Font("Dialog", Font.PLAIN, 18); + String name = "Page " + new Integer(page++); + StandalonePrintTextTest ptt = new StandalonePrintTextTest(name, font, null, false); + p.add(name, ptt); + book.append(ptt, portrait); + book.append(ptt, landscape); + + font = new Font("Dialog", Font.PLAIN, 18); + name = "Page " + new Integer(page++); + ptt = new StandalonePrintTextTest(name, font, null, true); + p.add(name, ptt); + book.append(ptt, portrait); + book.append(ptt, landscape); + + font = new Font("Lucida Sans", Font.PLAIN, 18); + name = "Page " + new Integer(page++); + ptt = new StandalonePrintTextTest(name, font, null, false); + p.add(name, ptt); + book.append(ptt, portrait); + book.append(ptt, landscape); + + font = new Font("Lucida Sans", Font.PLAIN, 18); + AffineTransform rotTx = AffineTransform.getRotateInstance(0.15); + rotTx.translate(60,0); + name = "Page " + new Integer(page++); + ptt = new StandalonePrintTextTest(name, font, rotTx, false); + p.add(name, ptt); + book.append(ptt, portrait); + book.append(ptt, landscape); + + font = new Font("Dialog", Font.PLAIN, 18); + AffineTransform scaleTx = AffineTransform.getScaleInstance(1.25, 1.25); + name = "Page " + new Integer(page++); + ptt = new StandalonePrintTextTest(name, font, scaleTx, false); + p.add(name, ptt); + book.append(ptt, portrait); + book.append(ptt, landscape); + + font = new Font("Dialog", Font.PLAIN, 18); + scaleTx = AffineTransform.getScaleInstance(-1.25, 1.25); + scaleTx.translate(-preferredSize/1.25, 0); + name = "Page " + new Integer(page++); + ptt = new StandalonePrintTextTest(name, font, scaleTx, false); + p.add(name, ptt); + book.append(ptt, portrait); + book.append(ptt, landscape); + + font = new Font("Dialog", Font.PLAIN, 18); + scaleTx = AffineTransform.getScaleInstance(1.25, -1.25); + scaleTx.translate(0, -preferredSize/1.25); + name = "Page " + new Integer(page++); + ptt = new StandalonePrintTextTest(name, font, scaleTx, false); + p.add(name, ptt); + book.append(ptt, portrait); + book.append(ptt, landscape); + + font = font.deriveFont(rotTx); + name = "Page " + new Integer(page++); + ptt = new StandalonePrintTextTest(name, font, null, false); + p.add(ptt, BorderLayout.CENTER); + p.add(name, ptt); + book.append(ptt, portrait); + book.append(ptt, landscape); + + font = new Font("Monospaced", Font.PLAIN, 12); + name = "Page " + new Integer(page++); + ptt = new StandalonePrintTextTest(name, font, null, false); + p.add(ptt, BorderLayout.CENTER); + p.add(name, ptt); + book.append(ptt, portrait); + book.append(ptt, landscape); + + Font xfont = font.deriveFont(AffineTransform.getScaleInstance(1.5, 1)); + name = "Page " + new Integer(page++); + ptt = new StandalonePrintTextTest(name, xfont, null, false); + p.add(ptt, BorderLayout.CENTER); + p.add(name, ptt); + book.append(ptt, portrait); + book.append(ptt, landscape); + + Font yfont = font.deriveFont(AffineTransform.getScaleInstance(1, 1.5)); + name = "Page " + new Integer(page++); + ptt = new StandalonePrintTextTest(name, yfont, null, false); + p.add(ptt, BorderLayout.CENTER); + p.add(name, ptt); + book.append(ptt, portrait); + book.append(ptt, landscape); + + if (System.getProperty("os.name").startsWith("Windows")) { + font = new Font("MS Gothic", Font.PLAIN, 12); + name = "Page " + new Integer(page++); + ptt = new PrintJAText(name, font, null, true); + p.add(ptt, BorderLayout.CENTER); + p.add(name, ptt); + book.append(ptt, portrait); + book.append(ptt, landscape); + + font = new Font("MS Gothic", Font.PLAIN, 12); + name = "Page " + new Integer(page++); + rotTx = AffineTransform.getRotateInstance(0.15); + ptt = new PrintJAText(name, font, rotTx, true); + p.add(ptt, BorderLayout.CENTER); + p.add(name, ptt); + book.append(ptt, portrait); + book.append(ptt, landscape); + } + + pjob.setPageable(book); + + JFrame f = new JFrame(); + f.add(BorderLayout.CENTER, p); + f.addWindowListener(new WindowAdapter() { + public void windowClosing(WindowEvent e) {System.exit(0);} + }); + f.pack(); + f.show(); + + try { + if (pjob.printDialog()) { + pjob.print(); + } + } catch (PrinterException e) { + throw new RuntimeException(e.getMessage()); + } + } + + public StandalonePrintTextTest(String page, Font font, AffineTransform gxTx, + boolean fm) { + this.page = page; + textFont = font; + this.gxTx = gxTx; + this.useFM = fm; + setBackground(Color.white); + } + + public static AttributedCharacterIterator getIterator(String s) { + return new AttributedString(s).getIterator(); + } + + static String orient(PageFormat pf) { + if (pf.getOrientation() == PageFormat.PORTRAIT) { + return "Portrait"; + } else { + return "Landscape"; + } + } + + public int print(Graphics g, PageFormat pf, int pageIndex) { + + Graphics2D g2d = (Graphics2D)g; + g2d.translate(pf.getImageableX(), pf.getImageableY()); + g.drawString(page+" "+orient(pf),50,20); + g.translate(0, 25); + paint(g); + return PAGE_EXISTS; + } + + public Dimension getMinimumSize() { + return getPreferredSize(); + } + + public Dimension getPreferredSize() { + return new Dimension(preferredSize, preferredSize); + } + + public void paint(Graphics g) { + + /* fill with white before any transformation is applied */ + g.setColor(Color.white); + g.fillRect(0, 0, getSize().width, getSize().height); + + + Graphics2D g2d = (Graphics2D) g; + if (gxTx != null) { + g2d.transform(gxTx); + } + if (useFM) { + g2d.setRenderingHint(RenderingHints.KEY_FRACTIONALMETRICS, + RenderingHints.VALUE_FRACTIONALMETRICS_ON); + } + + g.setFont(textFont); + FontMetrics fm = g.getFontMetrics(); + + String s; + int LS = 30; + int ix=10, iy=LS+10; + g.setColor(Color.black); + + s = "drawString(String str, int x, int y)"; + g.drawString(s, ix, iy); + if (!textFont.isTransformed()) { + g.drawLine(ix, iy+1, ix+fm.stringWidth(s), iy+1); + } + + iy += LS; + s = "drawString(AttributedCharacterIterator iterator, int x, int y)"; + g.drawString(getIterator(s), ix, iy); + + iy += LS; + s = "\tdrawChars(\t\r\nchar[], int off, int len, int x, int y\t)"; + g.drawChars(s.toCharArray(), 0, s.length(), ix, iy); + if (!textFont.isTransformed()) { + g.drawLine(ix, iy+1, ix+fm.stringWidth(s), iy+1); + } + + iy += LS; + s = "drawBytes(byte[], int off, int len, int x, int y)"; + byte data[] = new byte[s.length()]; + for (int i = 0; i < data.length; i++) { + data[i] = (byte) s.charAt(i); + } + g.drawBytes(data, 0, data.length, ix, iy); + + Font f = g2d.getFont(); + FontRenderContext frc = g2d.getFontRenderContext(); + + iy += LS; + s = "drawString(String s, float x, float y)"; + g2d.drawString(s, (float) ix, (float) iy); + if (!textFont.isTransformed()) { + g.drawLine(ix, iy+1, ix+fm.stringWidth(s), iy+1); + } + + iy += LS; + s = "drawString(AttributedCharacterIterator iterator, "+ + "float x, float y)"; + g2d.drawString(getIterator(s), (float) ix, (float) iy); + + iy += LS; + s = "drawGlyphVector(GlyphVector g, float x, float y)"; + GlyphVector gv = f.createGlyphVector(frc, s); + g2d.drawGlyphVector(gv, ix, iy); + Point2D adv = gv.getGlyphPosition(gv.getNumGlyphs()); + if (!textFont.isTransformed()) { + g.drawLine(ix, iy+1, ix+(int)adv.getX(), iy+1); + } + + iy += LS; + s = "GlyphVector with position adjustments"; + + gv = f.createGlyphVector(frc, s); + int ng = gv.getNumGlyphs(); + adv = gv.getGlyphPosition(ng); + for (int i=0; i<ng; i++) { + Point2D gp = gv.getGlyphPosition(i); + double gx = gp.getX(); + double gy = gp.getY(); + if (i % 2 == 0) { + gy+=5; + } else { + gy-=5; + } + gp.setLocation(gx, gy); + gv.setGlyphPosition(i, gp); + } + g2d.drawGlyphVector(gv, ix, iy); + if (!textFont.isTransformed()) { + g.drawLine(ix, iy+1, ix+(int)adv.getX(), iy+1); + } + + iy +=LS; + s = "drawString: \u0924\u094d\u0930 \u0915\u0948\u0930\u0947 End."; + g.drawString(s, ix, iy); + if (!textFont.isTransformed()) { + g.drawLine(ix, iy+1, ix+fm.stringWidth(s), iy+1); + } + + iy += LS; + s = "TextLayout 1: \u0924\u094d\u0930 \u0915\u0948\u0930\u0947 End."; + TextLayout tl = new TextLayout(s, new HashMap(), frc); + tl.draw(g2d, ix, iy); + + iy += LS; + s = "TextLayout 2: \u0924\u094d\u0930 \u0915\u0948\u0930\u0947 End."; + tl = new TextLayout(s, f, frc); + tl.draw(g2d, ix, iy); + } +} + +class PrintJAText extends StandalonePrintTextTest { + + + public PrintJAText(String page, Font font, AffineTransform gxTx, + boolean fm) { + super(page, font, gxTx, fm); + } + + private static final String TEXT = + "\u3042\u3044\u3046\u3048\u304a\u30a4\u30ed\u30cf" + + "\u30cb\u30db\u30d8\u30c8\u4e00\u4e01\u4e02\u4e05\uff08"; + + + public void paint(Graphics g) { + + /* fill with white before any transformation is applied */ + g.setColor(Color.white); + g.fillRect(0, 0, getSize().width, getSize().height); + + + Graphics2D g2d = (Graphics2D) g; + if (gxTx != null) { + g2d.transform(gxTx); + } + if (useFM) { + g2d.setRenderingHint(RenderingHints.KEY_FRACTIONALMETRICS, + RenderingHints.VALUE_FRACTIONALMETRICS_ON); + } + + String text = TEXT + TEXT + TEXT; + g.setColor(Color.black); + int y = 20; + float origSize = 7f; + for (int i=0;i<11;i++) { + float size = origSize+(i*0.1f); + g2d.translate(0, size+6); + Font f = textFont.deriveFont(size); + g2d.setFont(f); + FontMetrics fontMetrics = g2d.getFontMetrics(); + int stringWidth = fontMetrics.stringWidth(text); + g.drawLine(0, y+1, stringWidth, y+1); + g.drawString(text, 0, y); + y +=10; + } + } +}
--- a/test/java/security/Signature/TestInitSignWithMyOwnRandom.java Mon May 09 02:48:06 2016 +0100 +++ b/test/java/security/Signature/TestInitSignWithMyOwnRandom.java Mon May 09 04:37:12 2016 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2003, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2015, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -55,9 +55,9 @@ int count = 0; - public int nextInt() { + @Override + public void nextBytes(byte[] rs) { count++; - return 0; } public boolean isUsed() {
--- a/test/java/time/test/java/time/chrono/TestUmmAlQuraChronology.java Mon May 09 02:48:06 2016 +0100 +++ b/test/java/time/test/java/time/chrono/TestUmmAlQuraChronology.java Mon May 09 04:37:12 2016 +0100 @@ -30,6 +30,7 @@ import static java.time.temporal.ChronoField.MONTH_OF_YEAR; import static java.time.temporal.ChronoField.YEAR; import static org.testng.Assert.assertEquals; +import static org.testng.Assert.assertFalse; import static org.testng.Assert.assertTrue; import static org.testng.Assert.fail; @@ -71,6 +72,7 @@ /** * Tests for the Umm alQura chronology and data. * Note: The dates used for testing are just a sample of calendar data. + * @bug 8067800 */ @Test public class TestUmmAlQuraChronology { @@ -530,6 +532,24 @@ assertEquals(date.isLeapYear(), leapyear); } + // Data provider to verify that a given hijrah year is outside the range of supported years + // The values are dependent on the currently configured UmmAlQura calendar data + @DataProvider(name="OutOfRangeLeapYears") + Object[][] data_invalid_leapyears() { + return new Object[][] { + {1299}, + {1601}, + {Integer.MAX_VALUE}, + {Integer.MIN_VALUE}, + }; + } + + @Test(dataProvider="OutOfRangeLeapYears") + public void test_notLeapYears(int y) { + assertFalse(HijrahChronology.INSTANCE.isLeapYear(y), "Out of range leap year"); + } + + // Date samples to convert HijrahDate to LocalDate and vice versa @DataProvider(name="samples") Object[][] data_samples() {
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test/javax/imageio/plugins/jpeg/JpegImageColorSpaceTest.java Mon May 09 04:37:12 2016 +0100 @@ -0,0 +1,69 @@ +/* + * Copyright (c) 2016, 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 8041501 + * @summary Test verifies if there is no JFIF & EXIF header + * and sampling factor is same of JPEG image, then + * imageIO should not override colorspace determined + * in IJG library. + * @run main JpegImageColorSpaceTest + */ + +import java.awt.Color; +import java.awt.image.BufferedImage; +import java.io.File; +import javax.imageio.ImageIO; + +public class JpegImageColorSpaceTest { + + public static void main(String args[]) throws Exception { + + String fileName = "nomarkers.jpg"; + String sep = System.getProperty("file.separator"); + String dir = System.getProperty("test.src", "."); + String filePath = dir+sep+fileName; + System.out.println("Test file: " + filePath); + File imageFile = new File(filePath); + + BufferedImage bufferedImage = ImageIO.read(imageFile); + int imageWidth = bufferedImage.getWidth(); + int imageHeight = bufferedImage.getHeight(); + + for (int i = 0; i < imageWidth; i++) { + for(int j = 0; j < imageHeight; j++) { + /* + * Since image is white we check individual pixel values from + * BufferedImage to verify if ImageIO.read() is done with proper + * color space or not. + */ + if (bufferedImage.getRGB(i, j) != Color.white.getRGB()) { + // color space is not proper + throw new RuntimeException("ColorSpace is not determined " + + "properly by ImageIO"); + } + } + } + } +}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test/javax/management/remote/mandatory/connection/Name.java Mon May 09 04:37:12 2016 +0100 @@ -0,0 +1,49 @@ +/* + * Copyright (c) 2016, Red Hat Inc. + * 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. + */ + +public class Name implements NameMBean { + + private String firstName; + private String lastName; + + @Override + public String getFirstName() { + return firstName; + } + + @Override + public void setFirstName(String firstName) { + this.firstName = firstName; + } + + @Override + public String getLastName() { + return lastName; + } + + @Override + public void setLastName(String lastName) { + this.lastName = lastName; + } + +}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test/javax/management/remote/mandatory/connection/NameMBean.java Mon May 09 04:37:12 2016 +0100 @@ -0,0 +1,31 @@ +/* + * Copyright (c) 2016, Red Hat Inc. + * 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. + */ + +public interface NameMBean { + + String getFirstName(); + void setFirstName(String firstName); + + String getLastName(); + void setLastName(String lastName); +}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test/javax/management/remote/mandatory/connection/RMIConnectorLogAttributesTest.java Mon May 09 04:37:12 2016 +0100 @@ -0,0 +1,163 @@ +/* + * Copyright (c) 2016, Red Hat Inc. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +import java.io.IOException; +import java.lang.management.ManagementFactory; +import java.net.ServerSocket; +import java.rmi.registry.LocateRegistry; +import java.util.HashMap; +import java.util.Map; +import java.util.logging.Level; +import java.util.logging.Logger; + +import javax.management.Attribute; +import javax.management.AttributeList; +import javax.management.AttributeNotFoundException; +import javax.management.InstanceAlreadyExistsException; +import javax.management.InstanceNotFoundException; +import javax.management.InvalidAttributeValueException; +import javax.management.MBeanException; +import javax.management.MBeanRegistrationException; +import javax.management.MBeanServer; +import javax.management.MBeanServerConnection; +import javax.management.MalformedObjectNameException; +import javax.management.NotCompliantMBeanException; +import javax.management.ObjectName; +import javax.management.ReflectionException; +import javax.management.remote.JMXConnector; +import javax.management.remote.JMXConnectorFactory; +import javax.management.remote.JMXConnectorServer; +import javax.management.remote.JMXConnectorServerFactory; +import javax.management.remote.JMXServiceURL; + +/** + * @test + * @bug 8147857 + * @summary Tests whether RMIConnector logs attribute names correctly. + * @author Severin Gehwolf + */ +public class RMIConnectorLogAttributesTest { + + private static final String ILLEGAL = ", FirstName[LastName]"; + private static final Logger logger = Logger.getLogger("javax.management.remote.rmi"); + private static final String ANY_NAME = "foo"; + private static final TestLogHandler handler; + static { + handler = new TestLogHandler(ILLEGAL); + handler.setLevel(Level.FINEST); + logger.setLevel(Level.ALL); + logger.addHandler(handler); + } + + private JMXConnectorServer startServer(int rmiPort) throws Exception { + System.out.println("DEBUG: Create RMI registry on port " + rmiPort); + LocateRegistry.createRegistry(rmiPort); + + MBeanServer mbs = ManagementFactory.getPlatformMBeanServer(); + + HashMap<String,Object> env = new HashMap<String,Object>(); + + JMXServiceURL url = + new JMXServiceURL("service:jmx:rmi:///jndi/rmi://127.0.0.1:" + rmiPort + "/jmxrmi"); + JMXConnectorServer cs = + JMXConnectorServerFactory.newJMXConnectorServer(url, env, mbs); + + cs.start(); + System.out.println("DEBUG: Started the RMI connector server"); + return cs; + } + + private int findPort() { + for (int i = 13333; i < 13333 + 100; i++) { + try { + ServerSocket socket = new ServerSocket(i); + socket.close(); + return i; + } catch (IOException e) { + continue; + } + } + return -1; + } + + private void runTest() { + int rmiPort = findPort(); + if (rmiPort == -1) { + throw new RuntimeException("Test failed. No available port"); + } + JMXConnectorServer server = null; + try { + server = startServer(rmiPort); + JMXConnector connector = connectToServer(server); + doTest(connector); + } catch (Exception e) { + throw new RuntimeException("Test failed unexpectedly", e); + } finally { + if (server != null) { + try { + server.stop(); + } catch (IOException e) { + // ignore + } + } + } + } + + private JMXConnector connectToServer(JMXConnectorServer server) throws IOException, MalformedObjectNameException, NullPointerException, InstanceAlreadyExistsException, MBeanRegistrationException, NotCompliantMBeanException, ReflectionException, MBeanException { + JMXServiceURL url = server.getAddress(); + Map<String, Object> env = new HashMap<String, Object>(); + JMXConnector connector = JMXConnectorFactory.connect(url, env); + + System.out.println("DEBUG: Client connected to RMI at: " + url); + + return connector; + } + + private void doTest(JMXConnector connector) throws IOException, + MalformedObjectNameException, ReflectionException, + InstanceAlreadyExistsException, MBeanRegistrationException, + MBeanException, NotCompliantMBeanException, InstanceNotFoundException, AttributeNotFoundException, InvalidAttributeValueException { + MBeanServerConnection mbsc = connector.getMBeanServerConnection(); + + + ObjectName objName = new ObjectName("com.redhat.test.jmx:type=NameMBean"); + System.out.println("DEBUG: Calling createMBean"); + mbsc.createMBean(Name.class.getName(), objName); + + System.out.println("DEBUG: Calling setAttributes"); + AttributeList attList = new AttributeList(); + attList.add(new Attribute("FirstName", ANY_NAME)); + attList.add(new Attribute("LastName", ANY_NAME)); + mbsc.setAttributes(objName, attList); + } + + public static void main(String[] args) throws Exception { + RMIConnectorLogAttributesTest test = new RMIConnectorLogAttributesTest(); + test.runTest(); + if (handler.testFailed()) { + throw new RuntimeException("Test failed. Logged incorrect: '" + ILLEGAL + "'"); + } + System.out.println("Test passed!"); + } + +}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test/javax/management/remote/mandatory/connection/TestLogHandler.java Mon May 09 04:37:12 2016 +0100 @@ -0,0 +1,64 @@ +/* + * Copyright (c) 2016, Red Hat Inc. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +import java.util.logging.Handler; +import java.util.logging.LogRecord; + +public class TestLogHandler extends Handler { + + private final String illegal; + private boolean testFailed; + + public TestLogHandler(String illegal) { + this.illegal = illegal; + this.testFailed = false; + } + + @Override + public void publish(LogRecord record) { + String msg = record.getMessage(); + String method = record.getSourceMethodName(); + String className = record.getSourceClassName(); + if (msg.contains(illegal)) { + testFailed = true; + } + if (msg.contains("attribute names=")) { + System.err.println("LOG: " + className + "." + method + ": " + msg); + } + } + + @Override + public void flush() { + // nothing + } + + @Override + public void close() throws SecurityException { + // nothing + } + + public boolean testFailed() { + return testFailed; + } + +}
--- a/test/javax/print/PrintSEUmlauts/PrintSEUmlauts.java Mon May 09 02:48:06 2016 +0100 +++ b/test/javax/print/PrintSEUmlauts/PrintSEUmlauts.java Mon May 09 04:37:12 2016 +0100 @@ -107,14 +107,14 @@ System.err.println("printing content"); System.err.println(content); } - throw new RuntimeException("Expected <e4> to represent 'ä' but not found!"); + throw new RuntimeException("Expected <e4> to represent '\u00e4' but not found!"); } System.err.println("SUCCESS"); } public int print(Graphics g, PageFormat pf, int pg) { if (pg > 0) return NO_SUCH_PAGE; - g.drawString("ä", 100, 100); + g.drawString("\u00e4", 100, 100); return PAGE_EXISTS; } }
--- a/test/javax/security/auth/SubjectDomainCombiner/Optimize.java Mon May 09 02:48:06 2016 +0100 +++ b/test/javax/security/auth/SubjectDomainCombiner/Optimize.java Mon May 09 04:37:12 2016 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2003, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -37,13 +37,16 @@ ProtectionDomain pd1 = new ProtectionDomain( new CodeSource(null, (java.security.cert.Certificate[]) null), - new Permissions()); + new Permissions(), + null, null); ProtectionDomain pd2 = new ProtectionDomain( new CodeSource(null, (java.security.cert.Certificate[]) null), - new Permissions()); + new Permissions(), + null, null); ProtectionDomain pd3 = new ProtectionDomain( new CodeSource(null, (java.security.cert.Certificate[]) null), - new Permissions()); + new Permissions(), + null, null); ProtectionDomain[] current = new ProtectionDomain[] {pd1, pd2}; ProtectionDomain[] assigned = new ProtectionDomain[] {pd3, pd2};
--- a/test/javax/xml/crypto/dsig/GenerationTests.java Mon May 09 02:48:06 2016 +0100 +++ b/test/javax/xml/crypto/dsig/GenerationTests.java Mon May 09 04:37:12 2016 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -23,7 +23,7 @@ /** * @test - * @bug 4635230 6283345 6303830 6824440 6867348 7094155 + * @bug 4635230 6283345 6303830 6824440 6867348 7094155 8038184 8038349 * @summary Basic unit tests for generating XML Signatures with JSR 105 * @compile -XDignore.symbol.file KeySelectors.java SignatureValidator.java * X509KeySelector.java GenerationTests.java @@ -80,9 +80,10 @@ private static KeyInfoFactory kifac; private static DocumentBuilder db; private static CanonicalizationMethod withoutComments; - private static SignatureMethod dsaSha1, rsaSha1, rsaSha256, rsaSha384, rsaSha512; + private static SignatureMethod dsaSha1, dsaSha256, rsaSha1, + rsaSha256, rsaSha384, rsaSha512; private static DigestMethod sha1, sha256, sha384, sha512; - private static KeyInfo dsa, rsa, rsa1024; + private static KeyInfo dsa1024, dsa2048, rsa, rsa1024; private static KeySelector kvks = new KeySelectors.KeyValueKeySelector(); private static KeySelector sks; private static Key signingKey; @@ -106,10 +107,13 @@ "http://www.w3.org/TR/xml-stylesheet"; private final static String STYLESHEET_B64 = "http://www.w3.org/Signature/2002/04/xml-stylesheet.b64"; + private final static String DSA_SHA256 = + "http://www.w3.org/2009/xmldsig11#dsa-sha256"; public static void main(String args[]) throws Exception { setup(); - test_create_signature_enveloped_dsa(); + test_create_signature_enveloped_dsa(1024); + test_create_signature_enveloped_dsa(2048); test_create_signature_enveloping_b64_dsa(); test_create_signature_enveloping_dsa(); test_create_signature_enveloping_hmac_sha1_40(); @@ -135,6 +139,7 @@ test_create_signature_enveloping_sha512_rsa_sha512(); test_create_signature_reference_dependency(); test_create_signature_with_attr_in_no_namespace(); + test_create_signature_with_empty_id(); } private static void setup() throws Exception { @@ -156,15 +161,18 @@ withoutComments = fac.newCanonicalizationMethod (CanonicalizationMethod.INCLUSIVE, (C14NMethodParameterSpec)null); dsaSha1 = fac.newSignatureMethod(SignatureMethod.DSA_SHA1, null); + dsaSha256 = fac.newSignatureMethod(DSA_SHA256, null); sha1 = fac.newDigestMethod(DigestMethod.SHA1, null); sha256 = fac.newDigestMethod(DigestMethod.SHA256, null); sha384 = fac.newDigestMethod ("http://www.w3.org/2001/04/xmldsig-more#sha384", null); sha512 = fac.newDigestMethod(DigestMethod.SHA512, null); - dsa = kifac.newKeyInfo(Collections.singletonList + dsa1024 = kifac.newKeyInfo(Collections.singletonList (kifac.newKeyValue(validatingKey))); + dsa2048 = kifac.newKeyInfo(Collections.singletonList + (kifac.newKeyValue(getPublicKey("DSA", 2048)))); rsa = kifac.newKeyInfo(Collections.singletonList - (kifac.newKeyValue(getPublicKey("RSA")))); + (kifac.newKeyValue(getPublicKey("RSA", 512)))); rsa1024 = kifac.newKeyInfo(Collections.singletonList (kifac.newKeyValue(getPublicKey("RSA", 1024)))); rsaSha1 = fac.newSignatureMethod(SignatureMethod.RSA_SHA1, null); @@ -179,11 +187,25 @@ httpUd = new HttpURIDereferencer(); } - static void test_create_signature_enveloped_dsa() throws Exception { - System.out.println("* Generating signature-enveloped-dsa.xml"); + static void test_create_signature_enveloped_dsa(int size) throws Exception { + System.out.println("* Generating signature-enveloped-dsa-" + + size + ".xml"); + SignatureMethod sm = null; + KeyInfo ki = null; + Key privKey; + if (size == 1024) { + sm = dsaSha1; + ki = dsa1024; + privKey = signingKey; + } else if (size == 2048) { + sm = dsaSha256; + ki = dsa2048; + privKey = getPrivateKey("DSA", 2048); + } else throw new RuntimeException("unsupported keysize:" + size); + // create SignedInfo SignedInfo si = fac.newSignedInfo - (withoutComments, dsaSha1, Collections.singletonList + (withoutComments, sm, Collections.singletonList (fac.newReference ("", sha1, Collections.singletonList (fac.newTransform(Transform.ENVELOPED, @@ -191,7 +213,7 @@ null, null))); // create XMLSignature - XMLSignature sig = fac.newXMLSignature(si, dsa); + XMLSignature sig = fac.newXMLSignature(si, ki); Document doc = db.newDocument(); Element envelope = doc.createElementNS @@ -200,12 +222,12 @@ "xmlns", "http://example.org/envelope"); doc.appendChild(envelope); - DOMSignContext dsc = new DOMSignContext(signingKey, envelope); + DOMSignContext dsc = new DOMSignContext(privKey, envelope); sig.sign(dsc); -// StringWriter sw = new StringWriter(); -// dumpDocument(doc, sw); -// System.out.println(sw.toString()); +// StringWriter sw = new StringWriter(); +// dumpDocument(doc, sw); +// System.out.println(sw.toString()); DOMValidateContext dvc = new DOMValidateContext (kvks, envelope.getFirstChild()); @@ -225,21 +247,21 @@ static void test_create_signature_enveloping_b64_dsa() throws Exception { System.out.println("* Generating signature-enveloping-b64-dsa.xml"); test_create_signature_enveloping - (sha1, dsaSha1, dsa, signingKey, kvks, true); + (sha1, dsaSha1, dsa1024, signingKey, kvks, true); System.out.println(); } static void test_create_signature_enveloping_dsa() throws Exception { System.out.println("* Generating signature-enveloping-dsa.xml"); test_create_signature_enveloping - (sha1, dsaSha1, dsa, signingKey, kvks, false); + (sha1, dsaSha1, dsa1024, signingKey, kvks, false); System.out.println(); } static void test_create_signature_enveloping_sha256_dsa() throws Exception { System.out.println("* Generating signature-enveloping-sha256-dsa.xml"); test_create_signature_enveloping - (sha256, dsaSha1, dsa, signingKey, kvks, false); + (sha256, dsaSha1, dsa1024, signingKey, kvks, false); System.out.println(); } @@ -292,7 +314,7 @@ static void test_create_signature_enveloping_rsa() throws Exception { System.out.println("* Generating signature-enveloping-rsa.xml"); test_create_signature_enveloping(sha1, rsaSha1, rsa, - getPrivateKey("RSA"), kvks, false); + getPrivateKey("RSA", 512), kvks, false); System.out.println(); } @@ -300,7 +322,7 @@ throws Exception { System.out.println("* Generating signature-enveloping-sha384-rsa_sha256.xml"); test_create_signature_enveloping(sha384, rsaSha256, rsa, - getPrivateKey("RSA"), kvks, false); + getPrivateKey("RSA", 512), kvks, false); System.out.println(); } @@ -322,13 +344,13 @@ static void test_create_signature_external_b64_dsa() throws Exception { System.out.println("* Generating signature-external-b64-dsa.xml"); - test_create_signature_external(dsaSha1, dsa, signingKey, kvks, true); + test_create_signature_external(dsaSha1, dsa1024, signingKey, kvks, true); System.out.println(); } static void test_create_signature_external_dsa() throws Exception { System.out.println("* Generating signature-external-dsa.xml"); - test_create_signature_external(dsaSha1, dsa, signingKey, kvks, false); + test_create_signature_external(dsaSha1, dsa1024, signingKey, kvks, false); System.out.println(); } @@ -440,7 +462,7 @@ // create XMLSignature XMLSignature sig = fac.newXMLSignature(si, rsa, objs, "signature", null); - DOMSignContext dsc = new DOMSignContext(getPrivateKey("RSA"), doc); + DOMSignContext dsc = new DOMSignContext(getPrivateKey("RSA", 512), doc); sig.sign(dsc); @@ -486,7 +508,7 @@ XMLSignature sig = fac.newXMLSignature(si, rsa, Collections.singletonList(obj), "signature", null); - DOMSignContext dsc = new DOMSignContext(getPrivateKey("RSA"), doc); + DOMSignContext dsc = new DOMSignContext(getPrivateKey("RSA", 512), doc); dsc.setIdAttributeNS(nc, null, "Id"); sig.sign(dsc); @@ -509,6 +531,30 @@ System.out.println(); } + static void test_create_signature_with_empty_id() throws Exception { + System.out.println("* Generating signature-with-empty-id.xml"); + + // create references + List<Reference> refs = Collections.singletonList + (fac.newReference("#", sha1)); + + // create SignedInfo + SignedInfo si = fac.newSignedInfo(withoutComments, rsaSha1, refs); + + // create object with empty id + Document doc = db.newDocument(); + XMLObject obj = fac.newXMLObject(Collections.singletonList + (new DOMStructure(doc.createTextNode("I am the text."))), + "", "text/plain", null); + + // create XMLSignature + XMLSignature sig = fac.newXMLSignature(si, rsa, + Collections.singletonList(obj), + "signature", null); + DOMSignContext dsc = new DOMSignContext(getPrivateKey("RSA", 512), doc); + sig.sign(dsc); + } + static void test_create_signature() throws Exception { System.out.println("* Generating signature.xml"); @@ -1091,6 +1137,16 @@ "90670890367185141189796"; private static final String DSA_X = "0527140396812450214498055937934275626078768840117"; + private static final String DSA_2048_Y = + "15119007057343785981993995134621348945077524760182795513668325877793414638620983617627033248732235626178802906346261435991040697338468329634416089753032362617771631199351767336660070462291411472735835843440140283101463231807789628656218830720378705090795271104661936237385140354825159080766174663596286149653433914842868551355716015585570827642835307073681358328172009941968323702291677280809277843998510864653406122348712345584706761165794179850728091522094227603562280855104749858249588234915206290448353957550635709520273178475097150818955098638774564910092913714625772708285992586894795017709678223469405896699928"; + private static final String DSA_2048_P = + "18111848663142005571178770624881214696591339256823507023544605891411707081617152319519180201250440615163700426054396403795303435564101919053459832890139496933938670005799610981765220283775567361483662648340339405220348871308593627647076689407931875483406244310337925809427432681864623551598136302441690546585427193224254314088256212718983105131138772434658820375111735710449331518776858786793875865418124429269409118756812841019074631004956409706877081612616347900606555802111224022921017725537417047242635829949739109274666495826205002104010355456981211025738812433088757102520562459649777989718122219159982614304359"; + private static final String DSA_2048_Q = + "19689526866605154788513693571065914024068069442724893395618704484701"; + private static final String DSA_2048_G = + "2859278237642201956931085611015389087970918161297522023542900348087718063098423976428252369340967506010054236052095950169272612831491902295835660747775572934757474194739347115870723217560530672532404847508798651915566434553729839971841903983916294692452760249019857108409189016993380919900231322610083060784269299257074905043636029708121288037909739559605347853174853410208334242027740275688698461842637641566056165699733710043802697192696426360843173620679214131951400148855611740858610821913573088059404459364892373027492936037789337011875710759208498486908611261954026964574111219599568903257472567764789616958430"; + private static final String DSA_2048_X = + "14562787764977288900757387442281559936279834964901963465277698843172"; private static final String RSA_MOD = "010800185049102889923150759252557522305032794699952150943573164381" + "936603255999071981574575044810461362008102247767482738822150129277" + @@ -1113,43 +1169,48 @@ "204903524890556839550490384015324575598723478554854070823335021842" + "210112348400928769"; - private static PublicKey getPublicKey(String algo) throws Exception { - return getPublicKey(algo, 512); - } - private static PublicKey getPublicKey(String algo, int keysize) throws Exception { KeyFactory kf = KeyFactory.getInstance(algo); KeySpec kspec; if (algo.equalsIgnoreCase("DSA")) { - kspec = new DSAPublicKeySpec(new BigInteger(DSA_Y), - new BigInteger(DSA_P), - new BigInteger(DSA_Q), - new BigInteger(DSA_G)); + if (keysize == 1024) { + kspec = new DSAPublicKeySpec(new BigInteger(DSA_Y), + new BigInteger(DSA_P), + new BigInteger(DSA_Q), + new BigInteger(DSA_G)); + } else if (keysize == 2048) { + kspec = new DSAPublicKeySpec(new BigInteger(DSA_2048_Y), + new BigInteger(DSA_2048_P), + new BigInteger(DSA_2048_Q), + new BigInteger(DSA_2048_G)); + } else throw new RuntimeException("Unsupported keysize:" + keysize); } else if (algo.equalsIgnoreCase("RSA")) { if (keysize == 512) { kspec = new RSAPublicKeySpec(new BigInteger(RSA_MOD), new BigInteger(RSA_PUB)); - } else { + } else if (keysize == 1024) { kspec = new RSAPublicKeySpec(new BigInteger(RSA_1024_MOD), new BigInteger(RSA_PUB)); - } + } else throw new RuntimeException("Unsupported keysize:" + keysize); } else throw new RuntimeException("Unsupported key algorithm " + algo); return kf.generatePublic(kspec); } - private static PrivateKey getPrivateKey(String algo) throws Exception { - return getPrivateKey(algo, 512); - } - private static PrivateKey getPrivateKey(String algo, int keysize) throws Exception { KeyFactory kf = KeyFactory.getInstance(algo); KeySpec kspec; if (algo.equalsIgnoreCase("DSA")) { - kspec = new DSAPrivateKeySpec - (new BigInteger(DSA_X), new BigInteger(DSA_P), - new BigInteger(DSA_Q), new BigInteger(DSA_G)); + if (keysize == 1024) { + kspec = new DSAPrivateKeySpec + (new BigInteger(DSA_X), new BigInteger(DSA_P), + new BigInteger(DSA_Q), new BigInteger(DSA_G)); + } else if (keysize == 2048) { + kspec = new DSAPrivateKeySpec + (new BigInteger(DSA_2048_X), new BigInteger(DSA_2048_P), + new BigInteger(DSA_2048_Q), new BigInteger(DSA_2048_G)); + } else throw new RuntimeException("Unsupported keysize:" + keysize); } else if (algo.equalsIgnoreCase("RSA")) { if (keysize == 512) { kspec = new RSAPrivateKeySpec
--- a/test/javax/xml/crypto/dsig/KeySelectors.java Mon May 09 02:48:06 2016 +0100 +++ b/test/javax/xml/crypto/dsig/KeySelectors.java Mon May 09 04:37:12 2016 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -175,7 +175,8 @@ //@@@FIXME: this should also work for key types other than DSA/RSA static boolean algEquals(String algURI, String algName) { if (algName.equalsIgnoreCase("DSA") && - algURI.equals(SignatureMethod.DSA_SHA1)) { + algURI.equals(SignatureMethod.DSA_SHA1) || + algURI.equals("http://www.w3.org/2009/xmldsig11#dsa-sha256")) { return true; } else if (algName.equalsIgnoreCase("RSA") && (algURI.equals(SignatureMethod.RSA_SHA1) ||
--- a/test/javax/xml/jaxp/transform/8062518/XSLTFunctionsTest.java Mon May 09 02:48:06 2016 +0100 +++ b/test/javax/xml/jaxp/transform/8062518/XSLTFunctionsTest.java Mon May 09 04:37:12 2016 +0100 @@ -22,7 +22,7 @@ */ /* @test - * @bug 8062518 + * @bug 8062518 8133924 * @summary This class contains tests for XSLT functions * @compile DocumentExtFunc.java * @run testng/othervm XSLTFunctionsTest @@ -102,17 +102,34 @@ @DataProvider(name = "document") public static Object[][] documentTestData() { return new Object[][] { + // 8062518 {documentTestXml, documentTestXsl, documentTestExternalDoc, documentTesteExpectedResult}, + // 8133924 + {documentTestXml, nonExistingNodeXsl, documentTestExternalDoc, nonExistNodeExpectedResult}, }; } + // bug 8133924 xsl: test data to trigger the NPE when non-existing node is specified in xsl + static final String nonExistingNodeXsl = "<?xml version='1.0' encoding=\"UTF-8\"?>" + + "<xsl:transform xmlns:xsl=\"http://www.w3.org/1999/XSL/Transform\" version=\"1.0\"" + + " xmlns:set=\"http://exslt.org/sets\"" + + " exclude-result-prefixes=\"set\">" + + " <xsl:template match=\"/\">" + + " <xsl:copy-of select=\"set:leading(/Test, /Test/non-existing)\"/>" + + "</xsl:template>" + + "</xsl:transform>"; + + //For bug 8133924 xsl the empty transformation result is expected instead of NPE + static final String nonExistNodeExpectedResult = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>" + + "<Test>Doc</Test>"; + static final String documentTestXml = "<?xml version=\"1.0\" encoding=\"UTF-8\"?><Test>Doc</Test>"; static final String documentTestExternalDoc = "<?xml version=\"1.0\" encoding=\"UTF-8\"?><Test>External Doc</Test>"; static final String documentTestXsl = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>" + "<xsl:transform version=\"1.0\"" - + " xmlns:xsl=\"http://www.w3.org/1999/XSL/Transform\" " + + " xmlns:xsl=\"http://www.w3.org/1999/XSL/Transform\"" + " xmlns:cfunc=\"http://xml.apache.org/xalan/java/\">" + "<xsl:template match=\"/\">" + "<xsl:element name=\"root\">"
--- a/test/sun/jvmstat/perfdata/PrologSanity/PrologSizeSanityCheck.java Mon May 09 02:48:06 2016 +0100 +++ b/test/sun/jvmstat/perfdata/PrologSanity/PrologSizeSanityCheck.java Mon May 09 04:37:12 2016 +0100 @@ -24,7 +24,7 @@ /* * @test * @bug 4990825 - * @run main/othervm -XX:+UsePerfData PrologSizeSanityCheck + * @run main/othervm -XX:+UsePerfData -XX:PerfDataMemorySize=64k PrologSizeSanityCheck * @summary prolog size and overflow sanity checks */
--- a/test/sun/misc/Version/Version.java Mon May 09 02:48:06 2016 +0100 +++ b/test/sun/misc/Version/Version.java Mon May 09 04:37:12 2016 +0100 @@ -29,11 +29,13 @@ * @run main Version */ +import java.util.regex.*; import static sun.misc.Version.*; + public class Version { public static void main(String[] args) throws Exception { - VersionInfo jdk = newVersionInfo(System.getProperty("java.runtime.version")); + VersionInfo jdk = jdkVersionInfo(System.getProperty("java.runtime.version")); VersionInfo v1 = new VersionInfo(jdkMajorVersion(), jdkMinorVersion(), jdkMicroVersion(), @@ -44,7 +46,7 @@ if (!jdk.equals(v1)) { throw new RuntimeException("Unmatched version: " + jdk + " vs " + v1); } - VersionInfo jvm = newVersionInfo(System.getProperty("java.vm.version")); + VersionInfo jvm = jvmVersionInfo(System.getProperty("java.vm.version")); VersionInfo v2 = new VersionInfo(jvmMajorVersion(), jvmMinorVersion(), jvmMicroVersion(), @@ -95,74 +97,73 @@ } } - private static VersionInfo newVersionInfo(String version) throws Exception { + private static VersionInfo jdkVersionInfo(String version) throws Exception { // valid format of the version string is: - // n.n.n[_uu[c]][-<identifer>]-bxx + // <major>.<minor>[.<micro>][_uu[c]][-<identifier>]-bxx int major = 0; int minor = 0; int micro = 0; int update = 0; String special = ""; int build = 0; - CharSequence cs = version; - if (cs.length() >= 5) { - if (Character.isDigit(cs.charAt(0)) && cs.charAt(1) == '.' && - Character.isDigit(cs.charAt(2)) && cs.charAt(3) == '.' && - Character.isDigit(cs.charAt(4))) { - major = Character.digit(cs.charAt(0), 10); - minor = Character.digit(cs.charAt(2), 10); - micro = Character.digit(cs.charAt(4), 10); - cs = cs.subSequence(5, cs.length()); - } else if (Character.isDigit(cs.charAt(0)) && - Character.isDigit(cs.charAt(1)) && cs.charAt(2) == '.' && - Character.isDigit(cs.charAt(3))) { - // HSX has nn.n[n] (major.minor) version - major = Integer.valueOf(version.substring(0, 2)).intValue(); - if (Character.isDigit(cs.charAt(4))) { - minor = Integer.valueOf(version.substring(3, 5)).intValue(); - cs = cs.subSequence(5, cs.length()); - } - else { - minor = Character.digit(cs.charAt(3), 10); - cs = cs.subSequence(4, cs.length()); - } - } - if (cs.charAt(0) == '_' && cs.length() >= 3 && - Character.isDigit(cs.charAt(1)) && - Character.isDigit(cs.charAt(2))) { - int nextChar = 3; - String uu = cs.subSequence(1, 3).toString(); - update = Integer.valueOf(uu).intValue(); - if (cs.length() >= 4) { - char c = cs.charAt(3); - if (c >= 'a' && c <= 'z') { - special = Character.toString(c); - nextChar++; - } - } - cs = cs.subSequence(nextChar, cs.length()); - } - if (cs.charAt(0) == '-') { - // skip the first character - // valid format: <identifier>-bxx or bxx - // non-product VM will have -debug|-release appended - cs = cs.subSequence(1, cs.length()); - String[] res = cs.toString().split("-"); - for (int i = res.length - 1; i >= 0; i--) { - String s = res[i]; - if (s.charAt(0) == 'b') { - try { - build = Integer.parseInt(s.substring(1, s.length())); - break; - } catch (NumberFormatException nfe) { - // ignore - } - } - } - } - } + + String regex = "^([0-9]{1,2})"; // major + regex += "\\."; // separator + regex += "([0-9]{1,2})"; // minor + regex += "(\\."; // separator + regex += "([0-9]{1,2})"; // micro + regex += ")?"; // micro is optional + regex += "(_"; + regex += "([0-9]{2,3})"; // update + regex += "([a-z])?"; // special char (optional) + regex += ")?"; // _uu[c] is optional + regex += ".*"; // -<identifier> + regex += "(\\-b([0-9]{1,3}$))"; // JDK -bxx + + Pattern p = Pattern.compile(regex); + Matcher m = p.matcher(version); + m.matches(); + + major = Integer.parseInt(m.group(1)); + minor = Integer.parseInt(m.group(2)); + micro = (m.group(4) == null) ? 0 : Integer.parseInt(m.group(4)); + update = (m.group(6) == null) ? 0 : Integer.parseInt(m.group(6)); + special = (m.group(7) == null) ? "" : m.group(7); + build = Integer.parseInt(m.group(9)); + VersionInfo vi = new VersionInfo(major, minor, micro, update, special, build); - System.out.printf("newVersionInfo: input=%s output=%s\n", version, vi); + System.out.printf("jdkVersionInfo: input=%s output=%s\n", version, vi); return vi; } + + private static VersionInfo jvmVersionInfo(String version) throws Exception { + try { + // valid format of the version string is: + // <major>.<minor>-bxx[-<identifier>][-<debug_flavor>] + int major = 0; + int minor = 0; + int build = 0; + + String regex = "^([0-9]{1,2})"; // major + regex += "\\."; // separator + regex += "([0-9]{1,3})"; // minor + regex += "(\\-b([0-9]{1,3}))"; // JVM -bxx + regex += ".*"; + + Pattern p = Pattern.compile(regex); + Matcher m = p.matcher(version); + m.matches(); + + major = Integer.parseInt(m.group(1)); + minor = Integer.parseInt(m.group(2)); + build = Integer.parseInt(m.group(4)); + + VersionInfo vi = new VersionInfo(major, minor, 0, 0, "", build); + System.out.printf("jvmVersionInfo: input=%s output=%s\n", version, vi); + return vi; + } catch (IllegalStateException e) { + // local builds may also follow the jdkVersionInfo format + return jdkVersionInfo(version); + } + } }
--- a/test/sun/security/mscapi/AccessKeyStore.java Mon May 09 02:48:06 2016 +0100 +++ b/test/sun/security/mscapi/AccessKeyStore.java Mon May 09 04:37:12 2016 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2015, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -36,17 +36,6 @@ public static void main(String[] args) throws Exception { - // Check if the provider is available - try { - Class.forName("sun.security.mscapi.SunMSCAPI"); - - } catch (Exception e) { - System.out.println( - "The SunMSCAPI provider is not available on this platform: " + - e); - return; - } - // Check that a security manager has been installed if (System.getSecurityManager() == null) { throw new Exception("A security manager has not been installed"); @@ -86,8 +75,8 @@ } int i = 0; - for (Enumeration e = keyStore.aliases(); e.hasMoreElements(); ) { - String alias = (String) e.nextElement(); + for (Enumeration<String> e = keyStore.aliases(); e.hasMoreElements(); ) { + String alias = e.nextElement(); displayEntry(keyStore, alias, i++); } }
--- a/test/sun/security/mscapi/AccessKeyStore.sh Mon May 09 02:48:06 2016 +0100 +++ b/test/sun/security/mscapi/AccessKeyStore.sh Mon May 09 04:37:12 2016 +0100 @@ -1,7 +1,7 @@ #!/bin/sh # -# Copyright (c) 2005, 2011, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2005, 2015, Oracle and/or its affiliates. All rights reserved. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # # This code is free software; you can redistribute it and/or modify it @@ -26,6 +26,7 @@ # @test # @bug 6324295 6931562 +# @requires os.family == "windows" # @run shell AccessKeyStore.sh # @summary Confirm that permission must be granted to access keystores.
--- a/test/sun/security/mscapi/IsSunMSCAPIAvailable.java Mon May 09 02:48:06 2016 +0100 +++ b/test/sun/security/mscapi/IsSunMSCAPIAvailable.java Mon May 09 04:37:12 2016 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2015, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -33,16 +33,6 @@ public static void main(String[] args) throws Exception { - // Check if the provider is available - try { - Class.forName("sun.security.mscapi.SunMSCAPI"); - - } catch (Exception e) { - System.out.println( - "The SunMSCAPI provider is not available on this platform"); - return; - } - // Dynamically register the SunMSCAPI provider Security.addProvider(new sun.security.mscapi.SunMSCAPI()); @@ -58,7 +48,6 @@ /* * Secure Random */ - SecureRandom random = SecureRandom.getInstance("Windows-PRNG", p); System.out.println(" Windows-PRNG is implemented by: " + random.getClass().getName());
--- a/test/sun/security/mscapi/IsSunMSCAPIAvailable.sh Mon May 09 02:48:06 2016 +0100 +++ b/test/sun/security/mscapi/IsSunMSCAPIAvailable.sh Mon May 09 04:37:12 2016 +0100 @@ -1,7 +1,7 @@ #!/bin/sh # -# Copyright (c) 2005, 2011, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2005, 2015, Oracle and/or its affiliates. All rights reserved. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # # This code is free software; you can redistribute it and/or modify it @@ -26,6 +26,7 @@ # @test # @bug 6318171 6931562 +# @requires os.family == "windows" # @run shell IsSunMSCAPIAvailable.sh # @summary Basic test of the Microsoft CryptoAPI provider.
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test/sun/security/mscapi/IterateWindowsRootStore.java Mon May 09 04:37:12 2016 +0100 @@ -0,0 +1,130 @@ +/* + * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +import java.io.InputStream; +import java.security.KeyStore; +import java.security.Provider; +import java.security.Security; +import java.security.cert.CRL; +import java.security.cert.CRLException; +import java.security.cert.Certificate; +import java.security.cert.CertificateException; +import java.security.cert.CertificateFactorySpi; +import java.util.Collection; +import java.util.Enumeration; + +/* + * @test + * @bug 8139436 + * @summary This test validates an iteration over the Windows-ROOT certificate store + * and retrieving all certificates. + * Bug 8139436 reports an issue when 3rd party JCE providers would throw exceptions + * upon creating Certificate objects. + * This would for instance happen when using IAIK 3.15 and Elliptic Curve certificates + * are contained in the Windows-ROOT certificate store. + * The test uses a simple dummy provider which just throws Exceptions in its CertificateFactory. + * To test an external provider, you can use property sun.security.mscapi.testprovider and + * set it to the provider class name which has to be constructible by a constructor without + * arguments. The provider jar has to be added to the classpath. + * E.g. run jtreg with -javaoption:-Dsun.security.mscapi.testprovider=iaik.security.provider.IAIK and + * -cpa:<path to iaik_jce.jar> + * + * @requires os.family == "windows" + * @author Christoph Langer + * @run main IterateWindowsRootStore + */ +public class IterateWindowsRootStore { + public static class TestFactory extends CertificateFactorySpi { + @Override + public Certificate engineGenerateCertificate(InputStream inStream) throws CertificateException { + throw new CertificateException("unimplemented"); + } + + @Override + public Collection<? extends Certificate> engineGenerateCertificates(InputStream inStream) throws CertificateException { + throw new CertificateException("unimplemented"); + } + + @Override + public CRL engineGenerateCRL(InputStream inStream) throws CRLException { + throw new CRLException("unimplemented"); + } + + @Override + public Collection<? extends CRL> engineGenerateCRLs(InputStream inStream) throws CRLException { + throw new CRLException("unimplemented"); + } + } + + public static class TestProvider extends Provider { + private static final long serialVersionUID = 1L; + + public TestProvider() { + super("TestProvider", 0.1, "Test provider for IterateWindowsRootStore"); + + /* + * Certificates + */ + this.put("CertificateFactory.X.509", "IterateWindowsRootStore$TestFactory"); + this.put("Alg.Alias.CertificateFactory.X509", "X.509"); + } + } + + public static void main(String[] args) throws Exception { + // Try to register a JCE provider from property sun.security.mscapi.testprovider in the first slot + // otherwise register a dummy provider which would provoke the issue of bug 8139436 + boolean providerPrepended = false; + String testprovider = System.getProperty("sun.security.mscapi.testprovider"); + if (testprovider != null && !testprovider.isEmpty()) { + try { + System.out.println("Trying to prepend external JCE provider " + testprovider); + Class<?> providerclass = Class.forName(testprovider); + Object provider = providerclass.newInstance(); + Security.insertProviderAt((Provider)provider, 1); + } catch (Exception e) { + System.out.println("Could not load JCE provider " + testprovider +". Exception is:"); + e.printStackTrace(System.out); + } + providerPrepended = true; + System.out.println("Sucessfully prepended JCE provider " + testprovider); + } + if (!providerPrepended) { + System.out.println("Trying to prepend dummy JCE provider"); + Security.insertProviderAt(new TestProvider(), 1); + System.out.println("Sucessfully prepended dummy JCE provider"); + } + + // load Windows-ROOT KeyStore + KeyStore keyStore = KeyStore.getInstance("Windows-ROOT", "SunMSCAPI"); + keyStore.load(null, null); + + // iterate KeyStore + Enumeration<String> aliases = keyStore.aliases(); + while (aliases.hasMoreElements()) { + String alias = aliases.nextElement(); + System.out.print("Reading certificate for alias: " + alias + "..."); + keyStore.getCertificate(alias); + System.out.println(" done."); + } + } +}
--- a/test/sun/security/mscapi/KeyStoreCompatibilityMode.java Mon May 09 02:48:06 2016 +0100 +++ b/test/sun/security/mscapi/KeyStoreCompatibilityMode.java Mon May 09 04:37:12 2016 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2015, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -38,17 +38,6 @@ public static void main(String[] args) throws Exception { - // Check if the provider is available - try { - Class.forName("sun.security.mscapi.SunMSCAPI"); - - } catch (Exception e) { - System.out.println( - "The SunMSCAPI provider is not available on this platform: " + - e); - return; - } - if (args.length > 0 && "-disable".equals(args[0])) { mode = false; } else {
--- a/test/sun/security/mscapi/KeyStoreCompatibilityMode.sh Mon May 09 02:48:06 2016 +0100 +++ b/test/sun/security/mscapi/KeyStoreCompatibilityMode.sh Mon May 09 04:37:12 2016 +0100 @@ -1,7 +1,7 @@ #!/bin/sh # -# Copyright (c) 2005, 2011, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2005, 2015, Oracle and/or its affiliates. All rights reserved. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # # This code is free software; you can redistribute it and/or modify it @@ -23,9 +23,9 @@ # questions. # - # @test # @bug 6324294 6931562 +# @requires os.family == "windows" # @run shell KeyStoreCompatibilityMode.sh # @summary Confirm that a null stream or password is not permitted when # compatibility mode is enabled (and vice versa).
--- a/test/sun/security/mscapi/KeytoolChangeAlias.sh Mon May 09 02:48:06 2016 +0100 +++ b/test/sun/security/mscapi/KeytoolChangeAlias.sh Mon May 09 04:37:12 2016 +0100 @@ -1,7 +1,7 @@ #!/bin/sh # -# Copyright (c) 2006, 2011, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2006, 2015, Oracle and/or its affiliates. All rights reserved. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # # This code is free software; you can redistribute it and/or modify it @@ -26,6 +26,7 @@ # @test # @bug 6415696 6931562 +# @requires os.family == "windows" # @run shell KeytoolChangeAlias.sh # @summary Test "keytool -changealias" using the Microsoft CryptoAPI provider.
--- a/test/sun/security/mscapi/PrngSlow.java Mon May 09 02:48:06 2016 +0100 +++ b/test/sun/security/mscapi/PrngSlow.java Mon May 09 04:37:12 2016 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2006, 2015 Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -24,6 +24,7 @@ /** * @test * @bug 6449335 + * @requires os.family == "windows" * @summary MSCAPI's PRNG is too slow */ @@ -33,23 +34,15 @@ public static void main(String[] args) throws Exception { double t = 0.0; - try { - SecureRandom sr = null; - sr = SecureRandom.getInstance("PRNG", "SunMSCAPI"); - long start = System.nanoTime(); - int x = 0; - for(int i = 0; i < 10000; i++) { - if (i % 100 == 0) System.err.print("."); - if (sr.nextBoolean()) x++; - }; - t = (System.nanoTime() - start) / 1000000000.0; - System.err.println("\nSpend " + t + " seconds"); - } catch (Exception e) { - // Not supported here, maybe not a Win32 - System.err.println("Cannot find PRNG for SunMSCAPI or other mysterious bugs"); - e.printStackTrace(); - return; - } + SecureRandom sr = null; + sr = SecureRandom.getInstance("Windows-PRNG", "SunMSCAPI"); + long start = System.nanoTime(); + for (int i = 0; i < 10000; i++) { + if (i % 100 == 0) System.err.print("."); + sr.nextBoolean(); + }; + t = (System.nanoTime() - start) / 1000000000.0; + System.err.println("\nSpend " + t + " seconds"); if (t > 5) throw new RuntimeException("Still too slow"); }
--- a/test/sun/security/mscapi/PublicKeyInterop.java Mon May 09 02:48:06 2016 +0100 +++ b/test/sun/security/mscapi/PublicKeyInterop.java Mon May 09 04:37:12 2016 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -38,8 +38,6 @@ public class PublicKeyInterop { public static void main(String[] arg) throws Exception { - PrivateKey privKey = null; - Certificate cert = null; KeyStore ks = KeyStore.getInstance("Windows-MY"); ks.load(null, null); System.out.println("Loaded keystore: Windows-MY");
--- a/test/sun/security/mscapi/PublicKeyInterop.sh Mon May 09 02:48:06 2016 +0100 +++ b/test/sun/security/mscapi/PublicKeyInterop.sh Mon May 09 04:37:12 2016 +0100 @@ -1,7 +1,7 @@ #!/bin/sh # -# Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2011, 2015 Oracle and/or its affiliates. All rights reserved. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # # This code is free software; you can redistribute it and/or modify it @@ -25,6 +25,7 @@ # @test # @bug 6888925 +# @requires os.family == "windows" # @run shell PublicKeyInterop.sh # @summary SunMSCAPI's Cipher can't use RSA public keys obtained from other # sources.
--- a/test/sun/security/mscapi/RSAEncryptDecrypt.sh Mon May 09 02:48:06 2016 +0100 +++ b/test/sun/security/mscapi/RSAEncryptDecrypt.sh Mon May 09 04:37:12 2016 +0100 @@ -1,7 +1,7 @@ #!/bin/sh # -# Copyright (c) 2006, 2011, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2006, 2015, Oracle and/or its affiliates. All rights reserved. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # # This code is free software; you can redistribute it and/or modify it @@ -25,6 +25,7 @@ # @test # @bug 6457422 6931562 +# @requires os.family == "windows" # @run shell RSAEncryptDecrypt.sh # @summary Confirm that plaintext can be encrypted and then decrypted using the # RSA cipher in the SunMSCAPI crypto provider. NOTE: The RSA cipher is
--- a/test/sun/security/mscapi/ShortRSAKey1024.sh Mon May 09 02:48:06 2016 +0100 +++ b/test/sun/security/mscapi/ShortRSAKey1024.sh Mon May 09 04:37:12 2016 +0100 @@ -1,7 +1,7 @@ #!/bin/sh # -# Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2012, 2015, Oracle and/or its affiliates. All rights reserved. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # # This code is free software; you can redistribute it and/or modify it @@ -27,6 +27,7 @@ # @test # @bug 7106773 # @summary 512 bits RSA key cannot work with SHA384 and SHA512 +# @requires os.family == "windows" # @run shell ShortRSAKey1024.sh 1024 # @run shell ShortRSAKey1024.sh 768 # @run shell ShortRSAKey1024.sh 512
--- a/test/sun/security/mscapi/ShortRSAKeyWithinTLS.java Mon May 09 02:48:06 2016 +0100 +++ b/test/sun/security/mscapi/ShortRSAKeyWithinTLS.java Mon May 09 04:37:12 2016 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 2015, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -22,12 +22,9 @@ */ import java.io.*; -import java.net.*; -import java.util.*; import java.security.*; import javax.net.*; import javax.net.ssl.*; -import java.lang.reflect.*; import sun.security.util.KeyUtil;
--- a/test/sun/security/mscapi/SignUsingNONEwithRSA.java Mon May 09 02:48:06 2016 +0100 +++ b/test/sun/security/mscapi/SignUsingNONEwithRSA.java Mon May 09 04:37:12 2016 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -118,12 +118,12 @@ ks.load(null, null); System.out.println("Loaded keystore: Windows-MY"); - Enumeration e = ks.aliases(); + Enumeration<String> e = ks.aliases(); PrivateKey privateKey = null; PublicKey publicKey = null; while (e.hasMoreElements()) { - String alias = (String) e.nextElement(); + String alias = e.nextElement(); if (alias.equals("6578658")) { System.out.println("Loaded entry: " + alias); privateKey = (PrivateKey) ks.getKey(alias, null);
--- a/test/sun/security/mscapi/SignUsingNONEwithRSA.sh Mon May 09 02:48:06 2016 +0100 +++ b/test/sun/security/mscapi/SignUsingNONEwithRSA.sh Mon May 09 04:37:12 2016 +0100 @@ -1,7 +1,7 @@ #!/bin/sh # -# Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # # This code is free software; you can redistribute it and/or modify it @@ -26,6 +26,7 @@ # @test # @bug 6578658 +# @requires os.family == "windows" # @run shell SignUsingNONEwithRSA.sh # @summary Sign using the NONEwithRSA signature algorithm from SunMSCAPI
--- a/test/sun/security/mscapi/SignUsingSHA2withRSA.java Mon May 09 02:48:06 2016 +0100 +++ b/test/sun/security/mscapi/SignUsingSHA2withRSA.java Mon May 09 04:37:12 2016 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -58,12 +58,12 @@ ks.load(null, null); System.out.println("Loaded keystore: Windows-MY"); - Enumeration e = ks.aliases(); + Enumeration<String> e = ks.aliases(); PrivateKey privateKey = null; PublicKey publicKey = null; while (e.hasMoreElements()) { - String alias = (String) e.nextElement(); + String alias = e.nextElement(); if (alias.equals("6753664")) { System.out.println("Loaded entry: " + alias); privateKey = (PrivateKey) ks.getKey(alias, null);
--- a/test/sun/security/mscapi/SignUsingSHA2withRSA.sh Mon May 09 02:48:06 2016 +0100 +++ b/test/sun/security/mscapi/SignUsingSHA2withRSA.sh Mon May 09 04:37:12 2016 +0100 @@ -1,7 +1,7 @@ #!/bin/sh # -# Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # # This code is free software; you can redistribute it and/or modify it @@ -26,6 +26,7 @@ # @test # @bug 6753664 +# @requires os.family == "windows" # @run shell SignUsingSHA2withRSA.sh # @summary Support SHA256 (and higher) in SunMSCAPI
--- a/test/sun/security/mscapi/SmallPrimeExponentP.java Mon May 09 02:48:06 2016 +0100 +++ b/test/sun/security/mscapi/SmallPrimeExponentP.java Mon May 09 04:37:12 2016 +0100 @@ -28,13 +28,12 @@ import java.security.SecureRandom; import java.security.cert.X509Certificate; import java.security.interfaces.RSAPrivateCrtKey; -import java.util.HashSet; -import java.util.Set; /* * @test * @bug 8023546 * @summary sun/security/mscapi/ShortRSAKey1024.sh fails intermittently + * @requires os.family == "windows" */ public class SmallPrimeExponentP {
--- a/test/sun/security/pkcs11/sslecc/ClientJSSEServerJSSE.java Mon May 09 02:48:06 2016 +0100 +++ b/test/sun/security/pkcs11/sslecc/ClientJSSEServerJSSE.java Mon May 09 04:37:12 2016 +0100 @@ -57,10 +57,6 @@ } public void main(Provider p) throws Exception { - // MD5 is used in this test case, don't disable MD5 algorithm. - Security.setProperty( - "jdk.certpath.disabledAlgorithms", "MD2, RSA keySize < 1024"); - String testWithoutSunEC = System.getProperty("testWithoutSunEC"); if (p.getService("KeyFactory", "EC") == null) {
--- a/test/sun/security/provider/DSA/TestDSA2.java Mon May 09 02:48:06 2016 +0100 +++ b/test/sun/security/provider/DSA/TestDSA2.java Mon May 09 04:37:12 2016 +0100 @@ -50,7 +50,7 @@ public static void main(String[] args) throws Exception { boolean[] expectedToPass = { true, true, true }; test(1024, expectedToPass); - boolean[] expectedToPass2 = { true, true, true }; + boolean[] expectedToPass2 = { false, true, true }; test(2048, expectedToPass2); }
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test/sun/security/provider/X509Factory/BadPem.java Mon May 09 04:37:12 2016 +0100 @@ -0,0 +1,76 @@ +/* + * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @bug 8074935 + * @summary jdk8 keytool doesn't validate pem files for RFC 1421 correctness, as jdk7 did + */ + +import java.io.ByteArrayOutputStream; +import java.io.FileInputStream; +import java.io.FileOutputStream; +import java.io.PrintStream; +import java.security.KeyStore; +import java.security.cert.CertificateException; +import java.util.Arrays; +import java.util.Base64; + +import sun.security.provider.X509Factory; +import java.security.cert.CertificateFactory; +import java.io.ByteArrayInputStream; + +public class BadPem { + + public static void main(String[] args) throws Exception { + String ks = System.getProperty("test.src", ".") + + "/../../ssl/etc/keystore"; + String pass = "passphrase"; + String alias = "dummy"; + + KeyStore keyStore = KeyStore.getInstance("JKS"); + keyStore.load(new FileInputStream(ks), pass.toCharArray()); + byte[] cert = keyStore.getCertificate(alias).getEncoded(); + + ByteArrayOutputStream bout = new ByteArrayOutputStream(); + PrintStream pout = new PrintStream(bout); + byte[] CRLF = new byte[] {'\r', '\n'}; + pout.println(X509Factory.BEGIN_CERT); + for (int i=0; i<cert.length; i += 48) { + int blockLen = (cert.length > i + 48) ? 48 : (cert.length - i); + pout.println("!" + Base64.getEncoder() + .encodeToString(Arrays.copyOfRange(cert, i, i + blockLen))); + } + pout.println(X509Factory.END_CERT); + + CertificateFactory cf = CertificateFactory.getInstance("X.509"); + + try { + cf.generateCertificate(new ByteArrayInputStream(bout.toByteArray())); + throw new Exception("Should fail"); + } catch (CertificateException e) { + // Good + } + } +} +
--- a/test/sun/security/tools/keytool/KeyToolTest.java Mon May 09 02:48:06 2016 +0100 +++ b/test/sun/security/tools/keytool/KeyToolTest.java Mon May 09 04:37:12 2016 +0100 @@ -55,6 +55,8 @@ * NSS PKCS11 config file are changed, DSA not supported now. */ +import java.nio.file.Files; +import java.nio.file.Paths; import java.security.KeyStore; import sun.security.x509.*; import java.io.*; @@ -844,6 +846,24 @@ remove("mykey.cert"); } + // 8074935: jdk8 keytool doesn't validate pem files for RFC 1421 correctness + static void checkPem(String file) throws Exception { + boolean maybeLast = false; + for (String s: Files.readAllLines(Paths.get(file))) { + if (s.isEmpty()) continue; + if (s.startsWith("---")) continue; + if (maybeLast) { + throw new Exception("Last line already seen"); + } + if (s.length() > 64) { + throw new Exception(s); + } + if (s.length() < 64) { + maybeLast = true; + } + } + } + void v3extTest(String keyAlg) throws Exception { KeyStore ks; remove("x.jks"); @@ -1153,11 +1173,14 @@ "-rfc -file test.req"); // printcertreq testOK("", "-printcertreq -file test.req"); - // issue: deny KU, change criticality of 1.2.3 and 1.2.4, change content of BC, add 2.3.4 + checkPem("test.req"); + // issue: deny KU, change criticality of 1.2.3 and 1.2.4, + // change content of BC, add 2.3.4 testOK("", simple+"-gencert -alias ca -infile test.req -ext " + "honored=all,-KU,1.2.3:critical,1.2.4:non-critical " + "-ext BC=2 -ext 2.3.4=01020304 " + "-debug -rfc -outfile test.cert"); + checkPem("test.cert"); testOK("", simple+"-importcert -file test.cert -alias a"); ks = loadStore("x.jks", "changeit", "JKS"); X509CertImpl a = (X509CertImpl)ks.getCertificate("a");
--- a/test/sun/util/calendar/zi/tzdata/VERSION Mon May 09 02:48:06 2016 +0100 +++ b/test/sun/util/calendar/zi/tzdata/VERSION Mon May 09 04:37:12 2016 +0100 @@ -21,4 +21,4 @@ # or visit www.oracle.com if you need additional information or have any # questions. # -tzdata2015g +tzdata2016a
--- a/test/sun/util/calendar/zi/tzdata/asia Mon May 09 02:48:06 2016 +0100 +++ b/test/sun/util/calendar/zi/tzdata/asia Mon May 09 04:37:12 2016 +0100 @@ -897,6 +897,15 @@ 9:00 - TLT # India + +# From Ian P. Beacock, in "A brief history of (modern) time", The Atlantic +# http://www.theatlantic.com/technology/archive/2015/12/the-creation-of-modern-time/421419/ +# (2015-12-22): +# In January 1906, several thousand cotton-mill workers rioted on the +# outskirts of Bombay.... They were protesting the proposed abolition of +# local time in favor of Indian Standard Time.... Journalists called this +# dispute the "Battle of the Clocks." It lasted nearly half a century. + # Zone NAME GMTOFF RULES FORMAT [UNTIL] Zone Asia/Kolkata 5:53:28 - LMT 1880 # Kolkata 5:53:20 - HMT 1941 Oct # Howrah Mean Time? @@ -1107,8 +1116,15 @@ Rule Iran 2032 2033 - Sep 21 0:00 0 S Rule Iran 2034 2035 - Mar 22 0:00 1:00 D Rule Iran 2034 2035 - Sep 22 0:00 0 S -Rule Iran 2036 2037 - Mar 21 0:00 1:00 D -Rule Iran 2036 2037 - Sep 21 0:00 0 S +# +# The following rules are approximations starting in the year 2038. +# These are the best post-2037 approximations available, given the +# restrictions of a single rule using a Gregorian-based data format. +# At some point this table will need to be extended, though quite +# possibly Iran will change the rules first. +Rule Iran 2036 max - Mar 21 0:00 1:00 D +Rule Iran 2036 max - Sep 21 0:00 0 S + # Zone NAME GMTOFF RULES FORMAT [UNTIL] Zone Asia/Tehran 3:25:44 - LMT 1916 3:25:44 - TMT 1946 # Tehran Mean Time @@ -2134,8 +2150,8 @@ # http://www.app.com.pk/en_/index.php?option=com_content&task=view&id=99374&Itemid=2 # Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S -Rule Pakistan 2002 only - Apr Sun>=2 0:01 1:00 S -Rule Pakistan 2002 only - Oct Sun>=2 0:01 0 - +Rule Pakistan 2002 only - Apr Sun>=2 0:00 1:00 S +Rule Pakistan 2002 only - Oct Sun>=2 0:00 0 - Rule Pakistan 2008 only - Jun 1 0:00 1:00 S Rule Pakistan 2008 2009 - Nov 1 0:00 0 - Rule Pakistan 2009 only - Apr 15 0:00 1:00 S
--- a/test/sun/util/calendar/zi/tzdata/backward Mon May 09 02:48:06 2016 +0100 +++ b/test/sun/util/calendar/zi/tzdata/backward Mon May 09 04:37:12 2016 +0100 @@ -46,6 +46,7 @@ Link America/Toronto America/Montreal Link America/Rio_Branco America/Porto_Acre Link America/Argentina/Cordoba America/Rosario +Link America/Tijuana America/Santa_Isabel Link America/Denver America/Shiprock Link America/Port_of_Spain America/Virgin Link Pacific/Auckland Antarctica/South_Pole
--- a/test/sun/util/calendar/zi/tzdata/europe Mon May 09 02:48:06 2016 +0100 +++ b/test/sun/util/calendar/zi/tzdata/europe Mon May 09 04:37:12 2016 +0100 @@ -2616,13 +2616,20 @@ # Note: Effective 2008-03-01, (75) Chita Oblast and (80) Agin-Buryat # Autonomous Okrug merged to form (92, RU-ZAB) Zabaykalsky Krai. +# From Alexander Krivenyshev (2016-01-02): +# [The] time zone in the Trans-Baikal Territory (Zabaykalsky Krai) - +# Asia/Chita [is changing] from UTC+8 to UTC+9. Effective date will +# be March 27, 2016 at 2:00am.... +# http://publication.pravo.gov.ru/Document/View/000120151230010 + Zone Asia/Chita 7:33:52 - LMT 1919 Dec 15 8:00 - YAKT 1930 Jun 21 # Yakutsk Time 9:00 Russia YAK%sT 1991 Mar 31 2:00s 8:00 Russia YAK%sT 1992 Jan 19 2:00s 9:00 Russia YAK%sT 2011 Mar 27 2:00s 10:00 - YAKT 2014 Oct 26 2:00s - 8:00 - IRKT + 8:00 - IRKT 2016 Mar 27 2:00 + 9:00 - YAKT # From Tim Parenti (2014-07-03), per Oscar van Vlijmen (2009-11-29): @@ -3177,6 +3184,12 @@ # It's officially announced now by the Ministry of Energy. # Turkey delays winter time to 8th of November 04:00 # http://www.aa.com.tr/tr/turkiye/yaz-saati-uygulamasi-8-kasimda-sona-erecek/362217 +# +# From BBC News (2015-10-25): +# Confused Turks are asking "what's the time?" after automatic clocks defied a +# government decision ... "For the next two weeks #Turkey is on EEST... Erdogan +# Engineered Standard Time," said Twitter user @aysekarahasan. +# http://www.bbc.com/news/world-europe-34631326 # Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S Rule Turkey 1916 only - May 1 0:00 1:00 S
--- a/test/sun/util/calendar/zi/tzdata/northamerica Mon May 09 02:48:06 2016 +0100 +++ b/test/sun/util/calendar/zi/tzdata/northamerica Mon May 09 04:37:12 2016 +0100 @@ -348,6 +348,16 @@ # Statue 175 closer in synch with the US Congress' intent.... # http://www.legis.state.wi.us/2007/data/acts/07Act3.pdf +# From an email administrator of the City of Fort Pierre, SD (2015-12-21): +# Fort Pierre is technically located in the Mountain time zone as is +# the rest of Stanley County. Most of Stanley County and Fort Pierre +# uses the Central time zone due to doing most of their business in +# Pierre so it simplifies schedules. I have lived in Stanley County +# all my life and it has been that way since I can remember. (43 years!) +# +# From Paul Eggert (2015-12-25): +# Assume this practice predates 1970, so Fort Pierre can use America/Chicago. + # Rule NAME FROM TO TYPE IN ON AT SAVE LETTER Rule Chicago 1920 only - Jun 13 2:00 1:00 D Rule Chicago 1920 1921 - Oct lastSun 2:00 0 S @@ -504,6 +514,12 @@ # For lack of better information, assume that Metlakatla's # abandonment of use of daylight saving resulted from the 1983 vote. +# From Steffen Thorsen (2015-11-09): +# It seems Metlakatla did go off PST on Sunday, November 1, changing +# their time to AKST and are going to follow Alaska's DST, switching +# between AKST and AKDT from now on.... +# http://www.krbd.org/2015/10/30/annette-island-times-they-are-a-changing/ + # Zone NAME GMTOFF RULES FORMAT [UNTIL] Zone America/Juneau 15:02:19 - LMT 1867 Oct 18 -8:57:41 - LMT 1900 Aug 20 12:00 @@ -529,7 +545,8 @@ -8:00 US P%sT 1946 -8:00 - PST 1969 -8:00 US P%sT 1983 Oct 30 2:00 - -8:00 - PST + -8:00 - PST 2015 Nov 1 2:00 + -9:00 US AK%sT Zone America/Yakutat 14:41:05 - LMT 1867 Oct 18 -9:18:55 - LMT 1900 Aug 20 12:00 -9:00 - YST 1942 @@ -2610,25 +2627,6 @@ -8:00 US P%sT 2002 Feb 20 -8:00 Mexico P%sT 2010 -8:00 US P%sT -# Baja California (away from US border) -Zone America/Santa_Isabel -7:39:28 - LMT 1922 Jan 1 0:20:32 - -7:00 - MST 1924 - -8:00 - PST 1927 Jun 10 23:00 - -7:00 - MST 1930 Nov 15 - -8:00 - PST 1931 Apr 1 - -8:00 1:00 PDT 1931 Sep 30 - -8:00 - PST 1942 Apr 24 - -8:00 1:00 PWT 1945 Aug 14 23:00u - -8:00 1:00 PPT 1945 Nov 12 # Peace - -8:00 - PST 1948 Apr 5 - -8:00 1:00 PDT 1949 Jan 14 - -8:00 - PST 1954 - -8:00 CA P%sT 1961 - -8:00 - PST 1976 - -8:00 US P%sT 1996 - -8:00 Mexico P%sT 2001 - -8:00 US P%sT 2002 Feb 20 - -8:00 Mexico P%sT # From Paul Eggert (2006-03-22): # Formerly there was an America/Ensenada zone, which differed from # America/Tijuana only in that it did not observe DST from 1976 @@ -2641,6 +2639,13 @@ # other than America/Tijuana for Baja, but it's not clear yet what its # name or contents should be. # +# From Paul Eggert (2015-10-08): +# Formerly there was an America/Santa_Isabel zone, but this appears to +# have come from a misreading of +# http://dof.gob.mx/nota_detalle.php?codigo=5127480&fecha=06/01/2010 +# It has been moved to the 'backward' file. +# +# # Revillagigedo Is # no information @@ -2715,17 +2720,7 @@ -4:00 US A%sT # Cayman Is - -# From Paul Eggert (2015-05-15): -# The Cayman government has decided to introduce DST in 2016, the idea being -# to keep in sync with New York. The legislation hasn't passed but the change -# seems quite likely. See: Meade B. Cayman 27. -# http://www.cayman27.com.ky/2015/05/15/clock-ticks-toward-daylight-saving-time-in-cayman - -Zone America/Cayman -5:25:32 - LMT 1890 # Georgetown - -5:07:11 - KMT 1912 Feb # Kingston Mean Time - -5:00 - EST 2016 - -5:00 US E%sT +# See America/Panama. # Costa Rica @@ -3248,6 +3243,7 @@ Zone America/Panama -5:18:08 - LMT 1890 -5:19:36 - CMT 1908 Apr 22 # Colón Mean Time -5:00 - EST +Link America/Panama America/Cayman # Puerto Rico # There are too many San Juans elsewhere, so we'll use 'Puerto_Rico'.
--- a/test/sun/util/calendar/zi/tzdata/zone.tab Mon May 09 02:48:06 2016 +0100 +++ b/test/sun/util/calendar/zi/tzdata/zone.tab Mon May 09 04:37:12 2016 +0100 @@ -306,8 +306,7 @@ MX +2838-10605 America/Chihuahua Mexican Mountain Time - Chihuahua away from US border MX +2934-10425 America/Ojinaga US Mountain Time - Chihuahua near US border MX +2904-11058 America/Hermosillo Mountain Standard Time - Sonora -MX +3232-11701 America/Tijuana US Pacific Time - Baja California near US border -MX +3018-11452 America/Santa_Isabel Mexican Pacific Time - Baja California away from US border +MX +3232-11701 America/Tijuana US Pacific Time - Baja California state MX +2048-10515 America/Bahia_Banderas Mexican Central Time - Bahia de Banderas MY +0310+10142 Asia/Kuala_Lumpur peninsular Malaysia MY +0133+11020 Asia/Kuching Sabah & Sarawak @@ -437,10 +436,10 @@ US +433649-1161209 America/Boise Mountain Time - south Idaho & east Oregon US +332654-1120424 America/Phoenix Mountain Standard Time - Arizona (except Navajo) US +340308-1181434 America/Los_Angeles Pacific Time -US +550737-1313435 America/Metlakatla Pacific Standard Time - Annette Island, Alaska US +611305-1495401 America/Anchorage Alaska Time US +581807-1342511 America/Juneau Alaska Time - Alaska panhandle US +571035-1351807 America/Sitka Alaska Time - southeast Alaska panhandle +US +550737-1313435 America/Metlakatla Alaska Time - Annette Island US +593249-1394338 America/Yakutat Alaska Time - Alaska panhandle neck US +643004-1652423 America/Nome Alaska Time - west Alaska US +515248-1763929 America/Adak Aleutian Islands