Mercurial > hg > openjdk > bsd-port > jdk
changeset 4563:1da81fa43d48 jdk7u2-b06
Merge
author | lana |
---|---|
date | Thu, 01 Sep 2011 08:53:40 -0700 |
parents | 0f58ca394fb3 (current diff) c2f39983959f (diff) |
children | d26cd028ee0b 825430a003d4 |
files | |
diffstat | 43 files changed, 939 insertions(+), 325 deletions(-) [+] |
line wrap: on
line diff
--- a/make/java/util/FILES_properties.gmk Wed Aug 31 15:37:07 2011 -0700 +++ b/make/java/util/FILES_properties.gmk Thu Sep 01 08:53:40 2011 -0700 @@ -151,6 +151,7 @@ sun/util/resources/CurrencyNames_es_CL.properties \ sun/util/resources/CurrencyNames_es_CO.properties \ sun/util/resources/CurrencyNames_es_CR.properties \ + sun/util/resources/CurrencyNames_es_CU.properties \ sun/util/resources/CurrencyNames_es_DO.properties \ sun/util/resources/CurrencyNames_es_EC.properties \ sun/util/resources/CurrencyNames_es_ES.properties \
--- a/make/tools/src/build/tools/generatecurrencydata/GenerateCurrencyData.java Wed Aug 31 15:37:07 2011 -0700 +++ b/make/tools/src/build/tools/generatecurrencydata/GenerateCurrencyData.java Thu Sep 01 08:53:40 2011 -0700 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2006, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2011, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -120,7 +120,7 @@ private static int[] specialCaseOldCurrenciesNumericCode = new int[maxSpecialCases]; private static int[] specialCaseNewCurrenciesNumericCode = new int[maxSpecialCases]; - private static final int maxOtherCurrencies = 65; + private static final int maxOtherCurrencies = 70; private static int otherCurrenciesCount = 0; private static StringBuffer otherCurrencies = new StringBuffer(); private static int[] otherCurrenciesDefaultFractionDigits = new int[maxOtherCurrencies];
--- a/src/share/classes/com/sun/security/ntlm/Client.java Wed Aug 31 15:37:07 2011 -0700 +++ b/src/share/classes/com/sun/security/ntlm/Client.java Thu Sep 01 08:53:40 2011 -0700 @@ -69,14 +69,16 @@ * This method does not make any modification to this parameter, it neither * needs to access the content of this parameter after this method call, * so you are free to modify or nullify this parameter after this call. - * @throws NullPointerException if {@code username} or {@code password} is null. - * @throws NTLMException if {@code version} is illegal + * @throws NTLMException if {@code username} or {@code password} is null, + * or {@code version} is illegal. + * */ public Client(String version, String hostname, String username, String domain, char[] password) throws NTLMException { super(version); if ((username == null || password == null)) { - throw new NullPointerException("username/password cannot be null"); + throw new NTLMException(NTLMException.PROTOCOL, + "username/password cannot be null"); } this.hostname = hostname; this.username = username; @@ -117,13 +119,13 @@ * @param nonce random 8-byte array to be used in message generation, * must not be null except for original NTLM v1 * @return the message generated - * @throws NullPointerException if {@code type2} or {@code nonce} is null - * for NTLM v1. - * @throws NTLMException if the incoming message is invalid + * @throws NTLMException if the incoming message is invalid, or + * {@code nonce} is null for NTLM v1. */ public byte[] type3(byte[] type2, byte[] nonce) throws NTLMException { if (type2 == null || (v != Version.NTLM && nonce == null)) { - throw new NullPointerException("type2 and nonce cannot be null"); + throw new NTLMException(NTLMException.PROTOCOL, + "type2 and nonce cannot be null"); } debug("NTLM Client: Type 2 received\n"); debug(type2);
--- a/src/share/classes/com/sun/security/ntlm/NTLMException.java Wed Aug 31 15:37:07 2011 -0700 +++ b/src/share/classes/com/sun/security/ntlm/NTLMException.java Thu Sep 01 08:53:40 2011 -0700 @@ -64,6 +64,11 @@ */ public final static int BAD_VERSION = 5; + /** + * Protocol errors. + */ + public final static int PROTOCOL = 6; + private int errorCode; /**
--- a/src/share/classes/com/sun/security/ntlm/Server.java Wed Aug 31 15:37:07 2011 -0700 +++ b/src/share/classes/com/sun/security/ntlm/Server.java Thu Sep 01 08:53:40 2011 -0700 @@ -62,12 +62,13 @@ * is selected, authentication succeeds if one of LM (or LMv2) or * NTLM (or NTLMv2) is verified. * @param domain the domain, must not be null - * @throws NullPointerException if {@code domain} is null. + * @throws NTLMException if {@code domain} is null. */ public Server(String version, String domain) throws NTLMException { super(version); if (domain == null) { - throw new NullPointerException("domain cannot be null"); + throw new NTLMException(NTLMException.PROTOCOL, + "domain cannot be null"); } this.allVersion = (version == null); this.domain = domain; @@ -80,12 +81,13 @@ * @param nonce the random 8-byte array to be used in message generation, * must not be null * @return the message generated - * @throws NullPointerException if type1 or nonce is null - * @throws NTLMException if the incoming message is invalid + * @throws NTLMException if the incoming message is invalid, or + * {@code nonce} is null. */ - public byte[] type2(byte[] type1, byte[] nonce) { + public byte[] type2(byte[] type1, byte[] nonce) throws NTLMException { if (nonce == null) { - throw new NullPointerException("nonce cannot be null"); + throw new NTLMException(NTLMException.PROTOCOL, + "nonce cannot be null"); } debug("NTLM Server: Type 1 received\n"); if (type1 != null) debug(type1); @@ -105,13 +107,14 @@ * @param type3 the incoming Type3 message from client, must not be null * @param nonce the same nonce provided in {@link #type2}, must not be null * @return username and hostname of the client in a byte array - * @throws NullPointerException if {@code type3} or {@code nonce} is null - * @throws NTLMException if the incoming message is invalid + * @throws NTLMException if the incoming message is invalid, or + * {@code nonce} is null. */ public String[] verify(byte[] type3, byte[] nonce) throws NTLMException { if (type3 == null || nonce == null) { - throw new NullPointerException("type1 or nonce cannot be null"); + throw new NTLMException(NTLMException.PROTOCOL, + "type1 or nonce cannot be null"); } debug("NTLM Server: Type 3 received\n"); if (type3 != null) debug(type3);
--- a/src/share/classes/com/sun/security/sasl/ntlm/FactoryImpl.java Wed Aug 31 15:37:07 2011 -0700 +++ b/src/share/classes/com/sun/security/sasl/ntlm/FactoryImpl.java Thu Sep 01 08:53:40 2011 -0700 @@ -70,6 +70,12 @@ if (mechs[i].equals("NTLM") && PolicyUtils.checkPolicy(mechPolicies[0], props)) { + if (cbh == null) { + throw new SaslException( + "Callback handler with support for " + + "RealmCallback, NameCallback, and PasswordCallback " + + "required"); + } return new NTLMClient(mechs[i], authorizationId, protocol, serverName, props, cbh); } @@ -98,9 +104,9 @@ } if (cbh == null) { throw new SaslException( - "Callback handler with support for AuthorizeCallback, "+ - "RealmCallback, NameCallback, and PasswordCallback " + - "required"); + "Callback handler with support for " + + "RealmCallback, NameCallback, and PasswordCallback " + + "required"); } return new NTLMServer(mech, protocol, serverName, props, cbh); }
--- a/src/share/classes/com/sun/security/sasl/ntlm/NTLMClient.java Wed Aug 31 15:37:07 2011 -0700 +++ b/src/share/classes/com/sun/security/sasl/ntlm/NTLMClient.java Thu Sep 01 08:53:40 2011 -0700 @@ -107,7 +107,7 @@ * @param protocol non-null for Sasl, useless for NTLM * @param serverName non-null for Sasl, but can be null for NTLM * @param props can be null - * @param cbh can be null for Sasl, but will throw NPE for NTLM + * @param cbh can be null for Sasl, already null-checked in factory * @throws SaslException */ NTLMClient(String mech, String authzid, String protocol, String serverName, @@ -166,7 +166,7 @@ pcb.getPassword()); } catch (NTLMException ne) { throw new SaslException( - "NTLM: Invalid version string: " + version, ne); + "NTLM: client creation failure", ne); } } @@ -183,17 +183,20 @@ @Override public byte[] unwrap(byte[] incoming, int offset, int len) throws SaslException { - throw new UnsupportedOperationException("Not supported."); + throw new IllegalStateException("Not supported."); } @Override public byte[] wrap(byte[] outgoing, int offset, int len) throws SaslException { - throw new UnsupportedOperationException("Not supported."); + throw new IllegalStateException("Not supported."); } @Override public Object getNegotiatedProperty(String propName) { + if (!isComplete()) { + throw new IllegalStateException("authentication not complete"); + } if (propName.equals(Sasl.QOP)) { return "auth"; } else if (propName.equals(NTLM_DOMAIN)) {
--- a/src/share/classes/com/sun/security/sasl/ntlm/NTLMServer.java Wed Aug 31 15:37:07 2011 -0700 +++ b/src/share/classes/com/sun/security/sasl/ntlm/NTLMServer.java Thu Sep 01 08:53:40 2011 -0700 @@ -106,7 +106,7 @@ * @param serverName not null for Sasl, can be null in NTLM. If non-null, * might be used as domain if not provided in props * @param props can be null - * @param cbh can be null for Sasl, but will throw NPE in auth for NTLM + * @param cbh can be null for Sasl, already null-checked in factory * @throws SaslException */ NTLMServer(String mech, String protocol, String serverName, @@ -131,7 +131,7 @@ domain = serverName; } if (domain == null) { - throw new NullPointerException("Domain must be provided as" + throw new SaslException("Domain must be provided as" + " the serverName argument or in props"); } @@ -158,7 +158,7 @@ }; } catch (NTLMException ne) { throw new SaslException( - "NTLM: Invalid version string: " + version, ne); + "NTLM: server creation failure", ne); } nonce = new byte[8]; } @@ -181,8 +181,8 @@ hostname = out[1]; return null; } - } catch (GeneralSecurityException ex) { - throw new SaslException("", ex); + } catch (NTLMException ex) { + throw new SaslException("NTLM: generate response failure", ex); } } @@ -193,23 +193,29 @@ @Override public String getAuthorizationID() { + if (!isComplete()) { + throw new IllegalStateException("authentication not complete"); + } return authzId; } @Override public byte[] unwrap(byte[] incoming, int offset, int len) throws SaslException { - throw new UnsupportedOperationException("Not supported yet."); + throw new IllegalStateException("Not supported yet."); } @Override public byte[] wrap(byte[] outgoing, int offset, int len) throws SaslException { - throw new UnsupportedOperationException("Not supported yet."); + throw new IllegalStateException("Not supported yet."); } @Override public Object getNegotiatedProperty(String propName) { + if (!isComplete()) { + throw new IllegalStateException("authentication not complete"); + } if (propName.equals(Sasl.QOP)) { return "auth"; } else if (propName.equals(NTLM_HOSTNAME)) {
--- a/src/share/classes/java/util/CurrencyData.properties Wed Aug 31 15:37:07 2011 -0700 +++ b/src/share/classes/java/util/CurrencyData.properties Thu Sep 01 08:53:40 2011 -0700 @@ -29,7 +29,7 @@ # It is a serial number that accompanies with each amendment, such as # 'MAxxx.doc' -dataVersion=140 +dataVersion=151 # List of all valid ISO 4217 currency codes. # To ensure compatibility, do not remove codes. @@ -37,7 +37,7 @@ all=ADP020-AED784-AFA004-AFN971-ALL008-AMD051-ANG532-AOA973-ARS032-ATS040-AUD036-\ AWG533-AYM945-AZM031-AZN944-BAM977-BBD052-BDT050-BEF056-BGL100-BGN975-BHD048-BIF108-\ BMD060-BND096-BOB068-BOV984-BRL986-BSD044-BTN064-BWP072-BYB112-BYR974-\ - BZD084-CAD124-CDF976-CHF756-CLF990-CLP152-CNY156-COP170-CRC188-CSD891-CUP192-\ + BZD084-CAD124-CDF976-CHF756-CLF990-CLP152-CNY156-COP170-CRC188-CSD891-CUP192-CUC931-\ CVE132-CYP196-CZK203-DEM276-DJF262-DKK208-DOP214-DZD012-EEK233-EGP818-\ ERN232-ESP724-ETB230-EUR978-FIM246-FJD242-FKP238-FRF250-GBP826-GEL981-\ GHC288-GHS936-GIP292-GMD270-GNF324-GRD300-GTQ320-GWP624-GYD328-HKD344-HNL340-\ @@ -49,11 +49,11 @@ NIO558-NLG528-NOK578-NPR524-NZD554-OMR512-PAB590-PEN604-PGK598-PHP608-\ PKR586-PLN985-PTE620-PYG600-QAR634-ROL946-RON946-RSD941-RUB643-RUR810-RWF646-SAR682-\ SBD090-SCR690-SDD736-SDG938-SEK752-SGD702-SHP654-SIT705-SKK703-SLL694-SOS706-\ - SRD968-SRG740-STD678-SVC222-SYP760-SZL748-THB764-TJS972-TMM795-TND788-TOP776-\ + SRD968-SRG740-STD678-SVC222-SYP760-SZL748-THB764-TJS972-TMM795-TMT934-TND788-TOP776-\ TPE626-TRL792-TRY949-TTD780-TWD901-TZS834-UAH980-UGX800-USD840-USN997-USS998-\ UYU858-UZS860-VEB862-VEF937-VND704-VUV548-WST882-XAF950-XAG961-XAU959-XBA955-\ XBB956-XBC957-XBD958-XCD951-XDR960-XFO000-XFU000-XOF952-XPD964-XPF953-\ - XPT962-XTS963-XXX999-YER886-YUM891-ZAR710-ZMK894-ZWD716-ZWN942 + XPT962-XSU994-XTS963-XUA965-XXX999-YER886-YUM891-ZAR710-ZMK894-ZWD716-ZWL932-ZWN942-ZWR935 # Mappings from ISO 3166 country codes to ISO 4217 currency codes. @@ -124,6 +124,8 @@ BJ=XOF # BERMUDA BM=BMD +# Bonaire, Sint Eustatius and Saba +BQ=USD # BHUTAN BT=BTN # BOLIVIA @@ -186,6 +188,8 @@ HR=HRK # CUBA CU=CUP +# Cura\u00e7ao +CW=ANG # CYPRUS CY=EUR # CZECH REPUBLIC @@ -210,7 +214,7 @@ # ERITREA ER=ERN # ESTONIA -EE=EEK +EE=EUR # ETHIOPIA ET=ETB # FALKLAND ISLANDS (MALVINAS) @@ -476,7 +480,7 @@ # SINGAPORE SG=SGD # SLOVAKIA -SK=SKK +SK=EUR # SLOVENIA SI=EUR # SOLOMON ISLANDS @@ -497,6 +501,8 @@ SR=SRD # SVALBARD AND JAN MAYEN SJ=NOK +# Sint Maarten (Dutch part) +SX=ANG # SWAZILAND SZ=SZL # SWEDEN @@ -528,7 +534,7 @@ # TURKEY TR=TRL;2004-12-31-22-00-00;TRY # TURKMENISTAN -TM=TMM +TM=TMT # TURKS AND CAICOS ISLANDS TC=USD # TUVALU @@ -568,7 +574,7 @@ # ZAMBIA ZM=ZMK # ZIMBABWE -ZW=ZWD +ZW=ZWL # List of currencies with 0, 1, OR 3 decimals for minor units, or where there @@ -583,4 +589,4 @@ BHD-IQD-JOD-KWD-LYD-OMR-TND minorUndefined=\ XAG-XAU-XBA-XBB-XBC-XBD-XDR-XFO-XFU-XPD-\ - XPT-XTS-XXX + XPT-XSU-XTS-XUA-XXX
--- a/src/share/classes/java/util/LocaleISOData.java Wed Aug 31 15:37:07 2011 -0700 +++ b/src/share/classes/java/util/LocaleISOData.java Thu Sep 01 08:53:40 2011 -0700 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2011, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -254,6 +254,7 @@ + "BM" + "BMU" // Bermuda + "BN" + "BRN" // Brunei Darussalam + "BO" + "BOL" // Bolivia, Republic of + + "BQ" + "BES" // Bonaire, Sint Eustatius and Saba + "BR" + "BRA" // Brazil, Federative Republic of + "BS" + "BHS" // Bahamas, Commonwealth of the + "BT" + "BTN" // Bhutan, Kingdom of @@ -277,6 +278,7 @@ // + "CS" + "SCG" // Serbia and Montenegro + "CU" + "CUB" // Cuba, Republic of + "CV" + "CPV" // Cape Verde, Republic of + + "CW" + "CUW" // Cura\u00e7ao + "CX" + "CXR" // Christmas Island + "CY" + "CYP" // Cyprus, Republic of + "CZ" + "CZE" // Czech Republic @@ -433,6 +435,7 @@ + "SR" + "SUR" // Suriname, Republic of + "ST" + "STP" // Sao Tome and Principe, Democratic Republic of + "SV" + "SLV" // El Salvador, Republic of + + "SX" + "SXM" // Sint Maarten (Dutch part) + "SY" + "SYR" // Syrian Arab Republic + "SZ" + "SWZ" // Swaziland, Kingdom of + "TC" + "TCA" // Turks and Caicos Islands
--- a/src/share/classes/java/util/regex/Matcher.java Wed Aug 31 15:37:07 2011 -0700 +++ b/src/share/classes/java/util/regex/Matcher.java Thu Sep 01 08:53:40 2011 -0700 @@ -515,6 +515,7 @@ * @throws IllegalArgumentException * If there is no capturing group in the pattern * with the given name + * @since 1.7 */ public String group(String name) { if (name == null)
--- a/src/share/classes/sun/management/ManagementFactoryHelper.java Wed Aug 31 15:37:07 2011 -0700 +++ b/src/share/classes/sun/management/ManagementFactoryHelper.java Thu Sep 01 08:53:40 2011 -0700 @@ -171,7 +171,8 @@ ObjectName result = objname; if (result == null) { synchronized (this) { - if (objname == null) { + result = objname; + if (result == null) { result = Util.newObjectName(LOGGING_MXBEAN_NAME); objname = result; } @@ -228,7 +229,8 @@ ObjectName result = objname; if (result == null) { synchronized (this) { - if (objname == null) { + result = objname; + if (result == null) { result = Util.newObjectName(BUFFER_POOL_MXBEAN_NAME + ",name=" + pool.getName()); objname = result;
--- a/src/share/classes/sun/reflect/annotation/AnnotationInvocationHandler.java Wed Aug 31 15:37:07 2011 -0700 +++ b/src/share/classes/sun/reflect/annotation/AnnotationInvocationHandler.java Thu Sep 01 08:53:40 2011 -0700 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2011, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -40,6 +40,7 @@ * @since 1.5 */ class AnnotationInvocationHandler implements InvocationHandler, Serializable { + private static final long serialVersionUID = 6182022883658399397L; private final Class<? extends Annotation> type; private final Map<String, Object> memberValues;
--- a/src/share/classes/sun/reflect/annotation/AnnotationTypeMismatchExceptionProxy.java Wed Aug 31 15:37:07 2011 -0700 +++ b/src/share/classes/sun/reflect/annotation/AnnotationTypeMismatchExceptionProxy.java Thu Sep 01 08:53:40 2011 -0700 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2004, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2004, 2011, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -34,6 +34,7 @@ * @since 1.5 */ class AnnotationTypeMismatchExceptionProxy extends ExceptionProxy { + private static final long serialVersionUID = 7844069490309503934L; private Method member; private String foundType;
--- a/src/share/classes/sun/reflect/annotation/EnumConstantNotPresentExceptionProxy.java Wed Aug 31 15:37:07 2011 -0700 +++ b/src/share/classes/sun/reflect/annotation/EnumConstantNotPresentExceptionProxy.java Thu Sep 01 08:53:40 2011 -0700 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2004, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2004, 2011, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -33,6 +33,7 @@ * @since 1.5 */ public class EnumConstantNotPresentExceptionProxy extends ExceptionProxy { + private static final long serialVersionUID = -604662101303187330L; Class<? extends Enum> enumType; String constName;
--- a/src/share/classes/sun/reflect/annotation/TypeNotPresentExceptionProxy.java Wed Aug 31 15:37:07 2011 -0700 +++ b/src/share/classes/sun/reflect/annotation/TypeNotPresentExceptionProxy.java Thu Sep 01 08:53:40 2011 -0700 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2004, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2004, 2011, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -33,6 +33,7 @@ * @since 1.5 */ public class TypeNotPresentExceptionProxy extends ExceptionProxy { + private static final long serialVersionUID = 5565925172427947573L; String typeName; Throwable cause;
--- a/src/share/classes/sun/swing/DefaultLayoutStyle.java Wed Aug 31 15:37:07 2011 -0700 +++ b/src/share/classes/sun/swing/DefaultLayoutStyle.java Thu Sep 01 08:53:40 2011 -0700 @@ -48,10 +48,12 @@ @Override public int getPreferredGap(JComponent component1, JComponent component2, ComponentPlacement type, int position, Container parent) { - if (component1 == null || component2 == null || type == null) { throw new NullPointerException(); } + + checkPosition(position); + if (type == ComponentPlacement.INDENT && (position == SwingConstants.EAST || position == SwingConstants.WEST)) {
--- a/src/share/classes/sun/util/resources/CurrencyNames.properties Wed Aug 31 15:37:07 2011 -0700 +++ b/src/share/classes/sun/util/resources/CurrencyNames.properties Thu Sep 01 08:53:40 2011 -0700 @@ -106,6 +106,7 @@ COP=COP CRC=CRC CSD=CSD +CUC=CUC CUP=CUP CVE=CVE CYP=CYP @@ -232,6 +233,7 @@ THB=THB TJS=TJS TMM=TMM +TMT=TMT TND=TND TOP=TOP TPE=TPE @@ -267,14 +269,18 @@ XPD=XPD XPF=XPF XPT=XPT +XSU=XSU XTS=XTS +XUA=XUA XXX=XXX YER=YER YUM=YUM ZAR=ZAR ZMK=ZMK ZWD=ZWD +ZWL=ZWL ZWN=ZWN +ZWR=ZWR adp=Andorran Peseta aed=United Arab Emirates Dirham afa=Afghan Afghani (1927-2002) @@ -317,6 +323,7 @@ cop=Colombian Peso crc=Costa Rican Col\u00f3n csd=Serbian Dinar (2002-2006) +cuc=Cuban Convertible Peso cup=Cuban Peso cve=Cape Verdean Escudo cyp=Cypriot Pound @@ -443,6 +450,7 @@ thb=Thai Baht tjs=Tajikistani Somoni tmm=Turkmenistani Manat (1993-2009) +tmt=Turkmenistani Manat tnd=Tunisian Dinar top=Tongan Pa\u02bbanga tpe=Timorese Escudo @@ -485,3 +493,5 @@ zar=South African Rand zmk=Zambian Kwacha zwd=Zimbabwean Dollar (1980-2008) +zwl=Zimbabwean Dollar (2009) +zwr=Zimbabwean Dollar (2008)
--- a/src/share/classes/sun/util/resources/CurrencyNames_de.properties Wed Aug 31 15:37:07 2011 -0700 +++ b/src/share/classes/sun/util/resources/CurrencyNames_de.properties Thu Sep 01 08:53:40 2011 -0700 @@ -105,6 +105,7 @@ cop=Kolumbianischer Peso crc=Costa Rica Colon csd=Alter Serbischer Dinar +cuc=Kubanischer Peso (konvertibel) cup=Kubanischer Peso cve=Kap Verde Escudo cyp=Zypern-Pfund @@ -229,6 +230,7 @@ thb=Baht tjs=Tadschikistan Somoni tmm=Turkmenistan-Manat +tmt=Neuer Turkmenistan-Manat tnd=Tunesischer Dinar top=Pa\u02bbanga tpe=Timor-Escudo @@ -270,3 +272,4 @@ zar=S\u00fcdafrikanischer Rand zmk=Kwacha zwd=Simbabwe-Dollar +zwl=Simbabwe-Dollar (2009)
--- a/src/share/classes/sun/util/resources/CurrencyNames_es.properties Wed Aug 31 15:37:07 2011 -0700 +++ b/src/share/classes/sun/util/resources/CurrencyNames_es.properties Thu Sep 01 08:53:40 2011 -0700 @@ -105,6 +105,7 @@ cop=peso colombiano crc=col\u00f3n costarricense csd=antiguo dinar serbio +cuc=peso cubano convertible cup=peso cubano cve=escudo de Cabo Verde cyp=libra chipriota @@ -231,6 +232,7 @@ thb=baht tailand\u00e9s tjs=somoni tayiko tmm=manat turcomano +tmt=nuevo manat turcomano tnd=dinar tunecino top=pa\u02bbanga tongano tpe=escudo timorense @@ -273,3 +275,4 @@ zar=rand sudafricano zmk=kwacha zambiano zwd=d\u00f3lar de Zimbabue +zwl=d\u00f3lar zimbabuense
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/share/classes/sun/util/resources/CurrencyNames_es_CU.properties Thu Sep 01 08:53:40 2011 -0700 @@ -0,0 +1,67 @@ +# +# Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved. +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +# +# This code is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License version 2 only, as +# published by the Free Software Foundation. Oracle designates this +# particular file as subject to the "Classpath" exception as provided +# by Oracle in the LICENSE file that accompanied this code. +# +# This code is distributed in the hope that it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +# version 2 for more details (a copy is included in the LICENSE file that +# accompanied this code). +# +# You should have received a copy of the GNU General Public License version +# 2 along with this work; if not, write to the Free Software Foundation, +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. +# +# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA +# or visit www.oracle.com if you need additional information or have any +# questions. +# + +# +# COPYRIGHT AND PERMISSION NOTICE +# +# Copyright (C) 1991-2011 Unicode, Inc. All rights reserved. +# Distributed under the Terms of Use in http://www.unicode.org/copyright.html. +# +# Permission is hereby granted, free of charge, to any person obtaining +# a copy of the Unicode data files and any associated documentation (the +# "Data Files") or Unicode software and any associated documentation +# (the "Software") to deal in the Data Files or Software without +# restriction, including without limitation the rights to use, copy, +# modify, merge, publish, distribute, and/or sell copies of the Data +# Files or Software, and to permit persons to whom the Data Files or +# Software are furnished to do so, provided that (a) the above copyright +# notice(s) and this permission notice appear with all copies of the +# Data Files or Software, (b) both the above copyright notice(s) and +# this permission notice appear in associated documentation, and (c) +# there is clear notice in each modified Data File or in the Software as +# well as in the documentation associated with the Data File(s) or +# Software that the data or software has been modified. +# +# THE DATA FILES AND SOFTWARE ARE PROVIDED "AS IS", WITHOUT WARRANTY OF +# ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE +# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +# NONINFRINGEMENT OF THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT +# HOLDER OR HOLDERS INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR +# ANY SPECIAL INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES +# WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +# ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT +# OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THE DATA FILES OR +# SOFTWARE. +# +# Except as contained in this notice, the name of a copyright holder +# shall not be used in advertising or otherwise to promote the sale, use +# or other dealings in these Data Files or Software without prior +# written authorization of the copyright holder. + +# +# Generated automatically from the Common Locale Data Repository. DO NOT EDIT! +# +CUP=CU$ +CUC=CUC$
--- a/src/share/classes/sun/util/resources/CurrencyNames_et_EE.properties Wed Aug 31 15:37:07 2011 -0700 +++ b/src/share/classes/sun/util/resources/CurrencyNames_et_EE.properties Thu Sep 01 08:53:40 2011 -0700 @@ -1,5 +1,5 @@ -# -# Copyright (c) 2005, Oracle and/or its affiliates. All rights reserved. +# +# Copyright (c) 2005, 2011, Oracle and/or its affiliates. All rights reserved. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # # This code is free software; you can redistribute it and/or modify it @@ -21,18 +21,49 @@ # 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. -# +# -# (C) Copyright Taligent, Inc. 1996, 1997 - All Rights Reserved -# (C) Copyright IBM Corp. 1996 - 1999 - All Rights Reserved +# +# COPYRIGHT AND PERMISSION NOTICE +# +# Copyright (C) 1991-2011 Unicode, Inc. All rights reserved. +# Distributed under the Terms of Use in http://www.unicode.org/copyright.html. +# +# Permission is hereby granted, free of charge, to any person obtaining +# a copy of the Unicode data files and any associated documentation (the +# "Data Files") or Unicode software and any associated documentation +# (the "Software") to deal in the Data Files or Software without +# restriction, including without limitation the rights to use, copy, +# modify, merge, publish, distribute, and/or sell copies of the Data +# Files or Software, and to permit persons to whom the Data Files or +# Software are furnished to do so, provided that (a) the above copyright +# notice(s) and this permission notice appear with all copies of the +# Data Files or Software, (b) both the above copyright notice(s) and +# this permission notice appear in associated documentation, and (c) +# there is clear notice in each modified Data File or in the Software as +# well as in the documentation associated with the Data File(s) or +# Software that the data or software has been modified. # -# The original version of this source code and documentation -# is copyrighted and owned by Taligent, Inc., a wholly-owned -# subsidiary of IBM. These materials are provided under terms -# of a License Agreement between Taligent and Sun. This technology -# is protected by multiple US and International patents. +# THE DATA FILES AND SOFTWARE ARE PROVIDED "AS IS", WITHOUT WARRANTY OF +# ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE +# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +# NONINFRINGEMENT OF THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT +# HOLDER OR HOLDERS INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR +# ANY SPECIAL INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES +# WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +# ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT +# OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THE DATA FILES OR +# SOFTWARE. # -# This notice and attribution to Taligent may not be removed. -# Taligent is a registered trademark of Taligent, Inc. +# Except as contained in this notice, the name of a copyright holder +# shall not be used in advertising or otherwise to promote the sale, use +# or other dealings in these Data Files or Software without prior +# written authorization of the copyright holder. +# +# Generated automatically from the Common Locale Data Repository. DO NOT EDIT! +# EEK=kr +eek=Eesti kroon +EUR=\u20ac +eur=euro
--- a/src/share/classes/sun/util/resources/CurrencyNames_fr.properties Wed Aug 31 15:37:07 2011 -0700 +++ b/src/share/classes/sun/util/resources/CurrencyNames_fr.properties Thu Sep 01 08:53:40 2011 -0700 @@ -105,6 +105,7 @@ cop=peso colombien crc=col\u00f3n costaricain csd=dinar serbo-mont\u00e9n\u00e9grin +cuc=peso cubain convertible cup=peso cubain cve=escudo capverdien cyp=livre chypriote @@ -231,6 +232,7 @@ thb=baht tha\u00eflandais tjs=somoni tadjik tmm=manat turkm\u00e8ne +tmt=nouveau manat turkm\u00e8ne tnd=dinar tunisien top=pa\u2019anga tongan tpe=escudo timorais
--- a/src/share/classes/sun/util/resources/CurrencyNames_ja.properties Wed Aug 31 15:37:07 2011 -0700 +++ b/src/share/classes/sun/util/resources/CurrencyNames_ja.properties Thu Sep 01 08:53:40 2011 -0700 @@ -105,6 +105,7 @@ cop=\u30b3\u30ed\u30f3\u30d3\u30a2 \u30da\u30bd crc=\u30b3\u30b9\u30bf\u30ea\u30ab \u30b3\u30ed\u30f3 csd=\u30bb\u30eb\u30d3\u30a2\u30f3 \u30c7\u30a3\u30ca\u30fc\u30eb +cuc=\u30ad\u30e5\u30fc\u30d0 \u514c\u63db\u30da\u30bd cup=\u30ad\u30e5\u30fc\u30d0 \u30da\u30bd cve=\u30ab\u30fc\u30dc\u30d9\u30eb\u30c7 \u30a8\u30b9\u30af\u30fc\u30c9 cyp=\u30ad\u30d7\u30ed\u30b9 \u30dd\u30f3\u30c9 @@ -231,6 +232,7 @@ thb=\u30bf\u30a4 \u30d0\u30fc\u30c4 tjs=\u30bf\u30b8\u30ad\u30b9\u30bf\u30f3 \u30bd\u30e2\u30cb tmm=\u30c8\u30eb\u30af\u30e1\u30cb\u30b9\u30bf\u30f3 \u30de\u30ca\u30c8 +tmt=\u30c8\u30eb\u30af\u30e1\u30cb\u30b9\u30bf\u30f3 \u65b0\u30de\u30ca\u30c8 tnd=\u30c1\u30e5\u30cb\u30b8\u30a2 \u30c7\u30a3\u30ca\u30fc\u30eb top=\u30c8\u30f3\u30ac \u30d1\u30fb\u30a2\u30f3\u30ac tpe=\u30c6\u30a3\u30e2\u30fc\u30eb \u30a8\u30b9\u30af\u30fc\u30c9 @@ -273,3 +275,4 @@ zar=\u5357\u30a2\u30d5\u30ea\u30ab \u30e9\u30f3\u30c9 zmk=\u30b6\u30f3\u30d3\u30a2 \u30af\u30ef\u30c1\u30e3 zwd=\u30b8\u30f3\u30d0\u30d6\u30a8 \u30c9\u30eb +zwl=\u30b8\u30f3\u30d0\u30d6\u30a8 \u30c9\u30eb (2009)
--- a/src/share/classes/sun/util/resources/CurrencyNames_ko.properties Wed Aug 31 15:37:07 2011 -0700 +++ b/src/share/classes/sun/util/resources/CurrencyNames_ko.properties Thu Sep 01 08:53:40 2011 -0700 @@ -105,6 +105,7 @@ cop=\ucf5c\ub86c\ube44\uc544 \ud398\uc18c crc=\ucf54\uc2a4\ud0c0\ub9ac\uce74 \ucf5c\ub860 csd=\uace0 \uc138\ub974\ube44\uc544 \ub514\ub098\ub974 +cuc=\ucfe0\ubc14 \ud0dc\ud658 \ud398\uc18c cup=\ucfe0\ubc14 \ud398\uc18c cve=\uce74\ubcf4\ubca0\ub974\ub370 \uc5d0\uc2a4\ucfe0\ub3c4 cyp=\uc2f8\uc774\ud504\ub7ec\uc2a4 \ud30c\uc6b4\ub4dc
--- a/src/share/classes/sun/util/resources/CurrencyNames_pt.properties Wed Aug 31 15:37:07 2011 -0700 +++ b/src/share/classes/sun/util/resources/CurrencyNames_pt.properties Thu Sep 01 08:53:40 2011 -0700 @@ -87,6 +87,7 @@ bif=Franco do Burundi bmd=D\u00f3lar das Bermudas bnd=D\u00f3lar do Brunei +bob=Boliviano bov=Mvdol boliviano brl=Real brasileiro bsd=D\u00f3lar das Bahamas @@ -104,6 +105,7 @@ cop=Peso colombiano crc=Colon da Costa Rica csd=Dinar s\u00e9rvio antigo +cuc=Peso cubano convers\u00edvel cup=Peso cubano cve=Escudo cabo-verdiano cyp=Libra cipriota @@ -229,6 +231,7 @@ thb=Baht tailand\u00eas tjs=Somoni tadjique tmm=Manat do Turcomenist\u00e3o +tmt=Novo Manat do Turcomenist\u00e3o tnd=Dinar tunisiano top=Pa\u02bbanga de Tonga tpe=Escudo timorense @@ -271,3 +274,5 @@ zar=Rand sul-africano zmk=Cuacha zambiano zwd=D\u00f3lar do Zimb\u00e1bue +zwl=D\u00f3lar do Zimb\u00e1bue (2009) +zwr=D\u00f3lar do Zimb\u00e1bue (2008)
--- a/src/share/classes/sun/util/resources/CurrencyNames_sk_SK.properties Wed Aug 31 15:37:07 2011 -0700 +++ b/src/share/classes/sun/util/resources/CurrencyNames_sk_SK.properties Thu Sep 01 08:53:40 2011 -0700 @@ -1,5 +1,5 @@ -# -# Copyright (c) 2005, Oracle and/or its affiliates. All rights reserved. +# +# Copyright (c) 2005, 2011, Oracle and/or its affiliates. All rights reserved. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # # This code is free software; you can redistribute it and/or modify it @@ -21,18 +21,48 @@ # 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. -# +# -# (C) Copyright Taligent, Inc. 1996, 1997 - All Rights Reserved -# (C) Copyright IBM Corp. 1996 - 1999 - All Rights Reserved +# +# COPYRIGHT AND PERMISSION NOTICE +# +# Copyright (C) 1991-2011 Unicode, Inc. All rights reserved. +# Distributed under the Terms of Use in http://www.unicode.org/copyright.html. +# +# Permission is hereby granted, free of charge, to any person obtaining +# a copy of the Unicode data files and any associated documentation (the +# "Data Files") or Unicode software and any associated documentation +# (the "Software") to deal in the Data Files or Software without +# restriction, including without limitation the rights to use, copy, +# modify, merge, publish, distribute, and/or sell copies of the Data +# Files or Software, and to permit persons to whom the Data Files or +# Software are furnished to do so, provided that (a) the above copyright +# notice(s) and this permission notice appear with all copies of the +# Data Files or Software, (b) both the above copyright notice(s) and +# this permission notice appear in associated documentation, and (c) +# there is clear notice in each modified Data File or in the Software as +# well as in the documentation associated with the Data File(s) or +# Software that the data or software has been modified. # -# The original version of this source code and documentation -# is copyrighted and owned by Taligent, Inc., a wholly-owned -# subsidiary of IBM. These materials are provided under terms -# of a License Agreement between Taligent and Sun. This technology -# is protected by multiple US and International patents. +# THE DATA FILES AND SOFTWARE ARE PROVIDED "AS IS", WITHOUT WARRANTY OF +# ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE +# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +# NONINFRINGEMENT OF THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT +# HOLDER OR HOLDERS INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR +# ANY SPECIAL INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES +# WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +# ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT +# OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THE DATA FILES OR +# SOFTWARE. # -# This notice and attribution to Taligent may not be removed. -# Taligent is a registered trademark of Taligent, Inc. +# Except as contained in this notice, the name of a copyright holder +# shall not be used in advertising or otherwise to promote the sale, use +# or other dealings in these Data Files or Software without prior +# written authorization of the copyright holder. +# +# Generated automatically from the Common Locale Data Repository. DO NOT EDIT! +# SKK=Sk +skk=Slovensk\u00e1 koruna +EUR=\u20ac
--- a/src/share/classes/sun/util/resources/CurrencyNames_zh_CN.properties Wed Aug 31 15:37:07 2011 -0700 +++ b/src/share/classes/sun/util/resources/CurrencyNames_zh_CN.properties Thu Sep 01 08:53:40 2011 -0700 @@ -106,6 +106,7 @@ cop=\u54e5\u4f26\u6bd4\u4e9a\u6bd4\u7d22 crc=\u54e5\u65af\u8fbe\u9ece\u52a0\u79d1\u6717 csd=\u65e7\u585e\u5c14\u7ef4\u4e9a\u7b2c\u7eb3\u5c14 +cuc=\u53e4\u5df4\u53ef\u5151\u6362\u6bd4\u7d22 cup=\u53e4\u5df4\u6bd4\u7d22 cve=\u4f5b\u5f97\u89d2\u57c3\u65af\u5e93\u591a cyp=\u585e\u6d66\u8def\u65af\u9551 @@ -231,6 +232,7 @@ thb=\u6cf0\u94e2 tjs=\u5854\u5409\u514b\u65af\u5766\u7d22\u83ab\u5c3c tmm=\u571f\u5e93\u66fc\u65af\u5766\u9a6c\u7eb3\u7279 +tmt=\u571f\u5e93\u66fc\u65af\u5766\u65b0\u9a6c\u7eb3\u7279 tnd=\u7a81\u5c3c\u65af\u7b2c\u7eb3\u5c14 top=\u6c64\u52a0\u6f58\u52a0 tpe=\u5e1d\u6c76\u57c3\u65af\u5e93\u591a @@ -273,3 +275,4 @@ zar=\u5357\u975e\u5170\u7279 zmk=\u8d5e\u6bd4\u4e9a\u514b\u74e6\u67e5 zwd=\u6d25\u5df4\u5e03\u97e6\u5143 +zwl=\u6d25\u5df4\u5e03\u97e6\u5143 (2009)
--- a/src/share/classes/sun/util/resources/CurrencyNames_zh_TW.properties Wed Aug 31 15:37:07 2011 -0700 +++ b/src/share/classes/sun/util/resources/CurrencyNames_zh_TW.properties Thu Sep 01 08:53:40 2011 -0700 @@ -107,6 +107,7 @@ cop=\u54e5\u502b\u6bd4\u4e9e\u62ab\u7d22 crc=\u54e5\u65af\u5927\u9ece\u52a0\u79d1\u90ce csd=\u65e7\u585e\u5c14\u7ef4\u4e9a\u7b2c\u7eb3\u5c14 +cuc=\u53e4\u5df4\u53ef\u8f49\u63db\u62ab\u7d22 cup=\u53e4\u5df4\u62ab\u7d22 cve=\u7dad\u5fb7\u89d2\u57c3\u65af\u5eab\u591a cyp=\u8cfd\u666e\u52d2\u65af\u938a @@ -233,6 +234,7 @@ thb=\u6cf0\u9296 tjs=\u5854\u5409\u514b\u65af\u5766\u7d22\u83ab\u5c3c tmm=\u571f\u5eab\u66fc\u99ac\u7d0d\u7279 +tmt=\u571f\u5eab\u66fc\u65b0\u99ac\u7d0d\u7279 tnd=\u7a81\u5c3c\u897f\u4e9e\u7b2c\u7d0d\u723e top=\u6771\u52a0\u6f58\u52a0 tpe=\u5e1d\u6c76\u57c3\u65af\u5e93\u591a @@ -274,3 +276,4 @@ zar=\u5357\u975e\u862d\u7279 zmk=\u5c1a\u6bd4\u4e9e\u514b\u74e6\u67e5 zwd=\u8f9b\u5df4\u5a01\u5143 +zwl=\u8f9b\u5df4\u5a01\u5143 (2009)
--- a/src/share/classes/sun/util/resources/LocaleNames.properties Wed Aug 31 15:37:07 2011 -0700 +++ b/src/share/classes/sun/util/resources/LocaleNames.properties Thu Sep 01 08:53:40 2011 -0700 @@ -1,5 +1,5 @@ # -# Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2005, 2011, Oracle and/or its affiliates. All rights reserved. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # # This code is free software; you can redistribute it and/or modify it @@ -898,6 +898,7 @@ BM=Bermuda BN=Brunei BO=Bolivia +BQ=Bonaire, Sint Eustatius and Saba BR=Brazil BS=Bahamas BT=Bhutan @@ -921,6 +922,7 @@ CS=Serbia and Montenegro CU=Cuba CV=Cape Verde +CW=Cura\u00e7ao CX=Christmas Island CY=Cyprus CZ=Czech Republic @@ -1077,6 +1079,7 @@ SR=Suriname ST=Sao Tome And Principe SV=El Salvador +SX=Sint Maarten (Dutch part) SY=Syria SZ=Swaziland TC=Turks And Caicos Islands
--- a/src/share/demo/nio/zipfs/src/com/sun/nio/zipfs/ZipFileSystem.java Wed Aug 31 15:37:07 2011 -0700 +++ b/src/share/demo/nio/zipfs/src/com/sun/nio/zipfs/ZipFileSystem.java Thu Sep 01 08:53:40 2011 -0700 @@ -31,6 +31,7 @@ package com.sun.nio.zipfs; +import java.io.BufferedOutputStream; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.EOFException; @@ -1165,7 +1166,6 @@ // sync the zip file system, if there is any udpate private void sync() throws IOException { //System.out.printf("->sync(%s) starting....!%n", toString()); - // check ex-closer if (!exChClosers.isEmpty()) { for (ExChannelCloser ecc : exChClosers) { @@ -1179,84 +1179,84 @@ if (!hasUpdate) return; Path tmpFile = createTempFileInSameDirectoryAs(zfpath); - OutputStream os = Files.newOutputStream(tmpFile, WRITE); - ArrayList<Entry> elist = new ArrayList<>(inodes.size()); - long written = 0; - byte[] buf = new byte[8192]; - Entry e = null; + try (OutputStream os = new BufferedOutputStream(Files.newOutputStream(tmpFile, WRITE))) + { + ArrayList<Entry> elist = new ArrayList<>(inodes.size()); + long written = 0; + byte[] buf = new byte[8192]; + Entry e = null; - // write loc - for (IndexNode inode : inodes.values()) { - if (inode instanceof Entry) { // an updated inode - e = (Entry)inode; - try { - if (e.type == Entry.COPY) { - // entry copy: the only thing changed is the "name" - // and "nlen" in LOC header, so we udpate/rewrite the - // LOC in new file and simply copy the rest (data and - // ext) without enflating/deflating from the old zip - // file LOC entry. - written += copyLOCEntry(e, true, os, written, buf); - } else { // NEW, FILECH or CEN - e.locoff = written; - written += e.writeLOC(os); // write loc header - if (e.bytes != null) { // in-memory, deflated - os.write(e.bytes); // already - written += e.bytes.length; - } else if (e.file != null) { // tmp file - try (InputStream is = Files.newInputStream(e.file)) { - int n; - if (e.type == Entry.NEW) { // deflated already - while ((n = is.read(buf)) != -1) { - os.write(buf, 0, n); - written += n; + // write loc + for (IndexNode inode : inodes.values()) { + if (inode instanceof Entry) { // an updated inode + e = (Entry)inode; + try { + if (e.type == Entry.COPY) { + // entry copy: the only thing changed is the "name" + // and "nlen" in LOC header, so we udpate/rewrite the + // LOC in new file and simply copy the rest (data and + // ext) without enflating/deflating from the old zip + // file LOC entry. + written += copyLOCEntry(e, true, os, written, buf); + } else { // NEW, FILECH or CEN + e.locoff = written; + written += e.writeLOC(os); // write loc header + if (e.bytes != null) { // in-memory, deflated + os.write(e.bytes); // already + written += e.bytes.length; + } else if (e.file != null) { // tmp file + try (InputStream is = Files.newInputStream(e.file)) { + int n; + if (e.type == Entry.NEW) { // deflated already + while ((n = is.read(buf)) != -1) { + os.write(buf, 0, n); + written += n; + } + } else if (e.type == Entry.FILECH) { + // the data are not deflated, use ZEOS + try (OutputStream os2 = new EntryOutputStream(e, os)) { + while ((n = is.read(buf)) != -1) { + os2.write(buf, 0, n); + } + } + written += e.csize; + if ((e.flag & FLAG_DATADESCR) != 0) + written += e.writeEXT(os); } - } else if (e.type == Entry.FILECH) { - // the data are not deflated, use ZEOS - try (OutputStream os2 = new EntryOutputStream(e, os)) { - while ((n = is.read(buf)) != -1) { - os2.write(buf, 0, n); - } - } - written += e.csize; - if ((e.flag & FLAG_DATADESCR) != 0) - written += e.writeEXT(os); } + Files.delete(e.file); + tmppaths.remove(e.file); + } else { + // dir, 0-length data } - Files.delete(e.file); - tmppaths.remove(e.file); - } else { - // dir, 0-length data } + elist.add(e); + } catch (IOException x) { + x.printStackTrace(); // skip any in-accurate entry } - elist.add(e); - } catch (IOException x) { - x.printStackTrace(); // skip any in-accurate entry - } - } else { // unchanged inode - if (inode.pos == -1) { - continue; // pseudo directory node - } - e = Entry.readCEN(this, inode.pos); - try { - written += copyLOCEntry(e, false, os, written, buf); - elist.add(e); - } catch (IOException x) { - x.printStackTrace(); // skip any wrong entry + } else { // unchanged inode + if (inode.pos == -1) { + continue; // pseudo directory node + } + e = Entry.readCEN(this, inode.pos); + try { + written += copyLOCEntry(e, false, os, written, buf); + elist.add(e); + } catch (IOException x) { + x.printStackTrace(); // skip any wrong entry + } } } + + // now write back the cen and end table + end.cenoff = written; + for (Entry entry : elist) { + written += entry.writeCEN(os); + } + end.centot = elist.size(); + end.cenlen = written - end.cenoff; + end.write(os, written); } - - // now write back the cen and end table - end.cenoff = written; - for (Entry entry : elist) { - written += entry.writeCEN(os); - } - end.centot = elist.size(); - end.cenlen = written - end.cenoff; - end.write(os, written); - os.close(); - if (!streams.isEmpty()) { // // TBD: ExChannelCloser should not be necessary if we only @@ -1959,7 +1959,7 @@ writeBytes(os, name); if (elen64 != 0) { writeShort(os, EXTID_ZIP64);// Zip64 extra - writeShort(os, elen64); // size of "this" extra block + writeShort(os, elen64 - 4); // size of "this" extra block if (size0 == ZIP64_MINVAL) writeLong(os, size); if (csize0 == ZIP64_MINVAL)
--- a/src/solaris/classes/sun/awt/X11/XToolkit.java Wed Aug 31 15:37:07 2011 -0700 +++ b/src/solaris/classes/sun/awt/X11/XToolkit.java Thu Sep 01 08:53:40 2011 -0700 @@ -1532,6 +1532,10 @@ } public synchronized void addPropertyChangeListener(String name, PropertyChangeListener pcl) { + if (name == null) { + // See JavaDoc for the Toolkit.addPropertyChangeListener() method + return; + } initXSettingsIfNeeded(name); super.addPropertyChangeListener(name, pcl); }
--- a/src/windows/classes/sun/awt/windows/WToolkit.java Wed Aug 31 15:37:07 2011 -0700 +++ b/src/windows/classes/sun/awt/windows/WToolkit.java Thu Sep 01 08:53:40 2011 -0700 @@ -879,6 +879,10 @@ } public synchronized void addPropertyChangeListener(String name, PropertyChangeListener pcl) { + if (name == null) { + // See JavaDoc for the Toolkit.addPropertyChangeListener() method + return; + } if ( WDesktopProperties.isWindowsProperty(name) || name.startsWith(awtPrefix) || name.startsWith(dndPrefix))
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test/com/sun/security/sasl/ntlm/Conformance.java Thu Sep 01 08:53:40 2011 -0700 @@ -0,0 +1,104 @@ +/* + * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * 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 7043847 7043860 7043882 7043938 7043959 + * @summary NTML impl of SaslServer conformance errors + */ +import java.io.IOException; +import javax.security.sasl.*; +import java.util.*; +import javax.security.auth.callback.Callback; +import javax.security.auth.callback.CallbackHandler; +import javax.security.auth.callback.UnsupportedCallbackException; + +public class Conformance { + + public static void main(String[] args) throws Exception { + try { + Sasl.createSaslClient(new String[] {"NTLM"}, "abc", "ldap", + "server", new HashMap<String, Object>(), null); + } catch (SaslException se) { + System.out.println(se); + } + try { + Sasl.createSaslServer("NTLM", "ldap", + "server", new HashMap<String, Object>(), null); + } catch (SaslException se) { + System.out.println(se); + } + try { + Sasl.createSaslClient(new String[] {"NTLM"}, "abc", "ldap", + "server", null, new CallbackHandler() { + @Override + public void handle(Callback[] callbacks) throws + IOException, UnsupportedCallbackException { } + }); + } catch (SaslException se) { + System.out.println(se); + } + try { + SaslServer saslServer = + Sasl.createSaslServer("NTLM", "ldap", "abc", null, new CallbackHandler() { + @Override + public void handle(Callback[] callbacks) throws IOException, UnsupportedCallbackException { } + }); + System.err.println("saslServer = " + saslServer); + System.err.println("saslServer.isComplete() = " + saslServer.isComplete()); + // IllegalStateException is expected here + saslServer.getNegotiatedProperty("prop"); + System.err.println("No IllegalStateException"); + } catch (IllegalStateException se) { + System.out.println(se); + } + try { + SaslServer saslServer = + Sasl.createSaslServer("NTLM", "ldap", "abc", null, new CallbackHandler() { + @Override + public void handle(Callback[] callbacks) throws IOException, UnsupportedCallbackException { } + }); + System.err.println("saslServer = " + saslServer); + System.err.println("saslServer.isComplete() = " + saslServer.isComplete()); + // IllegalStateException is expected here + saslServer.getAuthorizationID(); + System.err.println("No IllegalStateException"); + } catch (IllegalStateException se) { + System.out.println(se); + } + try { + SaslServer saslServer = + Sasl.createSaslServer("NTLM", "ldap", "abc", null, new CallbackHandler() { + @Override + public void handle(Callback[] callbacks) throws IOException, UnsupportedCallbackException { } + }); + System.err.println("saslServer = " + saslServer); + System.err.println("saslServer.isComplete() = " + saslServer.isComplete()); + // IllegalStateException is expected here + saslServer.wrap(new byte[0], 0, 0); + System.err.println("No IllegalStateException"); + } catch (IllegalStateException se) { + System.out.println(se); + } + } +}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test/java/lang/management/ManagementFactory/GetObjectName.java Thu Sep 01 08:53:40 2011 -0700 @@ -0,0 +1,75 @@ +/* + * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * 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 7068328 + * @summary Test if getObjectName handles properly when called by + * multiple threads simultaneously. Run in othervm mode to + * make sure the object name is not initialized to begin with. + * @run main/othervm GetObjectName + */ + +import java.lang.management.BufferPoolMXBean; +import java.lang.management.ManagementFactory; +import java.lang.management.PlatformLoggingMXBean; +import java.lang.management.PlatformManagedObject; +import java.util.ArrayList; +import java.util.List; +import java.util.concurrent.ExecutorService; +import java.util.concurrent.Executors; +import java.util.concurrent.LinkedBlockingQueue; +import java.util.concurrent.TimeUnit; + +public class GetObjectName { + private static boolean failed = false; + public static void main(String[] args) throws Exception { + int tasks = 10000; + ExecutorService executor = Executors.newFixedThreadPool(10); + submitTasks(executor, tasks); + executor.shutdown(); + executor.awaitTermination(10, TimeUnit.SECONDS); + if (!failed) { + System.out.println("Test passed."); + } + } + + static void submitTasks(ExecutorService executor, int count) { + for (int i=0; i < count && !failed; i++) { + executor.execute(new Runnable() { + @Override + public void run() { + List<PlatformManagedObject> mbeans = new ArrayList<>(); + mbeans.add(ManagementFactory.getPlatformMXBean(PlatformLoggingMXBean.class)); + mbeans.addAll(ManagementFactory.getPlatformMXBeans(BufferPoolMXBean.class)); + for (PlatformManagedObject pmo : mbeans) { + // Name should not be null + if (pmo.getObjectName() == null) { + failed = true; + throw new RuntimeException("TEST FAILED: getObjectName() returns null"); + } + } + } + }); + } + } +}
--- a/test/java/util/Currency/ValidateISO4217.java Wed Aug 31 15:37:07 2011 -0700 +++ b/test/java/util/Currency/ValidateISO4217.java Thu Sep 01 08:53:40 2011 -0700 @@ -22,7 +22,7 @@ */ /* * @test - * @bug 4691089 4819436 4942982 5104960 6544471 6627549 + * @bug 4691089 4819436 4942982 5104960 6544471 6627549 7066203 * @summary Validate ISO 4217 data for Currency class. */ @@ -92,7 +92,7 @@ /* Codes that are obsolete, do not have related country */ static final String otherCodes = - "ADP-AFA-ATS-AYM-BEF-BGL-BOV-BYB-CLF-CYP-DEM-ESP-FIM-FRF-GRD-GWP-IEP-ITL-LUF-MGF-MTL-MXV-NLG-PTE-RUR-SDD-SIT-SRG-TPE-TRL-VEF-USN-USS-XAG-XAU-XBA-XBB-XBC-XBD-XDR-XFO-XFU-XPD-XPT-XTS-XXX-YUM-ZWN"; + "ADP-AFA-ATS-AYM-BEF-BGL-BOV-BYB-CLF-CUC-CYP-DEM-EEK-ESP-FIM-FRF-GRD-GWP-IEP-ITL-LUF-MGF-MTL-MXV-NLG-PTE-RUR-SDD-SIT-SKK-SRG-TMM-TPE-TRL-VEF-USN-USS-XAG-XAU-XBA-XBB-XBC-XBD-XDR-XFO-XFU-XPD-XPT-XSU-XTS-XUA-XXX-YUM-ZWD-ZWN-ZWR"; static boolean err = false;
--- a/test/java/util/Currency/tablea1.txt Wed Aug 31 15:37:07 2011 -0700 +++ b/test/java/util/Currency/tablea1.txt Thu Sep 01 08:53:40 2011 -0700 @@ -1,12 +1,12 @@ # # -# Based on BSi's ISO4217 data - "TABLE A1.doc" + amendments up until MA140.doc -# (As of 24 September 2007) +# Based on BSi's ISO4217 data - "TABLE A1.doc" + amendments up until MA151.doc +# (As of 7 April 2011) # # Version FILEVERSION=1 -DATAVERSION=140 +DATAVERSION=151 # ISO 4217 currency data AF AFN 971 2 @@ -33,6 +33,7 @@ BZ BZD 84 2 BJ XOF 952 0 BM BMD 60 2 +BQ USD 840 2 #BT INR 356 2 BT BTN 64 2 BO BOB 68 2 @@ -68,6 +69,7 @@ CI XOF 952 0 HR HRK 191 2 CU CUP 192 2 +CW ANG 532 2 CY EUR 978 2 CZ CZK 203 2 DK DKK 208 2 @@ -80,7 +82,7 @@ #SV USD 840 2 GQ XAF 950 0 ER ERN 232 2 -EE EEK 233 2 +EE EUR 978 2 ET ETB 230 2 FK FKP 238 2 FO DKK 208 2 @@ -218,7 +220,7 @@ SC SCR 690 2 SL SLL 694 2 SG SGD 702 2 -SK SKK 703 2 +SK EUR 978 2 # MA 131 #SI SIT 705 2 SI EUR 978 2 @@ -230,6 +232,7 @@ SD SDG 938 2 SR SRD 968 2 SJ NOK 578 2 +SX ANG 532 2 SZ SZL 748 2 SE SEK 752 2 CH CHF 756 2 @@ -249,7 +252,7 @@ # MA 128 #TR TRL 792 0 TR TRY 949 2 -TM TMM 795 2 +TM TMT 934 2 TC USD 840 2 TV AUD 36 2 UG UGX 800 2 @@ -271,7 +274,7 @@ EH MAD 504 2 YE YER 886 2 ZM ZMK 894 2 -ZW ZWD 716 2 +ZW ZWL 932 2 #XAU XAU 959 #XBA XBA 955 #XBB XBB 956
--- a/test/java/util/Locale/LocaleTest.java Wed Aug 31 15:37:07 2011 -0700 +++ b/test/java/util/Locale/LocaleTest.java Thu Sep 01 08:53:40 2011 -0700 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2007, 2011, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -25,7 +25,7 @@ * @bug 4052404 4052440 4084688 4092475 4101316 4105828 4107014 4107953 4110613 * 4118587 4118595 4122371 4126371 4126880 4135316 4135752 4139504 4139940 4143951 * 4147315 4147317 4147552 4335196 4778440 4940539 5010672 6475525 6544471 6627549 - * 6786276 + * 6786276 7066203 * @summary test Locales */ /* @@ -400,7 +400,7 @@ } /** - * @bug 4106155 4118587 + * @bug 4106155 4118587 7066203 */ public void TestGetLangsAndCountries() { // It didn't seem right to just do an exhaustive test of everything here, so I check @@ -440,8 +440,8 @@ String[] spotCheck2 = { "US", "CA", "GB", "FR", "DE", "IT", "JP", "KR", "CN", "TW", "TH" }; - if (test.length != 246) - errln("Expected getISOCountries to return 246 countries; it returned " + test.length); + if (test.length != 249) + errln("Expected getISOCountries to return 249 countries; it returned " + test.length); else { for (int i = 0; i < spotCheck2.length; i++) { int j;
--- a/test/java/util/zip/LargeZip.java Wed Aug 31 15:37:07 2011 -0700 +++ b/test/java/util/zip/LargeZip.java Thu Sep 01 08:53:40 2011 -0700 @@ -25,173 +25,242 @@ import java.io.*; import java.nio.*; +import java.nio.file.*; +import java.nio.file.attribute.*; +import java.nio.file.spi.*; import java.util.*; import java.util.zip.*; -public class LargeZip { - // If true, don't delete large ZIP file created for test. - static final boolean debug = System.getProperty("debug") != null; +import static java.nio.file.StandardCopyOption.*; - //static final int DATA_LEN = 1024 * 1024; - static final int DATA_LEN = 80 * 1024; - static final int DATA_SIZE = 8; +public class LargeZip { + // If true, don't delete large ZIP file created for test. + static final boolean debug = System.getProperty("debug") != null; - static long fileSize = 6L * 1024L * 1024L * 1024L; // 6GB - - static boolean userFile = false; + //static final int DATA_LEN = 1024 * 1024; + static final int DATA_LEN = 80 * 1024; + static final int DATA_SIZE = 8; - static byte[] data; - static File largeFile; - static String lastEntryName; + static long fileSize = 6L * 1024L * 1024L * 1024L; // 6GB + + static boolean userFile = false; + static byte[] data; + static File largeFile; + static String lastEntryName; - /* args can be empty, in which case check a 3 GB file which is created for - * this test (and then deleted). Or it can be a number, in which case - * that designates the size of the file that's created for this test (and - * then deleted). Or it can be the name of a file to use for the test, in - * which case it is *not* deleted. Note that in this last case, the data - * comparison might fail. - */ - static void realMain (String[] args) throws Throwable { - if (args.length > 0) { - try { - fileSize = Long.parseLong(args[0]); - System.out.println("Testing with file of size " + fileSize); - } catch (NumberFormatException ex) { - largeFile = new File(args[0]); - if (!largeFile.exists()) { - throw new Exception("Specified file " + args[0] + " does not exist"); - } - userFile = true; - System.out.println("Testing with user-provided file " + largeFile); - } - } - File testDir = null; - if (largeFile == null) { - testDir = new File(System.getProperty("test.scratch", "."), - "LargeZip"); - if (testDir.exists()) { - if (!testDir.delete()) { - throw new Exception("Cannot delete already-existing test directory"); - } - } - check(!testDir.exists() && testDir.mkdirs()); - largeFile = new File(testDir, "largezip.zip"); - createLargeZip(); - } + /* args can be empty, in which case check a 3 GB file which is created for + * this test (and then deleted). Or it can be a number, in which case + * that designates the size of the file that's created for this test (and + * then deleted). Or it can be the name of a file to use for the test, in + * which case it is *not* deleted. Note that in this last case, the data + * comparison might fail. + */ + static void realMain (String[] args) throws Throwable { + if (args.length > 0) { + try { + fileSize = Long.parseLong(args[0]); + System.out.println("Testing with file of size " + fileSize); + } catch (NumberFormatException ex) { + largeFile = new File(args[0]); + if (!largeFile.exists()) { + throw new Exception("Specified file " + args[0] + " does not exist"); + } + userFile = true; + System.out.println("Testing with user-provided file " + largeFile); + } + } + File testDir = null; + if (largeFile == null) { + testDir = new File(System.getProperty("test.scratch", "."), + "LargeZip"); + if (testDir.exists()) { + if (!testDir.delete()) { + throw new Exception("Cannot delete already-existing test directory"); + } + } + check(!testDir.exists() && testDir.mkdirs()); + largeFile = new File(testDir, "largezip.zip"); + createLargeZip(); + } else { + if (args.length > 1) + updateLargeZip(args[1]); // add new entry with zfs + } + readLargeZip1(); + readLargeZip2(); - readLargeZip1(); - readLargeZip2(); + if (!userFile && !debug) { + check(largeFile.delete()); + check(testDir.delete()); + } + } + + static void createLargeZip() throws Throwable { + int iterations = DATA_LEN / DATA_SIZE; + ByteBuffer bb = ByteBuffer.allocate(DATA_SIZE); + ByteArrayOutputStream baos = new ByteArrayOutputStream(); + for (int i = 0; i < iterations; i++) { + bb.putDouble(0, Math.random()); + baos.write(bb.array(), 0, DATA_SIZE); + } + data = baos.toByteArray(); + + try (FileOutputStream fos = new FileOutputStream(largeFile); + BufferedOutputStream bos = new BufferedOutputStream(fos); + ZipOutputStream zos = new ZipOutputStream(bos)) + { + long length = 0; + while (length < fileSize) { + ZipEntry ze = new ZipEntry("entry-" + length); + lastEntryName = ze.getName(); + zos.putNextEntry(ze); + zos.write(data, 0, data.length); + zos.closeEntry(); + length = largeFile.length(); + } + System.out.println("Last entry written is " + lastEntryName); + } + } + + private static byte buf[] = new byte[4096]; + + static void checkEntry(ZipEntry e, InputStream is) throws Throwable { + long N = 0; + int n = 0; + while ((n = is.read(buf)) >= 0) { + N += n; + } + check(N == e.getSize()); + } - if (!userFile && !debug) { - check(largeFile.delete()); - check(testDir.delete()); - } - } + static void readLargeZip1() throws Throwable { + ZipFile zipFile = new ZipFile(largeFile); + ZipEntry entry = null; + String entryName = null; + int count = 0; + System.out.println("ZipFile:"); + Enumeration<? extends ZipEntry> entries = zipFile.entries(); + while (entries.hasMoreElements()) { + entry = entries.nextElement(); + entryName = entry.getName(); + System.out.println(" checking " + entryName); + if (!entry.isDirectory()) { + try (InputStream zeis = zipFile.getInputStream(entry)) { + checkEntry(entry, zeis); + } + } + count++; + } + System.out.println("Number of entries read: " + count); + check(!entry.isDirectory()); + if (userFile || check(entryName.equals(lastEntryName))) { + ByteArrayOutputStream baos = new ByteArrayOutputStream(); + InputStream is = zipFile.getInputStream(entry); + int len; + while ((len = is.read(buf)) >= 0) { + baos.write(buf, 0, len); + } + baos.close(); + is.close(); + if (!userFile) + check(Arrays.equals(data, baos.toByteArray())); + } + } - static void createLargeZip() throws Throwable { - int iterations = DATA_LEN / DATA_SIZE; - ByteBuffer bb = ByteBuffer.allocate(DATA_SIZE); - ByteArrayOutputStream baos = new ByteArrayOutputStream(); - for (int i = 0; i < iterations; i++) { - bb.putDouble(0, Math.random()); - baos.write(bb.array(), 0, DATA_SIZE); - } - data = baos.toByteArray(); + static void readLargeZip2() throws Throwable { + System.out.println("ZipInputStream:"); + try (FileInputStream fis = new FileInputStream(largeFile); + BufferedInputStream bis = new BufferedInputStream(fis); + ZipInputStream zis = new ZipInputStream(bis)) + { + ZipEntry entry = null; + String entryName = null; + int count = 0; + while ((entry = zis.getNextEntry()) != null) { + entryName = entry.getName(); - try (FileOutputStream fos = new FileOutputStream(largeFile); - BufferedOutputStream bos = new BufferedOutputStream(fos); - ZipOutputStream zos = new ZipOutputStream(bos)) - { - long length = 0; - while (length < fileSize) { - ZipEntry ze = new ZipEntry("entry-" + length); - lastEntryName = ze.getName(); - zos.putNextEntry(ze); - zos.write(data, 0, data.length); - zos.closeEntry(); - length = largeFile.length(); - } - System.out.println("Last entry written is " + lastEntryName); - } - } + System.out.println(" checking " + entryName + + ", method=" + entry.getMethod()); + if (entryName.equals(lastEntryName)) { + break; + } + if (!entry.isDirectory()) { + checkEntry(entry, zis); + } + count++; + } + System.out.println("Number of entries read: " + count); + System.out.println("Last entry read is " + entryName); + if (!userFile) { + check(!entry.isDirectory()); + ByteArrayOutputStream baos = new ByteArrayOutputStream(); + byte buf[] = new byte[4096]; + int len; + while ((len = zis.read(buf)) >= 0) { + baos.write(buf, 0, len); + } + baos.close(); + check(Arrays.equals(data, baos.toByteArray())); + check(zis.getNextEntry() == null); + } + } + } - static void readLargeZip1() throws Throwable { - ZipFile zipFile = new ZipFile(largeFile); - ZipEntry entry = null; - String entryName = null; - int count = 0; - Enumeration<? extends ZipEntry> entries = zipFile.entries(); - while (entries.hasMoreElements()) { - entry = entries.nextElement(); - entryName = entry.getName(); - count++; - } - System.out.println("Number of entries read: " + count); - System.out.println("Last entry read is " + entryName); - check(!entry.isDirectory()); - if (check(entryName.equals(lastEntryName))) { - ByteArrayOutputStream baos = new ByteArrayOutputStream(); - InputStream is = zipFile.getInputStream(entry); - byte buf[] = new byte[4096]; - int len; - while ((len = is.read(buf)) >= 0) { - baos.write(buf, 0, len); - } - baos.close(); - is.close(); - check(Arrays.equals(data, baos.toByteArray())); - } - } + private static void updateFile(FileSystem fs, Path src) throws IOException { + Path dst = fs.getPath(src.toString()); + Path parent = dst.getParent(); + if (parent != null && Files.notExists(parent)) + Files.createDirectories(parent); + Files.copy(src, dst, REPLACE_EXISTING); + } + + private static FileSystemProvider getZipFSProvider() { + for (FileSystemProvider provider : FileSystemProvider.installedProviders()) { + if ("jar".equalsIgnoreCase(provider.getScheme())) + return provider; + } + return null; + } + + static void updateLargeZip(String pName) throws Throwable { + FileSystemProvider provider = getZipFSProvider(); + if (provider == null) { + System.err.println("ZIP filesystem provider is not installed"); + System.exit(1); + } + Map<String, Object> env = env = new HashMap<>(); + try (FileSystem fs = provider.newFileSystem(largeFile.toPath(), env)) { + Path path = FileSystems.getDefault().getPath(pName); + Files.walkFileTree( + path, + new SimpleFileVisitor<Path>() { + @Override + public FileVisitResult visitFile(Path file, + BasicFileAttributes attrs) + throws IOException + { + updateFile(fs, file); + return FileVisitResult.CONTINUE; + } + }); + } + } - static void readLargeZip2() throws Throwable { - try (FileInputStream fis = new FileInputStream(largeFile); - BufferedInputStream bis = new BufferedInputStream(fis); - ZipInputStream zis = new ZipInputStream(bis)) - { - ZipEntry entry = null; - String entryName = null; - int count = 0; - while ((entry = zis.getNextEntry()) != null) { - entryName = entry.getName(); - if (entryName.equals(lastEntryName)) { - break; - } - count++; - } - System.out.println("Number of entries read: " + count); - System.out.println("Last entry read is " + entryName); - check(!entry.isDirectory()); - - ByteArrayOutputStream baos = new ByteArrayOutputStream(); - - byte buf[] = new byte[4096]; - int len; - while ((len = zis.read(buf)) >= 0) { - baos.write(buf, 0, len); - } - baos.close(); - check(Arrays.equals(data, baos.toByteArray())); - check(zis.getNextEntry() == null); - } - } - - - //--------------------- Infrastructure --------------------------- - static volatile int passed = 0, failed = 0; - static void pass() {passed++;} - static void pass(String msg) {System.out.println(msg); passed++;} - static void fail() {failed++; Thread.dumpStack();} - static void fail(String msg) {System.out.println(msg); fail();} - static void unexpected(Throwable t) {failed++; t.printStackTrace();} - static void unexpected(Throwable t, String msg) { - System.out.println(msg); failed++; t.printStackTrace();} - static boolean check(boolean cond) {if (cond) pass(); else fail(); return cond;} - static void equal(Object x, Object y) { - if (x == null ? y == null : x.equals(y)) pass(); - else fail(x + " not equal to " + y);} - public static void main(String[] args) throws Throwable { - try {realMain(args);} catch (Throwable t) {unexpected(t);} - System.out.println("\nPassed = " + passed + " failed = " + failed); - if (failed > 0) throw new AssertionError("Some tests failed");} + //--------------------- Infrastructure --------------------------- + static volatile int passed = 0, failed = 0; + static void pass() {passed++;} + static void pass(String msg) {System.out.println(msg); passed++;} + static void fail() {failed++; Thread.dumpStack();} + static void fail(String msg) {System.out.println(msg); fail();} + static void unexpected(Throwable t) {failed++; t.printStackTrace();} + static void unexpected(Throwable t, String msg) { + System.out.println(msg); failed++; t.printStackTrace();} + static boolean check(boolean cond) {if (cond) pass(); else fail(); return cond;} + static void equal(Object x, Object y) { + if (x == null ? y == null : x.equals(y)) pass(); + else fail(x + " not equal to " + y);} + public static void main(String[] args) throws Throwable { + try {realMain(args);} catch (Throwable t) {unexpected(t);} + System.out.println("\nPassed = " + passed + " failed = " + failed); + if (failed > 0) throw new AssertionError("Some tests failed");} }
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test/javax/swing/GroupLayout/7071166/bug7071166.java Thu Sep 01 08:53:40 2011 -0700 @@ -0,0 +1,75 @@ +/* + * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * 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 7071166 + * @summary LayoutStyle.getPreferredGap() - IAE is expected but not thrown + * @author Pavel Porvatov + */ + +import javax.swing.*; +import static javax.swing.SwingConstants.*; +import java.awt.*; + +public class bug7071166 { + private static final int[] POSITIONS = {NORTH, EAST, SOUTH, WEST, // valid positions + NORTH_EAST, SOUTH_EAST, SOUTH_WEST, NORTH_WEST, 123, -456}; // invalid positions + + public static void main(String[] args) throws Exception { + for (UIManager.LookAndFeelInfo lookAndFeelInfo : UIManager.getInstalledLookAndFeels()) { + UIManager.setLookAndFeel(lookAndFeelInfo.getClassName()); + + System.out.println("LookAndFeel: " + lookAndFeelInfo.getName()); + + SwingUtilities.invokeAndWait(new Runnable() { + public void run() { + LayoutStyle layoutStyle = LayoutStyle.getInstance(); + + System.out.println("LayoutStyle: " + layoutStyle); + + for (int i = 0; i < POSITIONS.length; i++) { + int position = POSITIONS[i]; + + try { + layoutStyle.getPreferredGap(new JButton(), new JButton(), + LayoutStyle.ComponentPlacement.RELATED, position, new Container()); + + if (i > 3) { + throw new RuntimeException("IllegalArgumentException is not thrown for position " + + position); + } + } catch (IllegalArgumentException e) { + if (i <= 3) { + throw new RuntimeException("IllegalArgumentException is thrown for position " + + position); + } + } + } + } + }); + + System.out.println("passed"); + } + } +}
--- a/test/javax/swing/JPopupMenu/6694823/bug6694823.java Wed Aug 31 15:37:07 2011 -0700 +++ b/test/javax/swing/JPopupMenu/6694823/bug6694823.java Thu Sep 01 08:53:40 2011 -0700 @@ -69,7 +69,12 @@ toolkit.realSync(); System.out.println("Test passed!"); - frame.dispose(); + + SwingUtilities.invokeAndWait(new Runnable() { + public void run() { + frame.dispose(); + } + }); } private static void createGui() { @@ -88,30 +93,44 @@ frame.setSize(200, 200); } - private static void showPopup(final boolean shouldBeShifted) { - SwingUtilities.invokeLater(new Runnable() { + private static void showPopup(final boolean shouldBeShifted) throws Exception { + SwingUtilities.invokeAndWait(new Runnable() { public void run() { // Place frame just above the task bar Dimension screenSize = toolkit.getScreenSize(); frame.setLocation(screenSize.width / 2, screenSize.height - frame.getHeight() - screenInsets.bottom); frame.setVisible(true); + } + }); + // Ensure frame is visible + toolkit.realSync(); + + final Point point = new Point(); + SwingUtilities.invokeAndWait(new Runnable() { + public void run() { // Place popup over the task bar + point.x = 0; + point.y = frame.getHeight() - popup.getPreferredSize().height + screenInsets.bottom; + popup.show(frame, point.x, point.y); + } + }); + + // Ensure popup is visible + toolkit.realSync(); + + SwingUtilities.invokeAndWait(new Runnable() { + public void run() { Point frameLoc = frame.getLocationOnScreen(); - int x = 0; - int y = frame.getHeight() - - popup.getPreferredSize().height + screenInsets.bottom; - popup.show(frame, x, y); - if (shouldBeShifted) { if (popup.getLocationOnScreen() - .equals(new Point(frameLoc.x, frameLoc.y + y))) { + .equals(new Point(frameLoc.x, frameLoc.y + point.y))) { throw new RuntimeException("Popup is not shifted"); } } else { if (!popup.getLocationOnScreen() - .equals(new Point(frameLoc.x, frameLoc.y + y))) { + .equals(new Point(frameLoc.x, frameLoc.y + point.y))) { throw new RuntimeException("Popup is unexpectedly shifted"); } }
--- a/test/sun/text/resources/LocaleData Wed Aug 31 15:37:07 2011 -0700 +++ b/test/sun/text/resources/LocaleData Thu Sep 01 08:53:40 2011 -0700 @@ -6953,3 +6953,56 @@ CurrencyNames/de/svc=El Salvador Colon CurrencyNames/it/bob=Boliviano + +# bug 7066203 +CurrencyNames//CUC=CUC +CurrencyNames//TMT=TMT +CurrencyNames//XSU=XSU +CurrencyNames//XUA=XUA +CurrencyNames//ZWL=ZWL +CurrencyNames//ZWR=ZWR +CurrencyNames//cuc=Cuban Convertible Peso +CurrencyNames//tmt=Turkmenistani Manat +CurrencyNames//zwl=Zimbabwean Dollar (2009) +CurrencyNames//zwr=Zimbabwean Dollar (2008) + +CurrencyNames/de/cuc=Kubanischer Peso (konvertibel) +CurrencyNames/de/tmt=Neuer Turkmenistan-Manat +CurrencyNames/de/zwl=Simbabwe-Dollar (2009) + +CurrencyNames/es/cuc=peso cubano convertible +CurrencyNames/es/tmt=nuevo manat turcomano +CurrencyNames/es/zwl=d\u00f3lar zimbabuense + +CurrencyNames/es_CU/CUP=CU$ +CurrencyNames/es_CU/CUC=CUC$ + +CurrencyNames/et_EE/eek=Eesti kroon +CurrencyNames/et_EE/EUR=\u20ac +CurrencyNames/et_EE/eur=euro + +CurrencyNames/fr/cuc=peso cubain convertible +CurrencyNames/fr/tmt=nouveau manat turkm\u00e8ne + +CurrencyNames/ja/cuc=\u30ad\u30e5\u30fc\u30d0 \u514c\u63db\u30da\u30bd +CurrencyNames/ja/tmt=\u30c8\u30eb\u30af\u30e1\u30cb\u30b9\u30bf\u30f3 \u65b0\u30de\u30ca\u30c8 +CurrencyNames/ja/zwl=\u30b8\u30f3\u30d0\u30d6\u30a8 \u30c9\u30eb (2009) + +CurrencyNames/ko/cuc=\ucfe0\ubc14 \ud0dc\ud658 \ud398\uc18c + +CurrencyNames/pt/bob=Boliviano +CurrencyNames/pt/cuc=Peso cubano convers\u00edvel +CurrencyNames/pt/tmt=Novo Manat do Turcomenist\u00e3o +CurrencyNames/pt/zwl=D\u00f3lar do Zimb\u00e1bue (2009) +CurrencyNames/pt/zwr=D\u00f3lar do Zimb\u00e1bue (2008) + +CurrencyNames/sk_SK/skk=Slovensk\u00e1 koruna +CurrencyNames/sk_SK/EUR=\u20ac + +CurrencyNames/zh_CN/cuc=\u53e4\u5df4\u53ef\u5151\u6362\u6bd4\u7d22 +CurrencyNames/zh_CN/tmt=\u571f\u5e93\u66fc\u65af\u5766\u65b0\u9a6c\u7eb3\u7279 +CurrencyNames/zh_CN/zwl=\u6d25\u5df4\u5e03\u97e6\u5143 (2009) + +CurrencyNames/zh_TW/cuc=\u53e4\u5df4\u53ef\u8f49\u63db\u62ab\u7d22 +CurrencyNames/zh_TW/tmt=\u571f\u5eab\u66fc\u65b0\u99ac\u7d0d\u7279 +CurrencyNames/zh_TW/zwl=\u8f9b\u5df4\u5a01\u5143 (2009)
--- a/test/sun/text/resources/LocaleDataTest.java Wed Aug 31 15:37:07 2011 -0700 +++ b/test/sun/text/resources/LocaleDataTest.java Thu Sep 01 08:53:40 2011 -0700 @@ -33,7 +33,7 @@ * 6379214 6485516 6486607 4225362 4494727 6533691 6531591 6531593 6570259 * 6509039 6609737 6610748 6645271 6507067 6873931 6450945 6645268 6646611 * 6645405 6650730 6910489 6573250 6870908 6585666 6716626 6914413 6916787 - * 6919624 6998391 7019267 7020960 7025837 7020583 7036905 + * 6919624 6998391 7019267 7020960 7025837 7020583 7036905 7066203 * @summary Verify locale data * */